- Discrete LEDs
- Dot/Bar LEDs
- Matrix LEDs
- 7-Seg LEDs
- Serial -- Software
- Serial -- Hardware
- RS-232 via the MAX3232
- I2C -- EEPROM
- I2C -- DS1307 Real Time Clock
- 1-Wire -- DS18B20, Powered, Single-Drop
- 1-Wire -- DS18B20, Powered, Multi-Drop
- 1-Wire -- DS18B20, Parasitic, Multi-Drop
- TI Link Protocol -- Calculator Demo
- Infrared Communication
- MIDI -- Output Demo
- MIDI -- Input Demo
- MIDI to Analog Synth
Ultrasonic Ranging Device
Now here's a really cool doodad, the HC-SR04 ultrasonic ranging device. Translate that as sonar, for indeed that's what it really is. The theory of operation is identical to what bats use. A ping is transmitted and the sensor detects the return echo, computing distance based upon how long it takes for the reflection from a solid object to return.
As you can see in the photo, above, I was standing 7 inches in front of the sensor when I snapped the pic. My experiments show that the unit is good for from 1 inch to 16 feet. And it's accurate!
Remarkably, you can get these for less than $2 from Amazon, which is where I purchased mine.
The circuit is a piece of cake:
The software is also a breeze, since I've written a library unit for the HC-SR04 to handle all the details. Be sure to read it over, for it's filled with additional info and comments.
In the demo, the readout is in inches, but the library unit also accommodates feet, centimeters and meters.
Click to get the source code.
Click to get the schematic PDF.
Next Project: Incandescent Lamp