Decibels (max level per minute)
Movement (movement yes/no in the last minute)
- Paradox PDX-525DM motion sensor
SHT31 temperature/humidity sensor
SenseAir S8 CO2 sensor
WENSN1361 decibel meter
https://www.ebswift.com/reverse-enginee ... l-usb.html
All the code is in Python built into class libraries, I've started developing a lot of the code in c# but for now the Python version is running rock solid so it won't be changing for a while. Logging (every minute) is sent to Google Sheets, and a dashboard self updates with last recorded values, along with the reported IP address for the unit. I run a watchdog that will reset the unit if the python app fails and I implement timeouts on functions that can hang. After the sheet max's out after a few months it automatically emails a list of recipients stored in a sheet cell on the dashboard for the unit with an attached excel file of the log and clears the online sheet so it can resume logging.
The dashboard has a dropdown for sending remote commands to the units where I don't have direct access, like inside a remote corporate network. I can tell an individual unit to update the codebase, it will download all the code files from Google Drive. Changing a timestamp on Google Drive triggers all units to automatically grab the new code base and reboot. I can tell a unit to reboot remotely, and clear the log data. I can also tell it to run a custom shell script, I save the script to Google Drive, it downloads it and runs that specific script. The custom script can perform any operation, I can do things such as telling it to upload a log file back to Google Drive or make it update a particular module. The dashboard runs a timer script that checks the health of units automatically (have they reported data recently?) and grabs the latest recorded data for a snapshot overview. The dashboard is secured with sharing so I can let people view it but they can't control the remote unit.
I designed the case in Autodesk Inventor with the final print done on the Intamsys Funmat HT. Chamber temperature set to 70 degrees C was critical for the box so it wouldn't warp as it built up (ABS print). This is the second case version, the first was done in Blender which was pretty challenging. Inventor is much easier for case design in my opinion. I use a 12V supply for the motion sensor and regulate it down to 5V (generic AliExpress regulator) for the Raspi.
The research will be to assist sleep studies (as in environmental factors that might affect sleep) and room comfort monitoring. It took a very long time to get it to the point where it could run non-stop without some kind of reboot intervention, these things truly do not stop now unless they lose power - then they come right back up and keep going when they get power back. They are robust against connection loss, they keep logging locally until the connection comes back, then they will catch up whatever data they are behind onto the online sheet and resume logging normally. I actually execute a remote GAS script to get the sheet line count as there isn't an efficient remote client way of doing that especially as you hit a couple of hundred thousand rows.
Dashboard: Recorded Log - Note the SenseAir has been offline for a while so it is slowly self-calibrating at this point, right now with nobody in the office it is reporting a solid 400PPM CO2: Inside of the unit, minus the WENSN board: