lancaster-university / codal-microbit-v2

CODAL target for the micro:bit v2.x series of devices
MIT License
43 stars 52 forks source link

Noise on the speaker on low battery power #323

Open microbit-carlos opened 1 year ago

microbit-carlos commented 1 year ago

When the micro:bit is battery powered and the batteries are low there is an audible noise on the speaker.

microbit-carlos commented 1 year ago

Note from @finneyj:

I just replicated and scoped the low frequency noise Jonny was talking about (the sound that is audible when no sound is playing, but only under battery power) There's a weak but constant 23.15Hz sine wave that's visible on the power lines under both battery and USB only about 14mV pp but sounds like a plausible source of the noise my guess is the FET we're using as an amp is picking up on this when under battery power as the ground is weaker in that case. using the "silencelevel" API does eliminate the noise at the expense of some audible clicks when the output PWM enables and disables