
My Mini Race Car
Created by John Park
Last updated on 2021-04-07 06:12:01 PM EDT

2
3
5
5
6
7
7
8
8
9
10
10
11
13
18
19
23
23
30
30
30
31
33
36
36
36
37
40
41
41
43
43
44
45
46
48
49
50
53
54
59
59
59
Guide Contents
Guide Contents
Introduction
Unboxing Your Mini Race Car Kit
Kit Contents
Feather, USB Cable, & Batteries
Car Chassis & Assembly Tools
Prototyping Parts and Components
Assembling and Wiring Your Mini Race Car
Motors and Wheels and Tires
Lower Chassis
Turn over the plate
Turn over the plate again
Prepare the Battery Box
Middle Chassis Layer
Prepare the Electronics
LiPoly Battery
3D Printed Car Parts
Bonus Body Parts
How Your Race Car Works: The Basics
Board Support Package and Drivers
Libraries
DC Motor Test
Let's Get Moving
Code for Your Race Car
Libraries
The Code
Driving Your Race Car
Temperature and Humidity Data
Power Pins:
I2C Logic pins:
Download Adafruit_HTU21DF
Load Demo
Bluetooth Data Streaming
Plotting
Sensor Placement
Make Your Race Car Autonomous
Mounting the Sensors
The Code
Control Your Race Car's Speed
Using the Controller to Control Speed
Connecting Your Race Car to Adafruit IO
Sign up for Adafruit IO and create your first dashboard.
Send data to Adafruit IO
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 2 of 65

Introduction
Get ready to race down the track with your Feather microcontroller-based Mini Race Car! You'll build this
high performance racer, using the Bluetooth LE capable Feather 32u4 Bluefruit LE board, Motor Driver
FeatherWing, and TE HTU21D-F temperature & humidity sensor to give you racetrack telemetry data.
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 3 of 65

All of this is controlled from your mobile device using the free Bluefruit Connect app for iOS and Android.
Let's get started!!
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 4 of 65

Unboxing Your Mini Race Car Kit
My Mini Race Car is designed to introduce you to the joys of making with electronics. We decided to come
up with a fun pack of parts that:
Could introduce a beginner to making
Teach electronics and programming skills
Does not assume any prior experience
Does not require any soldering or special tools
Kit Contents
After a lot of thinking, here's what we came up with:
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 5 of 65

