• 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 , led dimming by obstacle sensor arduino

This Article Has Been Shared 651 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic 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)

  • DIY Basic Stand For TM1637 7 Segment LED Display Module

    Is Not It Risky To Use LED Display Unprotected? Here Is How To Build DIY Basic Stand For TM1637 7 Segment LED Display Module With Cardboard.

  • ATtiny Arduino Boards For Cost Saving Projects

    Ready to Use Cheap ATtiny Arduino Boards Available. Here is What to Know About ATtiny Arduino Boards For Cost Saving Projects Before Buying.

  • List of Electronics Prototyping & Project Materials

    Our Illustrated List of Electronics Prototyping & Project Materials is a Helpful Guide to Those Who Lacks Conventional Course on Electronics.

  • How To Play MP3 On Arduino With No Shield, No SD Card

    Here is How to Play MP3 On Arduino With No Shield, No SD Card at Lower Bit Rate for Few Seconds. It is Suggested to Try for Learning Basic.

  • 1602A LCD Display Arduino Connection (Blue Light White Text 16×2)

    Here is Detailed Steps on How to For 1602A LCD Display Arduino Connection. We Provided Guide on Soldering of Blue Light White Text Displays.

Additionally, 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

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

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 (20K Followers)
  • Twitter (4.9k Followers)
  • Facebook (5.8k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.2k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Top 10 Anti Hacking Software for Microsoft Windows January 22, 2021
  • What is Software Modernization? January 21, 2021
  • Cloud Computing : Cybersecurity Tips for Small Business Owners January 20, 2021
  • Arduino : Independently Blink Multiple LED January 18, 2021
  • What is a Loosely Coupled System? January 17, 2021

 

About This Article

Cite this article as: Abhishek Ghosh, "Arduino : IR Obstacle Detection Sensor For Dimming LED (Stop Event Facing Obstacle)," in The Customize Windows, April 24, 2018, January 23, 2021, https://thecustomizewindows.com/2018/04/arduino-ir-obstacle-detection-sensor-for-dimming-led-stop-event-facing-obstacle/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

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

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