The goal of this arduino project is to create an IoT Device which measures the distance and uploads data over The Things Network to the OpenSenseMap. Between measurements the microcontroller goes into deep sleep. The focus lies on an low power consumption solution, so the sensor is able to measure data over several months.
For measurement, this script supports two ways of communicating with an ultrasonic distance sensor:
TTGO ESP32 LoRA: The first approach happened with an TTGO ESP32 LoRa board. However the power consumption of the board during deep sleep is too high (10mA). Furthermore the sensors always drained power (even during deep sleep), but this could be solved by powering the sensor with a GPIO Pin.
-> see subfolder TTGO-ESP32-Ultrasonic.
HelTec CubeCell: As a result of the high power consumption during deep sleep a Heltec CubeCell microcontroller is used, which should need 2µA during deep sleep.
-> see subfolder Heltec-CubeCell-Ultrasonic.
Whatever microcontroller or ultrasonic sensor is used, the backend setup is the same.
Cayenne LPPhttps://ttn.opensensemap.org/v3. It is important to enable 'Uplink message'. The remaining fields can be left out (See here).distance, Unit: mm and Type: ultrasonic.Cayenne LPP (beta) as 'Decoding Profile'. Furthermore add your 'TTN Application-ID' and 'TTN Device-ID' from your TheThingsNetwork application.Illumination (to support floats with uint16) and if not already set, the 'Cayenne LPP Channel' to 1.This step depends on the microcontroller you are using. Please refer to the corresponding readme files:
You are more than welcomed to contribute to this project by trying out other microcontroller or share your experience :)