EBC MINODE User Manual
EBC MINODE User Manual
User Manual
3) Usage.................................................................................................................................................................. 8
3.1 Programming Using mi:node ..................................................................................................................... 8
3.2 Working With mi:node Libraries ................................................................................................................ 8
3.3 Working Without mi:node Libraries......................................................................................................... 11
3.4 Module Usage & API Reference ............................................................................................................... 11
a) Light Sensor .............................................................................................................................................. 11
b) Temperature and Humidity Sensor (DHT11)............................................................................................ 13
c) Sound Sensor ........................................................................................................................................... 16
d) Rotary Module ......................................................................................................................................... 17
e) Mini Fan Module ...................................................................................................................................... 20
f) Speaker Module ....................................................................................................................................... 21
g) PIR Sensor Module ................................................................................................................................... 22
h) RGB LED Module ...................................................................................................................................... 25
i) Switch Module ......................................................................................................................................... 26
j) Relay Module ........................................................................................................................................... 29
4) Appendix .......................................................................................................................................................... 31
4.1 Microsoft MakeCode................................................................................................................................ 31
4.2 Support..................................................................................................................................................... 31
With this kit there is no need for soldering, just connect and use. The construction of a working
circuit can be easily completed in less than one minute.
1.2 Features
Includes sensors for environmental and physical monitoring, as well as user interface modules
(such as a switch) to allow a number of exciting projects including wearable applications and
smart home devices.
Rich education guide with lesson documentation and many project stories.
Expandable
Reusable
2) Getting Started
User Manual V3.2
Embest |http://www.embest-tech.com 4
2.1 The Connector Board
The kit is comprised of a Connector Board and several sensor modules. The Connect Board is a
bridge between the BBC micro:bit and the mi:node sensor modules. It converts the BBC
micro:bit edge connector into several e-brick connectors. The sensor modules can then easily
be attached to it using the provided e-brick cables.
2.3 Inputs
b) Digital IO
Pin Name Description
D12 Connects to a micro:bit pin with digital IO (input or output) function
D13 Connects to a micro:bit pin with digital IO (input or output) function
D14 Connects to a micro:bit pin with digital IO (input or output) function
D15 Connects to a micro:bit pin with digital IO (input or output) function
Typically using names that start with the letter ‘A’ (like A0,A1, A2) denote ANALOG inputs, but
these connections can sometimes also be used as digital inputs or outputs.
Names starting with the letter ‘D’ can only be used to denote DIGITAL inputs and outputs. This is
similar to the I2C in that it can only be used to denote I2C connections.
python
For example, the RGB LED module works using I2C communication. By utilizing the already-
created mi:node library, you just need to call the RGB LED library function to control color and
brightness. You don’t have to worry about the details of how the I2C communication does this.
With the pre-created libraries you also don't need to think about which micro:bit pin a mi:node
sensor module connects to. You only need to know the name of the connector that your sensor
module and E-Brick Cable is connected to.
Steps to follow:
Go to https://makecode.microbit.org
Refer to the example code or API reference and drag the library blocks you want to use into
your project space.
For example, if you connect a sensor module to D12 on the Connector Board, from the table you
can see that this connector corresponds to pin12 on the micro:bit.
a) Light Sensor
The Light Sensor module can be used to detect the intensity of light in the surrounding
environment.
This module requires an analog connection, therefore can only be plugged into A0, A1, or
A3 on the Connector Board.
Block API:
Function
LightSensorGetLevel(connName: AnalogConnName): number;
Parameters
‘ConnName’ is the analog connector's name.
Function
onLightSensorEvent(connName: AnalogConnName, body: () => void): void;
Parameters
‘ConnName’ is the analog connector's name.
EXAMPLE:
This example shows you how to get the current light level and display it on the LED screen.
This example displays the word ‘Change’ on the LED screen whenever the light level
changes.
Electrical Characteristics
Humidity
Block API
Measure Temperature
Obtain the current temperature. This value can be configured the format of Celsius or
Fahrenheit.
Function
DHTGetTemperature(connName: ConnName, style: DHTTemStyle): number;
Parameters
‘ConnName’ is the connector's name.
‘style’ is the format of the temperature. You can choose Celsius or Fahrenheit.
Measure Humidity
Function
DHTGetHumidity(connName: ConnName): number;
Parameters
‘ConnName’ is the connector's name.
Check the temperature periodically and execute the associated code block whenever the
temperature changes. The smallest detectable unit of change is 1 degree Celsius.
Function
onDHTEvent(connName: ConnName, body: () => void): void;
Parameters
‘ConnName’ is the analog connector's name.
Electrical Characteristics
Parameter Min. Typical Max. Unit
Frequency range 100 - 10000 Hz
Sensitivity - -50 - dB
Block API:
Check if there were any noise periodically and execute the associated code block
whenever it detected a noise. It can be triggered by clapping your hand.
Function
onMICEvent(connName: AnalogConnName, body: () => void): void;
Parameters
‘ConnName’ is the analog connector's name.
EXAMPLE:
When a noise is detected, the word ‘Change’ is displayed on the LED screen.
Electrical Characteristics
Parameter Min. Typical Max. Unit
Resistance range 0 - 10 kΩ
Block API
Determine the current rotary position, the percentage of how much the rotary dial has
been rotated from its zero position.
Function
RotaryGetPercentage(connName: AnalogConnName): number;
Parameters
‘ConnName’ is the analog connector's name.
Check the angle of the rotary dial periodically and then execute the associated code block
when a dial change occurs.
Parameters
‘ConnName’ is the analog connector's name. This module can only be plugged into
analog connector A0,A1 and A2.
EXAMPLE:
This example shows you how to get the current rotary angle percentage and display it on
the LED screen.
When the rotary percentage is smaller than 50%no LEDs will be lit on the screen. When
the percentage is larger than 50% the LEDs will light up in the form of a smiley face.
While rotating the rotary dial, the LED screen will display a smiley face. When the dial is
stationary, no LEDs will be lit on screen.
Image 3.4e – Mini Fan Module with DC Motor and Orbit Fan
Block API
To change the speed of the motor/fan, adjust the second parameter value to a number
within the range of 0 to 100.
Function
FanControl_1(connName:AnalogConnName , speed:number): void
Parameters
‘ConnName’ is the analog connector's name.
‘Speed’ is the velocity of the motor; where 0 is used to stop the motor and 100 is
the fastest speed.
EXAMPLE:
User Manual V3.2
Embest |http://www.embest-tech.com 20
Use the Button to Control Motor Speed
This example demonstrate show to use Button A and B to control the motor speed.
Button A tells the motor to speed up and Button B tells the motor to slow down.
f) Speaker Module
The Speaker can be used to make a sound.
NOTE: As a default, the speaker is connected through pinP0 of the micro:bit, therefore it is
important to connect the speaker module to Connector A0.
EXAMPLE:
Electrical Characteristics
Check whether the PIR module has been triggered or not. When the PIR module is
triggered the signal line will be detected as high.
Function
PIRIsTriggered(connName: ConnName): boolean;
Parameters
‘ConnName’ is the connector's name.
This code block configures the selected specified pin for a digital input and then executes
the associated code block whenever the PIR is triggered (movement is detected).
Function
onPIREvent(connName: ConnName, body: () => void): void;
Parameters
‘ConnName’ is the connector's name.
EXAMPLE:
When the PIR detects a moving object, the LED screen will show a smiley face. When
there is no movement detected within the PIR modules range no LEDs will be lit.
Block API
Function
RGBChooseColor(connName: ConnName, color: MiNodeColor): void;
Parameters
‘ConnName’ is the analog connector's name.
‘Color’ is your choice of one color from the following pre-coded mi:node colors: Red,
Green, Blue, Yellow, Pink, Cyan or White.
To change the color of the RGB, adjust the three greyscale values.
Function
RGBSetColor(connName: ConnName, red: number, green: number, blue: number):
void;
EXAMPLE:
When you press button A the RGB LED will light up red. Pressing Button B will cause the
RGB LED to turn green.
This example shows you how to set a specific color for Button A and B.
i) Switch Module
The switch module can used to switch between two options (ie. on/off).
Block API
Function
switchIsOpened(connName: ConnName): boolean;
Parameters
‘ConnName’ is the connector's name.
Switch Event
This code block configures the specified pin for a digital input and then executes the
associated code block whenever the switch is either opened or closed, as selected.
Function
onSwitchEvent(connName: ConnName, event: SwitchEvent, body: () => void): void;
Parameters
‘ConnName’ is the analog connector's name.
EXAMPLE:
Electrical Characteristics
Parameter Description
Contact Rating NO:5A250VAC/28VDC
NC:3A 250VAC/28VDC
Operate Voltage ≤ V dc 2.25
Release Voltage ≥ V dc 0.3
Block API
Set Relay Status
Use this code block to set the relay module's status to open or close.
Function
RelayControl(connName:ConnName , status:FanStatus): void
Parameters
‘ConnName’ is the connector's name.
EXAMPLE:
Reference: https://makecode.microbit.org/reference
4.2 Support
Website: http://www.embest-tech.com/prod_view.aspx?TypeId=83&Id=383&Fid=t3:83:3