This project will teach you how to make a chime that will play Jingle Bells whenever a door is opened. A great way to get into the festive season!
You’ll learn how to use the accelerometer on the micro:bit and the music modules to create and trigger a tune.
We’ll be using Makecode to programme the micro:bit.
- Connect the micro:bit to your computer using the micro USB cable.
- Upload the code to the micro:bit.
- Disconnect the micro:bit from your computer and power it with the battery pack.
- Attach the battery pack to the micro:bit using some Blu tack.
- Place it on the door. We used Blu Tack but you can also use double-sided tape etc..
That’s it! You should now have a festive moment every time you open or close the door.
- You can adjust the sensitivity of the accelerometer by changing the number on the if statement of the code. The closer the number is to 1024 the more sensitive the accelerometer trigger will be.
- You can load your own tune by entering the appropriate notes.