Stufin
Home Quick Cart Profile

BBC Micro:Bit V2.2

Buy Now on Stufin

BBC Micro

Bit V2.2

Overview

The BBC Micro

Bit V2.2 is an exceptional tool for learning and development, offering a unique blend of ease of use, versatility, and affordability. Its range of features and sensors, combined with its compact size and low power consumption, make it an ideal component for a wide range of IoT projects and applications.

Dimensions

43mm x 52mm x 12mm

Weight

18g

Operating Temperature

-20C to 40C

Storage

512KB flash memory, 128KB RAM

Power Consumption

20mA (average), 100mA (peak)

Conclusion

Pin Configuration

  • BBC Micro:Bit V2.2 Pinout Reference
  • The BBC Micro:Bit V2.2 is a popular microcontroller board designed for educational and IoT projects. It features a range of GPIO pins, interfaces, and sensors that enable users to create interactive and connected devices. Here's a detailed explanation of each pin on the Micro:Bit V2.2 board:
  • Pinout Structure:
  • The Micro:Bit V2.2 has a 25-pin edge connector, labeled from 0 to 24, and three ring connectors for connecting alligator clips or banana plugs. The pinout is divided into several sections:
  • GPIO Pins: 0-16, 19-20
  • Power and Ground: 17-18, 21-22
  • SPI and I2C Interfaces: 23-24
  • Ring Connectors: A, B, C (alligator clip/banana plug compatible)
  • Pin-by-Pin Explanation:
  • GPIO Pins (0-16, 19-20):
  • 1. Pin 0: GPIO, Analog Input, Digital Input/Output
  • Can be used as a digital input/output or analog input (0-1023)
  • 2. Pin 1: GPIO, Analog Input, Digital Input/Output
  • Can be used as a digital input/output or analog input (0-1023)
  • 3. Pin 2: GPIO, Analog Input, Digital Input/Output
  • Can be used as a digital input/output or analog input (0-1023)
  • 4. Pin 3: GPIO, Digital Input/Output
  • Can be used as a digital input/output
  • 5. Pin 4: GPIO, Digital Input/Output
  • Can be used as a digital input/output
  • 6. Pin 5: GPIO, Digital Input/Output
  • Can be used as a digital input/output
  • 7. Pin 6: GPIO, Digital Input/Output
  • Can be used as a digital input/output
  • 8. Pin 7: GPIO, Digital Input/Output
  • Can be used as a digital input/output
  • 9. Pin 8: GPIO, Digital Input/Output
  • Can be used as a digital input/output
  • 10. Pin 9: GPIO, Digital Input/Output
  • Can be used as a digital input/output
  • 11. Pin 10: GPIO, Digital Input/Output
  • Can be used as a digital input/output
  • 12. Pin 11: GPIO, Digital Input/Output
  • Can be used as a digital input/output
  • 13. Pin 12: GPIO, Digital Input/Output
  • Can be used as a digital input/output
  • 14. Pin 13: GPIO, Digital Input/Output
  • Can be used as a digital input/output
  • 15. Pin 14: GPIO, Digital Input/Output
  • Can be used as a digital input/output
  • 16. Pin 15: GPIO, Digital Input/Output
  • Can be used as a digital input/output
  • 17. Pin 19: GPIO, Digital Input/Output
  • Can be used as a digital input/output
  • 18. Pin 20: GPIO, Digital Input/Output
  • Can be used as a digital input/output
  • Power and Ground (17-18, 21-22):
  • 19. Pin 17: 3V Out
  • Regulated 3V output ( max. 100mA)
  • 20. Pin 18: GND
  • Ground connection
  • 21. Pin 21: VIN
  • Input voltage (3.5-6V) for the onboard voltage regulator
  • 22. Pin 22: GND
  • Ground connection
  • SPI and I2C Interfaces (23-24):
  • 23. Pin 23: SCL (I2C Clock)
  • I2C clock signal
  • 24. Pin 24: SDA (I2C Data)
  • I2C data signal
  • Ring Connectors (A, B, C):
  • A: GND
  • B: 3V Out
  • C: GPIO Pin 0 (can be used as a digital input/output or analog input)
  • Connecting the Pins:
  • When connecting pins, ensure you use the correct voltage levels and follow proper electrical safety practices. You can connect:
  • GPIO pins to sensors, actuators, or other devices using jumper wires or breadboard connections
  • Power and ground pins to a power source, such as batteries or a USB connection
  • SPI and I2C interface pins to compatible devices, such as sensors or displays
  • Ring connectors to alligator clips or banana plugs for easy experimentation
  • Remember to consult the Micro:Bit V2.2 datasheet and documentation for specific usage guidelines, voltage tolerances, and safety precautions when working with the board.

