Humidity Meter - With a SHAKE!

Introduction: Humidity Meter - With a SHAKE!

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

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Things Used in This Project

Hardware components

Software apps and online services

Step 2: Story

About this project

Using the Micro:bit & xChips, assembly of this humidity meter is effortless. Coding is a piece of cake with the blocks software too! This project can be completed in under 5 minutes.


I built this humidity meter using the Micro:Bit and a couple of xChips from XinaBox. The XinaBox technology made this project extremely easy to do by eliminating the need for soldering and extra tools. The Micro:bit interface allows me to program easily. This project is an adaption of my previous Micro:bit Temperature Monitor project, showcasing another application of the SW01 sensor.

Step 3: Assemble the Circuit

  • Click the OD01 and SW01 together using an xBUS connector (from the XC10 pack).

Figure 1: Connected OD01 and SW01

  • Click 2 xBUS connectors to the left side of the IM02 then click on the connected SW01 and OD01. Make sure that the xChips faces the same way up, so you can see the SW01 name and the IM02 name both facing up.
  • Use another xBUS connector to connect the MD01 to the PB04. Set aside the connected PB04 and MD01 with 3 xBUS connectors and the AA batteries.
  • Click the Micro:Bit into the IM02. Make sure the LEDs faces up - same way as the SW01 name and the IM02 name.

Figure 2: Connected OD01, SW01, IM02 and Micro:bit

  • Attach a Micro-USB connection from your computer to the Micro:Bit. Notice the yellow LED on the bottom side turning on.

Step 4: Install Package

  • Open a browser and go to
  • Scroll down to "Advanced"
  • Then Scroll down to "Add Package"

Figure 3: Finding "Add Package"

  • Search for "weather" and click on "weather-bit" to add the package
  • Repeat points 2 and 3
  • Then paste this URL into the search bar : then click on OD01 to add the package

Figure 4: Adding the packages

  • You now have all the necessary packages.

Step 5: Programming

  • Drag and drop code elements until you get something that looks like the image below.

Figure 5: The code in Blocks

  • You can also cheat and click on the "{ } JavaScript" button on the top and simply copy and paste the code into the code section below. Click on "Blocks" again to see the result.

Step 6: Compile and Test

  • Click on "Download"
  • Drag the downloaded file, typically named: microbit-Untitled.hex, to your Micro:Bit drive, typically name: MICROBIT.
  • You should see the "X" on the rolling LED display on the Micro:bit and the string "Humidity Project" on the OLED screen on the OD01
  • Shake the unit. The Humidity reading should show as seen below. If it does then your project is working.

Figure 6: First Reading

  • Press button "A" on the Micro:bit to receive a humidity range. As seen below. The ranges are: "DRY" - when relative humidity is below 30%; "Moderate" - when relative humidity is above 30% but below 70% and "HUMID!!!" - when relative humidity is above 70%

Figure 7: Humidity range example

  • If it doesn't show appropriately, retrace your steps to pick up the mistake.

Step 7: Complete Temperature Monitor

  • Disconnect the Micro:bit from the Micro-USB connection.
  • Insert the AA batteries into the PB04
  • Use the 3 xBUS connectors to connect the PB04 and MD01 to the IM02and SW01 as seen in the picture below.
  • Turn the switch on the PB04 on.
  • Now your Micro:bit humidity meter is portable and ready to be placed/used wherever you choose.

Step 8: Code

Micro:bit Humidity Project Code JavaScript
It is JavaScript code that can be converted into blocks using the 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) {
    } else {
    if (Humidity > 70) {
    } else {
input.onGesture(Gesture.Shake, () => {
    # . . . #
    . # . # .
    . . # . .
    . # . # .
    # . . . #
OLED.init(64, 128)
OLED.showString("Humidity Project")
Humidity = weatherbit.humidity() / 1024

Be the First to Share


    • Magnets Challenge

      Magnets Challenge
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest