Project 06: Music Party

1. Overview
When we clap our hands, the microphone on the board picks up sound signals, and the speaker plays a cheerful birthday song while the RGB LED emits dazzling light.
2. Components
|
|
|
|---|---|---|
micro:bit board *1 |
micro:bit T-type expansion board *1 |
micro USB cable *1 |
|
|
|
red LED *1 |
220Ω resistor *3 |
jump wire *2 |
|
|
|
breadboard *1 |
battery holder *1 |
RGB card *1 |
3. Components Knowledge
Microphone
A high-quality digital microphone is integrated on the front side of the micro:bit V2 board to detect sound and audio signals. The chip that controls and processes the microphone is on its back.

The microphone is in a small round hole on the front of the board, which is convenient to capture surrounding sound signals. Just place the micro:bit board face up when using. Next to the hole is a microphone LED indicator. When the micro:bit measures sound levels, the indicator will light up.

RGB LED

RGB LED is imaged in the intersection of three primary colors (RGB): red, green and blue. Most colors can be synthesized by RGB in different proportions. The red, green and blue LEDs are packaged in a transparent plastic case to emit colors of light by changing the input voltage of R, G and B pins.

Trichromatic theory:

RGB LED can be divided into two types: common anode and common cathode:
In a common cathode RGB LED, the three LEDs share a negative connection (cathode);
In a common anode RGB LED, the three LEDs share a positive connection (anode).

Note: Herein, we provide a common cathode RGB LED.
RGB LED pins:
RGB LED boasts 4 pins: GND(the longest one), R(red), G(green) and B(blue). Place the RGB LED as shown below, pins from left to right are red, GND, green and blue.

4. Wiring Diagram


5. Code Flow

6. Test Code
The code file is provided in folder Project 06:Music Party, file Project-06-Music-Party.hex.

Load code blocks:

7. Test Result
After downloading the code to the board, when we clap our hands, the microphone on the board picks up sound signals, and the speaker plays a cheerful birthday song while the RGB LED emits dazzling light. Isn’t the music party in a happy and joyful atmosphere?
ATTENTION: If the wiring is correct but you cannot see the results, press the reset button on the back of the board.









