Lora Soil Moisture Sensor
The Lora soil moisture sensor is an Internet of Things (IoT) solution based on Atmel's Atmega328P MCU, Lora module and AHT10. It is a Lora terminal node that can collect air temperature and humidity, and soil humidity data and transmit it to the Lora gateway. The soil moisture sensor, the user can use the Arduino IDE for programming, is very easy, especially suitable for non-programmers.
• Classic ATMEL AVR 8-bit Atmega328P.
• RAM: 2KBytes.
• EEPROM: 1Kbytes.
• Clock Speed: 8 MHz.
• Interface: UART.
• Working Temperature: -20 ~ +85℃.
• Default baud rate: 115200bps.
This routine will use Lora Soil Moisture sensor and Lora gateway to make an Internet project that collects air temperature and soil humidity data and uploads it to the server, allowing you to learn the usage of Lora Soil and the basic use of Lora in depth.
1.The Lora Soil node sends data to the gateway.
- Here we need to use Arduino for programming.
- Connect CP2102 USB toTTL module to Lora soil moisture sensor.
- Open Arduino IDE, Board choose Arduino Pro or Pro Mini, Processor choose ATmega328p (3.3V, 8MHz), select the corresponding port.
- Download the program from here: TransmitterAHT10.
- Open the program and click upload (you need to press the reset button during the upload process). After success, you can see the following output from the serial monitor:
2. LoRa Gateway Here uses Micropython programming to receive and process data.
You need to use Makepython Lora module and MakePython ESP32 module, you can get them from the link below.
Assemble MakePython Lora and ESP32 to make a gateway that can receive remote data and upload it to the Internet.
3.Receive the data transmitted by Lora Soil Moisture sensor.
You download the code from here: code, then upload all xxx.py in the Micropython_Lora_Soil file to ESP32.
Open the LoRaDuplexCallback.py file, You need to make some adjustments so that your ESP32 can connect to the network and upload data to the server.
- Modify the API_KEY you obtained in ThingSpeak. (I will introduce how to obtain it later)
- Modify SSID and PSW to connect WiFi.
ssid = "Makerfabs" pswd = "20160704"
- Open the connectWiFi.py file, here also need to modify the ssid and pswd.
- Sign up an account in https://thingspeak.com/. If you already have one, sign in directly.
- Click New Channel to create a new ThingSpeak channel.
- Input name, Description, Select Field 1 to 5. Then save channel on the bottom.
- Click the API Keys option, copy the API Key, we will use it in the program.
Press the reset button of Makeoython ESP32, after the connection to the network is successful, the screen can display the data sent by the Lora Soil Moisture sensor module.
After logging into ThingSpeak, you can see the data uploaded by ESP32 Gateway.
You can list your questions here or contact with email@example.com for technology support.