Digital Pin (e.g., D2)→IR Sensor (Left) OUT
For reading left sensor state
Digital Pin (e.g., D3)→IR Sensor (Right) OUT
For reading right sensor state
Digital Pin (e.g., D4)→L298N IN1
Motor A direction control
Digital Pin (e.g., D5)→L298N IN2
Motor A direction control
PWM Pin (e.g., D9)→L298N ENA
Motor A speed control (PWM)
Digital Pin (e.g., D6)→L298N IN3
Motor B direction control
Digital Pin (e.g., D7)→L298N IN4
Motor B direction control
PWM Pin (e.g., D10)→L298N ENB
Motor B speed control (PWM)
Digital Pin 10 (PWM)→L298N Motor Driver enA
Left Motor Speed Control
Digital Pin 9→L298N Motor Driver in1
Left Motor Direction 1
Digital Pin 8→L298N Motor Driver in2
Left Motor Direction 2
Digital Pin 7→L298N Motor Driver in3
Right Motor Direction 1
Digital Pin 6→L298N Motor Driver in4
Right Motor Direction 2
Digital Pin 5 (PWM)→L298N Motor Driver enB
Right Motor Speed Control
Analog Pin A0→IR Sensor Left OUT
Left Line Sensor Input
Analog Pin A1→IR Sensor Right OUT
Right Line Sensor Input
Analog Pin A2→HC-SR04 Ultrasonic Echo
Ultrasonic Echo Pin
Analog Pin A3→HC-SR04 Ultrasonic Trigger
Ultrasonic Trigger Pin
Analog Pin A5→Servo (Scanning) Signal
Main Scanning Servo
Analog Pin A4→Servo (Gate) Signal
Gate Control Servo
5V→IR Sensors VCC, HC-SR04 VCC, Servos VCC
Power for sensors and servos
GND→L298N GND, IR Sensors GND, HC-SR04 GND, Servos GND
Common Ground