-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Something odd about the Sound values on Enviro Urban #98
Comments
That's something I've also been wondering about, and haven't had the time to investigate. Looking at my logs, taken from recordings every 15 minutes, I have 3,495 total readings, of which 3,489 are at 1.50, five at 1.51, and a single case of 1.56. |
OK, looking at the code from https://github.com/pimoroni/enviro/blob/main/enviro/boards/urban.py the code block for sound is this:
Looking at it, the min_value and max_value are set to 1.65. I'm wondering if the minimum value comes out at around .15, and the max never gets high enough to replace the initially set value. I'm fairly sure that the 1.51 (& 1.56) values are to do with the problems with rounding floating numbers in micropython. |
I also wonder if the |
Great work! Just for giggles to see what happens, I've initialized Shall report back once the real-world readings come in. |
It can't be this, as an average would add them and then divide them. |
Nearly 3 days of readings taken every 15 minutes: 270 readings at 0.01, and single ones at 0.02 and 0.07. I'm based in the commutersville suburbs - quiet at night, and really not that quiet during the daytime :) |
Looking at another (temperature) project where they use a similar "formula to compute the voltage from a digital sample in 16 bits mode," they used: |
Had a look at this code, and @taisau is correct that the value line is wrong. It should multiply by 3.3, then divide by 65535 (or divide first then multiply). I have now pushed a fix for this to the It's currently the peak-to-peak voltage of the measured signal, which from checking the schematic is 10x what the actual microphone produces due to the onboard op-amp. It would be nice if the value was in decibels but I've not figured that out yet. Here's the datasheet if you wish to investigate: https://www.mouser.co.uk/datasheet/2/218/know_s_a0010769161_1-2271807.pdf |
There is a new release that fixes this issue: https://github.com/pimoroni/enviro/releases/tag/v0.0.9 |
I've just got an Enviro Urban too. Set it up outside yesterday, and the sound for the last 12 hours looks like this:
I'm taking readings every minute, and the only change is at 04:02 in the morning, and is only a difference of 0.01?
I think that there must be something wrong in the calculations here!
The text was updated successfully, but these errors were encountered: