This project is designed to be used as a low cost IOT solution for monitoring laboratory environments and processes. It was originally developed for the central monitoring of -80°C lab freezers to ensure stored sample viability. This project can easily be extended for the monitoring of additional variables.
- Raspberry pi setup procedure/script
- Stack installation procedure/script
- Setup Docker container (IOT stack project may cover this if used)
- Detail security hardening procedure
Software
- OTA Updates
- Deep sleep between measurements for nodes
- Batch write to Influx and store during deep sleep
- Read battery level through analog input see here
Hardware
- Measure current consumption for accurate battery life estimation
- Complete CAD modeling of case for nodes
- Flash software to ESP using programmer tool. Be sure to include OTA updates in software as USB programming will be unavailable after assembly in current design.
- Assemble hardware as shown in Node wiring Schematic
- Configure WiFi using WiFiManager
- Verify assembly and deploy
- Flash OS and configure for boot from SSD
- Install needed software (see server software)
- Configure software
- InfluxDB
- Database creation
- Privileges
- Retention policy/Downsampling
- Grafana
- Privileges
- Alerts
- InfluxDB
- Harden security
- Verify and deploy
- Raspberry Pi
- SSD for storage
- If using Pi 4 be sure to use proper heat sink such as Flirc
- SSD for storage
- Python 3
- IOT stack project
- C/C++
- Written using PlatformIO
- Libraries
- InfluxDB Arduino Client
- OneWire
- DallasTemperature
- WiFiManager
Note: Resistors and capacitors not included. See Node Wiring Schematic for additional components required.
Name | Link | Price | Quantity |
---|---|---|---|
K-type Thermocouple | Amazon | $13.80ea | 1 |
ESP-12F WiFi Serial Module Microcontroller 802.11N Module Wireless Transceiver | Amazon | $2.20ea | 1 |
Programmer Tool ESP8266 Adapter Socket for ESPRESSIF ESP-12S ESP-07S Module | Amazon | $25.99 | 1 |
Thermocouple Amplifier MAX31850K | Adafruit | $14.95 | 1 |
MCP1700-3302E/TO Low Dropout Linear Regulator 3.3V out | Digikey | $0.37 | 1 |
18650 3400mAh LI-ION Battery | Orbtronic | $12.99 | 1 |
BATTERY HOLDER 18650 | Digikey | $2.94 | 1 |
The Raspberry Pi acts as the central server, and is assigned a static IP for ease of connection. The server may be connected to the LAN (Local Area Network) via a router or direct Ethernet connection. The ESP nodes may or may note reside on another subnet of the LAN. The nodes will access the server via direct IP address. The Pi server may write to local memory or an attached USB drive. Backups may be desired to ensure data integrity depending on the value of the data. (Although if SSD is used for the Pi data corruption is highly unlikely.) This can be done for example using cron jobs and rsync or another preferred method to backup to additional hard drive or NAS (Network-attached storage).
From a high level perspective the node software consists of 3 stages. First, the node reads the sensor data and stores to the RTC memory so that the data persists through deep sleep. Second, the node enters a deep sleep state to minimize power consumption. Lastly, the node batch uploads the stored sensor data to the server. Power consumption during each stage should be minimized, only powering the necessary components at each stage of the process. The modem should be switched off when not pushing to the server. At each stage in this process there is room for customization of the software. For example, the amount of sensor read/sleep cycles between batch uploads will depend on the RTC memory capacity and the size of data being stored. The desired time between measurements will depend on the desired resolution of data and desired battery life of the node. Multiple measurements may also be recorded and averaged during the read stage to improve data accuracy.