Coconote
AI notes
AI voice & video notes
Try for free
🛠️
Arduino Uno with Infrared Sensor Module Tutorial
Jul 13, 2024,
📄
View transcript
🤓
Take quiz
Arduino Uno with Infrared Sensor Module
Introduction
Demonstration of using an Arduino Uno with an infrared sensor module.
Components needed:
Arduino Uno
Infrared sensor module
3 male to female jumper wires
Connections
Connect VCC and ground pin of the infrared sensor module to 5V and ground pin of Arduino Uno respectively.
Connect the output pin of the infrared sensor module to pin 12 of Arduino Uno.
Arduino IDE Setup
void setup()
: Define pins
Use pin 12 as the input pin (digital pins can be used)
Use pin 13 as the output pin (built-in LED connected to pin 13)
void loop()
: Detect sensor value
Infrared sensor gives a low value upon object detection
Use
if
statement to check object detection at pin 12
If detected (digital read at pin 12 == low), turn pin 13 high
Else, keep pin 13 low
Code Upload
Compile the code.
Plug Arduino into computer using USB cable.
Select correct board and communication port.
Upload code to Arduino.
Upon detection of an object, the sensor will send a low signal and turn on the built-in LED connected to pin 13.
Adjusting Sensor Range
Use a screwdriver to adjust the potentiometer on the sensor.
Turning in one direction decreases the range; the other direction increases it.
Conclusion
Like, share, and subscribe.
Take care and Allah Hafiz.
📄
Full transcript