A PXT library for Smarthon Smart Home IoT Maker kit
Smarthon Smart Home IoT Maker Kit for micro:bit is designed to introduce smart home concept implementation of Internet of Things (IoT) into daily life. Derived from Smarthon IoT board, you can express your creativity on building a smart house for living using in up to 13 cases from simple to IoT level, including smart saving light bulb, and home health data monitoring system in different areas like living room, bedroom, kitchen, toilet, door area etc. The provided full flexible model allows the user to create different styles of the house and add the decoration to the model easily.
You may check the product information by https://en.smarthon.cc/micro-bit-smart-home-kit
- Smarthon WiFi extension board
- Ultrasonic Distance Sensor
- Motor Fan
- Multi-Colour LED (WS2812)
- Button
- Flame Sensor
- Light Sensor
- PIR Motion Sensor
- Temperature, Humidity sensor (DHT11)
- 180ᵒ Servo
- 360ᵒ Servo
- Cardboard Model
- Crocodile Clips
The light sensor will return the percentage value of luminance in environment
Maxmium:100
Minmium:0
basic.showNumber(House.getLight(AnalogPin.P0))
The Distance sensor will return the distance between sensor and object
Maxmium:4M
Minmium:3cm
basic.showNumber(House.read_distance_sensor(House.DistanceUnit.Centimeters, DigitalPin.P14, DigitalPin.P15))
The flame sensor will return the detection of fire result
Detected:TRUE
Not Detected:FALSE
if (House.getFlame(DigitalPin.P0)) {
basic.showString("Detected!")
}
The motion sensor will return the motion changing at the front
Detected change:TRUE
Not Detected change:FALSE
if (House.read_motion_sensor(DigitalPin.P0)) {
basic.showString("Detected!")
}
The function in the block will be execute after the button (connected to pin) pressed
House.Button(House.PressButtonList.b0, function () {
basic.showString("Pressed!")
})
The DHT11 sensor will return the temperature and humidity in environment, and save in the variable
Before showing or using the variable, need to be read the DHT11 sensor
For Temperature
Maxmium:50 Celsius degree
Minmium:0 Celsius degree
For Humidity
Maxmium:80%
Minmium:20%
House.readDHT11(DigitalPin.P0)
basic.showNumber(House.readTemperatureData(House.Temp_degree.degree_Celsius))
basic.showNumber(House.readHumidityData())
Base on the temperature and humidity, the IAQ score will repersent the comfortability of environment
Before geting the IAQ score, need to be read the DHT11 sensor
House.readDHT11(DigitalPin.P0)
basic.showNumber(House.getIAQ())
Input the value to let the motor fan work in different speed
Maxmium:1023
Minmium:0
input.onButtonPressed(Button.A, function () {
House.TurnMotor(1023, AnalogPin.P1)
})
Input the value to let the 180 degree servo motor move to specific position
Maxmium:180
Minmium:0
input.onButtonPressed(Button.A, function () {
House.Turn180Servo(180, AnalogPin.P0)
})
Choose the direction and speed to let the 360 degree servo motor to moving in specific way and speed
For direction
Maxmium:clockwise
Minmium:anti-clockwise
For Speed
Maxmium:Level 3
Minmium:Stop
input.onButtonPressed(Button.A, function () {
House.Turn360Servo(House.ServoDirection.clockwise, House.ServoSpeed.level3, AnalogPin.P0)
})
MIT
- for PXT/microbit
(The metadata above is needed for package search.)