Intel Edison: Radar

by mkarvonen in Circuits > Arduino

19721 Views, 151 Favorites, 0 Comments

Intel Edison: Radar

Kansi.jpg
Arduino Radar

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!

Things Needed.

DSCN4656.JPG

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.

Build the Sensor Shaft.

DSCN4658.JPG
DSCN4659.JPG
DSCN4660.JPG
DSCN4661.JPG
DSCN4662.JPG
DSCN4663.JPG

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.

Connections.

DSCN4664.JPG
DSCN4665.JPG
DSCN4666.JPG
DSCN4667.JPG
DSCN4668.JPG
DSCN4669.JPG

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

GND-----------------GND

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

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

And for the micro servo

Vcc-----------------Vcc

GND---------------GND

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.

Insert It on the Edison and Start Coding!

DSCN4670.JPG
DSCN4671.JPG
DSCN4672.JPG
DSCN4673.JPG

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() {
Serial.begin(115200);

myservo.attach(9);

pinMode(ECHOPIN, INPUT); pinMode(TRIGPIN, OUTPUT); }

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); }

Downloads

Run the Programm.

DSCN4674.JPG
DSCN4675.JPG
DSCN4676.JPG
Kuvaaja.jpg

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!

Downloads