Built with my kid for fun.
3d design was found on ThingsGivers.com by Kevin Thomas.
How to assemble the robot.
We utilized the Raspberry Pi Pico as it was readily available for our project. As the board required a 5v VCC, we incorporated a buck converter. Additionally, we integrated an H-bridge to regulate the motors. Upon detection of an obstacle within 5cm by the ultrasonic sensor, the robot will reverse for 1.5 seconds at a reduced speed. It will then randomly select a direction and turn at a random angle before continuing to drive forward until encountering another obstacle. Raspberry pi pico was programmed in c++ using Arduino IDE. This is version 1 of the project, we will make further modifications. Feel free to use, change, update the code but keep authorship attribution.
- Raspberry pi pico
- H-bridge
- Buck converter
- Prototype board
- Wires
- 9v battery
- 3d printed model
- Print 3d model and assemble it. How to assemble the robot.
- Connect 9v battery to a buck converter.
- Connect buck converter (5v out) to pipico VSYS (vcc).
- Connect ground pin of pi pico to a ground pin of a buck converter.
- Connect 9 v bettery to H-bridge.
- Connect pi pico pins 0, 1, to H-bridge in1 and in2.
- Connect pi pico pins 2, 3, to H-bridge in3 and in4.
- Connect motor A to H-bridge output for motor A.
- Connect motor B to H-bridge output for motor B.
- Connect ultrasonic sensor VCC to 5v output of a buck converter, connect ground terminal to a ground.
- Connect trigger pin and echo pin of an ultrasonic sensor to pins 14 and 15 of pi pico correspondingly.
- For convenience may add a switch for a positive terminal of 9v battery.
If I missed anything please text me for clarifiactions.
I have observed that the ultrasonic sensor has suddenly started malfunctioning and was no longer able to accurately measure distance.
Even small delays between measurements did not improve the situation. However, after lowering the buck converter to below 5 volts,
the issue was resolved. It is possible that the switching power supply was causing interference with the sensor. I will confirm this later.
In addition, I have added a 0.1uF capacitor between the 5V and ground rails of the sensor to reduce noise.