Difference between revisions of "Lora Soil Moisture Sensor"

From MakerFabsWiki
Jump to: navigation, search
(Usage)
(Usage)
Line 61: Line 61:
 
</pre>
 
</pre>
 
*Open the connectWiFi.py file, here also need to modify the ssid and pswd.<br>
 
*Open the connectWiFi.py file, here also need to modify the ssid and pswd.<br>
[[File:Lora_Soil_8.jpg|500px]]<br>
+
[[File:Lora_Soil_8.jpg|700px]]<br>
 
<br>
 
<br>
 
4.Use ThingSpeak IoT<br>
 
4.Use ThingSpeak IoT<br>
Line 67: Line 67:
 
*Click New Channel to create a new ThingSpeak channel.<br>
 
*Click New Channel to create a new ThingSpeak channel.<br>
 
*Input name, Description, Select Field 1 to 5. Then save channel on the bottom.<br>
 
*Input name, Description, Select Field 1 to 5. Then save channel on the bottom.<br>
[[File:Lora_Soil_9.jpg|500px]]<br>
+
[[File:Lora_Soil_9.jpg|700px]]<br>
 
*Click the API Keys option, copy the API Key, we will use it in the program.<br>
 
*Click the API Keys option, copy the API Key, we will use it in the program.<br>
[[File:Lora_Soil_10.jpg|500px]]<br>
+
[[File:Lora_Soil_10.jpg|700px]]<br>
 
5. Result<br>
 
5. Result<br>
 
*Insert one end of the Lora Soil Moisture sensor module into the soil of the flower pot to collect data.<br>
 
*Insert one end of the Lora Soil Moisture sensor module into the soil of the flower pot to collect data.<br>
 
*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.<br>
 
*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.<br>
[[File:Lora_Soil_11.jpg|500px]]<br>
+
[[File:Lora_Soil_11.jpg|700px]]<br>
 
After logging into ThingSpeak, you can see the data uploaded by ESP32 Gateway.<br>
 
After logging into ThingSpeak, you can see the data uploaded by ESP32 Gateway.<br>
[[File:Lora_Soil_12.jpg|500px]]<br>
+
[[File:Lora_Soil_12.jpg|700px]]<br>
  
 
== FAQ  ==
 
== FAQ  ==

Revision as of 07:35, 29 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. Users can use Arduino IDE to program, it is very easy.

Lora Soil 0.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.
  • Use the serial tool to connect the 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

  • Insert one end of the Lora Soil Moisture sensor module into the soil of the flower pot to collect data.
  • 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