Loading the figure…
A pocket computer with 25 LEDs, two buttons, a touch logo, a motion sensor, a speaker and a microphone
Each lesson runs your own code on the board. Finish its checks to tick it off.
Build the board in the right order, then power it up and check it, as on the bench.
0 of 10 stepsTake the USB cable and the battery out before you work on the board.
Each fault really happens in the simulation. Trigger one, watch the figure, then read why.
The micro:bit is the board schools hand out first. The front has a 5 x 5 grid of red LEDs, buttons A and B, a gold logo you can touch and a gold edge connector with five big rings (0, 1, 2, 3V and GND) you can clip crocodile leads to. The back holds the nRF52833 that runs your program, a second nRF52 chip that turns USB into a drive called MICROBIT and a serial port, a 3.3 V regulator, a motion sensor, a speaker and a microphone. You write MicroPython, drag the file onto the drive, and the board restarts with your program. Everything runs at 3.3 V, and no pin takes 5 V.
| Header | Pin | Name | Functions | Level | Max current | Notes |
|---|---|---|---|---|---|---|
| ring | 0 | P0 | AIN0, Touch, PWM, UART, Sound out | 3.3 V | 4 mA | Sound also comes out here: music and the speaker play on pin 0 at the same time. Resistive touch (10 MΩ pull-up), so touch GND with your other hand. |
| ring | 1 | P1 | AIN1, Touch, PWM, UART | 3.3 V | 4 mA | |
| ring | 2 | P2 | AIN2, Touch, PWM, UART | 3.3 V | 4 mA | |
| ring | 3V | 3V | 3.3 V out, 3 V in | 3.3 V | 190 mA | 3.3 V out, up to 190 mA. You can also power the board here, but nothing protects this ring: wrong polarity or more than 3.6 V damages the chips. |
| ring | GND | GND | – | – | – | |
| edge | 1 | P3 | LED column 3, AIN7, PWM | 3.3 V | 4 mA | One of the five LED matrix columns. Turn the display off before you use it for anything else. |
| edge | 3 | P4 | LED column 1, AIN4, PWM | 3.3 V | 4 mA | One of the five LED matrix columns. Turn the display off before you use it for anything else. |
| edge | 4 | P5 | Button A | 3.3 V | 4 mA | Wired to a button on the front with a 10 kΩ pull-up. It reads LOW when the button is pressed; leave it for the button. |
| edge | 5 | P6 | LED column 4 | 3.3 V | 4 mA | One of the five LED matrix columns. Turn the display off before you use it for anything else. |
| edge | 6 | P7 | LED column 2 | 3.3 V | 4 mA | One of the five LED matrix columns. Turn the display off before you use it for anything else. |
| edge | 8 | P8 | GPIO, PWM, UART | 3.3 V | 4 mA | |
| edge | 9 | P9 | GPIO, PWM, UART, NFC1 | 3.3 V | 4 mA | Shares the nRF52833's NFC antenna pin. It works as GPIO, but pick another pin if you can. |
| edge | 10 | P10 | LED column 5, AIN6 | 3.3 V | 4 mA | One of the five LED matrix columns. Turn the display off before you use it for anything else. |
| edge | 11 | P11 | Button B | 3.3 V | 4 mA | Wired to a button on the front with a 10 kΩ pull-up. It reads LOW when the button is pressed; leave it for the button. |
| edge | 12 | P12 | Accessibility | 3.3 V | 4 mA | Reserved for accessibility devices. It works as GPIO for testing, but leave it free in your projects. |
| edge | 14 | P13 | GPIO, SPI SCK, PWM, UART | 3.3 V | 4 mA | |
| edge | 15 | P14 | GPIO, SPI MISO, PWM, UART | 3.3 V | 4 mA | |
| edge | 16 | P15 | GPIO, SPI MOSI, PWM, UART | 3.3 V | 4 mA | |
| edge | 17 | P16 | GPIO, PWM, UART | 3.3 V | 4 mA | |
| edge | 18 | 3V | 3.3 V | 3.3 V | – | Narrow 3V strip next to the 3V ring: same net, same limits |
| edge | 20 | 3V | 3.3 V | 3.3 V | – | Narrow 3V strip next to the 3V ring: same net, same limits |
| edge | 21 | P19 | I2C SCL (external bus), GPIO, PWM | 3.3 V | 4 mA | The external I²C bus (P19 is SCL, P20 is SDA) with 4.7 kΩ pull-ups on the board. It is a separate bus from the one the motion sensor uses. |
| edge | 22 | P20 | I2C SDA (external bus), GPIO, PWM | 3.3 V | 4 mA | The external I²C bus (P19 is SCL, P20 is SDA) with 4.7 kΩ pull-ups on the board. It is a separate bus from the one the motion sensor uses. |
| edge | 23 | GND | – | – | – | |
| edge | 25 | GND | – | – | – |
Sensors and actuators this board drives, with the real connections.
Clip ring 1 to the LED's long leg through a 470 Ω resistor and the short leg to GND: about 3 mA.
| Part pin | Board pin |
|---|---|
| A | P1Wire colour yellow |
| K | GNDWire colour black |
A V2 pin gives only 1 to 4 mA. Never connect an LED without a resistor.
Use P8 and turn on the internal pull-up with pin8.set_pull(pin8.PULL_UP); the pin reads 0 while pressed.
| Part pin | Board pin |
|---|---|
| 1 | P8Wire colour yellow |
| 3 | GNDWire colour black |
Ends to 3V and GND, wiper to ring 2: pin2.read_analog() gives 0 to 1023.
| Part pin | Board pin |
|---|---|
| 1 | 3VWire colour red |
| 2 | P2Wire colour green |
| 3 | GNDWire colour black |
Make a divider with a 10 kΩ resistor from ring 0 to GND, and read it with pin0.read_analog().
| Part pin | Board pin |
|---|---|
| 1 | 3VWire colour red |
| 2 | P0Wire colour yellow |
Ring 0 and GND: music already plays on pin 0, so it beeps along with the speaker.
| Part pin | Board pin |
|---|---|
| + | P0Wire colour orange |
| - | GNDWire colour black |
Signal on ring 1: pin1.set_analog_period(20), then pin1.write_analog(51) to pin1.write_analog(102) for 1 to 2 ms pulses.
| Part pin | Board pin |
|---|---|
| signal | P1Wire colour orange |
| V+ | 3VWire colour red |
| GND | GNDWire colour brown |
An SG90 can pull hundreds of mA when it starts. Powered from the 3V ring it browns the board out; give it its own 4 to 6 V supply and join the grounds.
P19 to SCL and P20 to SDA through an edge breakout; MicroPython's i2c object uses that external bus at 100 kHz.
| Part pin | Board pin |
|---|---|
| VCC | 3VWire colour red |
| GND | GNDWire colour black |
| SCL | P19Wire colour yellow |
| SDA | P20Wire colour blue |
Same external I²C bus as any other sensor: P19 SCL, P20 SDA, 3V and GND.
| Part pin | Board pin |
|---|---|
| GND | GNDWire colour black |
| VCC | 3VWire colour red |
| SCL | P19Wire colour yellow |
| SDA | P20Wire colour blue |
TRIG on P13 and ECHO on P14 through an edge breakout.
| Part pin | Board pin |
|---|---|
| VCC | 3VWire colour red |
| TRIG | P13Wire colour orange |
| ECHO | P14Wire colour yellow |
| GND | GNDWire colour black |
The classic HC-SR04 needs 5 V and sends a 5 V echo, which no micro:bit pin can take. Use a 3.3 V version, or power it from 5 V and divide the echo down to 3.3 V.