Build an easy LED circuit that senses hot and cold distances.
In this project, youll combine an Arduino micro-controller, a Ping ultrasonic sensor, and LEDs to build a circuit that senses distances as hot and cold. Then youll run 3 Arduino programs (called sketches) that use this hot/cold information in very different ways. Its an easy project that requires no soldering, so its perfect for beginners. And its a great way to learn how a single circuit in hardware can be made to perform all kinds of tricks in the software that runs on the microcontroller.
Sketch 1 measures distance from the sensor. When youre far away, the cold blue LED glows. As you move closer, the cold LED fades and the hot red LED turns up to full brightness!
Sketch 2 is a capture the Ping game. The cold blue LED glows, and every so often, the hot red LED flashes. When the red LED is on, quickly move your hand in front of the sensor. If youre fast enough, the red LED will flash. Got it! If youre too slow, the blue one will flash. Fail!
Sketch 3 is a simple hot/cold switch. The cold blue LED pulses slowly until the sensor detects an object then the blue LED turns off and the hot red one shines at full brightness. Use this switch to trigger effects such as alerting you when someone arrives, or waking your computer when you sit in front of it.
Keith Hammond, MAKE Projects Editor
ADVERTORIAL
Jumper the Arduino to the breadboard.
Connect the Ping ultrasonic sensor to power, ground, signal.
Add the super-bright LEDs and their resistors.
Upload the Arduino program to the microcontroller.
The LEDs glow to tell distance: blue = far (cold), red = near (hot)!
Experiment with more hot/cold Arduino programs.
Learn to use an Arduino to read a distance sensor and control super-bright LED lights, without any soldering!
Parts list:
USB cable, A to B
Super-bright Blue LED, 5mm, 30mA @3.5V
Super-bright Red LED, 5mm, 25mA @1.86V
Resistor, 56, 1/4W, for Blue LED
Resistor, 150, 1/4W, for Red LED
Breadboard Jumper Wires
Tools checklist:
Computer running Arduino software (free download from arduino.cc)
USB cable, A to B (not pictured)
For complete instructions and details on this project visit:
radioshackdiy.com/hot-cold-LEDs
If you always want what you cant have, what do you want when you can have anything?
Tagline from Primer, 2004
Make:
FOUNDER & PUBLISHER
Dale Dougherty
dale@makezine.com
PRESIDENT & COO
Greg Brandeau
greg@makezine.com
EDITOR-IN-CHIEF
Mark Frauenfelder
markf@makezine.com
EDITORIAL
EXECUTIVE EDITOR
Mike Senese
msenese@makezine.com
EDITORIAL DIRECTOR
Ken Denmead
kdenmead@makezine.com
MANAGING EDITOR
Cindy Lum
clum@makezine.com
PROJECTS EDITOR
Keith Hammond
khammond@makezine.com
SENIOR EDITOR
Goli Mohammadi
goli@makezine.com
SENIOR EDITOR
Stett Holbrook
sholbrook@makezine.com
TECHNICAL EDITOR
Sean Michael Ragan
sragan@makezine.com
ASSISTANT EDITOR
Laura Cochrane
STAFF EDITOR
Arwen OReilly Griffith
EDITORIAL ASSISTANT
Craig Couden
COPY EDITOR
Laurie Barton
SENIOR EDITOR, BOOKS
Brian Jeps
EDITOR, BOOKS
Patrick Di Justo
CONTRIBUTING EDITORS
William Gurstelle, Charles Platt
CONTRIBUTING WRITERS
John Abella, Tom Burtonwood, James Christianson, Tim Deagan, Stuart Deutsch, Cory Doctorow, Brook Drumm, Anna Kaziunas France, Matt Griffin, Kacie Hultgren, Fred Kahl, Ben Lancaster, Blake Maloof, Chris McCoy, Tyler McNaney, Bob Parks, Derek Poarch, Matt Stultz, Anderson Ta
ONLINE CONTRIBUTORS
Alasdair Allan, John Baichtal, Meg Allan Cole, Michael Colombo, Jimmy DiResta, Nick Normal, Haley Pierson-Cox, Matt Richardson, Andrew Salomone, Andrew Terranova, Glen Whitney
DESIGN, PHOTOGRAPHY & VIDEO
CREATIVE DIRECTOR
Jason Babler
jbabler@makezine.com
ART DIRECTION SENIOR DESIGNER
Juliann Brown
SENIOR DESIGNER
Pete Ivey
PHOTO EDITOR
Jeffrey Braverman
VIDEOGRAPHER
Nat Wilson-Heckathorn
FABRICATOR
Daniel Spangler
WEBSITE
DIRECTOR OF WEB DEVELOPMENT
Parker Thomas
WEB DEVELOPER
Jake Spurlock