muhammed shameel k.v
Published © GPL3+

Simple Obstacle Sensor with Arduino

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

BeginnerFull instructions provided15 minutes36,651
Simple Obstacle Sensor with Arduino

Things used in this project

Hardware components

IR transmitter (generic)
×1
Photo Diode
×1
Arduino UNO
Arduino UNO
×1
3k resistor
×1
150 ohm resistor
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
LED (generic)
LED (generic)
×2

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Schematics

Schematics

Schematics

Schematics

Code

Code

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

Credits

muhammed shameel k.v

muhammed shameel k.v

0 projects • 11 followers
I am a great at electronics. I have programming knowledge and some projects of my own

Comments