Raspberry Pi Zero W Controlled Robotic Vehicle with Ultrasonic Navigation and 9DOF Sensor Feedback
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary of the Circuit
This circuit is designed to interface a Raspberry Pi Zero W with various peripherals including an HC-SR04 Ultrasonic Sensor, a 9DOF Sensor LSM9DS0, two DC Mini Metal Gear Motors, and an L298N DC motor driver. The circuit is powered by a 12V battery, which is regulated down to 5V using a Buck converter to supply the Raspberry Pi and sensors. The Raspberry Pi controls the motors through the L298N motor driver and collects data from the sensors for processing.
Component List
Raspberry Pi Zero W
- A low-cost, compact variant of the Raspberry Pi with wireless LAN and Bluetooth connectivity.
- Pins: 5V, 3V3, multiple GPIOs, GND, CSI (Camera)
L298N DC Motor Driver
- A high-power motor driver capable of driving up to two DC motors.
- Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, ENA, IN1, IN2, IN3, IN4, ENB
12V Battery
- A power source for the circuit, providing 12V to the motor driver and the buck converter.
- Pins: + (positive), - (negative)
DC Mini Metal Gear Motor (x2)
- Small DC motors with gear reduction for increased torque.
- Pins: IN1, IN2
9DOF Sensor LSM9DS0
- A nine degrees of freedom (DOF) sensor with an accelerometer, magnetometer, and gyroscope.
- Pins: INT2XM, INT1XM, DRDYG, INTG, DEN, GND, VDD, SDA, SCL, SDOXM, SDOGM, CSXM, CSG
HC-SR04 Ultrasonic Sensor
- An ultrasonic distance sensor capable of measuring distances by emitting ultrasonic waves.
- Pins: VCC, TRIG, ECHO, GND
Buck Converter
- A DC-DC converter that steps down voltage from 12V to 5V.
- Pins: IN+, IN-, OUT+, OUT-
Wiring Details
Raspberry Pi Zero W
- 5V connected to HC-SR04 VCC, 9DOF Sensor VDD, and Buck Converter OUT+
- GROUND connected to HC-SR04 GND, 9DOF Sensor GND, and Buck Converter OUT-
- GPIO 23 connected to HC-SR04 TRIG
- GPIO 24 connected to HC-SR04 ECHO
- GPIO 12 connected to L298N ENA
- GPIO 16 connected to L298N IN1
- GPIO 20 connected to L298N IN2
- GPIO 21 connected to L298N IN3
- GPIO 04 connected to 9DOF Sensor CSG
- GPIO 17 connected to 9DOF Sensor DEN
- GPIO 22 connected to 9DOF Sensor SDA
- GPIO 10 connected to 9DOF Sensor SDOXM
- GPIO 5 connected to 9DOF Sensor CSXM
- GPIO 6 connected to 9DOF Sensor SDOG
- GPIO 13 connected to L298N ENB
- GPIO 19 connected to 9DOF Sensor SCL
- GPIO 26 connected to L298N IN4
L298N DC Motor Driver
- 12V connected to Buck Converter IN+ and 12V Battery +
- GND connected to Buck Converter IN- and 12V Battery -
- OUT1 connected to DC Mini Metal Gear Motor IN2 (Motor 2)
- OUT2 connected to DC Mini Metal Gear Motor IN1 (Motor 2)
- OUT3 connected to DC Mini Metal Gear Motor IN2 (Motor 1)
- OUT4 connected to DC Mini Metal Gear Motor IN1 (Motor 1)
12V Battery
-
- (positive) connected to Buck Converter IN+ and L298N 12V
-
- (negative) connected to Buck Converter IN- and L298N GND
DC Mini Metal Gear Motor (Motor 1)
- IN1 connected to L298N OUT4
- IN2 connected to L298N OUT3
DC Mini Metal Gear Motor (Motor 2)
- IN1 connected to L298N OUT2
- IN2 connected to L298N OUT1
9DOF Sensor LSM9DS0
- VDD connected to Raspberry Pi 5V
- GND connected to Raspberry Pi GROUND
- SDA connected to Raspberry Pi GPIO 22
- SCL connected to Raspberry Pi GPIO 19
- CSG connected to Raspberry Pi GPIO 04
- DEN connected to Raspberry Pi GPIO 17
- CSXM connected to Raspberry Pi GPIO 5
- SDOXM connected to Raspberry Pi GPIO 10
- SDOG connected to Raspberry Pi GPIO 6
HC-SR04 Ultrasonic Sensor
- VCC connected to Raspberry Pi 5V
- GND connected to Raspberry Pi GROUND
- TRIG connected to Raspberry Pi GPIO 23
- ECHO connected to Raspberry Pi GPIO 24
Buck Converter
- IN+ connected to 12V Battery +
- IN- connected to 12V Battery -
- OUT+ connected to Raspberry Pi 5V, HC-SR04 VCC, and 9DOF Sensor VDD
- OUT- connected to Raspberry Pi GROUND, HC-SR04 GND, and 9DOF Sensor GND
Documented Code
No code has been provided for the microcontrollers in the circuit. The Raspberry Pi would typically be programmed using Python or another suitable language to control the GPIO pins and communicate with the sensors and motor driver. The code would initialize the GPIO pins, set up communication protocols (such as I2C for the 9DOF sensor), and implement logic for motor control and sensor data acquisition.