• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Arduino : IR Obstacle Detection Sensor For Dimming LED (Stop Event Facing Obstacle)

By Abhishek Ghosh April 24, 2018 8:56 pm Updated on April 24, 2018

Arduino : IR Obstacle Detection Sensor For Dimming LED (Stop Event Facing Obstacle)

Advertisement

Normally, We Use IR Obstacle Sensor to Initialize an Event, Like Lighting Up LED. That is commonly what we need for robotics. Like in our previous guide, Arduino IR Obstacle Sensor Buzzer With LED, we started LED and buzzer when an obstrucle was in front. But We Can Do the Opposite. That stop action makes a digital switch working like our regular switches – when you are present in front of a desk lamp, it will remain light up, but when you are absent, it will automatically shut down. We can reach that desired effect with other kind of sensors but using IR sensors made from components is more cheaper and sufficient for many applications. Here is Arduino IR Obstacle Detection Sensor For Dimming LED to Stop Event Facing an Obstacle.

That thing will help us for upgrading previous DIY guides for adding useful automation. Suppose, we are using one push button switch to start an event and another push button switch to stop the event. In modified form using IR Obstacle Detection Sensor, we can replace the second push button to stop the event. Like, you started a timer with push button to start buzzer after a time lapse which will not stop till you press the second push button. Using IR Obstacle Detection Sensor, you can stop that buzzer by simply going closer to it. PIR Motion Sensor does similar work but more specific around object which approached.
 

Arduino IR Obstacle Detection Sensor For Dimming LED : Circuit Diagram and Code

 

You will need quite basic components for this project :

Advertisement

---

  1. Regular IR Obstacle Detection Sensor (Not necessarily Sharp IR Sensor like shown in illustration)
  2. Arduino UNO or similar board
  3. Optionally a LED and one 220 Ohm resistor. Actually UNO’s LED will do the job of testing.

Here is illustration cum wiring :

Arduino IR Obstacle Detection Sensor For Dimming LED Stop Event Facing Obstacle

In short :

Vim
1
2
3
4
5
6
7
# Sensor
GND  ===> Arduino's GND
Vcc  ===> Arduino's 5V
Data ===> Arduino's 7th Pin
# Optional LED
LED  ===> (+) to Arduino's 13th Pin
LED  ===> (-) to Arduino's GND

Here is the code :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
int LED = 13; // onboard LED
int obstaclePin = 7;  // Sensor input pin
int hasObstacle = HIGH;  // Note the logic, it is for else statement later
 
void setup() {
  pinMode(LED, OUTPUT);
  pinMode(obstaclePin, INPUT);
  Serial.begin(9600);  
}
void loop() {
  hasObstacle = digitalRead(obstaclePin);
  if (hasObstacle == HIGH) //Obsracle present
  {
    Serial.println("Something ahead");
    digitalWrite(LED, LOW);//Dims the LED
  }
  else
  {
    Serial.println("Clear");
    digitalWrite(LED, HIGH); //Illuminates the LED
  }
  delay(200);
}

Open the serial monitor of Arduino IDE and notice the debug output.

Tagged With obstacle detection arduino with led , arduino led buzzer obstacle sensor , arduino pir sensor buzzer dosent stop after object not present , https://thecustomizewindows com/2018/04/arduino-ir-obstacle-detection-sensor-for-dimming-led-stop-event-facing-obstacle/ , led dimming by obstacle sensor arduino
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Arduino : IR Obstacle Detection Sensor For Dimming LED (Stop Event Facing Obstacle)

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Arduino : LED Switch On By Push Button Switch Off By IR Obstacle Sensor

    Here is Circuit Diagram and Code To Make LED Switch On By Push Button Switch Off By IR Obstacle Sensor and Arduino Board.

  • Arduino With DHT 11 Sensor and Arduino Online IDE : Basic IoT

    Arduino With DHT 11 Sensor and Arduino Online IDE is Example of Basic IoT Which Needs No Special Hardware But Arduino, DHT11, Internet Connection & Web Browser.

  • Arduino Temperature Humidity Sensor : New DHT11, DHT21, DHT22 Test Code

    Here is New Test Codes For Arduino Temperature Humidity Sensor DHT11, DHT21, DHT22 Test Code as Hardware (Not Shields). 2 Libraries Needed.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy