Servo:Bit Affordable Multi-Servo Driver for Microbit

Servo:Bit Multi-Servo Driver

Purchase Servo:Bit here

Servo:Bit is a little board, exactly the same size as a Raspberry Pi Zero and the 4tronix Drive:Bit, which provides control for up to 16 servos. Access to the useful pins of the Microbit is provided as is a single Smart RGB LED

Power for the servos is provided by one of three options:

  • USB connector
  • 2-pin male header
  • 2-way screw connector

Providing power (5V – 6V) to one of these connectors also provides power for the Microbit.


NB: Fit the Microbit into the connector with the LEDs on the Microbit facing the switch and indicator LED.


Most hobby servos operate within 5V to 6V range. Ensure that the voltage you provide does not exceed the voltage supported by your servo. Unless you have a specialist servo, you should be safe with the 5V USB input

Current Draw

Running 16 servos will consume a fair amount of current. Check the specification of your servos to see how much current they may take and ensure your power supply can provide sufficient. For instance, 16 servos taking 100mA each may require up to 1.6A this may not be available from your USB power supply.

You can connect both USB power and one of 2-pin male header or 2-way screw terminal to power at the same time as there are blocking diodes to prevent back-current. Do NOT connect power to both the 2-pin male header and the 2-way screw terminal as there is no blocking diode between these two. Use one or the other, but not both.

Each servo output is provided with 3 connections using the GVS (Ground, Volts, Signal) layout common to servo cables. Ensure you plug them in the correct way round or your servo may be damaged. Brown or Black is the normal colour for the Ground lead and this should be connected nearest to the pins near the edge of the board labelled ‘G’. The signal wire is likely to be White, Yellow or Orange and this should be on the pins labelled ‘S’

The Microbit can power the Smart RGB LED and the blue LED on the board, but it cannot power and is not connected to the servos. Your servos will not operate unless you connect power into the USB, 2-pin header or 2-way screw terminal.

Programming the ServoBit in Microsoft Makecode

There is a Makecode extension available to control the servos and Smart RGB LED on the ServoBit. Go into the Advanced tab in Makecode (or click on the gear icon in top right) then select Extensions. Enter ServoBit in the search box and select it.

The 4tronix ServoBit uses a PCA9685 to control 16 independent servos.
Helper commands are available to centre all servos, or set individual servos to any angle from -90 to +90 degrees

It is also possible to set the speed at which each servo moves to its new position, which gives a smoother operation

In addition, the 4tronix ServoBit contains a single Smart RGB status LED which can be set to any colour and brightness and a flashing function is also available.

Setting the servos

Set all 16 servos to the centre position


Set a specified servo to an angle, between -90 and +90 degrees

eg. Set Servo 5 to +30 degrees
ServoBit.setServo(5, 30)

Controlling servo movements and speeds

You can control the number of degrees per second that the servo moves. A typical servo would have a maximum speed of around 500 degrees per second.
Reasonable values for slower movements are between 30 and 200 degrees per second, although a range of 1 to 1000 is supported.
Setting the servo position whilst it is still moving, will cancel the movement command.
Creating a new movement command for a servo with an existing movement will cancel the first and then start the second.
You can also check if the servo has reached its target position, or wait until it has completed.

Move specified servo to an angle at a specified speed (speed can be from 1 degree per second to 1000 degrees per second)

eg. Move servo 5 to 30 degrees at 40 degrees per second
ServoBit.moveServo(5, 30, 40)

Check current position of specified servo

eg. Check current actual position of servo 5
let variable = ServoBit.getServoActual (5)

Check target positon for servo

eg. Check target positon for servo 5
let variable = ServoBit.getServoTarget (5)

Wait for specified servo to complete its movement

eg. Wait for servo 5 to complete its movement
ServoBit.waitServo (5)

Smart RGB LED helpers

The 4tronix ServoBit has a single smart RGB LED (aka neopixel) fitted. There are various blocks available to make it easy to control the LED

Clear the LED (turn it Off)


Set LED to selected colour. You can use other blocks to generate your own RGB colours

eg. Set LED to Red

Set brightness of LED from 0 to 255. Default value is 40


Start Flashing the LED with selected colour and defined speed

eg. Start Flashing the LED with Green at 100ms
ServoBit.startFlash(ServoBit.vColours(vColors.Green), 100)

Stop flashing the LED



McRoboFace Home Page

McRoboFace – Emoticon for Electronic Creations