Code Examples

BBC Micro:Bit V2.2 Documentation
Overview
The BBC Micro:Bit V2.2 is a small, low-cost, and versatile microcomputer designed for educational and DIY projects. It is a compact, wearable device that provides a range of features, including sensors, buttons, and wireless connectivity. The Micro:Bit is an ideal platform for beginners and experienced developers alike, offering a Python-based programming environment and a wide range of APIs and libraries.
Hardware Features
32-bit ARM Cortex-M4 processor
 16KB RAM and 256KB Flash memory
 5x5 LED matrix display
 2 programmable buttons
 Micro-USB connector for power and programming
 Bluetooth Low Energy (BLE) module for wireless connectivity
 Accelerometer and magnetometer sensors
 Temperature sensor
 Edge connector with 25 pins for expansion and prototyping
Software Features
Python-based programming environment (MicroPython)
 API and library support for various sensors and peripherals
 Wireless communication using BLE
 Interactive programming using the Micro:Bit's LED display and buttons
Examples
### Example 1: Blinking LED Matrix
This example demonstrates how to use the Micro:Bit's LED matrix display to create a simple blinking pattern.
```python
import microbit
while True:
    microbit.display.clear()
    microbit.display.set_pixel(2, 2, 9)  # Set the center pixel to maximum brightness
    microbit.sleep(500)
    microbit.display.clear()
    microbit.sleep(500)
```
In this example, we use the `microbit` module to access the Micro:Bit's LED display. We clear the display, set the center pixel to maximum brightness, and then sleep for 500ms. We repeat this process to create a blinking effect.
### Example 2: Accelerometer-based Gesture Detection
This example demonstrates how to use the Micro:Bit's accelerometer sensor to detect simple gestures, such as tilting or shaking the device.
```python
import microbit
while True:
    x, y, z = microbit.accelerometer.get_values()
    if abs(x) > 500 or abs(y) > 500:
        microbit.display.show("Tilted!")
    elif abs(z) > 1000:
        microbit.display.show("Shaken!")
    else:
        microbit.display.clear()
    microbit.sleep(100)
```
In this example, we use the `microbit.accelerometer` module to read the accelerometer values. We then check if the device has been tilted (x- or y-axis values exceed 500) or shaken (z-axis value exceeds 1000). Based on the detected gesture, we display a corresponding message on the LED display.
### Example 3: BLE-based Communication
This example demonstrates how to use the Micro:Bit's BLE module to establish a wireless connection between two devices.
Sender Code
```python
import microbit
import ubluetooth
sender = ubluetooth.BLE()
sender.advertise("MicroBit_Sender")
while True:
    sender.send("Hello, receiver!")
    microbit.sleep(1000)
```
Receiver Code
```python
import microbit
import ubluetooth
receiver = ubluetooth.BLE()
receiver.connect("MicroBit_Sender")
while True:
    message = receiver.recv()
    microbit.display.show(message)
    microbit.sleep(1000)
```
In this example, we use the `ubluetooth` module to establish a BLE connection between two Micro:Bit devices. The sender device advertises its presence and sends a message every second, while the receiver device connects to the sender and displays the received message on its LED display.