PYPER is a Python-based, 3D-Printed, Electric Rover.
I designed PYPER from scratch from the ground up - I used Blender for 3D-modeling of the chassis, steering mechanism, and drivetrain, printed the parts on my Creality Ender 3 3D Printer, designed the electrical circuitry, and wrote the code that coordinates its driving mechanics.
The project is fully open source under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license. The source code that runs on an onboard Raspberry Pi is available here and the 3D-printed parts (.stl files) can be found on Thingiverse here.
- Weight, fully assembled: 23g
- Dimensions: 173x213x76 mm (WxLxH)
- Gear Ratio: PYPER uses a 48:1 TT motor (please note that, while the title of this product on Amazon states it is a 1:48 ratio, it is actually a 48:1 (reduction) gear ratio) against a 4:5 3D-printed compound gear system I developed. This graphic helped me calculate this ratio:
- Teeth on motor gear (gear attached to TT motor, receiving rotational input): 15
- Teeth on mid-axle gear (intermediary between motor gear and final drive shaft): 24
- Teeth on drive shaft gear: 12
- Motor Gear to Mid-Axle Gear ratio (driven / driving) = 24/15 = 24:15
- Mid-Axle Gear to Drive Shaft Gear ratio (driven / driving) = 12/24 = 12:24
- Ratio of PYPER's 3D-printed combined gear system = 24/15 * 12/24 = 288/360 = 4/5 = 4:5
- This can be interpretted as: for every 4 turns the motor gear makes (powered by the motor), the final drive shaft will rotate 5 times.
- Thus, PYPER's gear system actually speeds up the TT motor (gains speed, loses torque) a little bit.
- Altogether, combining the 48:1 ratio of the TT motor against the 4:5 ratio of PYPER's fixed 3D-printed gear system, PYPER has a 192:5 gear ratio.
- This means that pairing PYPER's 3D-printed gear system to the TT motor speeds up the TT motor slightly, gaining speed, but losing torque (going from gear ratio of 48.0 to 38.4).
I built PYPER to demonstrate the essential components required to build a basic RC car: a steering mechanism and a mid-mounted motor delivering power to the rear wheels through a multi-gear drivetrain. While many other models you can find online are very impressive, they tend to be overly complex and advanced, posing challenges for beginners to mechanical engineering to understand.
In contrast, PYPER is intentionally designed to be straightforward, accessible, and approachable for anybody. So, for the sake of learning, I describe PYPER and its systems (steering, drivetrain, code, etc.) below in detail.
I hope you can learn from PYPER and uses these ideas in your own projects.
You can watch the video below to see PYPER being built from the 3D-printed parts below, from the ground up. Click the image below to watch!
PYPER is fully open source, everything you need to build one is available here. These are the parts used in PYPER, if you choose to build a PYPER yourself or repurpose these ideas in your own design:
Part | Cost (USD) |
---|---|
~110g of PLA filament (20% infill used) | $1.76 |
1 Raspberry Pi Pico W | $6 |
1 SG90 Servo Motor | $1.88 |
1 TT Motor | $1.47 |
1 1S Lithium Polymer Battery | $6.42 |
1 MT3608 DC-DC Boost Converter | $0.90 |
8 MR115-2RS (5x11x4mm) Bearings | $4.27 |
1 L293D DC Brushed Motor Driver | $1.25 |
1 Small Breadboard | $1.71 |
22 M2 and M3 Screws, Bolts, Washers (see below) | < $2.00 |
Misc Wires | < $1.00 |
Part costs to build PYPER: roughly $28.66.
All of the 3D-printed parts needed to make PYPER are available on Thingiverse for free. Each part and its role is described below:
These visualizations can be found in this PowerPoint deck.
- You will need to insert a MR115-2RS (5x11x4mm) bearing into the following parts after printing. Each part is designed to accept the bearing with little friction, but you may need to use a mallet/hammer to bang the bearing in.
mid_axle_gear.stl
bearing_mount.stl
wheel_front.stl
- After printing the gears, you may need to slightly sand down some of the teeth of each gear so they mesh well against one another.
Metric screws are used in PYPER's design due to their wide availability, precision, and compatibility. The holes cut into the 3D-printed parts will fit are all intended for metric screws.
These are how many of each metric screw specification you'll need:
Size (width*length) | Count |
---|---|
M3*30mm | 4 |
M3*12mm | 2 |
M3*8mm | 4 |
M2*12mm | 4 |
M2*8mm | 6 |
M2*6mm | 2 |
These are the specific needs for these screws in PYPER's design:
- 2 M3*30mm for steering uprights
- 2 M3*12mm for steering uprights
- 2 M3*8mm for screwing front wheels in
- 4 M2*12mm for screwing in final drive bearing mounts
- 4 M2*8mm for screwing in mid axle mount
- 2 M3*30mm for screwing TT motor into TT frame
- 2 M3*8mm for screwing TT frame into base
- 2 M2*6mm for screwing in rear wheels
- 2 M2*8mm for screwing in SG90 servo to frame
PYPER uses:
- A 1S (1 cell) Lithium Polymer battery (but this can be swapped with any battery < 5V that can provide enough current to power these electronics, which is minimal)
- A MT3608 DC-DC converter to step up the 3.2-4.2 nominal volts of the 1 cell battery to a stable 5V
- An L293D brushed DC motor driver for controlling the application of electricity to the motor via the Raspberry Pi's GPIO pins
- A 1:48 gear ratio TT motor to turn the rear wheels, moving it forward or backward
- An SG90 servo to actuate a steering angle
- A Raspberry Pi Pico W to serve as "the brain", driving PYPER around according to requests
The components should be wired together as depicted in this wiring diagram below:
The draw.io wiring diagram can be found here, if you'd prefer to pull up a higher-resolution version.
PYPER is drivable via an onboard Raspberry Pi Pico W which runs a web server on your local network and receives movement commands via HTTP requests. PYPER's software is written in MicroPython and is available in the src
folder here.
Before deploying this code to your own Raspberry Pi Pico W, you will need to configure a few variables in the settings.py module:
wifi_ssid
: The SSID (username) of your wifi network. The Raspberry Pi Pico will use this to connect to your wifi network and receive movement instructions via HTTP requests.wifi_password
: The password to your wifi network. The Raspberry Pi Pico will use this to connect to your wifi network and receive movement instructions via HTTP requests.gp_steering
: Set this to the GPIO pin (GP number, not pin number) that you are using to control the servo via the servo's signal wire. If you used the same GP pin that I used in my code, this does not need to be changed.gp_safety
: Set this to the GPIO pin (GP number, not pin umber) that you have connected to the top-left pin of the L293D motor driver; this serves as the "safety" input (for the L293D to give any power to the motor, this must be set to a high state). If you used the same GP pin that I used in my code, this does not need to be changed.gp_i1
: Set this to the GPIO pin (GP number, not pin number) that you are using to control one of the motor inputs (see wiring diagram). If you used the same GP pin that I used in my code, this does not need to be changed.gp_i2
: Set this to the GPIO pin (GP number, not pin number) that you are using to control the other motor input (see wiring diagram). If you used the same GP pin that I used in my code, this does not need to be changed.
With the contents of the src folder loaded onto a Raspberry Pi Pico W (programs like Thonny or rshell can be used for this), once the Raspberry Pi Pico W is powered up, it will immediately begin to execute the code in the main.py module. Once the onboard LED of the Raspberry Pi Pico W goes solid, this indicates it is ready to operate!
PYPER has two operation modes: HTTP mode and UDP mode. You can change which mode PYPER is in by changing the operation_mode
variable in the settings.py module. 0
= HTTP mode, 1
= UDP mode.
Both operation modes are described in separate documention:
- Driving PYPER in HTTP mode
- Driving PYPER in UDP mode (coming soon!)
I routinely took small clips during PYPER's development, demonstrating each part of the design. I'm listing them here for learning purposes, in case you want to study a specific piece:
- Assembling 3D-printed steering system
- First demonstration of powered steering system
- First prototype of TT motor mount
- First drivetrain demonstration (no wheels)
- Servo actuating steering angle
- Final steering upright design
- Drive axle and mid axle attached to base
- Complete drivetrain Closeup demonstration
- hardware
Total grams of filament usedCar weightCar top speed @ 6v?Cost estimate w/ parts and filament- All individual parts and full assembled STL
- And how many of each part you will need to print to make the full thing
- Video putting it together?
DimensionsPictures of fully assembled- Video of it working
- Explanation of each part. i.e. compare front + rear hub cap differences
- Why I made this: basic fundamentals of driving
- The type of steering system it uses
- Wiring diagram is supplied as draw.io (and add picture to readme)
- software
- how the code works
- rover control method (HTTP requests)