This project involves controlling a car using UART communication and an ultrasonic sensor with a Raspberry Pi Pico. The car can move in all directions and stop based on commands received via the UART channel over Bluetooth. Additionally, the car is equipped with a crash prevention feature using an ultrasonic sensor to detect obstacles in front of the robot. If the crash prevention feature is enabled and the car is about to collide with an obstacle, the robot will automatically stop. The car also has a function to measure the distance to an obstacle using the ultrasonic sensor.
- Raspberry Pi Pico
- Bluetooth Module (UART)
- Ultrasonic Sensor (HC-SR04)
- DC Motors
- Motor Driver (L298N)
- LED Indicator
The wiring diagram illustrates how the Raspberry Pi Pico is connected to the DC motors, ultrasonic sensor, and other components. Ensure correct connections for the proper functioning of the car control system.
| Pin | Function |
|---|---|
| GPIO6 | IN1 |
| GPIO7 | IN2 |
| GPIO8 | EN_A |
| GPIO4 | IN3 |
| GPIO3 | IN4 |
| GPIO2 | EN_B |
| GPIO21 | Trigger |
| GPIO20 | Echo |
| GPIO25 | LED |
| GPIO1 (TX) | RX (HC05) |
| GPIO2 (RX) | TX (HC05) |
Refer to the Raspberry Pi Pico pinout diagram to identify the GPIO pins used for connecting the various components.
This project includes an Android APK that serves as the control interface for the car. Install the APK on your Android device to remotely control the car via Bluetooth. The app provides a user-friendly interface with buttons corresponding to various car movements.
- Download the provided APK file.
- Enable installation from unknown sources in your Android device's settings.
- Install the APK by following on-screen instructions.
- Open the app and establish a Bluetooth connection with the Raspberry Pi Pico.
- Upload the provided .aab file to MIT App Inventor (https://appinventor.mit.edu/).
- Modify the app's design and functionality using the visual programming interface.
- Download the modified .apk file generated by MIT App Inventor.
- Install the modified .apk file on your Android device.
Feel free to explore and enhance the app's features using MIT App Inventor's intuitive interface. Once installed, use the app to control the car's movements and interact with the various functions provided by the Raspberry Pi Pico.
If you'd like to enhance the aesthetics or functionality of your car, you can 3D print custom wheels. STL files for the wheels are provided in the CarSTL directory.
Feel free to customize the code for additional features or optimizations. Happy driving!



