Microbit Mi:Node User manual

Mi:Node Kit 使用手冊
Make creative ‘things’ with micro:bit
Revision
Date
Description
V0.1.0
March 2017 by Paul
Initial version

TOC
Mi:Node Kit User Manual
Introduction
Features
What is the Kit?
What is it include?
How it works
E-brick Connector
E-brick Connector - Analog In/PWM Type
E-brick Connector - Digital IO Type
E-brick Connector - IIC Type
Conversation on Remaping Micro:bit Edge Pin
How to use it
Programming with the kit
Work with our library
Steps
Work without our library
Modules Usage & API Reference
Light Sensor
Block API
Get the light level
Parameters
Light Sensor event
Parameters
Example
Show the light level
Light level change event
DHT11(Temperature and Humidity Sensor)
Block API
Get the temperature
Parameters
Get humidity
Parameters
Temperature change event
Parameters
Example
Use button to get the temperature and humidity
Temperature change event
Sound Sensor
Block API
Get sound level
Parameters
Sound Sensor event
Parameters
Example

Show the sound level
Sound level change event
Rotary Module
Block API
Get the percentage
Parameters
Light Sensor event
Parameters
Example
Show the percentage
Rotary control the LED show
Rotary change event
Mini Fan Module
Block API
Control the motor speed
Parameters
Example
Use button to control the motor's speed.
Speaker Module
Example
Let your speaker make a sound
PIR Module
Block API
Check the PIR status
Parameters
PIR event
Parameters
Example
Detecting the movement
RGB LED
Block API
Choose a RGB color
Parameters
Set a specific RGB color by setting rgb gray value
Parameters
Example
Use button to show different color.
Set specific color
Switch Module
Block API
Check the switch's status
Parameters
Switch event
Parameters
Example
Switch control the screen show

介紹
Mi:Node kit 是一個模塊化,安全且易於使用的項目,可讓孩子們盡量減少
Micro:bit 進行 IOT 學習所需的工作量。
對於該套件,不需要焊接,只需要用連接線接插頭然後使用,工作電路的設計可以
在一分鐘內完成。
Introduction
The Mi:Node kit is a modular, safe and easy to use group of items that allow kids to
minimize the effort required to get started with IOT learning with Micro:bit.
For this kit, there is no need for soldering, plug then use, the construction of the
working circuit can be done within one minute.
特徵
•像Lego 一樣,它是模塊化,安全和即用的
•10 個傳感器模塊包括環境監控,用戶界面和物理監控可以建立很多酷炫的項
目,包括可穿戴設備和智能家居等。
•可擴展和可重用
•豐富的教育指導文件和許多項目故事
Features
•It is modular, safe and ready-to-use just like Lego
•10 sensor modules include environmental monitoring, user interface and
physical monitoring can be built a lot of cool projects include wearable device
and smart home, etc.
•It is expandable and reusable
•Rich education guide document and many project stories

What is the Kit?
What is it include?
Category
Module
Quantity
Conector Type
Description
Micro:bit
Micro:bit Main
Board
0
NA
The Micro:bit is not
include in the kit
Connect
Board
Connect Board
1
NA
This a bridge between
the micro:bit and
sensor modules
Sensor
Module
(10)
Light Sensor
1
Analog Input
It can be used to detect
the intensity of light in
the environment
Temperature
and Humidity
Sensor
1
Analog Input
It can get temperature
and humidity in the
environment
Sound Sensor
1
Analog Input
It can detect the sound
strength of the
environment
Rotary Angle
1
Analog Input
It can produce analog
output between 0 and

