Aim
The goal of this activity is to operate a servo motor using an IR sensor.
Materials Required
- Raspberry Pi 4 B-1
- Servo Motor-1
- IR Sensor-1
- Several Jumper Wires
- Micro USB Cable-1
Wiring Diagram
Desired Outcome
The servo motor will rotate by 90 degrees every time the IR sensor detects an object in its range. Once the object is not in the range, the servo motor will go back to its original position