Environment_IoT package is developed under the cooperation of ELECFREAKS, CLASSROOM and TINKERCADEMY.
Environment IoT Kit can detect all kinds of environment data like temperature, humidity,wind speed, light intensity, noise, dust, PM2.5 and so on. Besides, you can upload these environment data to thingspeak IoT server through ESP8266 serial wifi module.
Before start, you have to register an account of thingspeak.
- ELECFREAKS Octopus:bit.
- IIC OLED display
- Sound Sensor
- Octopus Temperature And Humidity Sensor
- Octopus Soil Moisture Sensor
- Octopus Analog Photocell
- Dust Sensor
- PM2.5/PM10
- Win Sensor
- ESP8266 Serial Wifi Module
- Open Microsoft Makecode/microbit and create a new project
- Search and add the
environment
package - Use the
Environment_IoT
drawer in the editor to drag out and arrange the blocks - Click
Download
to move your program to the micro:bit
Initialize dust sensor. Set pin vLED and VO.
Environment_IoT.initdust(DigitalPin.P10, AnalogPin.P1)
get dust(μg/m³)
Environment_IoT.initdust(DigitalPin.P10, AnalogPin.P1)
basic.forever(() => {
basic.showNumber(Environment_IoT.ReadDust())
})
get DHT11 Temperature(℃)
basic.forever(() => {
basic.showNumber(Environment_IoT.ReadTemperature(AnalogPin.P0))
})
get pm2.5(μg/m³)
basic.forever(() => {
basic.showNumber(Environment_IoT.ReadPM25(DigitalPin.P11))
})
get pm10(μg/m³)
basic.forever(() => {
basic.showNumber(Environment_IoT.ReadPM10(DigitalPin.P12))
})
get soil moisture, Value Range: 0~100.
basic.forever(() => {
basic.showNumber(Environment_IoT.ReadSoilHumidity(AnalogPin.P3))
})
get wind speed(m/s)
basic.forever(() => {
basic.showNumber(Environment_IoT.ReadWindSpeed(AnalogPin.P4))
})
MIT
- for PXT/microbit (The metadata above is needed for package search.)
environment=github:elecfreaks/pxt-environment
iot=github:elecfreaks/pxt-environment