Just finished the initial build and software for an environmental monitoring system for a computer room. It will use a DHT-22 for temperature and humidity, a Panasonic PIR for motion detection and a water leak detection circuit. The Photon inits everything including code which keeps the clock aligned with DST and the proper timezone. The temp/humidity, water status and motion status is also displayed locally on a 20x4 blue LCD screen.
A high and low temperature threshold is configured and if either of these conditions are met, a front-mounted LED (tri-color) turns red (normal state is green). The LED shows blue during the init phase. Emails are sent using native SMTP (no third-party providers needed) via smtp2go. Emails are currently sent every 15 minutes for the following conditions, as long as they exist:
- High temperature
- Low temperature
- Water leak
- Motion detection
The Panasonic PIR gives us about 15-18' of coverage. The water leak detection circuit is connected via a 15' cable with a plastic box that sits on the concrete floor below the raised flooring for the computer room.
All of the output if uploaded to Freeboard which has indicators for temperature, humidity, the last boot time, the last system reset reason (SRR), and indicator lights for high/low temp, water leak and motion. Another indicator light turns on if the unit doesn't check in at least every 30 seconds, which is 4-5 times the normal processing loop time.
A second unit will be built with two water detection cables so two different rooms can be monitor. I originally wrote code to allow the high and low temperature thresholds to be set via CURL using functions but since I can access the device through the cloud I can always update through the IDE.
I had originally included a piezo buzzer but since these systems are not in populated rooms there wasn't anyone to hear it.