Feather, USB Cable, & Batteries
Feather 32u4 Bluefruit LE is the brains of your race car! It is Arduino-compatible and has Bluetooth
wireless control
Motor FeatherWing is the muscle of this car, providing power to the motors -- Lets you drive up to 4
DC or 2 stepper motors- certainly enough motors to power the car kit!
TE HTU21D-F is the heart of your race car. Temperature & Humidity sensor breakout board for
realtime car/track sensing!
1x USB Cable - Standard A-B - 3 ft/1m (http://adafru.it/62) - use this to install new code onto your
Feather (from any computer)
3.7V LiPoly battery - this battery will power your Feather (but not the motors)
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 6 of 65

4x AA Batteries (http://adafru.it/3349) - Use these to power your the motors of your super
awesome little race car
Car Chassis & Assembly Tools
Three layer Robot Chassis Kit in Black (http://adafru.it/3244) - This kit gives you everything you need
to build the shell of a 2-wheel-drive Mobile Platform Robot to help you channel your inner Mario
Andretti
Pocket Screwdriver with Philips and slotted ends
Prototyping Parts and Components
Half Size Breadboard Perfect fit for your car kit. Your Feather will connect to the breadboard,
allowing you to easily plug in other sensor, LEDs, buzzers, potentiometers, switches, and more
1x 4xAA Battery Holder w/ On/Off Switch (https://adafru.it/sfq) - A nice portable battery holder for your
car's motor batteries.
1x Shield stacking headers for Arduino (http://adafru.it/85) - Allow optional plugging in of many
different boards, sensors, and wiring
1x Rubber Bumper Feet (https://adafru.it/dLG) - Helps keep the battery packs safe and secure
Jumper wires for making additional connections
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 7 of 65

Assembling and Wiring Your Mini Race Car
The wiring and assembly is pretty easy, and there is no soldering required! You'll just need the
small screwdriver that came in the kit, and it wouldn't hurt to grab some pliers. (It'll make it faster and
easier to put together)
First, you'll assemble the robot chassis. All the parts needed for this are inside the brown box with the
'Custom Black 2WD Robot + extra layer' sticker on it.
Motors and Wheels and Tires
To start, take the two motors, four long screws, four nuts, and
two black panels.
Screw the two black panels onto the motors.
The metal panels go on the side with the red and black wires
coming out.
Have the hex nuts on the metal panel side so they don't
interfere with the wheel!
The metal panels go on the side with the red and black wires coming out.
Have the hex nuts on the metal panel side so they don't interfere with the wheel!
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 8 of 65

Take the two wheels, rubber treads, and 2x small screws
found in the same bag as the wheels.
Put the rubber treads on the wheels. This is a lot of fun!
Fit the wheels onto the white knob on the motors, they will
snap nicely onto the oval center.
Lower Chassis
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 9 of 65

Take one of the black chassis layers. All three layers are
identical.
Align it on your table as shown on the left. Note that the panel
is not symmetrical - look on the left to see that rectangle cut
out? Make sure it's aligned as you see here!
Attach two of the brass standoffs onto the black chassis layer.
The standoffs should be screwed into the second set of
holes from the outer edge - meaning the two interior holes.
Turn over the plate
Attach the white free-wheel into the exterior hole closest to the rectangular opening.
The white free-wheel should be on the opposite side of the chassis of the standoff.
Turn over the plate again
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 10 of 65

Take your assembled wheels and fit them into the chassis layer.
There are 2 slots on the black panels that you attached to your motor that should fit perfectly into the
chassis layer.
The metal front of the motor will be pointing toward the side of the chassis where you placed your white
freewheel
Prepare the Battery Box
For this step, you will need the AA battery box, 4 x AA batteries, the screwdriver, and a sheet of 4 rubber
bumpers.
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 11 of 65

First, open each battery box, grab out the screw, insert your batteries, and then screw the boxes shut. Oh,
and make sure you have the boxes switched to the off position. Now, take the 4 rubber bumpers and
place them as shown in the picture below. Notice how the one bumper on the left side is not in the upper
left corner. Important: don't throw away the leftover piece of bumper material, we are going to use that on
the next step.
Do not discard the leftover piece of bumper material.
Flip the battery box over and place the scrap piece of the bumper material in the middle. This will help
hold the battery box nice and tight between the top and middle plate of your robot.
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 12 of 65

Middle Chassis Layer
Place the middle chassis layer onto robot, making sure to fit the motor tabs into the slots of the layer, then
screw in the two brass standoffs.
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 13 of 65

Take a look at the image below and install the brass stand-offs in the same positions. You can insert the
stand-off screws through the middle plate and hand tighten the stand-offs while putting a bit of pressure
on the screw with your finger. Or, as a tip, you can screw in the stand-off screws with the flat end of the
screwdriver, which can reach through the holes in the bottom plate.
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 14 of 65

Once you have the stand-offs in place as shown in the image above, let's place the battery box in the
correct spot as shown in the image below.
Notice the battery box is lined up on the left side of the middle chassis plate. It should be just in-between
the upper left stand-off and the lower left stand-off (not touching either). This will make sure the on-off
switch lines up just right in the hole of the top plate. Go ahead and install the top plate now as shown
here.
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 15 of 65

See how the on-off switch is now accessible through the top plate? Now let's take just a minute to route
the wires from the motors and the battery box through the chassis like shown in the image below.
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 16 of 65

We are getting close! Now let's install the breadboard on top of the robot. Peel off the backing from the
foam sticker on the bottom of the breadboard. Take a look at the image below and stick it exactly as
shown. Be sure to install the breadboard just as shown in the image below and not sideways or the motor
wires won't reach the motor driver Feather Wing.
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 17 of 65

© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 18 of 65

For this next step, a pair of pliers is handy. First, grab the 6
header pins all attached together and break them into 3 sets
of 2 header pins. Then, grab them in the pliers like shown
here, and then slightly bend them so they look like the next
picture.
If you don't have pliers you can do it with your fingers
(carefully!)
With the breadboard in place, go ahead and grab your stacked Bluefruit Feather, and Motor Driver
FeatherWing and install it in the breadboard with the USB port facing away from the wires like shown in
the image below. Then use your screwdriver and install the bent header pins like shown in the image.
Finally, attach the motor wires and power wires as shown in the image. It is important that you have the
red and black wires in the correct position. Please reference the image below and triple check that they
are installed correctly.
LiPoly Battery
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 19 of 65

The AA batteries will supply power to the motors through the
Motor Driver FeatherWing, but what about power for the
Feather itself? For that, you'll use a LiPoly battery. It's small,
powerful, and very convenient -- you can charge it simply by
plugging the Feather into a USB charger!
Plug the LiPoly battery into the JST battery port on the
Feather, and then tuck the battery into the space in the lower
level of the robot. If you like, you can secure it with double
stick foam tape.
Congratulations, you've built your robot!
© Adafruit Industries https://learn.adafruit.com/my-mini-race-car Page 20 of 65