Connect whistle chip to snap:bit

Shows how to connect the whistle chip (WC) to snap:bit as an alternative to the speaker for playing music from the micro:bit.
Connect whistle chip to snap:bit
Build the circuit shown on the diagram above.

Download the code shown below to your micro:bit. Use the "Download" link at the bottom of the embedded code editor.
After downloading the code, disconnect all cables from your micro:bit. Both the USB and the battery pack must be disconnected from the micro:bit.

In the previous project you have seen how to connect the speaker to snap:bit to play music from the micro:bit. You can replace the speaker with the whistle chip. It works the same way as the speaker. The whistle chip (WC) must be connected across snap 0 and either the 3V or GND snap of the snap:bit.

When you close the slide switch (S1), the Battery Holder (B1) powers the snap:bit through the 3V snap and the micro:bit turns on. The “on start” event triggers and the micro:bit plays the melody. The sound is modulated as a current through snap 0, which goes through the whistle chip and makes it play the sound.

In fact, you will hear louder sound from the whistle chip than from the speaker. This is because the current from pin 0 of the micro:bit is weak. The micro:bit is designed to play music to headphones, not to loudspeakers. The speaker has a higher resistance than the whistle chip. Therefore, the sound from the whistle chip is louder.

Minimal whistle chip connection

Just like the speaker, you can connect the whistle chip directly across the 0 and 3V snaps on top of the snap:bit without any additional wires.

minimal whistle chip connection

This minimal setup is very useful when experimenting with the code and the micro:bit is connected to the computer. This way you can have just the snap:bit with the whistle chip next to your computer without any additional components.