Tuesday, December 25, 2007

Arduino with Parallax Sonar sensor

Yesterday, I picked up one of the heavily-advertised Parallax PING Ultrasonic sonar sensors from Radio Shack, and wanted to see how easy (or difficult) it would be to get operating with the Arduino. As it turned out, it was incredibly easy - in fact, it took less than 15 minutes of coding to get operating, and all I needed was the PDF spec-sheet from Parallax:


I plugged the sonar module into the top of the breadboard, wired ground, wired +5V, and then connected a wire from the signal port to the Arduino's pin 8. 15 minutes later, here's a video of me moving the sensor towards and away from my laptop's monitor:



After I wrote my own code, I found a slightly more elegant way to wait and count the length of the return pulse - there's Open Source community in action - thanks!

Anyway, here's my code - I've uploaded it to Liquidware.

2 comments:

Aaron said...

Hey thanks, I picked up a PING))) sensor at Radio Shack today and your function works great!

dghnfgj said...

You said you will love me wow gold the whole life, but WoW Gold you marry her. You said you will wow power leveling,come to marry me, but this will not be carried out forever.WoW Gold I am trying my best to forget you and do not love you anymore. wow leveling But I failed and I still love you. Maybe wow leveling she needs you more compared wow leveling with me. So I tell you that world of warcraft power leveling you should love world of warcraft power leveling her and take good world of warcraft leveling care of her. You said I was so kind.world of warcraft leveling Yes, because I love you,world of warcraft leveling I hope you will be power leveling happy forever.