/hygge

Arduino-based humidor temperature and humidity monitoring system.

Primary LanguageC++Apache License 2.0Apache-2.0

hygge

NOTE: This readme requires an update that I'm too lazy to do at the moment. Overall project remains the same, hardware selection has changed, as has the message format.

IMPORTANT: Because I'm a licensed ham radio operator, and the LoRa radio is operating at 433 MHz, in accordance to FCC regulations for amateur radio broadcasts, the message format remains plain-text and contains my callsign. It does contain an HMAC digest for the purposes of validation, and to mitigate abuse.

Arduino-based humidor temperature and humidity monitoring system.

I am a nerd who enjoys cigars, and this is my fun project, so expect it to be both hacky and over-the-top.

This is being developed in multiple phases:

  1. A thing that lives inside the humidor. Open the humidor to see the humidity.
  2. Two things that do the same work...
  3. A thing that lives inside the humidor, and sends periodic reports wirelessly.
  4. A thing that lives on a desk (or wherever), receives the reports, and displays the values.
  5. Three things that are collectively overengineered.
  6. A thing that lives inside the humidor, and sends periodic reports wirelessly.
  7. A thing that lives...somewhere, is network-attached, receives the reports, and stores the values in a time series database (probably influxdb).
  8. A thing that lives on a desk (or wherever), periodically queries Thing-3.2's time series database, and displays the values.
  9. A web app, probably just Grafana, served by Thing-3.2, providing improved visualization of the data, including an over-time view to see how well the humidor is performing.
  10. Supplement Things-3.x with an additional monitor just outside the humidor so that we have an inside/outside metric for humidor performance. (e.g. it does well until outer humidity drops below 20%RH, when it starts to struggle, or whatevs.)

Phase 1 - Thing-1

Thing-1 has already been developed, and consists of two components (less the USB travel battery currently powering the thing):

  1. For the processor board, I chose the MagTag by Adafruit, because of its forward compatibility with my goals.
  2. For the temperature and humidity sensor, I chose the Adafruit SHTC3 breakout board, because I had one on hand. For the next hardware iteration, I will switch to the Adafruit SHT31-D breakout.

Phase 2

Qi power, magnet mounts, 433 LoRa...

Appease the FCC...

...with documentation of the wireless protocol that I'll be using.

Modulation

Let it be known that LoRa:registered: is a registered trademark of LoRa Alliance. I'm stating this here to avoid potential issues by not appending ®️ to every mention of the term, because I'm lazy and don't like dealing with lawyers.

Transmitted data will use the very efficient, proprietary LoRa modulation on 433MHz between +0dBm and +20dBm, most likely using a Semtech chipset.

Data Format

UPDATED FORMAT: W4PHO|1|338d4cef|26|39.75|21.27|4.17

  1. Callsign
  2. Message Type
  3. HMAC Digest
  4. Packet Sequence
  5. % relative humidity
  6. Temp (C)
  7. Batt Volts

TODO: Move this piece to its own repository.

Because I use LoRa for multiple purposes, I'm formalizing both my message encapsulation scheme, as well as the specific message definition for this piece of the project.

Message Encapsulation Format (MEF)

All of my wireless messages follow the following format:

Name Description Byte Length
Callsign Amateur radio callsign in plaintext. Case-insensitive 4 - 6 bytes
Message Type Message type 2 bytes
Data Message payload 1 or more bytes
  • Message type, for the purposes of this project, is 0x02
  • Overall MEF message length should be as short as possible, and not exceed a total of 255 bytes.

Message Type 0x02

Name: Temperature and Humidity Format: two 32-bit floats, little endian; the first is temperature, and the second is humidity.