Firmware for the Twomes Room Monitor Module.
This firmware is designed to run on the ESP32 of the Twomes Temperature Monitor hardware, connected with the Twomes CO₂ Monitor Shield hardware which contains two primary sensors:
The ESP32 reads various properties of these sensors, and stores them in RTC fast memory, to preserve them during the deep sleep interval between brief moments when the ESP32 needs to be awake for data acquisition. After a series of 20 measurements at fixed time intervals, the ESP32 will send the series of measurements to the Twomes P1 Gateway measurement device using the ESP-NOW protocol.
Via the Twomes P1 Gateway measurement device, the Twomes Room Monitor Module sends the following properties to the Twomes server:
Sensor | Property | Unit | Printf format | Measurement interval [h:mm:ss] | Description |
---|---|---|---|---|---|
SCD41 | CO2concentration |
ppm | %d | 0:05:00 | CO₂ concentration |
SCD41 | humidity |
%RH | %d | 0:05:00 | relative humidity |
SCD41 | roomTempCO2 |
°C | %.1f | 0:05:00 | air temperature |
Si7051 | roomTemp |
°C | %.1f | 0:05:00 | air temperature |
After deploying and installation in the home, the Twomes Room Monitor Module should be paired as a satellite to the Twomes P1 Gateway measurement device.
This section describes how you can deploy binary releases of the firmware, i.e. without changing the source code, without a development environment and without needing to compile the source code.
To deploy the firmware, in addition to the generic prerequisites for deploying Twomes firmware, you need:
- a 3.3V TTL-USB Serial Port Adapter (e.g. FT232RL, CP210x, etc..), including the cable to connect ths adapter to a free USB port on your computer (a USB to miniUSB cable in the case of a FT232RL);
- You need to place a 3.6V Lithium AA-battery (e.g. SAFT LS14500) in its holder to power the board, as the Twomes Room Monitor Module is not powered via the 6 pin programming connector.
- Find a row of 6 holes holes (J1 in the corner of the PCB of the Toom Monitor Module), find the
GND
pin (see bottom of the PCB), alighn the 6 pins of the serial port adapter such thatGND
and other pins match; then connect the serial port adapter to your computer and connect the 6 pins of the serial port adapter to the 6 holes on the PCB.
- Download the binary release for your device and extract it to a directory of your choice.
- Follow the generic Twomes firmware upload instructions , with the exceptions mentioned below:
- When you see the beginning of the sequence
Connecting ......_____......
, press and hold the button labeledGPIO0 (SW2)
on the PCB, then briefly press the button labeledRESET (SW1)
. - You should see an indication that the firmware is being written to the device.
- When the upload is finished, view the serial output with a serial monitor tool like PuTTY or the utility of your IDE (115200 baud). Press
RESET (SW1)
shortly to make sure the firmware boots. - Remove the battery or insert a battery insulating pull tab when you do not plan to use the room monitor module immediately, to prevent unnecessary battery drain.
- When you see the beginning of the sequence
This section describes how you can change the source code using a development environment and compile the source code into a binary release of the firmware that can be depoyed, either via the development environment, or via the method described in the section Deploying.
Please see the developing section of the generig Twomes firmware first. Reember to presse buttons to upload the firmware:
- When you see the beginning of the sequence
conecting ......_____......
, press and hold the button labeledGPIO0 (SW2)
on the PCB, then briefly press the button labeledRESET (SW1)
shortly. - You should see an indication that the firmware is being written to the device.
List of features ready and TODOs for future development.
Ready:
- Pairing with Twomes P1 Gateway measurement device
- Measure temperature using the Si7051 sensor
- Measure CO₂ concentration, relative humidity and temperature using the SCD41 sensor
- Deep sleep between data acquisition for ultra-low power consumption
- Send measurement data to the paired Twomes P1 Gateway measurement device using ESP-NOW
To-do:
- Align indication of status and error via LEDs with other measurement devices.
Project is: in Progress.
This software is available under the Apache 2.0 license, Copyright 2021 Research group Energy Transition, Windesheim University of Applied Sciences
This software is a collaborative effort of:
- Sjors Smit · @Shorts1999
- Fredrik-Otto Lautenbag · @Fredrik1997
- Gerwin Buma · @GerwinBuma
- Werner Heetebrij · @Werner-Heetebrij
- Henri ter Hofte · @henriterhofte · Twitter @HeNRGi
Thanks also go to:
- Maarten Vermeulen · @m44rtn
- Tristan Jongedijk · @tristanjongedijk
- Laurens de Boer · @Laurenz02
Product owner:
- Marco Winkelman · @MarcoW71
We use and gratefully acknowlegde the efforts of the makers of the following source code and libraries:
- ESP-IDF, by Espressif Systems, licensed under Apache 2.0 License