Echolocation with HC-SR04 ultrasonic distance sensor

Ultrasonic echolocation is common practice in many areas including nature itself. We all know how bats or dolphins navigate – they emit ultrasonic waves and depending on the time delay of reflected echoes, they can determine the distance from obstacles or catch. From an engineering perspective it is relatively easy to measure distances with ultrasound – all you need to know is sound speed in the air and time delay between sent and received pulses. L is the measured distance; CAIR – ultrasound speed; t – the time between transmitted and received pulses. The accuracy of measured distance mainly depends on air temperature. The following formula can calculate sound speed in the air approximately : For instance, at 25ºC the speed of sound in dry air CAIR = 346.13 m/s. If you want greater accuracy, you should also measure temperature to adjust sound speed.

Continue reading

Testing LCD keypad Shield for Arduino

arduino lcd keypad shield

Recently I’ve got an Arduino LCD keypad shield. Haven’t decided yet where will it be used. But why not to plug it to Arduino board and see it working. The shield was initially introduced by DFRobot who has some cool open-source stuff including robotics related. This LCD keypad shield is a cheap and convenient solution for adding 2×16 LCD and five push buttons (+1 reset) to Arduino design. LCD here is interfaced using 4-bit mode and occupies 4 (D4), 5 (D5), 6(D6), 7(D7), 8(RS), 9(E) and ten digital pins. Pin 10 is used to control LCD backlight through transistor key. All five buttons are connected to single Analog pin 0 using a resistor-based voltage divider. This lets us keep other pins for general use. The shield is designed to work with 5V based boards.

Continue reading