Fancier option (if you have a crimper tool) | Simpler option |
---|---|
Crimp a 3-way female dupont connector as follows. | Solder a 2-pin male pinheader |
If you have a servo tester, it is worth testing the servos before attaching them to the breadboard.
Drill a 2mm hole in the middle of the side of one of the servos. E.g. on the side that has no sticker:
Then repeat the same for the second servo, but a different side (e.g. the side with the sticker. Remove it first, of course):
If you got the “GeekServo”-style servos, drill the holes here:
If you want to bolt the motors to the breadboard (i.e. you did not skip the previous step), then proceed as follows:
Peel the covering paper partially from the back of the breadboard. Push a 2mm bolt through, start screwing it into the hole made in the previous step. Stick the motor to the back, aligning it with the side of the breadboard, then tighten the bolt. Do not overtighten, though.
Attach the second motor in the same manner, symmetrically:
If you do not plan to use bolts, then just stick the motors carefully to the back, as shown on the image above.
Make sure the connectors align correctly, as shown on the image below. The left motor’s connector should align with holes 3-4-5 (counting from the left side). The right motor’s connector should align with holes 4-5-6 (counting from the right side). The grounds of both connectors must be on the outside.
For GeekServo-style servos you might not be able to align the left-side connector exactly against the holes 3-4-5. This is fine, just take this into account when referencing the “wiring” images later.
Pull the wires down through the space between the motors, then fold back and forth twice and stick a ~2x3cm patch of double-sided tape to close.
For GeekServo servos the process is similar, just make sure the “outside-facing” wire on the right motor passes flat against the back:
If you plan to use caster ball, make sure you don’t have the wire sticking out too much on the bottom.
If you are using FS90R servos with lego-style wheels, this is a good time to screw on the wheel adapters.
TODO: Make a photo.
Attach the wheels, put the robot on the table so that the breadboard is vertical and slightly slanted forward, then peel the two-sided tape on the back and stick the battery box so that its bottom (or the caster ball, if you use it) would touch the floor. Make sure you stick the battery with the switch on the front and the cover on the back.
Wire the breadboard as follows:
Your breadboard wiring kit will probably have different colored wires, so, for the reference, here are the sizes of the wires used in the image above (and in the examples documentation later):
The idea here is to route 5V and GND between the servos and the respective MCU pins, and connect the servo signal wires to pins D0 and D6. The ground is routed through the right side of the breadboard to support the line tracker sensor in the first example later.
If you went for the “fancy” battery connector, plug a 15mm pin header as follows. Supergluing it in place is a good idea.
The aim of this is to reduce the chances of connecting the battery incorrectly, which is one of the easiest ways of destroying the MCU in this kit.
If you are building the robot for yourself, you might not bother and simply take extra care to plug the battery in the right spot, but if you plan to use it to teach your kids, for example, do consider any ways of making the connector more foolproof.
I am pretty sure there could be an even more foolproof connector option here - if you come up with a good idea, drop it in the issues section of this Github repository.
RPI2-RP2
should appear. Copy the .uf2
file downloaded in the previous step to this drive. When download completes, the microcontroller restarts and an external drive named CIRCUITPY
should appear.
breadboardbot/platform_rp2040.py
: replace the line motors_model=motors.MotorsModel.SG90
with motors_model=motors.MotorsModel.GEEKSERVO
.If all went fine, you should observe that the newly uploaded program first blinks the green LED and then starts showing a rainbow effect on its RGB LED.
Plug the microcontroller as follows:
The signal wires of the servos should connect to the very first (D0) and last (D6) pins on the left side of the MCU. To test the connection without risking burning the controller, do not plug in the battery yet. Instead, connect the MCU to the computer via USB (do not attach the wheels yet either). You should see the same rainbow animation program execute as in the previous step, but now the motors will turn on and off intermittently.
Now you can detach the USB cable, attach the wheels and plug in the battery connector. This is the final moment when you can burn your MCU if you connect things incorrectly. Make sure the battery box is switched off and its red and black wires attach to the following rows of the breadboard:
Once verified the connection is correct, you can switch on the battery box and let the robot roam your room like that.
Congratulations! Now let us extend the robot to do more fun things.