Introduction: Simple Microbit Robot
The following describes a simple RC car made using the BBC Microbit, the Adafruit Dragontail for Microbit, and the Emgreat chassis.
This robot costs about $30 to build. While there are commercially available low-cost Microbit robots, such as the DFROBOT, my DIY approach helps the builder understand how the system works, using non-specialized code, helping the builder to feel empowered.
Step 1: Introduction
The following describes a version of the robotic vehicle made using a BBC MicroBit in place of an Arduino.
A homemade cut-out piece of corrugated plastic (Coroplast) or cardboard is used in place of the stock plexiglas plate that comes with the Emgreat robot chassis kit. This is done because the Emgreat chassis is about an inch too narrow to fit the battery pack on the bottom, and is about an inch too short to permit free rotation of the caster wheel.
The major electrical components are attached using Velcro, to make them easier to reposition if needed.
The Microbit cannot directly supply enough current to drive the motors, so transistor drivers must be used. While the Arduino version of the robot car used an L298 H-bridge module to control the motors, this requires six(6) control lines, which are in short supply on the Microbit. I realized it was not essential that the motors be able to spin backwards. So in place of the L298, the Microbit version of the robot uses a ULN2803A 8-channel Darlington transistor array as a motor driver. This can be used to drive a speaker, lights, and other devices as well, as the Microbit has five(5) general purpose I/O lines on pins 0,1,2,8, and 16. Pin 0 can be used for audio output. The other pins can be tricky to use, as they are shared with the built-in LEDs.
Alternatively, one could use discrete transistors, such as the TIP120; however, this would require using many more parts and wires.
To access the pins on the MicroBit, this design uses the Adafruit Dragontail for Microbit, which plugs directly into the breadboard, making the pins easily accessible without the need for connection wires, as well as connecting the 3V power bus.
Step 2: Wireless Remote
To control the robot wirelessly via Bluetooth, you can use a second Microbit, powered either by the AAA battery pack that comes in the Microbit Go kit, or a coin cell battery pack, the MI Power Board for Microbit.
Both Microbits need to be set to the same radio channel.
Step 3: Parts and Tool List
- Emgreat Motor Robot Chassis Kit
- Microbit Go Kit
- ULN 2803A 8-channel Darlington Array
- Adafruit Dragontail for Microbit #3695
- Half-size Breadboard Adafruit #64
- Adafruit 4x "AA" Battery Box With Switch #830
- 22 gauge solid hookup wire, assorted colors Adafruit# 1311
- Mini Metal Speaker with Wires Adafruit #1890
- Corrugated plastic or cardboard
- Scotch 1" x 1" fastener strips
- AA batteries x 4
- Razor Knife
- Soldering Iron
- Wire Stripper
- Hot Glue Gun
- Mini Screw Driver(comes with chassis)
- Sharpie Marker
Optional(for use with stranded wire)
Step 4: Assembly
- Cut out 6" x 8" piece of corrugated plastic or cardboard
- Mark position of holes for caster wheel and motor brackets, using the supplied plexiglas as a template.
- Solder 8" red and black wires to each of the two motors; hot glue to motors for strain relief.
- Attach the motors to the baseplate with the metal brackets provided in the Emgreat kit.
- Attach the caster wheel to the bottom end.Attach the 4 x AA battery box(with batteries) to the underside of the chassis,, using velcro squares,
- Locate the battery box between the motors and the caster wheel; this gives the best traction.
- Insert the MicroBit Dragontail into the breadboard;
- Attach the breadboard to the top of the chassis using double-stick tape or velcro strips
- Attach the 2xAAA 3V battery pack to the chassis using velcro strips;
- Insert the JST battery plug into Microbit board battery socket.
- Insert the ULN 2803A Darlington array IC into the breadboard across the 'valley'.
- Make a small 1/4" x 1/4" hole in the chassis board next to the breadboard for the wires to go through.
Step 5: Wiring
- Thread 6V wires up through hole and plug into right-hand power bus on breadboard.
- Connect wire between the left and right-hand ground buses on the breadboard.
- Connect black wire between pin 9 on ULN2803A and ground.
- Connect red wire between pin 10 on ULN 2803A and +6V power buss.
Connect jumper wires:
- Between Pin 0 on dragontail and Pin 8 on 2803A (SPEAKER)
- Between Pin 1 on dragontail and Pin 6 on 2803A (MOTOR 1)
- Between Pin 2 on dragontail and Pin 4 on 2803A (MOTOR 2)
- Between Pin 8 on dragontail and Pin 2 on 2803A (ACCESSORY)
- Connect Motor 1 wires to +6V buss and Pin 13 on 2803A
- Connect Motor 2 wires to +6V buss and Pin 15 on 2803A
- Connect speaker wires to +6V and Pin 11 on 2803A
Step 6: PROGRAMMING 1: MOTOR TEST
Go to Make Code Microbit editor online: https://makecode.microbit.org/
Create three motor Functions- Turn Left, Forward, and Halt
In the main loop, call each function as shown.
Step 7: Radio Control
For the radio control, we will use the Bluetooth feature of the Microbit.
Assemble a second Microbit to the MI Power Board for Microbit, which includes a 3V coin cell battery, or use the 2xAAA battery that comes in the Microbit Go packaging.
Using MakeCode Editor, write a short program as shown above so it can act as a remote control. Name it "Transmitter".
The sample program includes a display to the LED so you can tell it is on.
The program does 2 things. When Button A is pushed, it sends the #1 out( to beep the horn).
When Button B is pushed, it sends the #2 out to trigger the drive motors.
Step 9: Radio Control Receiving Program
Using the MakeCode editor , create a new Project called Receiver.
To use the radio control, both Microbits need to be set to the same channel.
When the number 1 is received, it beeps the horn,
When the number 2 is received, the robot turns, goes forward, then stops.