My Cart:

0 item(s) - £0.00
You have no items in your shopping cart.


Using Kitronik ZIP LEDs With The BBC microbit

In this practical guide for Kitronik ZIP LEDs, we cover; what ZIP LEDs are, how they work and how to write code for them, using the Microsoft MakeCode Editor for the BBC microbit. If the technical details are not your cup of tea you can jump straight to the step by step guide and get coding straight away.


Each ZIP stick has five addressable RGB LED’s. The name is a nod to the ZIP postal codes used in the US. Each LED can be controlled independently and all LEDs are connected using the same three wire bus. Each LED can produce a full spectrum of colours independent to all of the other LEDs on the bus. Multiple ZIP LEDs can be connected to produce longer strips. The LEDs used are based on the WS2812B part making them compatible with any WS2812B driver code.

Click here to see the datasheet:

Some key features of ZIP LEDs are:

  • Each ZIP LED has a Red, Green and Blue element within the LED, and each of these can achieve 256 levels of brightness. This results in 16,777,216 possible output colours.
  • Integrated intelligent reverse connect protection, so a reverse connection of the power supply does not damage the IC in each of the LEDs.
  • Simple 3 wire connection for all LEDs.
  • LEDS can be placed up to 5m apart without the need for any additional circuitry.


How do ‘ZIP’ LEDs work?

The ZIP LEDs are connected using a three wire bus. These connects are V+ (3.5V to 5.3V), Gnd (Vss) and Data. The data is fed into the data in pin on the first LED and then out of the data out pin. This then feeds on to the next LED as shown in the graphic below which is taken from the datasheet.


The control data is made up of 24bits. These are read into the first LED. When a second set of data is sent the first set is then sent out of the first LED and on to the second. In this way the data cascades from one LED to the next. Data sets are separated by reset codes. This is shown in the graphic below (again taken from the datasheet). D1 to D4 refer to four LEDs connected to each other. as you can see the first LED has three blocks of data passed through it, the second two and last LED just one.


The data structure is as follows:

Each 0 or 1 is sent as 1.25uS high to low cycle. The length of the high and low determines if it is a 0 or a 1 being sent. The times are as follows:

T0H 0 code, high time 0.4us
T0L 0 code, low time 0.85us
T1H 1 code, high time 0.85us
T1L 1 code, low time 0.4us
RET 1 code, low time >50us


sequence chart


Using ZIP LEDS with a BBC micro:bit:

Our ZIP LEDs use WS2812B LEDs meaning that the neopixel blocks for the MakeCode block editor can easily be used to control them. The following describes how to control the ZIP LEDs on our Servo:Lite board for the BBC microbit.


STEP 1: Attach a microbit to the Servo:Lite board.

STEP 2: Put batteries into the Servo:Lite PCB, and turn it on

STEP 3: Connect it to a computer using a micro-USB cable.

STEP 4: Bring up Javascript Blocks Editor (


STEP 5: In the top right of the screen click on the cog.

STEP 6: Select ‘Extensions’ from the menu.

STEP 7: Select the ‘neopixel’ box.


NOTE: This will load a set of blocks compatible with Kitronik’s ZIP LEDs, which makes them really easy to code!

STEP 8: Create a variable and name it ‘PixelArray’.

A variable is like a container which can store information. This could be a number, a word or a piece of information you want your program to remember.

STEP 9: Create the following code.

This tells the micro:bit that Pin 0 is connected to 5, colour addressable LEDs. When button A is pressed, light up all the pixels red.

When button B is pressed, clear the variable and show it on the LEDs. This will turn them off.


STEP 10: The program will automatically run on the simulator. Click on the ‘A’ button on the simulator to see the LED pattern. Click on the ‘B’ button to see the message.

STEP 11: Try changing the code to make a different colour.


STEP 12: as well as addressing all the LEDs on the Servo:LIte at once it is possible to set them individually, or as a group. The first pixel always has an address of 0 (see diagram below).

STEP 13: Change the code under ‘On button A pressed’ to the following. This will set the first two pixels to red, the middle pixel to white and the last two to blue.


REMEMBER: To show a change you must use a block with ‘show’ in it.

NOTE: You may need to click on ‘More’ under the ‘neopixel’ toolset to view extra blocks.

STEP 14: Try it out. Press A and watch the lights!

STEP 15: Create the code below.


This code shows a colour changing pattern when button A is pressed and stops when button B is pressed.

NOTE: The ‘rotate pixels’ tool shifts each pixel colour onto the next pixel. When it reaches the end of the line, it goes back onto to the first pixel.

STEP 16: Try it out. Press A and watch the light show!


We have developed several products that feature ZIP LEDs, you can find links to them below:


NeoPixels® is a registered trademark of Adafruit Industries LLC.

← Previous Post Next Post →

14 thoughts on “Using Kitronik ZIP LEDs With The BBC microbit”

  • Hi - I am having trouble programming additional LEDs - I have added a string of 16 neopixels, and they light white on reset, but won't change colors like the first 5 - can you show a program that has more LEDs attached.

    • Hi Kari, in your code, there will probably be a line of code in an 'on start' block that defines which micro:bit output pin is being used, how many LEDs there are and what LED format the LEDs are. This will all be in one NeoPixel code block and your values will probably be P0, 5 and RGB (GRB format). For 16 LEDs it should be P0, 16 and RGB (GRB format). I hope this helps.

  • Peter Whitehouse October 2, 2017 at 12:17 pm

    any Micropython equivalent code please?

  • I recently bought a 5 LED Zip Stick. It did not come with any instructions, so I went to the guide on the Kitronik website but the instructions there referred to using a Servo:Lite board, which would not fit in with my project. Which pins of my Micro:bit do I use for my Zip Stick and how do I program it?

    • Hi John, the guide here has the information you need. Although it is the servo light that is pictured, the instructions are the same. If you use P0 to control the ZIP LEDs you can use the exact same code. Please note that the MakeCode Editor has just relaunched with a new look so the blocks now look a little different but still function as they did previously.

      • Hi Mark. So, one end of the ZIP Stick has 4 tabs GND, DIN, 5VDC and GND and the other end has 4 tabs GND, DOUT, 5VDC and GND. Do I connect the DIN to the PO pin, the 5VDC to the 3V pin and one of the GNDs to one of the 0V pins? It would appear, from the flashing 101 image on the Kitronik website, that nothing is connected to this other end. Thanks. John

        • Hi John, yes it is exactly as you have stated above. The unused end is for attaching other ZIP LED sticks, arcs, rings etc and can just stay as is if only using the stick that you have.

  • I have purchased the zip hex leds and I do not know how to connect them to a microbit using wires to power and program all 5, any help?

    • Hi Tom, this URL PDF should contain the information you require for connections:

      If it is unclear or if you would like some guidance, our support team are always on hand to offer some direct assistance: [email protected]

  • Hey Kitronik. I recently bought my ZIP LED. And through lots of coding it now only shows 2 colours. Red and Green. Even after coding it to show Rainbow colours.

    Anyway you can help me?

    Regards Erneeraq Lennert

  • Torben Kristensen March 15, 2020 at 5:51 pm

    Just bought some ZIP Halos (24LED) , but I can't find any extensions for them. Only for the HaloHD(60). Help, please...

Leave a Reply