Software apps and online services
Hand tools and fabrication machines
Here's the ORIGINAL Project web page with more construction photos.
BBC micro:Bits are great! They are easy to program, they're packed with features like Bluetooth and an accelerometer and they're inexpensive.
There are several micro:Bit robot kits out there varying from $60 to over $100. Wouldn't it be great to be able to build a robot car that costs next to NOTHING?
This project is inspired by the desire for elementary school students to be able to build robots using a minimum of parts and wherever possible, use recycled materials.
It takes very little time and encourages students to learn coding, some engineering and to use their craft skills. There's no cutting or drilling with power tools and no soldering. The primary building materials are a FACIAL TISSUE box (ex. 'Kleenex') and a bit of box cardboard. It can be completed in a few days of class time. So let's get started!Parts List
Item Cost Quantity
Tissue box free 1
Box cardboard (corrugated) free 2
pieces Solid core wire minimal
BBC micro:Bit Retail 2
micro:Bit GPIO Edge Connector $6 to 15 1
Geared Motor /wheel $3 each 2
Mini breadboard $0.75 1
9Volt Battery clip $0.25 1
SN754410NE Motor Chip $0.40 1
Ping Pong Ball minimal 1
Ball caster (optional) $1.20 1 - can use half a ping pong ball
Two-sided foam tape $2 1
White glue You've probably already got some
* Price estimates from eBayTools Needed
A rulerA small utility knifeHot Glue Gun (optional)Paper clip or compass for piercing small holes in the tissue boxRotary cutting tool(optional) or razor saw to cut the ping pong ball in half.Let's start Building! Robot Construction
Place the tissue box on the corrugated cardboard sheet so the long side of the box is in line with the ridges of the cardboard. Trace the base of the tissue box on the cardboard. You'll need two pieces. Carefully cut out the pieces with the knife and ruler. You should trim them so they will fit flat inside the box.
Carefully open one end of the tissue box to test fit the cardboard sheets.
Use white glue or carpenter's glue to glue one piece of the cardboard to the inside base of the box. Put some heavy objects like batteries inside the box to weigh down the cardboard so it will fasten securely to the box. Let it dry.
Before we go further, you may wish to solder short lengths of solid-core wire onto your motor wires and 9 volt battery clip wires. Then cover the joints with heat shrink tubing. It will make it easy to insert these wires into the breadboard. I know I said, "No soldering", but hey, this IS electronics!
Now start laying out the parts on the other piece of cardboard as shown. Try to mount the breadboard towards the end that will be the rear of the car so the micro:Bit and edge connector fit. For consistency, the red-rail of the board is at the top of the pictures. It's recommended you orient yours the same way for ease of assembly.
Hot glue is great for attaching the breadboard. Then you can easily remove it if you want to use it for another project. DO NOT USE THE TWO SIDED TAPE on the bottom of the breadboard. It holds the metal connections inside the breadboard. If you pull it away, it'll wreck the breadboard.
Now attach the edge connector to the breadboard as shown with the connector pointing to the front of the robot. The pins should straddle the trough(ravine) that runs along the middle of the breadboard.
Carefully install the SN754410NE motor chip on the breadboard. The small notch should be pointed towards the edge connector.
If you look down on the motor chip from above, with the notch on the right, the pins on top are numbered 1 to 8 from right to left and then the pins on the bottom are numbered from 9 to 16 on the bottom. An explanation of how the motor chip works will be provided at the end of this project.
Use small lengths of wire to join, Pin 1 to the red rail Pin 8 to the red rail Pin 9 to the red rail Pin 16 to the red railUse a short length of wire to join the edge connector ground to the blue rail pf the breadboard.
Use a small length of wire to join the top-side blue rail to pin 4 OR 5 of the motor chip. It's the chip's GROUND point and you only need to ground the chip with one wire.
We are using micro:Bit pins 13, 14, 15 and 16 for two reasons. First, they're all together on the board for convenient wiring. Secondly, they are not used for other purposes by the micro:Bit so you won't be disabling features like the LED array should you wish to use it in your final design. A link to the pin wiring assignments is at the end of this project for your future reference.
Join edge connector pin 13 to pin 7 on the motor chip.
Join edge connector pin 14 to pin 2 on the motor chip.
Join edge connector pin 15 to pin 10 on the motor chip. (the yellow wires in the picture)
Join edge connector pin 16 to pin 15 on the motor chip.
Join the blue rail on one side of the breadboard to the blue rail on the other side with a length of wire.
Join the red rail on one side of the breadboard to the red rail on the other side with a length of wire. These wires carry voltage to both sides of the circuit and ground source to both sides of the circuit.
Put the green(black) wire of the left-hand (top in the diagram) motor to pin 3 on the motor chip.
Put the red wire of the left-hand motor to pin 6 on the motor chip.
Put the red wire of the right-hand motor to pin 14 on the motor chip.
Put the green(black) wire of the right-hand motor to pin 11 on the motor chip.
Attach the black wire of the 9 volt battery clip to the ground rail of the breadboard.
Attach the red wire of the 9 volt battery clip to pin 16 of the motor chip.
Your wiring is done!
Take a few minutes to double-check your work. It may save some cooked batteries or worse, CIRCUITS, if you catch the errors and correct them before powering up the car.
Use the wiring diagram below to confirm your connections.Coding the micro:Bit Transmitter
We're going to use one micro:Bit as our remote control. We'll use the accelerometer to measure the forward/backward tilt of the micro:Bit to make the car go forwards or backwards or stop. We'll use the A and B buttons to modify forward/backward to include left/right turning.
It's assumed that you're familiar with using makeCode blocks to program a micro:Bit. The code blocks are provided here with explanations of what each block does.
You may just download the transmitter code link below. A picture file of the program with comments is also available if you'd like to enter it yourself.
File Size: 613 kbFile Type: hex
File Size: 220 kbFile Type: pngCoding the Robot's micro:Bit (receiver)
We're going to use one micro:Bit as our receiver to translate the driving commands from the transmitter into motor movements.
You may just download the receiver/control code link below. A picture file of the program with comments is also available if you'd like to enter it yourself.
File Size: 614 kbFile Type: hex
File Size: 236 kbFile Type: pngFinal Assembly
After you've uploaded your codeBlocks to the transmitter and robot-control micro:Bits, plug the robot-control micro:Bit into the edge-connector and turn it on. Turn on the transmitter and try to drive the car just by moving the transmitter and pressing the A and B buttons. If all works, proceed. if not, go back through your wiring and check your connections. Are your batteries all okay?
Carefully cut a ping-pong ball in half. Invert the box and then hot glue the half-ball to the underside of the box. This is your 'third wheel'. If you want a better solution, buy the steel ball caster mentioned in the parts list and mount it with hot glue or use wire poked through the bottom of the box.
Now let's mount the motors to the base and box.
One at a time, orient each motor so that the small circular protrusion is facing outwards. Then on the BOTTOM of each motor, put a piece of two-sided tape.Insert the component board into the tissue box. Next, rotate the motor so the little circular protrusion is facing outwards. Then, PRESS the back of the motor against the side of the box so a small dimple appears on the outside. if you put your thumb on the outside of the box and press against the axle, you'll get a deeper dimple that's easy to see. Use a small knife to cut out the dimple. This will be where the axle exits the box.
Next, press the motor against the side of the box AGAIN so that the small circular protrusion makes a dimple. Cut out this dimple as well.
Remove the backing from the two-sided tape and press each motor down to secure them against the base of your component board.
Insert a compass or un-bent paper clip into the two screw holes in each motor and push outwards to pierce the box.
Now cut two pieces of solid-core wire, each about 8 cm long. Bend like a 'U' shape and feed the wire ends into the motors from the outside. Twist them to secure the motors against the sides of the box.
Now we just have to insert the programmed micro:Bit into the edge-connector and attach the battery packs.
The 9 volt battery now sits between the motors. The negative wire plugs into a blue ground rail and the red wire plugs into Pin 16 of the motor control chip. If you like, you could use a male/female Dupont-type wire to allow the connecting/disconnecting of the 9V battery from the circuit when not in use. Plug the male end of the Dupont wire into Pin 16 on the motor chip and leave the female end free. Then you just plug the red 9 volt wire into the female end of the Dupont wire and your robot is energized.
Attach the wheels to your robot and you're done!
If you wish to decorate your robot as the school bus, the artwork has been provided as a file here. For best results, print the artwork on glossy photo paper. Superglue works well for attaching the artwork to the box. I used Gorilla-brand Gel-style superglue and worked great!
There are lots of theme ideas here. School bus, fire truck, RV, delivery van. Your imagination is your guide! Once you've built this robot, you could experiment with folded corrugated cardboard to make different style chassis.
Now turn on the micro:Bits, attach the 9 volt battery and start driving your bus/car!
I hope you found this project enjoyable and a nice introduction to robotics with micro:Bits!
Gord Payne (Newmarket, Ontario Canada)
File Size: 257 kbFile Type: png Frequently Asked Questions
Why aren't you using an L293D or L298 Motor Controller IC?
The micro:Bit is a 3 volt logic level device. It cannot supply the 5 volts necessary to activate an L293D orL298. The SN754410NE also requires 5 to 7 volts to activate, but the chip's design is robust enough to handle a Vcc of 9 volts. So we use the 9 volt battery to power both the motor chip and the motors. Thanks to Learning Developments for this insight. Having said this, it may be possible to come across an L293D that can activate on 3V, but it's not compliant to the original design specification for the chip.
Where can I learn more about the SN754410NE Motor Controller IC?
Check out this lesson based on the L293D. The SN754410NE has the identical pin arrangement and works the same way.
My motors run the reverse to the instructions. How do I fix it.
Just swap the wires on your motors to the opposite pins. Red to pin x and Black to pin y becomes Red to pin y and Black to pin x.
How can I cut a ping pong ball in half?
You can use a rotary cutting tool or a small hobbyist saw (like X-acto) to carefully cut the ball.
Why are the reverse direction pin values the opposite of the forward pin values? We hard-wired the enable pins on the motor chip permanently high so that we use two fewer pins on the micro:Bit. As a result, the way we do reverse requires us to do 1023 minus value to get the desired speeds. Hence full speed 1023 in forward needs to be 1023 minus 1023 (ie. 0) to get full speed in reverse.
Why are we using pins 13, 14, 15 and 16 for the motor control pins? Couldn't we use lower numbered pins?
Yes you can. However you'll see from this pinout diagram, that different pins serve other purposes on the micro:Bit. For example, the LED array on the micro:bit uses pins 3, 4, 6, 7, 9 and 10. So if you want to also access the LED array, you can't use the pins shared by the array. Using those pins deactivates the LED array.
Why should I delete the LED display commands from my busReceiver code?
Turning ON/OFF LEDs takes processing time and it slows down the responsiveness of your transmitter and receiver. Leave the LED display commands in your code if you wish.
NOW GO OUT AND MAKE SOMETHING WONDERFUL!