The last sensor to work in is the Sound Detector Board. I am using the ENVELOPE output, which is an analog representation of the volume of detected sound.
I haven't actually given it a proper run-through yet but I'm confident it will work just fine.
The ADC reads about 20-30 in normal quiet workshop conditions.
Clattering a tool near the sensor on the bench shoots it up to about 100+. Loudly clattering the tool intentionally can easily spike 150+.
I don't see any reason the same treatment for other sensors won't work - regularly read values into a ring buffer and calculate a dynamic threshold to use based on the standard deviation of readings. Slower, more gradual changes will be ignored but sudden changes will trigger the Peril-detection part of the code.
This is the last sensor to fiddle with; I think the sensor suite is complete now with:
- GSR (Galvanic Skin Response) sensor
- Sound Sensor
- Ambient Light Sensor
- Accelerometer (including freefall detection)
Peril will detected either reactively or pre-emptively based on the readings from these sensors.