(Click on any image to enlarge)

Purchase McRoboFace Here


The McRoboFace is a robotic face with 17 individually controllable RGB LEDs that you can use to bring your electronic creations to life.

Each LED can be set to any of 16 million different colours (256 for each of Red, Green and Blue).

All the LEDs as fully compatible with the “standard” WS2812, also known as “neopixels” – a name coined by Adafruit. As such, any of the many libraries and examples for most of the common controllers can be used to drive them. This includes:

  • Crumble
  • Arduino
  • micro:bit
  • ESP8266
  • Raspberry Pi
  • Codebug
  • BeagleBone


Tour of the ‘Face


The “mouth” is made up of 14 small (3.5mm) pixels numbered in small lettering from 0 to 13:

  • Lighting 0 to 5 gives a smile
  • Lighting 0, 5, 6, 7, 8, 9 gives a frown
  • Lighting 0, 5, 10, 11, 12, 13 gives a straight-line
  • Use other combinations for quizzical looks, open mouth, etc

The “nose” comprises a small (3.5mm) pixel numbered 14

The “eyes” comprise two standard (5mm) pixels numbered 15 & 16



The rear shows the 3 mounting holes, each is 2.8mm diameter for use with M2.5 screws

There are 4 connections at the bottom:

  • Gnd – Ground pin. Connect to 0V from your controller
  • Vcc – Power pin. Connect to the power pin from your controller.Ideally this is 5V, but on the micro:bit for instance only 3.3V is available. This will work, although it is below the recommended minimum voltage
  • Din – Data input pin. Connect this to the control output from your controller
  • Dout – Data Output pin. Use this to connect additional smart pixels such as another McRoboFace, a CodeBug GlowStar/GlowBug, Crumble Sparkles or an Adafruit neopixel strip etc.


Connections to Example Controllers

For the following photos I have soldered on the 4-pin right angle header to make connections easier using jumper leads. Photos are of a prototype McRoboFace, without the numbers to identify each pixel



The Crumble knows smart pixels as Sparkles and they must be connected to the D pin. Use the + and – pins to provide Power and Ground

The software is as simple as setting each pixel to the required colour. This is what the picture above is running:





For the Arduino, any of the output pins will work. In this example we are using A0 as it is closest to the %V and Ground pins.

The code used relies on the well-known and well supported FastLED library. In the Arduino IDE, go to Sketch / Include library / Manage Libraries and then search for FastLED. Select it and install.

Then you can use this example code to show various facial expressions. The important parts are:

  • in setup ( ) – you need to define the number of LEDs, and the pin to be used to control them: FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
  • to change any pixel, set its RGB value in the led array, eg. leds [3] = CRGB (RedValue, GreenValue, BlueValue);  When you have set all the pixels you need, then call ( ); to transfer the changes to the pixels.




In micro python on the micro:bit, you can use any output pin to control the McRoboFace’s pixels. In this example we’re using Pin 0

As with the Arduino, you first need to include the right library and then define which pin you’ll be using and how many pixels are required. micro:bit calls them “neopixels”



Raspberry Pi

You can do this in two ways:

  1. Connect directly to GPIO pin and install some software. This software often changes as Raspberry Pi change things in the kernel and will need keeping up to date
  2. Use Picon Zero to provide a simple interface to all your devices including smart pixels

Directly to GPIO Pin


You need to use GPIO 18, which is physical pin 12. You can use the 5V and Ground pins directly. No level changers are required as the pixel can be controlled using 3.3V quite happily as shown.

If you already have neopixels supported on your Pi then there is no need for the build and install steps below. You can visit McRoboFace githib repo for the information below

$ git clone
$ cd ~/mcroboface
$ sudo apt-get install python-pip python-dev
$ sudo python install

NB. For Raspbian Jessie release 10th May 2016 (and probably later versions also) you will need to add the following lines in ‘/boot/config.txt’ :


This will create a folder on your Pi called mcroboface and provide a simple example, Run this as:

$ sudo python


Using the 4tronix Picon Zero


Picon Zero output 5 can be used to drive smart pixels in a very simple manner. You should first visit the main Picon Zero page to download the library

Download the simple test example from here


Singalong Kit for McRoboFace


The Kickstarter campaign for McRoboFace included an option for some electronics that allowed the mouth of McRoboFace to be controlled by an audio input signal.

This was developed by Robin Newman and the full blog can be seen here

Download the assembly instructions here