Raspberry Pi 4B-Controlled Multi-Functional Robot with Navigation and Object Detection
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to interface a Raspberry Pi 4B with various peripherals including servo motors, DC motors, an ultrasonic sensor, an IR sensor, a GPS module, a camera module, and motor drivers. The Raspberry Pi 4B serves as the central processing unit, controlling the servo motors through a 16-Channel PWM Servo Driver, driving the DC motors via an L298N Motor Driver, and interfacing with the sensors and GPS module for input. The circuit is powered by battery cases, and the components are interconnected through a series of GPIO pins and power lines.
Component List
Raspberry Pi 4B
- A microcomputer with multiple GPIO pins used for controlling the peripherals and processing sensor data.
Servo Motor 9G (x3)
- Small and lightweight servo motors for precise control of mechanical movement.
16-Channel PWM Servo Driver
- A driver board that allows the Raspberry Pi to control multiple servo motors via I2C communication.
DC Motor (x4)
- Motors that convert electrical energy into mechanical energy, used for driving wheels or other rotating parts.
L298N Motor Driver
- A dual H-bridge motor driver that allows for controlling the direction and speed of two DC motors.
HC-SR04 Ultrasonic Sensor
- A sensor that measures distance by emitting ultrasonic waves and measuring the time taken for the echo to return.
IR Sensor
- An infrared sensor used for object detection or line tracking.
GPS NEO 6M
- A GPS module that provides location data to the Raspberry Pi.
OV2640 Camera Module
- A camera module that captures images or video for processing by the Raspberry Pi.
MG996R Servo (x3)
- High-torque digital servo motors for applications requiring more strength and precision.
My Battery Case (x2)
- Power sources for the circuit, providing the necessary voltage and current to the components.
Wiring Details
Raspberry Pi 4B
5Vconnected to HC-SR04 Ultrasonic Sensor VCC and GPS NEO 6M VCC.GPIO2(SCL) connected to 16-Channel PWM Servo Driver SCL.GPIO3(SDA) connected to 16-Channel PWM Servo Driver SDA.GPIO4connected to GPS NEO 6M GND.GPIO14connected to GPS NEO 6M RX.GPIO15connected to GPS NEO 6M TX.GPIO17connected to L298N MOTOR DRIVER IN1.GPIO18connected to L298N MOTOR DRIVER IN2.GPIO27connected to L298N MOTOR DRIVER IN3.GNDconnected to IR Sensor GND, HC-SR04 Ultrasonic Sensor GND, and 16-Channel PWM Servo Driver GND.GPIO22connected to L298N MOTOR DRIVER IN4.GPIO23connected to HC-SR04 Ultrasonic Sensor TRIG.3V3connected to IR Sensor VCC.GPIO24connected to HC-SR04 Ultrasonic Sensor ECHO.GPIO25connected to IR Sensor OUT.GPIO19connected to L298N MOTOR DRIVER ENA.GPIO26connected to L298N MOTOR DRIVER ENB.CAMERAconnected to OV2640 Camera Module PWDN.
Servo Motor 9G
VCC 5Vconnected to 16-Channel PWM Servo Driver V+.PMWconnected to 16-Channel PWM Servo Driver PWM (specific channel varies per servo).GNDconnected to 16-Channel PWM Servo Driver GND.
16-Channel PWM Servo Driver
V+connected to My Battery Case +.VCCconnected to My Battery Case -.SDAandSCLconnected to Raspberry Pi GPIO2 and GPIO3 respectively.OEnot connected.GNDconnected to Raspberry Pi GND and servo motors GND.PWM1-16connected to servo motors PMW and MG996R SIG as per channel assignment.
DC Motor
pin 1andpin 2connected to L298N MOTOR DRIVER OUT 1-4 (specific connections vary per motor).
L298N Motor Driver
IN1-4connected to Raspberry Pi GPIO17, GPIO18, GPIO27, and GPIO22 respectively.ENAandENBconnected to Raspberry Pi GPIO19 and GPIO26 respectively.OUT 1-4connected to DC Motors.GNDconnected to My Battery Case -.5Vnot connected.12Vconnected to My Battery Case +.
HC-SR04 Ultrasonic Sensor
VCCconnected to Raspberry Pi 5V.TRIGconnected to Raspberry Pi GPIO23.ECHOconnected to Raspberry Pi GPIO24.GNDconnected to Raspberry Pi GND.
IR Sensor
outconnected to Raspberry Pi GPIO25.gndconnected to Raspberry Pi GND.vccconnected to Raspberry Pi 3V3.
GPS NEO 6M
VCCconnected to Raspberry Pi 5V.RXconnected to Raspberry Pi GPIO14.TXconnected to Raspberry Pi GPIO15.GNDconnected to Raspberry Pi GPIO4.
OV2640 Camera Module
PWDNconnected to Raspberry Pi CAMERA.
MG996R Servo
VCCconnected to 16-Channel PWM Servo Driver V+.SIGconnected to 16-Channel PWM Servo Driver PWM (specific channel varies per servo).GNDconnected to 16-Channel PWM Servo Driver GND.
My Battery Case
+connected to 16-Channel PWM Servo Driver V+ and L298N MOTOR DRIVER 12V.-connected to 16-Channel PWM Servo Driver VCC and L298N MOTOR DRIVER GND.
Documented Code
No code has been provided for the microcontrollers in the circuit. The documentation of the code would typically include descriptions of the functions, algorithms, and any libraries used to interface with the hardware components. It would also detail the setup and loop structures, along with any interrupt service routines or event handlers. Since no code is available, this section remains empty.