INTEL EDISON DISTANCE SENSOR

SUMMARY:

This  project will measure distance using ultrasonic sensor,simple led and the serial monitor will show how far the distance is, and the buzzer will buzz depend on the distance.This project can be implemented also with Arduino UNO.

PARTS LIST:

  1. Intel Edison
  2. HC SR04 Ultrasonic Sensor
  3. LED
  4. Piezzo Buzzer
  5. Breadboard
  6. Jumper wires

IMG_20160512_203318.jpg

Step 1: configure arduino board with intel edsion:

Configure your arduino board with intel edison.Look at this link to configure                     ( https://software.intel.com/en-us/iot/library/edison-getting-started ).
Make sure your serial communiction and port are fixed. Check out  arduino board with intel edison by loading a simple program to your board.
This is how we connect arduino board with intel edsion.

 

IMG_0674

Step 2: PIN SELECTION

So first of all we need to assemble the ultrasonic sensor (HC SR04 ), buzzer and led to the Intel Edison’s GPIO.

The arrangement are 

Ultrasonic Sensor :

Trigger : Pin : 10
Echo : Pin 11

Buzzer : Pin 6

Actually there is 4 pins in Ultrasonic Sensor , the last pin is Vcc, we have to connect it to 5v pin on Intel Edison.

STEP 3: PIEZO BUZZER

Buzzer haas two pins Vcc and gnd. we have to give signal to buzzer through arduino board so connect the Vcc to pin 6 of arduino board.

 

20160512_214012.jpg
STEP 4: ULTRASONIC RANGE SENSOR (HC-SR04)

First of all check your Ultrasonic Range Sensor (HC-SR04) by using a simple arduino code.
Connect the ultra sonic sensor using some jumper wires.

IMG_0723

connect all the parts with arduino intel edison board as like below:
20160512_210216.jpg

Step 5: Coding Section:

Open up Arduino IDE which has a Intel Edison board in the board select menu.

Make sure port is connected correctly.

Screenshot (2)

Use this code in arduino uno:
#define trigPin 10 // Define the trigger pin for the Ultrasonic Sensor
#define echoPin 11 // Define the echo pin for the Ultrasonic Sensor
#define buzzer 6 // Define Buzzer Pin
void setup() {
Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
}

void loop() {
long distance, duration;
int sound;

digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration / 2) / 29.1;

sound = (140 + (distance/2));

if (distance > 20 || distance <= 0)
{
Serial.println(“Out of range”);
noTone(buzzer);
}
else
{
Serial.print(distance);
Serial.println(” cm”);
tone(buzzer, sound);
}
}

This is the final step of the project, a Testing phase.
Just get some paper and try to measure the distance we want in front of the Ultrasonic Sensor.
The buzzer will buzz with a different note when the distance is change and led will on.

Here is the video

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s