The following tutorial will get you up and running to build an RC car with the provided materials. All of the soldering is already done and the most of the code is flashed onto the brain board. It will be your responsibility to use the tools provided to you in your orientation bag along with the tools available in the Prototyping Lab to design and build a chassis for your car.
-
Collect the above components from the Prototyping Lab staff.
-
Attach the components to the individual boards. AAA battery pack to brain board (only goes in one way). Bluetooth module to Bluetooth board (RCA, not RCM). Motors to motor board (needs a screwdriver and wires may need to be switched later).
-
Stack the boards together with the brain at the bottom and Bluetooth at the top. Make sure to align them properly (see image).
-
Try placing 3 AAA batteries in their holder and turn it on. If you've assembled everything correctly, the blue and red lights on the underside of the Bluetooth module should start blinking.
-
The code for the brain board is written in CircuitPython, which means you will not need to download any software to edit and manipulate the code.
-
Download the RC Car code from here. Make sure it is named
code.py. -
Using a micro USB cable, connect the brain board to your computer (you do not need to disconnect the other boards). Your computer should now have a new USB drive available named
CIRCUITPYwhere the code is stored. -
Click and drag
code.pyontoCIRCUITPY, replacing the file that is on the drive. -
Your code should now be running on the brain board. If you would like to edit this code, just open
code.pyin any text editor (TextEdit and NotePad are fine). The new code will run whenever you save.- Editing code this way does not give you access to any debugging outputs, so you may want to edit using Mu or Thonny so you can read any
print()statements you add to the code. - The max speed of the default code is slow, which you may want to change if you want to win the race.
- Python uses spacing in a particular way, so you may need to match the indendation of lines.
- For more details on how the code works see here.
- Editing code this way does not give you access to any debugging outputs, so you may want to edit using Mu or Thonny so you can read any
-
Place the Bluetooth module marked
RCMin the remote. It should only fit one way. -
Plug in the 9V batteries on both your remote and turn on the AAA batteries on your car.
-
The lights on the Bluetooth dongles (HC-05) will stop blinking when they have successfully paired.
-
If it fails to pair, try power cycling the car ands the remote.
-
Design and build the body of the RC car, you are welcome to use the materials provided in the Prototyping Lab from cardboard to wood. Make sure it holds everything! We've produced a tutorial if you'd like to start with a lasered template here.
-
Attach the gear motors to the body of the RC car that you have designed/built and assemble the tires. Depending on how you attach the motors, you may have to change some wires to get it to move forward (instructions below).
If you have been able to connect to your RC car, but it is going the wrong direction, you may need to swap the motor wires.
- If your car is going backward when it should be going forward - Swap the red and black wires on both motors.
- If your car is going left when it should be going right or right when it should be going left - Swap which side of the motor driver your motors are wired to.
- For other problems, ask a member of the Prototyping Lab staff.