How To Make an Automatic barrier using IR Sensor, Object detection, smart, simple Circuit
Here’s a code for your Arduino project using a servo motor and an IR sensor. In this scenario, when the IR sensor detects an object, the servo motor arm moves to 120 degrees and stays there for 2 seconds before returning to its initial position.
Components Required:
- 1 x Arduino
- 1 x Servo motor
- 1 x IR sensor (e.g., IR obstacle avoidance sensor)
- Jumper wires
- 1 Green LED and one Red LED with Resistance
Circuit Diagram:
- Servo Motor:
- Connect the signal pin to Arduino digital pin
9
- Connect the VCC to
5V
- Connect the GND to
GND
- Connect the signal pin to Arduino digital pin
- IR Sensor:
- Connect the output pin to Arduino digital pin
7
- Connect the VCC to
5V
- Connect the GND to
GND
- LED Connections:
- Connect the RED LED to
11
- Connect the GREEN LED to
10
Video Link: - Click Here For Video
How To Make an Automatic barrier using IR sensor, Object detection, smart, simple Circuit: -
Arduino IDE Program
-----------------------------------------------------------------------------------------------------------------------------
Explanation:
- The IR sensor detects an object.
- When an object is detected, the servo motor moves its arm to 120 degrees, simulating the parking token scenario and green LED will turn on after 1 sec and red will be off.
- After 2 seconds, the servo arm returns to its original position (0 degrees) and green LED turns off and red LED turned on.
- The code continuously checks for objects using the IR sensor.
Circuit Simulation:
You can use Tinkercad to simulate this project by adding the ultrasonic sensor, buzzer, and Arduino. Run the simulation to check how it works! Let me know if you need more details or help setting up.
Share, Support, and Subscribe!!! 1. PRO KAM EXPLAINED 2. Knowledge KAM 3. PRO KAM Follow us on 1. Facebook 2. Instagram 3. Pinterest 4. Blogspot 5 Twitter If you have any other ideas to make me design, you can describe them in the comment section and if I can, I will make a designing video on it. So I am waiting #prokam #wtc #Arduino #ideas #projects #diy #how #to
0 Comments