IR Sensor Controlled Servo Motor using Raspberry Pi 4 B

Aim

 The goal of this activity is to operate a servo motor using an IR sensor.

Materials Required

  1. Raspberry Pi 4 B-1    
  2. Servo Motor-1 
  3. IR Sensor-1  
  4. Several Jumper Wires   
  5. 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