Components :
- Atmel ATMega3208
- Lora E5 SoC
- Sensirion SHT41
- IPX connector
- 100 nF capacitors
- 10 uF capacitors
- 10k Ω resistors
- 22 Ω resistors
- pin headers for debugging, flashing
Software:
- MegaCoreX - environment for Arduino compatibility (Serial, Wire, Interrupts)
- Sensirion I2C SHT4X library - SHT41 sensor data reading
- Platformio - development, flashing ATMega
This project assumes, that credentials were configured by Serial Lora E5 AT Commands (DevEUI, AppKey) before flashing the project code.
Flow:
- Should be in a range of some nearest LoraWAN Gateway (can look on TTNMapper)
- Power on the device with 3.3 V (2x AA or 2x AAA batteries) connected to VCC and GND pins (look at board schema, SV1 blue line GND down, red line VCC)
- The device will try to OTA join configured LoraWAN network
- Broadcast data packet (temperature, humidity, voltage)
- 2.5 minutes sleeping (configured for DR5, spread factor 7, make sure to not violate ETSI regulations or TTN fair access policy. Should be calculated before use)
- Back to step 4.
stateDiagram
[*] --> PowerOn
PowerOn --> Join
Join --> Measure
Measure --> SendPacket
SendPacket --> Sleep
Sleep --> Measure
Low power (250 µA measured in sleep)
- use AT+DR=DR5 (will work only if a gateway is close or open area without a lot of RF noise)
- use AT+POWER=2 (same above)
- other AT commands already used in code
TTN
Use this payload formatter for decoding. Weather data can be later processed with some TTN integration options (MQTT, webhooks...)
From personal testing, the sensor could transmit for 4 months on 2x AA batteries with default settings (DR5, AT+POWER=2)
Photos of setup:
Soldered by hand and hot air gun