Water bottle sitting on a table with a CHARGE for micro:bit attached to the front of it.

Introducing the Water Bottle Signal

Curious if someone else is using your water bottle? Set up your micro:bit to detect if someone takes a sip and only reset when you put in the secret code. Make it easy to attach your micro:bit to your bottle by using the CHARGE rechargeable battery pack.

What you need:

With CHARGE for micro:bit

Without CHARGE

  • micro:bit (V1 or V2)
  • USB cable
  • Chromebook, laptop, or desktop
  • power bank or battery pack
  • wrist strap, clips, or elastic bands
  • Water Bottle

Code your Water Bottle Signal:

  1. Open makecode.microbit.org
  2. Basic drawer: add “show icon [heart]” to “on start”
  3. Change the heart icon to whichever icon you’d like, we’ll change ours to the duck.
  4. Input drawer: add “on shake” change shake to screen down.
  5. Basic drawer: add “show icon [heart]” to “on tilt”
  6. Change the heart icon to an X
  7. Input drawer: add “on button A pressed” and change button A to A + B
  8. Copy and paste the “show icon [duck]” into “on button A+B pressed”
  9. Plug in your micro:bit, pair, download your code and test!

Or experiment with the finished code here:

Use the Water Bottle Signal:

Now attach the CHARGE and micro:bit to the front of your water bottle, turn on the CHARGE, and test it out! If you take a sip and the screen changed to an X, you know it worked! Now reset the micro:bit by pressing A + B at the same time.

Did the screen not change? Try adjusting screen down to match the direction your micro:bit tilts when you take a drink from your water bottle.

Demonstration of water bottle with the CHARGE for micro:bit attached, the micor:bit is displaying the duck icon and then being lifted out of frame, then set back onto the table with an X on the micro:bit. Then resetting the micro:bit to display the duck icon.

Make it better:

Can you make your reset code more secure? Think of other ways you could program it to reset! Maybe you want to send a message to whoever is drinking from your bottle, how would you communicate that?

Also Check Out:

See what else you can do with a micro:bit, CHARGE power pack, and water bottle by checking out this course: