Difference between revisions of "Lora Soil Moisture Sensor"

From MakerFabsWiki
Jump to: navigation, search
(Interface Function)
(Interface Function)
Line 15: Line 15:
  
 
== Interface Function ==
 
== Interface Function ==
[[File:Lora_Soil_2.jpg|800px]]<br>
+
[[File:Lora_Soil_2.jpg|1000px]]<br>
 
①ANT: Lora Antenna.<br>
 
①ANT: Lora Antenna.<br>
 
②RFM95T/RFM96T/RFM5W.<br>
 
②RFM95T/RFM96T/RFM5W.<br>

Revision as of 10:20, 27 May 2020

Introduction

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.

Lora Soil 1.jpg

Features

• Classic ATMEL AVR 8-bit Atmega328P.
• RAM: 2KBytes.
• EEPROM: 1Kbytes.
• Clock Speed: 8 MHz.
• Interface: UART.
• Working Temperature: -20 ~ +85℃.
• Default baud rate: 115200bps.

Interface Function

Lora Soil 2.jpg
①ANT: Lora Antenna.
②RFM95T/RFM96T/RFM5W.
③SWD: Serial Wire Debug.
④ATMega328P.
⑤AHT10.
⑥J1: serial port interface.

Usage

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.

Step:
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.

Lora Soil 3.jpg

  • 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:

Lora Soil 4.jpg

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.
https://www.makerfabs.com/makepython-esp32.html
Makepython ESP32:
Lora Soil 5.jpg
Makepython Lora:
Lora Soil 6.jpg
Assemble MakePython Lora and ESP32 to make a gateway that can receive remote data and upload it to the Internet.
Lora Soil 7.jpg

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)
#https://thingspeak.com/channels/1035244
API_KEY='SO3W20EMSKIEJN4E'
  • 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.

Lora Soil 8.jpg

4.Use ThingSpeak IoT

  • 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.

Lora Soil 9.jpg

  • Click the API Keys option, copy the API Key, we will use it in the program.

Lora Soil 10.jpg
5. Result
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.
Lora Soil 11.jpg
After logging into ThingSpeak, you can see the data uploaded by ESP32 Gateway.
Lora Soil 12.jpg


FAQ

You can list your questions here or contact with support@makerfabs.com for technology support.

Resources