Book Image

BBC Micro:bit in Practice

By : Ashwin Pajankar, Abhishek Sharma, Sandeep Saini
Book Image

BBC Micro:bit in Practice

By: Ashwin Pajankar, Abhishek Sharma, Sandeep Saini

Overview of this book

This book is a one-stop guide for learning BBC Micro:bit with MicroPython, exploring many hardware components and programming techniques to provide detailed insights into developing practical applications with the Micro:bit. It will also show you how hardware components can be manipulated using a combination of Micro:bit and MicroPython for developing practical projects. BBC Micro:bit in Practice will help you gain a holistic understanding of the BBC Micro:bit platform and MicroPython programming, guiding you through mini projects aimed at developing practical knowledge of circuit design and writing programs. You’ll learn how to write programs for working with built-in LEDs and buttons, interfacing external LEDs, buttons, motors, buzzers, and much more. You’ll also work with built-in radio, speakers, accelerometer, and a compass. You’ll dive into concepts related to the Micro:bit filesystem, interfacing external displays, and working with libraries in detail before exploring sewable circuits and wearable technology. After reading this Micro:bit book, you’ll understand how to apply principles in electronics and MicroPython to create interesting real-life projects from scratch.
Table of Contents (22 chapters)
1
Part 1: Getting Started with the BBC Micro:bit
6
Part 2: Programming Hardware with MicroPython
10
Part 3: Filesystems and Programming Analog I/O
13
Part 4: Advanced Hardware Interfacing and Applications

The specifications of Micro:bit V1 and Micro:bit V2

The following table compares the features of the BBC Micro:bit V1 and V2 side by side (source: https://microbit.org/):

BBC Micro:bit

V1

V2

Processor

Nordic nRF51822

Nordic nRF52833

Flash memory

256 KB

512 KB

RAM

16 KB

128 KB

Speed

16 MHz

64 MHz

Bluetooth

Bluetooth 4.0

Bluetooth 5.1 with Bluetooth Low Energy (BLE)

Radio communication

2.4 GHz radio (80 channels)

2.4 GHz radio (80 channels)

Buttons

Two programmable (A and B) and one system (reset)

Two programmable (A and B) and one system (power/reset)

On/off switch

None

Press and hold the rear power button

Touchpad

None

Touch-sensitive logo

Microphone

None

Onboard Knowles SPU0410LR5H-QB-7 MEMS microphone (with LED indicator)

Display

5x5 programmable LED matrix (25 LEDs in total)

5x5 programmable LED matrix (25 LEDs in total)

Speaker

None

Onboard JIANGSU HUANENG MLT-8530 (up to 80 dB)

Motion sensor and compass

LSM303AGR

LSM303AGR

Temperature sensor

On-board temperature sensor

On-core NRF52

Edge connector

25 pins

25 pins

Table 1.1 – Comparison of the features of BBC Micro:bit V1 and V2

The processors used in both versions are a special type of processor known as a System on Chip (also abbreviated as SoC or SOC). An SoC is an Integrated Circuit (IC) that has all or most components of a complete working computer system. A typical SoC has a processor, flash memory, and RAM. Both versions employ Advanced RISC Machines (ARM) processors. The ARM uses Reduced Instruction Set Computer (RISC) instruction architecture. The V1 uses Nordic nRF51822 SoC (https://www.nordicsemi.com/Products/nRF51822), and the V2 uses Nordic nRF52833 (https://www.nordicsemi.com/products/nrf52833). The Random Access Memory (RAM) is used to execute the programs. The flash memory is used to store the programs, and it is reprogrammable.

The following diagram shows the front faces of V2 and V1 side by side:

Figure 1.1 – Hardware features on the fronts of V2 and V1 (courtesy: ©Micro:bit Educational Foundation/microbit.org)

Figure 1.1 – Hardware features on the fronts of V2 and V1 (courtesy: ©Micro:bit Educational Foundation/microbit.org)

The following diagram shows the rear of the V2 and V1 side by side:

Figure 1.2 – The hardware features on the rears of V2 and V1 (courtesy: ©Micro:bit Educational Foundation/microbit.org)

Figure 1.2 – The hardware features on the rears of V2 and V1 (courtesy: ©Micro:bit Educational Foundation/microbit.org)

Another important aspect of the Micro:bit boards of both versions is that they come with edge connectors to interface with external hardware components. The following diagram explains the slight difference between the edge connectors of V2 and V1 side by side:

Figure 1.3 – The edge connectors of V2 and V1 (courtesy: https://tech.microbit.org/hardware/edgeconnector/)

Figure 1.3 – The edge connectors of V2 and V1 (courtesy: https://tech.microbit.org/hardware/edgeconnector/)

You can read online about the edge connectors in detail at https://tech.microbit.org/hardware/edgeconnector/ and https://microbit.pinout.xyz/.

I understand that you may feel a bit overwhelmed with all this technical information at this stage. Without enough context about the utility of this technical information, it is natural to feel that way. However, in the upcoming chapters, we will learn about and demonstrate all these features in detail.

Now that we have a fair understanding of the history and specifications of the Micro:bit, let’s learn various methods to power it up.