Ir sensor using Arduino
An IR sensor project with Arduino Uno can be used for obstacle detection, line following, or remote control applications. Here's a simple guide: Components Needed - Arduino Uno - IR Sensor Module (e.g., VL53L0X or simple IR sensor) - Breadboard and jumper wires - LED (optional) Circuit Setup 1. Connect the IR sensor module to the Arduino: - VCC to 5V pin - GND to GND pin - Signal pin to a digital pin (e.g., pin 2) Code For simple IR sensor: const int irPin = 2; void setup() { pinMode(irPin, INPUT); Serial.begin(9600); } void loop() { int irValue = digitalRead(irPin); Serial.println(irValue); delay(100); } For obstacle detection with LED: const int irPin = 2; const int ledPin = 13; void setup() { pinMode(irPin, INPUT); pinMode(ledPin, OUTPUT); } void loop() { int irValue = digitalRead(irPin); if (irValue == LOW) { digitalWrite(ledPin, HIGH); // Obstacle detected }...