Arduino interfacing SRF05 rage finder with LCD screen

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 Preview Image

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);
 digitalWrite(initPin, LOW);

 pulseTime = pulseIn(echoPin, HIGH);

 lcd.print(pulseTime / 58, DEC);


Another application for SRF05 is a basic theremin by LuckyLarry. You can see it in action here:

Flickr Video Flickr Video

Read on here:

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed.

4 thoughts on “Arduino interfacing SRF05 rage finder with LCD screen”

  1. 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?


  2. 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

Leave a Reply

Your email address will not be published. Required fields are marked *