Xia mi Multi-functional Expansion Board for BBC micro:bit V2 Wiki - DFRobot


Look for more hardware to play with your new micro:bit? Check this out! This is a micro:bit V2-based multi-functional expansion board for programming education.

Featuring a small size of 57×87mm and a compact layout, the board expands more than 10 functional modules including sensors of all kinds, 4-way motor, LED lights, OLED screen and external power supply, which allows students to not only learn the basic functions of micro:bit but also further advance to the next level like controlling robot cars, Mecanum wheel robot, and so on. Moreover, even with so many things integrated on the board, the price still remains low. Come and explore all these extra features!


Board Overview

Power Supply Method

IO Ports Description

Tutorial- MakeCode

  1. Enter the MakeCode programming platform in browser: https://makecode.microbit.org/
  2. Create a new project and name it.
  3. Load in the program library of xia_mi board: click “setting”, and “expansion” in turn, then paste this link in the search box: https://github.com/DFRobot/pxt-DFRobot_xia_mi_Board.

1. Light Up RGB LED

In this sample, we are going to make the RGB light present three colors in turn.

MakeCode Program Link: https://makecode.microbit.org/_FJt7rr78WMKC

RGB LED color switching

2. Traffic Signal Light

In this sample, the red one lights for 30s, the yellow one lights for 2s, and the green one lights for 30s, in a loop execution.

MakeCode Program Link: https://makecode.microbit.org/_RduW652MPKyk

Traffic Light

3. Ambient Temperature and Humidity Sensor

In this sample, read the values of temperature and humidity, and display them on the OLED.

MakeCode Program Link: https://makecode.microbit.org/_K7y2TtVvMio7

Read temperature and humidity

4. Control Servo via Angular Rotation Sensor

In this sample, a 9g servo is connected to the P0 port, and the rotation angle sensor is used to control the angle of the servo. The position of the knob and the angle of the servo are displayed on the screen in real time.

MakeCode Program Link: https://makecode.microbit.org/_TVmLvAXTq2v5


5. IR-controlled Relay Switch

In this sample, the mini-infrared remote control is used to control the relay. When the button 1 on the remote control is pressed, the relay is closed, and when the button 0 is pressed, the relay is released. The corresponding relay indicator will switch automatically.

Infrared remote control and corresponding key value:

IR Remote Controller

MakeCode Program Link: https://makecode.microbit.org/_FEt27cb1qLar


6. Fire Alarm

In this sample, a lighter is needed, please pay attention to the safety of using fire. Turn on the lighter about 20cm in front of the flame sensor, the display will show the current flame intensity value, if it exceeds 200, the buzzer will start to alarm, and stop the alarm when it is lower than 200. Because the infrared flame sensor also has a certain sense of sunlight, it has a value of several tens by default. The stronger the light, the larger the value, which is normal. But the infrared flame sensor is more sensitive to the wavelength of the flame.

MakeCode Program Link: https://makecode.microbit.org/_HAJPpYYfW6hq


Fire Alarm

7. SR04 Ultrasonic Distance Sensor

This sample will use the SR04 ultrasonic module. This module is not included in the product and needs to be purchased independently. Insert the SR04 ultrasonic sensor into the interface (as shown in the figure below), and it will display the measured distance on the OLED screen.

MakeCode Program Link: https://makecode.microbit.org/_0K01rcdXf0y1

SR04 Ultrasonic Sensor


8. 4-way Motor Drive

This product is equipped with 4 motor drives on board, which can be used as the control board of the Mecanum wheel robot platform. In this sample, 4 motors are driven to realize forward and reverse rotation. Demonstrate the use of motor drive.

MakeCode Program Link: https://makecode.microbit.org/_eR62rrYvCfyo



For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents

DFshopping_car1.png Get xia mi board for micro:bit from DFRobot Store or DFRobot Distributor.

Turn to the Top