Vcc by adjust the
angular range from 0 ~
300.
Mini Fan
1
Analog
Output/PWM
A DC motor + orbit fan
Speaker
1
Analog
Output/PWM
Voice output speaker
PIR Motion
Sensor
1
Digital Input
It allows user to sense
motion, usually human
movement in its range
RGB LED
1
Digital Output
A colorful LED. The
color and brightness
can be programable
Switch
1
Digital Input
It can used to switch
ON/OFF
Relay
1
Digital Output
It is an digital switch
can be used to control
high-votage elecrical
devices. (maximum
250V)
Cables
Universal 4 Pin
Buckled Cable
8
NA
20cm cable x 2, 10cm
cable x 6
Micro-B USB
cable
2
NA
1 for power input, 1 for
micro:bit program
upload
怎麼運行的
該套件由連接板和多個傳感器模塊組成。 連接板是微位置主板和傳感器模塊之間
的橋樑。 它將微位置連接器轉換為服務器 E-brick 連接器。 傳感器模塊可以通過
電纜連接到它。
How it works
The kit is composed of a connect board and several sensor modules. The connect
board is a bridge between the micro:bit main board and the sensor modules. It
converts the micro:bit edge connector into serveral E-brick connector. The sensor
modules can be attached to it by cable.

E-brick Connector
E-brick 連接器與 Seeed 的標準 Grove 兼容。 它是 2.0mm 1x4 連接器。 信號包
括:1 VCC,1GND,2個模擬/數字信號。
一個 E-brick 連接器有 4個引腳:
E-brick Connector
The E-brick connectors are compatible with the standard Grove from Seeed. It¡¯s a
2.0mm 1x4 connector. With signals include: 1 VCC, 1GND, 2 analog / digital signal.
An E-brick connector have 4 pins:
Pin
ID
Pin
Name
Description
Pin#1
Signal#1
Connect to a micro:bit pin with analog in / digital io / i2c
function
Pin#2
Signal#2
Same to Signal#1. The Signal#2 is often not used, because 1
signal pin is enough for most sensor modules
Pin#3
VCC
Power pin

Pin#4
GND
Power pin
連接器有 3種類型:
•3個模擬輸入連接器
•3個I2C 連接器
•4個數字 IO 連接器
There are 3 types of the connector:
•3 analog input connectors
•3 I2C connectors
•4 digital IO connectors
E-brick Connector - Analog In/PWM Type
Pin ID
Pin Name
Remark
Pin#1
A1
Connect to a micro:bit pin with analog input/PWM function
Pin#2
A2
Same to A1, but most sensor module may not use the A2 pin
E-brick Connector - Digital IO Type
Pin ID
Pin Name
Remark
Pin#1
D1
Connect to a micro:bit pin with digital io function
Pin#2
D2
Same to D1, but most sensor module may not use the D2 pin
E-brick Connector - IIC Type
IIC (Inter-Integrated Circuit),發音為 I-squared-C 是由飛利浦半導體(現在的恩智
浦半導體)發明的多主機(master),多從機(slave),單端,串行計算機總線。 它通
常用於在短距離,板內通信中將低速外設連接到微控制器。
有一些基於 IIC 總線的傳感器模塊。 我們可以在相同的總線上附加服務器模塊,因
為它們可以被不同的地址識別。
IIC (Inter-Integrated Circuit), pronounced I-squared-C, is a multi-master, multi-
slave, single-ended, serial computer bus invented by Philips Semiconductor (now
NXP Semiconductors). It is typically used for attaching lower-speed peripheral to
microcontrollers in short-distance, intra-board communication.

