Difference between revisions of "Lora Soil Moisture Sensor"
|Line 1:||Line 1:|
== Introduction ==
== Introduction ==
== Features ==
== Features ==
Revision as of 08:15, 23 June 2020
The Lora soil moisture sensor is based on Atmel's Atmega328P, it collect local air temperature/ humidity with sensor AHT10, and detect the soil humidity with capacitor-humility measurement solution with 555, and transmit the local environment data to the gateway, with Lora communication, suit for applications for smart-farm, irrigation, agriculture, etc.
In applications, always you do not need to check the air/soil state continuously, have a test of them for few seconds after then minutes/hours sleeping is normally Ok for most projects. To save the power, there the Air/ Soil measuring functional could be shut down in the working, so they can be only powered ON a short time and then a long time power off. With MCU in sleeping mode and low power consumption Lora module, this module works ok with 2 AAA battery for months. Besides, this sensor is coated with waterproof paint, makes it longer working time in the damp soil.
The Lora soil moisture sensor is shipped out with Arduino pro-mini bootloader pre-loaded, and there also default sketch programmed. Uses can re-program it with Arduino IDE, we suggest a standard USB2UART convertor for this. Note that the DTR in the USB2UART convertor is needed to connect to “Reset” pin for Arduino sketch downloading, if there no DTR, you may need to press the “reset” button manually in the downloading.
• 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.
- 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.
- 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.
- 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.
- 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.