Project tutorial
Simple Obstacle Sensor with Arduino

Simple Obstacle Sensor with Arduino © GPL3+

I am going to show you how to make a simple obstacle sensing system with cheap parts like IR LED and photo diode.

  • 7,015 views
  • 2 comments
  • 9 respects

Components and supplies

Apps and online services

About this project

Step 1: Gather Stuff

Stuff you are gonna need:

  • Arduino
  • 150 ohms resistor
  • 3k ohms resistor
  • IR LED
  • Photodiode
  • jumpers
  • breadboard
  • LEDs

Step 2: Assemble

  • IR LED Anode => 150 ohms resistor => 5v
  • IR Cathode => GND
  • PhotoDiode Anode => GND
  • PhotoDiode Cathode => 3k ohms resistor => D2
  • PhotoDiode Cathode => A0
  • Green LED => D13
  • Red LED => D12

Step 3 Upload The Code:

Upload the code given. See my other projects:

Thank You!

Support:

Please support me by Going to Instructables and voting my Work. Without your work I can't keep on making stuff.

Vote For Me!

https://www.instructables.com/id/How-to-Make-Remote-Controlled-Bulb-With-Arduino/

https://www.instructables.com/id/How-to-Make-a-Parabolic-Microphone-With-an-Old-TV-/

https://www.instructables.com/id/How-to-Make-Secret-Drawer-Alarm/

Code

CodeArduino
Arduino Code
int photoDiode=2;                      
int GreenLed=13;                     
int senRead=0;                  
int SenseRate=905;                   
 void setup()    
 {  
  pinMode(photoDiode,OUTPUT);  
  pinMode(GreenLed,OUTPUT);
  pinMode(12,OUTPUT);
  digitalWrite(photoDiode,HIGH);       
  digitalWrite(GreenLed,LOW);      
  Serial.begin(9600);           
 }  
 void loop()  
 {  
  int val=analogRead(senRead);    
  Serial.println(val);            
  if(val <= SenseRate)               
  {
   digitalWrite(12,HIGH);  
   digitalWrite(GreenLed,LOW);       
   delay(20);  
  }  
  else if(val > SenseRate)            
  {  
   digitalWrite(12,LOW);
   digitalWrite(GreenLed,HIGH);       
   delay(20);  
  }  
 }  

Schematics

Schematics
Schematics
Obstacl 5xyaqznmcu
Schematics
Schematics
obstacl_GeLzd2U2jr.fzz

Comments

Similar projects you might like

Simple Homemade Flex Sensor

by Shahir nasar

  • 3,803 views
  • 1 comment
  • 9 respects

Simple Programmable Robotic Arm

Project showcase by Ryan Chan

  • 49,015 views
  • 63 comments
  • 145 respects

DHT11 Temperature/Humidity Sensor

Project tutorial by Zachary Haslam

  • 13,130 views
  • 1 comment
  • 30 respects

Hall effect sensor with Arduino

Project tutorial by AMAL NS

  • 9,420 views
  • 1 comment
  • 22 respects

Arduino Simple "Camera Slider" Electronics

Project tutorial by Ian Cumming

  • 7,207 views
  • 3 comments
  • 18 respects

Ambient Light Sensor Using Photo Resistor and LED Lights!

Project tutorial by DCamino

  • 3,365 views
  • 4 comments
  • 17 respects
Add projectSign up / Login