avatarMariam Manzoor

Summary

The web content provides a beginner's guide to using an IR sensor with an Arduino UNO for projects that involve detecting obstacles and differentiating between black and white surfaces.

Abstract

The article on the website introduces the use of an Arduino UNO microcontroller board in conjunction with an IR sensor for simple electronics projects. It explains the working principle of the IR sensor, detailing its components such as the IR emitter LED, receiver, distance adjuster, and output pin. The guide demonstrates how the IR sensor can distinguish between reflective and non-reflective surfaces, as well as detect obstacles, by emitting and receiving infrared radiation. It also provides step-by-step instructions for hardware connections between the Arduino and the IR sensor, software requirements including a link to the Arduino code, and a sample output from the Arduino Serial Monitor. The project serves as a foundation for more complex electronic projects like line-following cars, obstacle-avoiding cars, and gesture-controlled robots, emphasizing the importance of understanding sensor basics with Arduino for innovation in electronics.

Opinions

  • The article positions the IR sensor as a versatile tool for beginners in electronics, highlighting its ease of use and practical applications.
  • It suggests that mastering the basics of sensors and Arduino can lead to significant advancements in electronic project development.
  • The guide encourages readers to engage with the content by providing a hands-on project that combines theory with practical implementation.
  • It implies that the Arduino UNO is a user-friendly platform for learning and experimenting with microcontrollers.
  • The article promotes a cost-effective AI service, ZAI.chat, as an alternative to ChatGPT Plus (GPT-4), indicating a preference for more affordable educational resources.

Arduino with Infrared Sensor

Beginners guide to Arduino Project with IR Sensor

Photo from circuits-diy.com

Arduino UNO is a microcontroller board- it is the brain of any electronics project. IR sensor, on the other hand, is an infrared rays transmitter and receiver. In the following project, we will learn the working principle of IR sensor followed by its application as a discriminator between black and white surfaces and as an obstacle detector with Arduino UNO.

IR Sensor

Photo from popuplearning.pk

FC-51 IR Sensor emits and detected infrared radiations. IR radiations are part of the electromagnetic spectrum, with wavelength higher than that of visible light, and are generally invisible to the human eye.

The IR sensor consists of:

  1. IR Emitter LED: Emits infrared light
  2. IR Receiver: A photodiode with resistance depending on the amount of IR light falling on it
  3. Distance Adjuster: Changes detection distance
  4. Vcc Pin: Provides 3–5 V input voltage
  5. Gnd Pin: Ground input
  6. Out Pin: Transmits output signal from the sensor to Arduino
  7. Obstacle LED: Turns on when light falls on IR Receiver
  8. Power LED: Turns on when the sensor is connected to a voltage source
Photo from http://qqtrading.com.my

Working of IR Sensor:

Photo from https://osoyoo.com

As per the property of light — light falling on a smooth shiny surface bounces off in a particular direction i.e. reflection — the ray send by IR Transmitter gets reflected from a surface and falls on IR Reciever. Subsequently, the receiver’s resistance drops, and a LOW/0 signal is sent by the OUT pin to the microcontroller.

image courtesy author

Similarly, when the light sent isn’t reflected either because there is no surface ahead or the surface ahead absorbs light, the resistance of the receiver rises and a HIGH/1 signal is sent by OUT pin to the microcontroller.

image courtesy author

IR Sensor differentiating between black (rough) and white (smooth and reflective) surface

image courtesy author

IR Sensor detecting an obstacle

image courtesy author

Using IR Sensor with Arduino

Hardware requirements:

  1. Arduino UNO
  2. IR Sensor
  3. Jumper Wires

Software Requirements:

  1. Arduino IDE
  2. Copy-paste the code from here:

https://gist.github.com/Mariam-73/2e502980e632867167e8f25e5b16527d

Connections:

Photo from http://qqtrading.com.my

Connect the IR sensor to Arduino using Jumper wise as following:

  1. Vcc pin on the sensor to 5V pin on Arduino
  2. Gnd pin on the sensor to GND pin on Arduino
  3. Out pin on the sensor to any digital pin on Arduino UNO (7 in this example)

Connect Arduino to Laptop using USB cable, and upload the code. Open serial monitor to view results.

Sample Arduino Serial Monitor Output

image courtesy author

Conclusion

In the above mini-project, it was shown how the IR sensor can be used along Arduino to detect obstacles or differentiate between reflecting and non-reflecting surfaces. IR sensor, along with Arduino can be used in many sensor-based electronic projects like line following car, obstacle avoiding car, and gesture control robot. A roboticist can learn and innovate in electronics by learning the basics of different sensor and Arduino, and developing such projects.

Arduino
Ir Sensor
Projects
Beginner
Recommended from ReadMedium