Micro:bit Sound Meter!

by Elenavercher in Teachers > 3

2099 Views, 5 Favorites, 0 Comments

Micro:bit Sound Meter!

FKXPO6PKUPIYGBX.jpeg
Micro:bit sound meter!🌈💡✨

We created a sound meter with a LED strip and the micro:bit so that the students would know if they were using the adequate level of voice.

In a collaborative classroom, it is important to keep the volume to the stablished level so that everyone will be comfortable. For example, if we are working in teams, we should be speaking in a voice tone so that everyone in the team will listen to us, but at the same time that the other students in the team next to us will be comfortable speaking among them. That is why we created the micro:bit sound meter about the voice levels chart.

Supplies

microbit.png
FDEKENGKUPIYFS4.png

As seen in the pictures:

- Micro:bit V2

- Addressable led lights (WS2812E)

- Printed voice level chart

Define the Voice Levels Using the Micro:bit V2 Microphone

IMG_2996.JPG
IMG_2997.JPG
IMG_2794_censored.jpg

Using the micro:bit V2 microphone, we can decide the minimum and maximum values of each voice level. We explain the students that the minimum value will be 0 and the maximum 255.

  1. First, use an input block to detect the voice level: When button A is pressed.
  2. After this, use one of the basic blocks to show a string.
  3. Fill the string with the input block "Sound level".


And try it! :)


Here is an example of a possible code: https://makecode.microbit.org/_d5sMFFH67Xkm

Code the Micro:bit Using MakeCode

IMG_2998.JPG

Now is the time to code the micro:bit with the values we have decided using boolean conditionals and the Neopixel library.

  1. On start, set the strip to the pin you will be using and also the brightness of the LED lights (I usually use 100 as the maximum brightness).
  2. Forever:
  • Add a plot bar graph of the sound level up to the maximum voice value we will be using (For example, 80).
  • Add a condition for each sound level:
  • If sound level is higher than 80, then turn the strip colour to violet and pause for one second.
  • If sound level is lower or equal to 80 and higher or equal to 60, then turn the strip colour to blue and pause for one second.
  • If sound level is lower or equal to 59 and higher or equal to 30, then turn the strip colour to orange and pause for one second.
  • Else, turn the strip colour to white.

Here is an example of the code created by our students: https://makecode.microbit.org/36132-67695-49271-89748

Create the Voice Level Chart Using Canva

IMG_7217_censored.jpg
IMG_2995.JPG

Using Canva, we will design the posters for every voice level and place it in our classroom.

Now, get ready for some quiet time!✨✨✨