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 time delay of reflected echoes, they can determine the distance from obstacles or catch. From 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 – time between transmitted and received pulses. The accuracy of measured distance mainly depends on air temperature. Approximately sound speed in air can be calculated by following formula: For instance at 25ºC the speed of sound in dry air CAIR = 346.13 m/s. So 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. Shield was originally introduced by DFRobot who has some cool open-source stuff including robotics related. This LCD keypad shield is really cheap and convenient solution for adding 2×16 LCD and 5 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 10 digital pins. Pin 10 is used to control LCD backlight through transistor key. All five buttons are connected to single Analog pin 0 using resistor based voltage divider. This lets us keep other pins for general use. Shield is designed to work with 5V based boards.

Continue reading