There are some sensor modules based on the IIC bus. We can attach serveral
modules on the same bus, Because they can be identificated by different addresses.
Pin ID
Pin Name
Remark
Pin#1
IIC SCL
IIC clock signal. Connect to micro:bit pin19
Pin#2
IIC SDA
IIC data signal. Connect to micro:bit pin20
Conversation on Remaping Micro:bit Edge Pin
請注意連接器名稱。 連接器名稱中有約定。 連接器名稱可以指示映射的微:位信
號名稱。
例如:連接器 D12 表示:信號#1被重新映射到 micro:bit 引腳 12,信號#2被重
新映射到 micro:bit 引腳 13(12 + 1)
在開發代碼時,我們可以快速定位 micro:bit 引腳
Please note the Connector Name. There is a convention in the connector name. A
connector name can be indicated the mapped micro:bit signal name.
For example: Connector D12 means: The Signal#1 is remapped to micro:bit pin 12,
and Signal#2 is remapped to micro:bit pin 13(12+1)
It's useful for us to position the micro:bit pin quickly when develop code.
Connector Type
Connector Name
Micro:bit Pin Name(Signal#1, Signal#2)
Analog Input /
A0
pin0, pin1
Digital IO
A1
pin1, pin2
A2
pin2, pin3
Digital IO
D12
pin12, pin13
D13
pin13, pin14
D14
pin14, pin15
D15
pin15, pin16
IIC
IIC
pin19, pin20
IIC
pin19, pin20
IIC
pin19, pin20
•我們通常使用 A0,A1,A2 作為模擬輸入連接器,但也可以用作數字 io 連接
器。
•D12,D13,D14,D15 只能用作數字 IO 連接器。

•3 IIC 只能用作 IIC 連接器。
•We usually use A0, A1, A2 as a analog input connector, but it can also be used as
a digital io connector.
•D12, D13, D14, D15 can be only used as digital IO connector.
•3 IIC can be only used as IIC connector.
How to use it
只需用連接線插入插頭然後使用它,這很容易。
Just plug then use it, That's easy.
Programming with the kit
As you know, There are 5 editors we can chose on micro:bit official website.
•Microsoft PXT

•Code Kingdoms JavaScript
•Microsoft Block Editor
•Microsoft Touch Develop
•python
We'll focus more on the Microsoft PXT.
Work with our library
我們將開發傳感器模塊的庫。 這可以減少您使用模塊的工作量。您不必學習模塊
的技術細節。 例如,RGB LED 基於 IIC 總線,我們只需要調用庫函數來控制顏色
和亮度。 我們不在乎 IIC 本身。
使用庫,您不需要關心模塊連接到哪個引腳,您只需要知道使用了 E-brick 連接
器。
We'll develop the libraries for the sensor modules. This can reduce your effort on
using the modules.You don't have to study the technical details of the modules. For
example, The RGB LED is based on the IIC bus, We just need to call the library
function to control the color and brightness. We don't care the IIC bus itself.
With the library, you don't need to care which pin a module connects to, You just
need to know what E-brick connector is used.
NOTE
The library is based on Microsoft PXT.
Steps
•Step 1: Add our library to your code
•Step 2: Refer to the API reference or example code
•Step 3: Drag the library blocks.

Work without our library
您還可以使用 micro:bit 引腳庫直接控制傳感器模塊。 在這種情況下,我們可以
通過 E-brick 連接器 ID 獲取 micro:bit 引腳 ID。例如,我們將傳感器模塊連接到
D12。然後我們可以得到相應的 Micro:bit 引腳為 pin12。
You can also use the micro:bit pin library to control the sensor modules directly. In
this situation, We can get the micro:bit pin ID by the E-brick connector ID. For
example, We connect a sensor module to D12. Then We can get that the
corresponding Micro:bit pin is pin12.

Modules Usage & API Reference
Light Sensor
光傳感器模塊可用於檢測環境中的光強度。將亮度分為 5級。該模塊只能插入類
比連接器(A0,A1 和A2)。
The Light Sensor module can be used to detect the intensity of light in the
environment.We divide the brightness into 5 levels.This module can only be pluged
into Analog connector(A0, A1 and A2).
Module
Connect Type
Available Connectors
Light Sensor
Analog
A0, A1, A2
Block API
Get the light level
獲得當前的光照水平,我們將光強度分為 5個等級,從 1到5.其中 1表示最亮,5
表示黑暗。

Get current light level, we divide the light intensity into 5 levels,from 1 to 5.which 1
represents brightest and 5 represents darkness.
function LightSensorGetLevel(connName: AnalogConnName): number;
Parameters
•connName is the analog connector's name.this module can only be pluged into
analog connector A0,A1 and A2.
Light Sensor event
配置 MCU 定期檢查光級別,然後在光級別更改時執行相關的代碼塊。
Configure the MCU check the light level periodically, and then execute the associated
code block whenever the light level changes.
function onLightSensorEvent(connName: AnalogConnName, body: () => voi
d): void;
Parameters
•connName is the analog connector's name.this module can only be pluged into
analog connector A0,A1 and A2.
Example
Show the light level
此示例顯示如何獲取當前的燈光級別,並將其顯示在 LED 屏幕上。
This example show you how to get the current light level,and show it on the LED
screen.

Light level change event
When the light level changes there will show a string on the screen.
DHT11(Temperature and Humidity Sensor)
This DHT11 Temperature & Humidity Sensor features a temperature & humidity
sensor complex with a calibrated digital signal output. It can get temperature and
humidity in the environment

Module
Connect Type
Available Connectors
DHT11
Digital IO
D12, D13, D14, D15
TODO
Need hardware engineers to confirm this module's specific parameters.
Module
Measurement Range
Humidity Accuracy
Temperature Accuracy
DHT11
20-90%RH / 0-50
℃
±5%RH
±2℃
Block API
Get the temperature
獲取當前溫度,您可以配置溫度的格式,以攝氏或華氏為單位。

Get current temperature, you can configure the format of the temperature in Celsius
or Fahrenheit.
function DHTGetTemperature(connName: ConnName, style: DHTTemStyle):
number;
Parameters
•connName is the connector's name.this module can be pluged into both analog
connector and digital connector.
•style is the format of the temperature.you can choose Celsius or Fahrenheit.
Get humidity
獲得當前濕度。
Get current humidity.
function DHTGetHumidity(connName: ConnName): number;
Parameters
•connName is the connector's name.this module can be pluged into both analog
connector and digital connector.
Temperature change event
配置 MCU 定期檢查溫度,然後在溫度變化時執行相應的代碼塊。最小單位變化為
1攝氏度。
Configure the MCU check the temperature periodically, and then execute the
associated code block whenever the temperature changes.The smallest unit of
changing is 1 degrees Celsius.
function onDHTEvent(connName: ConnName, body: () => void): void;

Parameters
•connName is the analog connector's name.this module can be pluged into both
analog connector and digital connector.
Example
Use button to get the temperature and humidity
此示例顯示如何使用按鈕 A和B獲取溫度和濕度。當您按下按鈕 A時,屏幕將顯
示當前溫度,如果按鈕為 B,則顯示濕度
This example show you how to use the button A and B to get the temperature and
humidity.When you press the button A the screen will show the current
temperature,if the button is B it will show the humidity.
Temperature change event
當溫度變化時,屏幕會顯示笑臉!
When the temperature changes the screen will show a smile face!

Sound Sensor
聲音傳感器模塊可用於檢測環境的聲音強度。 我們將聲音分為 5個等級,您可以
使用我們的塊獲取當前級別。 該模塊只能插入模擬連接器(A0,A1 和A2)。
The Sound Sensor Module can be used to detect the sound strength of the
environment. We divide the sound into 5 levels, you can use our block to get the
current level. This module can only be plugged into analog connector (A0,A1 and
A2).
Module
Connect Type
Available Connectors
Sound Sensor
Analog
A0, A1, A2
Table of contents
Popular Microcontroller manuals by other brands

Texas Instruments
Texas Instruments LaunchPad MSP430FR2311 user guide

Itaca Innovation
Itaca Innovation uChip Quick start manual

Nuvoton
Nuvoton NuMicro MS51 Series Technical reference manual

Kneron
Kneron KL520 Series Product information

ZiLOG
ZiLOG Z8 Encore! MC Series user manual

Texas Instruments
Texas Instruments TIRIS RI-STU-MRD1 Reference manual

Cypress
Cypress CapSense CY8CMBR2010 Design guide

ROYOLE
ROYOLE RoKit introduction

Texas Instruments
Texas Instruments AFE722 Series user guide

FuzzDog
FuzzDog One-Knob Fuzz(es) quick start guide

Microchip Technology
Microchip Technology MPLAB user guide

Backyard Brains
Backyard Brains DIY SpikerBox v1.3 instructions