This is a another sample demonstrating Arduino MEGA, LCD screen and SRF05 ultrasonic range finder. The distance measurement from SRF05 is displayed on the LCD screen in centimetres.
[youtube]http://www.youtube.com/watch?v=VNJu6oR69Zs[/youtube]
Different from Infra Red range finder witch uses IR light to measure distance, ultrasonic range finder sends short high pitch sound pulses and measures the time for the echo to come back to the microphone. Here is a very good comparison of the two types of range finders. The code running on the Arduino:
// include the library code: #include <LiquidCrystal.h> #define echoPin 6 // the SRF05's echo pin #define initPin 7 // the SRF05's init pin unsigned long pulseTime = 0; // variable for reading the pulse // initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { // set up the LCD's number of rows and columns: lcd.begin(16, 2); // make the init pin an output: pinMode(initPin, OUTPUT); // make the echo pin an input: pinMode(echoPin, INPUT); } void loop() { digitalWrite(initPin, HIGH); delayMicroseconds(10); digitalWrite(initPin, LOW); pulseTime = pulseIn(echoPin, HIGH); lcd.setCursor(0,0); lcd.print(pulseTime / 58, DEC); lcd.print("cm"); delay(100); lcd.clear(); }
Another application for SRF05 is a basic theremin by LuckyLarry. You can see it in action here:
[flickrvideo]http://www.flickr.com/photos/peplop/4083266594[/flickrvideo] [flickrvideo]http://www.flickr.com/photos/peplop/4083675920[/flickrvideo]
Read on here:
Hy! u’ve done nice work there!
I have a question for you if you don’t mind: from where did u learn the code who running on Arduino board? and what’s the name of the compiler?
Cheers!
Hi Marian,
I’ve learned Arduino coding purely from the examples that you can find on this page: http://www.arduino.cc/en/Tutorial/HomePage . There is also plenty of info in the documentation section http://arduino.cc/en/Hacking/HomePage.
Hi again!
Thanks a lot for thoes links…very helpful.
Cheers!
Hello, I am also working on a SRF05 Rangefinder, but I am using a Altera Terasic DE0 Board…can you please tell me where can i find or learn to program it on a DE0 board.
Thank You