Intel Edison: Radar




Introduction: Intel Edison: Radar

About: 31 years old tinker and diy hobbyist. From Oulu, Finland. IG @mkarvonen_instructables

This is a simple homemade radar using Intel Edison, HC-SR04 and Tower Pro micro servo.

Follow this guide to make your own.

Remember to vote for me if you like my project!

The video included can be viewed with mobile from HERE!

Step 1: Things Needed.

Few things needed to make this work.

First of all, programmable Arduino based board. I used Intel Edison.

Then you will need HC-SR04 ultrasound sensor.

And lastly a micro servo.

Optionally i made a shaft to the servo to hang the ultrasound sensor to it. The shaft is basic breadboard cut in size. This also allows to easily solder jumper wires to the sensor.

Step 2: Build the Sensor Shaft.

You will need 4 holes for the sensor and 4 holes for the cables. The length of the shaft is about 15 cm.

Solder the sensor to the other end of the shaft, add jumper wires and lastly solder the connector from the other end. It's simple but very reliable.

Step 3: Connections.

I made a simple shield for the whole thing just to keep all cables in a neat order.

The basics of this is that the Edison (With external power supply) will power the ultrasound sensor and the servo.

The basic USB power wont last long with this since the servo need's steady current and it draws much of it.

So this is how the connection is.

HC-SR04 Edison

Vcc-------------------Edison Vcc


Echo---------------- Pin 6

Trigger--------------Pin 5

And for the micro servo



Signal------------ Pin 9

After soldering i attached the micro servo on to the shield with hot glue.

The shaft goes straight on the servo with hot glue and zip ties.

Step 4: Insert It on the Edison and Start Coding!

The code basic's is pretty simple, just make the servo rotate in steps from right to left and back and then make the ultrasound sensor to look up the distance to the current position.

All the information is printed to serial, witch we will be using later to draw a describer from the data collected.

The code goes like this.

Define components and setup global variables.

#define ECHOPIN 6
#define TRIGPIN 5 #include

Servo myservo; int pos = 0;

Then lets get the setup right.

void setup() {



And then the main program. If you want to adjust the angle of the servo just adjust the pos=10 and pos=170.

This is the servos movement in servo position. The pos+=3 means that each step is 3 steps for the servo motor.

oid loop() {
myservo.write(10); delay(1000); for(pos = 10; pos <= 170; pos += 3) { myservo.write(pos); Print(Distance() , pos); delay(15); } delay(1000); for(pos = 170; pos>=10; pos-=3) { myservo.write(pos); Print(Distance() , pos);

delay(15); }}

Then we make few subroutines to run in the loop. This will just make the main program look much more cleaner.

void Print (int R , int T)
{ Serial.print(R);Serial.print(", "); Serial.print(T);Serial.println("."); delay(100); }

float Distance () { digitalWrite(TRIGPIN, LOW); delayMicroseconds(2); digitalWrite(TRIGPIN, HIGH); delayMicroseconds(10); digitalWrite(TRIGPIN, LOW); // Distance Calculation float distance = pulseIn(ECHOPIN, HIGH); distance= distance/58.2; return(distance); }

Step 5: Run the Programm.

Download Processing 2 and insert the code from the file to the program and run it when the board is running.

If you need any assistance with this, Go to this project to get the info---> Intel Edison: Heart rate monitor

You can see the drawing what it does in the last picture.

That about it. If you have any guestion's just ask. I will try to answer them.

Thank's for reading!

Explore Science Contest

Participated in the
Explore Science Contest

On a Budget Contest

Participated in the
On a Budget Contest

Protected Contest

Participated in the
Protected Contest

Be the First to Share


    • Pets Challenge

      Pets Challenge
    • Remote Control Contest

      Remote Control Contest
    • Digital Fabrication Student Design Challenge

      Digital Fabrication Student Design Challenge



    7 years ago on Introduction


    next step is to mount it on wheels :)

    I can share some hints :


    Reply 7 years ago

    hi. i have already done it. Check out my obstacle avoiding robot from my projects. thanks for the comment.


    7 years ago on Step 5

    Nice :-) Maybe I will integrate this and a mearm.......


    7 years ago on Introduction

    Awsome Instructable :).... But we can use a normal arduino and any normal analog motors instead of an expensive servo


    Reply 7 years ago on Introduction

    Hi, This should work with Arduino uno just fine. These micro servos are really cheap. If you want to use normal hobby motor on it you will have to get a shield for that to change the polarity of the motor. Or a ic made for that job.


    7 years ago on Introduction

    Can u suggest any other cheap board ?.. this one is expensive for me.... Like a broad not that much advanced as this just it has enough processing power that will do this job...


    7 years ago on Introduction

    Hi, great Instructable. I'm really interested in these kind of projects but I found something which looked a bit strange to me, within the code which I just don't understand correctly. It`s the "distance" part, how did you came up with the 58.2 and why do you "reset" the TRIGPIN when you`re not using it (you use the ECHOPIN instead).


    Reply 7 years ago on Introduction


    The 58.2 comes from speed of sound converted in this formula as centimeters.

    If you want to change it to inches use 148.

    ( t = r / c c=speed of sound (340m/s), t=time, r=distance ).

    It is used in many other examples that you can find from web.

    In this example the distance= distance/58.2

    (the second distance is in many cases called duration. Don't know why i did that but it does the job. might be a error in my head that messes it up a bit.)

    The trigger pin must be shutdown when the echo pin listens the echo of the trigger pin. If the time is more than it should be ie. the measured distance is too long it will stop listening and sends a new signal through the trigger again. That is just something that has to be included in the code in order to make the sensor work properly.

    Here is a link for the components datasheet to help understand the inner workings.

    If you have anything to ask just ask.