My goal is to collect data over a larger distance than achievable with protocols like Wifi. I need a large amount of nodes and I also want to power the senders with batteries for the simple reason I do not have electricity where I want to collect data. The object I want to monitor is a big farm with distances over 1 Km.
In short I need:
However: first I need a proof of concept, and I just finished step one: sending data from a DHT22 sensor over LoRa to another LoRa board. The maximum distance I measured was 700 meters, a promising start.
I have recently bought two TTGO LORA32 V2.0 433/868/915 mhz ESP32 LoRa OLED 0.96 inch Sd-kaart Blue Display ESP-32 WIFI Bluetooth Modules at Aliexpress. I have also bought two LoRa32u4 boards from bsfrance.fr which I have not been able to get to work.
This instructable will enable you to make a simple proof of concept, but is far from finished as you can read below.
First you need to add "https://dl.espressif.com/dl/package_esp32_index.json" to File > Preferences > additional boards in the IDE. You can separate several entries with a comma.
I have uploaded the default "receiver" sketch with the Arduino IDE to one board.
I have adapted the default "sender" sketch to allow readings from de DHT22 sensor
The pinout is simple:
Load the sketch in to the Arduino IDE, select your board (TTGO LoRa32-OLED V1 (appearently V2 is not yet available, but this worked for me)
Select your USB (com) port, compile and upload.
Succes!!! On powering up I see the data coming in on the OLED of the receiving board.
Some remarks:
I have used the "SimpleDHT" library to connect the DHT to the board.
I can not use the ESP32 DHT library. The examples are way over my head; I am not a very good programmer.....
All sketches are included in this Instructable.
I am running into a few problems:
- SOLVED: The board keeps rebooting when the sensor is connected at powering up. Powering up and connecting the sensor to the 5v pin of the boards works. I solved this by switching the DHT data cable from pin 12 to pin 25
- How can I implement deep sleep to enable to nodes to run for many months on one battery?
- How do I get the data into the database of e.g. Domoticz? I suppose I need some sort of a gateway for that...
- It is irritating me that I can't get the LoRa32u4 II boards working.... In short: the proof of concept works, but there is much to be done. Any help or advise is greatly appreciated...