Water Bottle Signal with CHARGE Power Pack
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
- micro:bit (V1 or V2)
- USB cable
- Chromebook, laptop, or desktop
- CHARGE w/ wrist strap
- Water Bottle
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:
- Open makecode.microbit.org
- Basic drawer: add “show icon [heart]” to “on start”
- Change the heart icon to whichever icon you’d like, we’ll change ours to the duck.
- Input drawer: add “on shake” change shake to screen down.
- Basic drawer: add “show icon [heart]” to “on tilt”
- Change the heart icon to an X
- Input drawer: add “on button A pressed” and change button A to A + B
- Copy and paste the “show icon [duck]” into “on button A+B pressed”
- 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.
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: