Popular Tutorials

Click on the Robot interested  to know what they are, how to do them and more...
Scroll down to check out to specific topic of tutorials on Electronics and Robotics.
Ultrasonic based RADAR

Items Required

           PRODUCT NAME                   QTY
  • SPduino                                       1   Buy Now
  • Servo Motor                                 1   Buy Now
  • Ultrasonic Sensor                          1   Buy Now
  • Jumper Wires                               1    Buy Now


  • Used to plot the distance and angle at which obstacle is present as used in Ship or any moving robot.

Component Specification

Power HD HD-6001MG Servo Motor:
  • Voltage: 4.8~6.0v
  • Speed: 0.16~0.14sec
  • Torque: 5.8~6.7kg/cm
  • Weight: 43gSize: 40.7x20.5x39.5mm

Ultrasonic Sensor:
  • Power: 5V DC
  • Quiescent Current : <2mA
  • Effectual Angle: <15 degree
  • Ranging Distance : 2cm to 500 cm/1" - 16ft
  • Resolution: 0.3 cm
  • Dimensions: 45 x 20 x 15mm
  • Weight: 8.5g
  •  Measuring Distance : 2cm to 500 cm/1" - 16ft


Interfacing SPduino with Ultrasonic sensor and Servo Motor : (Connection Procedure)

  1. Connect the Vcc , Ground pins of Servo motor to 3.3V and GND of SPduino. Also, the Signal pin of Servo motor is connected to Pin 9 of the SPduino.
  2. Now, in Ultrasonic sensor, Connect the Vcc and Gnd pins to +5V and Ground of the SPduino.
  3. The Trigger pin is connected to Pin 7 and echo pin to Pin 6 of SPduino.
  4. Once done, the circuit will look like this.


Instruction for using Processing Software

  1. Here, to develop the RADAR plot, we have used a GUI development software known as Processing.
  2.  To download this software, go to  and in this Under the Stable Releases Download Version 2.2.1 for your particular Operating system.
  3. Then install the software by running the installer.
  4. Once done, open a new file in the Processing from your system and download the below code and paste the code into the new file. Save the file .
  5. Then, run the Code to see the Output.

Sample Program for SPduino

                                                     Sample Program

Sample Output and Explaination

The Ouptut here is the RADAR plot and it consists of Legends which gives you the Guidelines on how to estimate the Object position and angle.

NOTE: Upload the SPduino code to SPduino and to view the Output Plot,Press the 'Run' button in the Processing Software after saving the above Processing code.

The First sweep and Second sweep are the initial sweeps. You have to wait for two 180 degree sweeps before you can actually see the output.

After this, You will be able to see the Obstacle position with help of the Distance and Angle mentioned below the Plot.
Remember that,values Outside the Plot like 180,210,240,270,300 etc.. represent the Angle value corresponding to the Servo motor.
The Distance value indicates the distance of the Obstacle from the Ultrasonic sensor.

Thus, if the Obstacle is at Angle 300 and Distance 57 (Say) , then you will see a ' Red circle '
indicating the Motion of obstacle in the radar Plot.

  1.  Initially, the GUI of Radar plot will be as shown below. Here the First sweep in radar plot is ' Initial Sweep' (0-180 degrees). During this setup phase, the obstacle wont be detected and is done mainly to check the servo rotation .
  2.  After this is the Second Sweep. Here, the obstacle presence is just detected, but not plotted. The obstacle which was present in both the first sweep and second sweep is detected here and is as shown.
  3. Now. from third sweep , the obstacle would be detected and if it is in motion / static, it would be indicated by a ' Red Circle '.[ Example: If the obstacle is at distance of 100 cm and at an angle of 90 degree, then the Red circle are plotted accordingly as shown below.]
  4. The AVERAGE value between the changing position of obstacle (if any) is indicated by the colour of Average as mentioned in Legend(found at top left of Radar plot).
Home | Shop | Terms & Conditions | Privacy Policy | Disclaimer | Contact Us
Copyright © SP Robotic Works. All Rights Reserved.