Octopus Electronic Bricks! You can use them build electronics projects just as easy as piling bricks! By using Octopus electronic bricks, you may connect Arduino or compatible boards easily with various digital, analog and I2C/Uart interfaces. These breadboard-less firm connections includes an extensive collection of modules like potentiometers, sensors, relays, servos, and even buttons. Just plug and play!
Octopus Analog Noise Sound Sensor Detection Module is a sensor module based on a MIC sound sensing element. The sensor is particularly sensitive to sound intensity, and it can be used to detect ambient sound level.
Connect the sound detection sensor module to P1 port on OCTOPUS:BIT.
Click Advanced in the code drawer of MakeCode.
To program for the sound detection sensor, we have to add a package. Find Add Package in the bottom of code drawer and click it. This will pop up a dialogue box. Search "IOT" in the box and click to download this package.
You can see the whole program from the link here
When any sound was detected by the sensor, micro:bit will display the decibel value on the screen.