Skip to content
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

Loudness sensor, Lotus / Grovepi and signal quality #46

Open
dothebart opened this issue Feb 25, 2018 · 2 comments
Open

Loudness sensor, Lotus / Grovepi and signal quality #46

dothebart opened this issue Feb 25, 2018 · 2 comments

Comments

@dothebart
Copy link

I'm using the Loudness sensor to detect environmental volume.
I've started using it with the groovepi, via python from the raspii to monitor the environment continually. I've noticed that it doesn't reliably deliver a good signal so I started digging deeper.

I found that the Lotus is really compareable to the grovepi, so I wanted to retry with it, put a usual level converter to attach it to the Raspi I2C, and it worked with the grovepi firmware. However, the values delivered from the loudness sensor were even less reliable.

I've retried using the lotus alone with usb attached to a host and the values output would be reliable. But, even once I would connect the i2c (without even using it) the values would become unreliable again.

When I simply attach a pot to the analog in to the lotus or the grovepi it will give reliable values..

So, my assumption is, that the digital i2c couples into the loudness sensor and voids its values. Please advise whether there is an easy way to fix the sensor.

@KillingJacky
Copy link
Contributor

KillingJacky commented Feb 27, 2018

Hi, could you please post the sensor readings for both reliable and unreliable?

But, even once I would connect the i2c (without even using it) the values would become unreliable again.

This is really weird, leaving the I2C bus idle means the I2C will not introduce any noise into the power circuit.

@dothebart
Copy link
Author

Since the grove pi contains lots of code, I'm using this simple sketch on a lotus:
https://github.com/dothebart/sketches/tree/master/loudness
its squaring the current values, to calculate the RMS later on, which it does in 0.1s steps over 1s.
In column 1 we have the current value measured at that very time, the second value is the RMS over the last second.

I've measured a silent environment:

noise:9409:6943
noise:6400:7249
noise:7921:7252
noise:6889:7409
noise:7569:7166
noise:7921:7140
noise:5776:7139
noise:7396:7382
noise:7569:7071
noise:7396:7146
noise:6084:7120
noise:7569:7355
noise:8281:7022

single: 5776 - 9409; Avg 1s 6943 - 7409
delta 3633 ; 466

i2c plugged in:

noise:7744:6946
noise:6889:7616
noise:9604:7117
noise:4900:8132
noise:9216:7677
noise:6561:6883
noise:6561:7494
noise:2809:7619
noise:6889:7398
noise:7569:8047
noise:4761:7308
noise:9604:7541
noise:7744:7462
noise:8100:7140
noise:8464:7707
noise:7744:7464

Single: 2809 - 9604; Avg 1s 6883 - 8132
Delta: 6795 ; 1249

So you see that the range of the values are quiet different once i2c is plugged in; While the RMS in the disconnected state narrows in very well, it even spreads with i2c connected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants