Home > Projects > LCD Projects > Arduino + Processing – Make a Radar Screen to Visualise Sensor Data from SRF-05 – Part 1

Arduino + Processing – Make a Radar Screen to Visualise Sensor Data from SRF-05 – Part 1

Summary of Arduino + Processing – Make a Radar Screen to Visualise Sensor Data from SRF-05 – Part 1


This article outlines building an Arduino-based radar system using an SRF-05 ultrasonic sensor mounted on a servo. The setup scans 180 degrees, taking averaged distance readings sent to the serial port for visualization in Processing. While the SRF-05 is used, the author notes its limitations for precision and suggests IR sensors as alternatives.

Parts used in the Arduino Radar:

  • SRF05 Ultrasonic range finder
  • Arduino Deumilanove w/ ATMEGA328
  • Breadboard / Prototyping board
  • Jumper/ Connector wires
  • Servo (max 5v supply)
  • Mounting material (blu-tac or modelling clay)

First things first, we need to build our circuit. This is the easy bit! We’ll be using the Arduino to control a servo that will rotate our sensor around 180 degrees. The Arduino will then send the value from the distance sensor along with the current angle of the servo to the serial port.

Before proceeding please take a moment to check out some of my other work with the SRF-05 and servos if you’re unfamiliar with either.
Arduino SRF-05 Tutorials
Arduino Servo Tutorials

I’m building this with the SRF-05 ultrasonic range finder/ distance sensor, but because this has a fairly wide field of detection it’s not very precise – I think I’ll end up trying a different range finder maybe an IR one as the SRF-05 works best as a static sensor/ detector, anyway…

Arduino + Processing – Make a Radar Screen to Visualise Sensor Data from SRF-05 – Part 1

Arduino Radar Parts list

SRF05 Ultrasonic range finder
Arduino Deumilanove w/ ATMEGA328
Breadboard / Prototyping board
Jumper/ Connector wires
1x Servo (has to need no more than 5v supply)
You’ll also need some way to mount the sensor to the servo.

Arduino Radar Servo Circuit

Straight forward, we have the Arduino providing power to the breadboard and we have the servo and the SRF-05 sharing this power. Then we have the servo output pin going to Arduino digital pin 9 and the SRF-05 pins going to digital pin 2 and 3. You’ll notice that in my pictures I have 2 servos – I’m just using the bottom one of the pair to rotate the sensor round. On your servo you’ll need to figure out a way to mount the sensor on to the servo wheel – I used a lot of blu-tac! You’ll also see I’ve mounted my sensor vertically so that the when the servo moves there’ll be less interference with recieving values – placing the sensor horisontally seemed to give differences of up to and sometimes over 5cm between the first and second readings.

My servos do tend to move a bit so I’ve used more blu-tak/ modelling clay to hold them down and in place – if the servos move other than the way they’re meant to then it means dodgy readings.

Arduino SRF05 Radar Sketch

The hardest bit – rotate the servo from left to right, then right to left and for every degree of movement take a series of readings and send them to the serial port. We’ll want to produce an average reading value for consistancy. Unfortunately with this ultrasound sensor we have to be quite slow to make sure we’re getting accurate values and we have to allow time for the signal to come back each time and register in order to produce the average value.

We do the rotation using a for loop to count to 180 and for each iteration we move the servo by +1 or -1 depending on which way we’re going – if you’ve hacked your servos then you can do a full 360 loop. During this loop we do another FOR loop to count to 10/ numReadings and for each iteration we add the distance measured to the total and after 10 readings we get our average by dividing the total by the number of readings. Then reset the total and the counter to start again for the next servo position. Finally before finishing the  the FOR loop for the servo we output the servo position and average reading to the serial port each with a preceeding character for us to later use to identify the values when reading the serial port in Processing. The last line is using println which will start a new line for the next set of values – each reading has its own line in the serial buffer makign it much easier to get our values back out.

 

For more detail: Arduino + Processing – Make a Radar Screen to Visualise Sensor Data from SRF-05 – Part 1

Quick Solutions to Questions related to Arduino Radar:

  • How does the Arduino control the sensor rotation?
    The Arduino uses a servo to rotate the sensor around 180 degrees.
  • Why did the author suggest trying a different range finder?
    The SRF-05 has a wide field of detection and is not very precise compared to other options like IR sensors.
  • What pins are used for the SRF-05 connections?
    The SRF-05 pins connect to digital pin 2 and digital pin 3 on the Arduino.
  • How can you improve reading consistency with the SRF-05?
    You should take a series of readings at each position and calculate an average value.
  • Why was the sensor mounted vertically instead of horizontally?
    Vertical mounting reduces interference; horizontal placement caused differences of up to 5cm between readings.
  • What method is used to hold the servos in place?
    The author used blu-tac or modelling clay to prevent the servos from moving during operation.
  • How does the code handle the servo movement loop?
    A for loop counts to 180, moving the servo by +1 or -1 degree per iteration depending on direction.
  • How many readings are taken for each servo position?
    The code performs 10 iterations to gather 10 readings before calculating the average.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top