So Many Robots DIY - Print in Place Robot With Python and Raspberry Pi Pico W
by SoManyRobots in Circuits > Robots
1976 Views, 25 Favorites, 0 Comments
So Many Robots DIY - Print in Place Robot With Python and Raspberry Pi Pico W
In this Instructable, we will guide you through creating your very own robot using a Raspberry Pi Pico W, MicroPython, and 3D printing. This project is perfect for students, educators, or hobbyists looking to explore the fundamentals of mobile robotics and coding.
The So Many Robots DIY: Print in Place Robot is designed to be accessible, educational, and fun. You'll learn how to assemble the robot, explore robot features from any phone, and add custom functionality with MicroPython.
• This guide includes details for sourcing your own parts (or parts that you already have).
• Links have been provided to purchase prepackaged kits with a custom Printed Circuit Board (PCB) to minimize wiring and simplify the build process.
So Many Robots offers multiple options to simplify the assembly process of the robot.
• So Many Robots: Electronics starter kit
• All of the electronics and custom PCB to build the robot
• Does not include 3D printed parts
• Start with Step 1: 3D Print the Robot Parts
• All of the electronics and custom PCB to build the robot
• Includes 3D printed parts
• Start with Step 4: (Optional) Electronics Starter Kit
• So Many Robots: Custom Educational Robot
• Fully assembled and ready to explore
• Start with Step 6: Use the Robot Explorer App
Supplies
Making DIY version
Supplies
• 1x Raspberry Pi Pico W with headers
• 1x HC-SR04 Ultrasonic Sensor
• 2x MG90S Servo Micro 360° 9G Servo Motor
• AA Battery terminals (may be substituted with 3 AA battery box or an equivalent 4.5 V supply)
• 1x AA Battery Positive terminal (sold in pairs with Negative terminal)
• 1x AA Battery Negative terminal
• 2x AA Battery Positive Negative Conversion terminal
• 1x SPDT Vertical Slide Switch
• 2x Nitrile O-Ring 50mm OD 43mm ID 3.5mm
• 0.1 Pin headers
• 1x Solderless Breadboard
• 22 Gauge Stranded wire
• 22 Gauge Solid wire
• Solder
• PETG 3D printing filament
Tools
• 3D printer
• Soldering Iron
• Screwdriver
• Micro USB cable
• Computer with USB port
Making with So Many Robots: Electronics starter kit
Supplies
• 1x So Many Robots: Electronics starter kit that includes the following
• 1x So Many Robots PCB with Raspberry Pi Pico W
• 1x HC-SR04 Ultrasonic Sensor
• 2x MG90S Servo Micro 360° 9G Servo Motor
• AA Battery terminals
• 1x AA Battery Positive terminal
• 1x AA Battery Negative terminal
• 2x AA Battery Positive Negative Conversion terminal
• 2x Nitrile O-Ring 50mm OD 43mm ID 3.5mm
• Solder
• PETG 3D printing filament
Tools
• 3D printer
• Screwdriver
• Soldering Iron
• Micro USB cable
• Computer with USB port
Making with So Many Robots DIY kit
Supplies
• 1x So Many Robots DIY kit that includes the following
• 1x So Many Robots PCB with Raspberry Pi Pico W
• 1x HC-SR04 Ultrasonic Sensor
• 2x MG90S Servo Micro 360° 9G Servo Motor
• AA Battery terminals
• 1x AA Battery Positive terminal
• 1x AA Battery Negative terminal
• 2x AA Battery Positive Negative Conversion terminal
• 2x Nitrile O-Ring 50mm OD 43mm ID 3.5mm
• 3D Printed Robot Parts
• 1x Robot Body
• 1x Robot Case
• 2x Robot Wheels
Tools
• Screwdriver
• Micro USB cable
• Computer with USB port
Using with fully assembled So Many Robots: Custom Educational Robot
Supplies
• 1x So Many Robots: Custom Educational Robot that includes the following
• Fully assembled robot
Tools
• Micro USB cable
• Computer with USB port
3D Print the Robot Parts
Download the STL Files: Download files for SoManyRobots DIY - Print In Place Robot
• Robot Body
• Robot Wheel
• Robot Case
3D Print Settings
• Use PETG filament for durable robot components.
• Use minimally 0.2 mm layer height.
• Use gyroid infill pattern for increased strength.
3D Print the Parts
• 1x Robot Body
• 2x Robot Wheels
• 1x Robot Case
Mount Continuous Rotation Servos and Wheels
Mount Continuous Rotation Servos: Attach the continuous rotation servos to the body of the robot using screws.
• Route the servo wire through the bottom of the robot body to be attached with the electronics in subsequent steps.
• Servos will be placed on the Robot Body and use mounting holes that exist with the servo shaft facing the front of the robot.
• Use the Servo mounting screws to mount continuous rotation servo to the Robot Body.
• Repeat for the second continuous rotation servo.
Add O-Ring to Wheels Add the Nitrile O-Ring to the 3D Printed Wheels.
• Slip the Nitrile O-Ring around the 3D Printed Wheel between the teeth.
• Ensure that the Nitrile O-Ring has a tight fit with the teeth on the circumference of the wheel.
• Repeat for the second 3D Printed Wheel.
Attach the Wheels: Secure the 3D Printed Wheels to the continuous rotation servos.
• Press the 3D Printed Wheel to the continuous rotation servo.
• Use the Servo screw to mount the 3D Printed Wheel to the continuous rotation servo.
• Tighten the Servo screw until secure and the servo begins to spin.
• Repeat for the second 3D Printed Wheel.
Assemble Electronics
Skip this step and move to Step 4 if using the So Many Robots Electronics starter kit
Prototyping with the Raspberry Pi Pico W has many options. Using a solderless breadboard allows flexibility to reuse, test, and extend designs without soldering and making it more difficult to iterate quickly.
Solderless breadboards include strips of 0.1" on center holes that may be used to insert electronic components or wire to build circuits. We will use 22 Gauge Solid Wire to build connections between electronic components.
In this step we will use a Raspberry Pi Pico W that has been soldered with header pins. If your Raspberry Pi Pico W did not come with header pins, you will need to add these.
While wiring a circuit or programming with a Microcontroller, using the reference pinout document allows you to understand the capabilities and purpose of each pin. The Pinout for the Raspberry Pi Pico W can be accessed from the official Raspberry Pi Pico docs (pinout image used with attribution).
Downloads
(Optional) Electronics Starter Kit
Skip this step and move to Step 5 if using the DIY version
The custom PCB has been created to simplify the build process and minimize wiring and overall size. A Raspberry Pi Pico W can be used as a castellated module to be directly soldered to a carrer board or with through hole 0.1" headers.
So Many Robots PCB with Raspberry Pi Pico W uses the Raspberry Pi Pico W as a castellated module ready to use with minimal connections to the power, sensors, and servo motors. Additional sensors or actuators may be added if desired, see Step 8: Advanced Customizations once the base robot has been created.
Place AA Battery Terminals into the Robot Body
• Start with the Positive end (flat with single wire)
• Route the wire through the wire channel in the Robot Body
• Press the Positive terminal into the battery holder.
• Continue with the Negative end (spring with single wire)
• Route the wire through the wire channel in the Robot Body
• Press the Negative terminal into the battery holder.
• Finally add both of the Positive Negative Conversion terminals
• Ensure that the polarity of the terminals has been maintained.
• Press the Positive Negative Conversion terminals into the battery holder.
Make connections with the electronics to the So Many Robots PCB with Raspberry Pi Pico W
• Connect the Left Servo wire to the PCB header marked Left Motor.
• Connect the Right Servo wire to the PCB header marked Right Motor.
• Connect the Battery ground wire to the PCB ground connection.
• Connect the Battery 4.5V wire to the PCB power connection.
Place the So Many Robots PCB with Raspberry Pi Pico W into the Robot Body
• Fit the Ultrasonic Sensor into the front of the Robot Body.
• The Ultrasonic Sensor transmitter and receiver should be fitted through the circles.
• Ensure that all wires have been secured, a zip tie may be used to secure excess wires.
• Carefully adjust wires into the Robot Body.
• Place the So Many Robots PCB onto the Robot Body with the USB port above the right wheel.
• The PCB and robot body should fit securely together.
Insert 3x AA batteries
• Switch the robot into the On state by sliding the Slide Switch on the So Many Robots PCB.
• Expect the robot to power on with the LED in a blinking state ready to connect.
Flash Robot Explorer Firmware
The Raspberry Pi Pico W can be flashed with firmware using UF2 files.
For the So Many Robots DIY: Print in Place Robot we will install a custom So Many Robots: Robot Explorer UF2 Firmware. The source code for the firmware has been included at https://github.com/somany-io/robot and has been based off of the Micropython UF2 file.
- Download So Many Robots: Robot Explorer.uf2
- Press and hold the BOOTSEL button on the Raspberry Pi Pico W while connecting to a computer via a USB cable.
- Drag and drop the downloaded So Many Robots: Robot Explorer.uf2 to the RPI-RP2 volume.
See the official Raspberry Pi Pico documentation for details on UF2 and other configuration options. The drag and drop Raspberry Pi Pico UF2 example image used with attribution.
Use the Robot Explorer App
So Many Robots Explorer Firmware includes a self hosted web application served by the robot over its own WiFi. This web application includes basic explorer functionality to understand basics about the robot and directly control its motion.
Power on the Robot
• Switch the robot into the On state by sliding the Slide Switch
• Expect the robot to power on with the LED in a blinking state ready to connect.
Connect to the Robot WiFi
• The robot uses a Captive portal to serve a self hosted web application over its own WiFi network.
• Open your phone and connect to the So Many Robots WiFi network
• Your phone will prompt to connect to the WiFi network using the Robot's captive portal.
• Since the robot does not have an internet connection use the network "As Is"
• Navigate to your web browser
• Open somany.io
• Select Connect
• The joystick may be used to control the robot wheels.
• Data from the robot will be streamed back to observe data such as Ultrasonic Sensor Distance in cm and computed direction based on wheel rotation.
Troubleshooting
• If the robot does not connect
• Attempt to "Forget" the So Many Robots
• Restart the Robot by toggling the Slide Switch to Off and back to On
• Ensure that the LED blinks.
• Follow the instructions to Connect to the Robot WiFi
Explore With Python
The Robot Explorer App may be used as a foundation to extend functionality of the So Many Robots DIY: Print in Place Robot.
The Robot Explorer App may be directly modified by connecting the Raspberry Pi Pico W to a computer with a Micropython development environment configured. See the Raspberry Pi Pico MicroPython documentation for getting your computer setup.
✨Advanced Customizations✨
Congratulations you have built and programmed the robot!
This step is all about pushing the boundaries of your robot's capabilities by exploring creative modifications to the wheels, body/case, and electronics. Whether you're looking to make your robot walk, speed across different surfaces, or enhance its sensory capabilities, the possibilities are endless.
Can You Make the Robot Walk?
- Transform your robot from a wheeled wonder into a walking machine! Consider designing wheels that can fold out into legs or using a combination of gears and joints to mimic a walking gait. Experiment with different leg designs to see how they affect movement.
Speed Optimization for Different Surfaces
- Smooth Surfaces (Wood or Tile): Try designing low-friction wheels or adding rubber treads to increase grip. You could also experiment with lightweight materials that reduce drag and maximize speed.
- Carpet: For thicker, softer surfaces, consider wheels with larger diameters or textured treads to improve traction.
Case Modifications
Custom Sensor Placement
- Optimize your robot's performance by experimenting with sensor placement. Depending on your goals, you might place sensors at different angles or heights. For example, positioning an ultrasonic sensor higher on the case could improve obstacle detection, while placing light sensors at the base might enhance line-following capabilities.
Custom Case
- Import STL files into Tinkercad or another CAD program of your choice to edit and customize the designs.
- Warning
- Printing the provided STL files will ensure success on the first print.
- Some customizations may not allow desired functionality of the robot. These include modifications to servo mounts, sensor placement, or other components with tighter tolerances.
- Easy customizations with less risk to the functionality
- Adding your name to the Robot Cover
- Adding a low resolution SVG image to the Robot Cover
Unique Aesthetic Touches
- Go beyond functionality by customizing the look of your robot. Use 3D-printed parts, paint, or stickers to give your robot a unique personality. You could even create themed robots—like a futuristic bot with a sleek metallic finish or a nature-inspired robot with leaf-patterned covers.
Electronics Upgrades
- Take your robot to the next level by upgrading its electronics.
- Consider adding more sensors, such as infrared or temperature sensors, to expand its environmental awareness.