0% found this document useful (0 votes)
29 views

Cheap Obstacle Sensor With Arduino

The document describes how to create a cheap obstacle sensor using an infrared LED, infrared photodiode, and an Arduino board. It provides instructions on soldering the LED and photodiode together, covering the photodiode, and connecting the sensor to an Arduino. The Arduino code samples show how to detect obstacles by checking the sensor reading and lighting an LED if an obstacle is detected within a set sensitivity distance. The cheap sensor allows detecting obstacles for projects without expensive ultrasonic or infrared sensors.

Uploaded by

geniunet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Cheap Obstacle Sensor With Arduino

The document describes how to create a cheap obstacle sensor using an infrared LED, infrared photodiode, and an Arduino board. It provides instructions on soldering the LED and photodiode together, covering the photodiode, and connecting the sensor to an Arduino. The Arduino code samples show how to detect obstacles by checking the sensor reading and lighting an LED if an obstacle is detected within a set sensitivity distance. The cheap sensor allows detecting obstacles for projects without expensive ultrasonic or infrared sensors.

Uploaded by

geniunet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Food Living Outside Play Technology Workshop

Cheap obstacle sensor - with Arduino!


by dunnos on October 24, 2011

Table of Contents

Cheap obstacle sensor - with Arduino! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: Cheap obstacle sensor - with Arduino! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1: Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2: Constructing the sensor 1, soldering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 3: Constructing the sensor 2, covering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 4: Finishing, arduino. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

http://www.instructables.com/id/Cheap-obstacle-sensor-with-Arduino/
Intro: Cheap obstacle sensor - with Arduino!
When I started with arduino, and electronics, I always wanted to do things the cheap way.

Nothing has changed.

Step 1: Parts
You will need:
- Infrared LED
- Infrared photodiode
- Arduino
- Wires of some sort
- Electrical tape, duct tape, even hot glue!
- Heat shrink
- Perhaps a breadboard for testing

http://www.instructables.com/id/Cheap-obstacle-sensor-with-Arduino/
Step 2: Constructing the sensor 1, soldering
First off the sensor will be soldered together.

As you can see in the pictures, both the LED and the photodiode have a long and a short leg. The short legs should be connected to eachother like you can see in the
picture. Any questions?

Step 3: Constructing the sensor 2, covering


The photodiode will be covered, so any ambient light won't affect the readings. This will be done with some heatshrink tubing, or duct tape. Heat shrink is recommended.

Cut off a section of heat shrink a bit longer the black blob on your photodiode. Put it on and heat it! Easy, right?

Step 4: Finishing, arduino.


You will now have an LED and a photodiode soldered together. You can either glue these together, tape them together (wich I think is neater) or heatshrink
together(neatest).
What results is something like picture

Connect the long pin of the LED with +5v, the short pins to GND and the long photodiode lead to a pin on your Arduino. Preferably an analog pin. Set it as INPUT and
write it HIGH to activate the internal pullup resistor. The lower the value analogRead() gives, the closer something is.

an example code, you can upload this to your arduino board. The LED will light as soon as the obstacle comes close. Increasy the integer sensitivity to increase the
distance to activate. Watch out though! Too much and you won't be able to sense because of ambient light!

int LED = 13;


int sensor = A0;
int distance;
int sensitivity = 700

void setup()
{
pinMode(LED, OUTPUT);
pinMode(sensor, INPUT);
digitalWrite(sensor, HIGH);
Serial.begin(9600);
}

void loop()
{
distance = analogRead(sensor);
if (distance < sensitivity)
{
digitalWrite(LED, HIGH);}
else
{
http://www.instructables.com/id/Cheap-obstacle-sensor-with-Arduino/
digitalWrite(LED,LOW);
}

Serial.println(distance);

Related Instructables

Arduino motor Ultrasonic Arduino-based Ultrasonic Arduino reverse Ard-e: The robot
drives cheap Batgoggles by robot with IR Parking Sensor obstacle sensor with an Arduino
toy car (Photos) suneth radar by (Photos) by for cars by liudr as a brain by
by techbitar techbitar atatistcheff imadami

http://www.instructables.com/id/Cheap-obstacle-sensor-with-Arduino/

You might also like