Skip to main content
Birger TMaster Builder
Wannabe Engineer
Asked a question 2 years ago

Arduino programming knowledge needed for better Otto reaction on noise sensor. Because in Arduino you will get the noise level only in that moment when an analogRead is executed. With the AVR it's possible to make the analog readings automatically and store the values somwhere. My idea is to implement the automatic analog read for the noise sensors input and store the maximum and the minimum level. An Otto functioncall could read and return these min- & max- values and reset them. So it would be possible to detect a noise event also after these many blocking gesture functions. Is there anybody out there, who could program this?

Camilo Parra Palacio Otto Creator
So you mean like an automatic calibration? it might be possible by using the EEPROM memory, maybe as a variable? https://www.arduino.cc/reference/en/language/functions/analog-io/analogread/
Birger T Master Builder
I didn't mean an automatic calibration - the AD converter should be programmed, so it generates an interrupt (ADC complete), the interrupt handler reads and stores the present value in a variable, comparing it to the last value and set a max- and a min- variable too.

In the Otto sketch (as a Lib function?!) you can read these stored values whenever it's possible. when reading these values the min- and max- variables must be reset so the ADC complete interrupt handler will process them again..and so on.

Then - I have found something else - look at the end "Detail and Caveats"
https://www.arduino.cc/en/Tutorial/Foundations/AnalogInputPins
It explains why the analog value of the noise sensor is jitter while the Mouth matrix get updated..

For more content join our community, sign up and become an Otto Builder now!