Skip to content

tinkertanker/pxt-iot-environment-kit

Repository files navigation

environment

Environment and Science IoT package is developed under the cooperation of ELECFREAKS, CLASSROOM and TINKERCADEMY.

The ELECFREAKS Environment and Science IoT Kit can detect all kinds of environment data like temperature, humidity, wind speed, light intensity, noise, dust, and PM2.5 level. In addition, you can upload these environment data to the Thingspeak IoT server (free registration required), using the ESP8266 serial wifi module.

Hardware list

  1. ELECFREAKS Octopus:bit.
  2. IIC OLED display
  3. Sound Sensor
  4. Octopus Temperature And Humidity Sensor
  5. Octopus Soil Moisture Sensor
  6. Octopus Analog Photocell
  7. Dust Sensor
  8. PM2.5/PM10
  9. Win Sensor
  10. ESP8266 Serial Wifi Module

Basic usage

  1. Open Microsoft Makecode/microbit and create a new project
  2. Search and add the environment package
  3. Use the Environment_IoT drawer in the editor to drag out and arrange the blocks
  4. Click Download to move your program to the micro:bit

Example

dust sensor init

Initialize dust sensor. Set pin vLED and VO.

Environment_IoT.initdust(DigitalPin.P10, AnalogPin.P1)

read dust

get dust(μg/m³)

Environment_IoT.initdust(DigitalPin.P10, AnalogPin.P1)
basic.forever(() => {
    basic.showNumber(Environment_IoT.ReadDust())
})

read temperature

get DHT11 Temperature(℃)

basic.forever(() => {
    basic.showNumber(Environment_IoT.ReadTemperature(AnalogPin.P0))
})

read PM2.5

get pm2.5(μg/m³)

basic.forever(() => {
    basic.showNumber(Environment_IoT.ReadPM25(DigitalPin.P11))
})

read PM10

get pm10(μg/m³)

basic.forever(() => {
    basic.showNumber(Environment_IoT.ReadPM10(DigitalPin.P12))
})

read soil moisture

get soil moisture, Value Range: 0~100.

basic.forever(() => {
    basic.showNumber(Environment_IoT.ReadSoilHumidity(AnalogPin.P3))
})

read wind speed

get wind speed(m/s)

basic.forever(() => {
    basic.showNumber(Environment_IoT.ReadWindSpeed(AnalogPin.P4))
})

License

MIT

Supported targets

  • for PXT/microbit (The metadata above is needed for package search.)
environment=github:sunnyrainwss/pxt-iot-environment-kit
iot=github:sunnyrainwss/pxt-iot-environment-kit