Brittany Bull
Published © MIT

Humidity Meter - With A SHAKE!

Super simple yet fun humidity project. Easy assembly and programming, you'll be ready to shake in 5 minutes.

EasyFull instructions provided5 minutes183
Humidity Meter - With A SHAKE!

Things used in this project

Hardware components

XinaBox IM02
×1
OD01
XinaBox OD01
×1
MD01
XinaBox MD01
×1
SW01
XinaBox SW01
×1
PB04
XinaBox PB04
×1
BBC micro:bit board
BBC micro:bit board
×1
AA Batteries(generic)
×2
XC10
XinaBox XC10
×1

Software apps and online services

pxt.microbit.org
micro:bit pxt.microbit.org

Story

Read more

Code

Micro:bit Humidity Project Code

JavaScript
It is JavaScript code that can be converted into blocks using the makecode.microbit.org webpage. This code allows you to measure the humidity levels with the circuit built in the above tutorial. It can easily be adjusted to your own preferences within the parameters allowed in the micro:bit software
let Humidity = 0
input.onButtonPressed(Button.A, () => {
    if (Humidity < 30) {
        OLED.showString("DRY")
    } else {
        OLED.showString("Moderate")
    }
    if (Humidity > 70) {
        OLED.showString("HUMID!!!")
    } else {
        OLED.showString("Moderate")
    }
})
input.onGesture(Gesture.Shake, () => {
    OLED.showString("Humidity")
    OLED.showNumber(Humidity)
    basic.pause(100)
})
basic.showLeds(`
    # . . . #
    . # . # .
    . . # . .
    . # . # .
    # . . . #
    `)
OLED.init(64, 128)
weatherbit.startWeatherMonitoring()
OLED.showString("Humidity Project")
Humidity = weatherbit.humidity() / 1024

Credits

Brittany Bull

Brittany Bull

4 projects • 4 followers
A student exploring the world of coding and IoT from a beginners' perspective
Contact

Comments

Add projectSign up / LoginAbout BBC micro:bit