Coder Social home page Coder Social logo

lora-soil-moisture-sensor's Introduction

Lora Soil Moisture Sensor

[toc]

Makerfabs

Makerfabs home page

Makerfabs Wiki

Lora Soil Moisture Sensor

Introduce

Product Link: Lora_Soil_Moisture_Sensor

Wiki Link: Lora_Soil_Moisture_Sensor_V3

The Lora soil moisture sensor is based on Atmel's Atmega328P, it collects local air temperature/ humidity with sensor AHT10, and detect the soil humidity with capacitor-humility measurement solution with MCU clock, 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 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 more than one year. Besides, this sensor is coated with waterproof paint, which makes it longer working time in damp soil.

Feature

  • Classic ATMEL AVR 8-bit Atmega328P, with Arduino Pro Mini(3.3V/8M bootloader pre-loaded) .
  • Capacitor-humility measurement.
  • AHT10 temperature and humidity sensor.
  • Working with 2 AAA more than one years.
  • 3D printed case.
  • Waterproof coating.
  • Unique ID, can be used directly without secondary programming.

front

Version

V3

In the latest version, the 555 chip has been removed so that the sleep current can be as low as 7.1uA. And added UID, can be used directly.

More details, see readme. md in the V3 folder.

V2

Old version, containing 555 chip. A number of items are provided as references.

More details, see readme. md in the V2 folder.

lora-soil-moisture-sensor's People

Contributors

195cn avatar gray-hxx avatar makerfabs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lora-soil-moisture-sensor's Issues

Slowly increasing moisture reading

I see the moisture reading slowly increasing over days especially in mostly dry soil. If I move the probe the reading resets itself so I assume this is polarization. I reduced the time the PWM is on and decreased the number of readings but still see the effect to a lesser extent at the default 2MHz. Any ideas how to further reduce this or depolarize it somehow? This graph attached shows moisture slowly increasing and then where I wiggle the probe around a little and moisture content drops
IMG_20221018_184956_285

Outdoor version

Lora is for long distance communication which is more about farm rather than greenhouse so i think you better make outdoor version. For greenhouse, normal RF433 or Esp8266 is enough .

the unit will not program

I can compile your sample, but when i try to upload the upload fails.
I'm using this programmer: https://www.amazon.ca/DSD-TECH-Adapter-FT232RL-Compatible/dp/B07BBPX8B8
the programmer is set to 3.3V
I tried connecting the DTR to the reset line on the programmer and to the DTR line on the programmer (it has pad an the board that I pulled out for that)
in both cases the programming fails, but when the unit is powered I can see communication on the serial port:


Soil start.
success!
AHT10 acknowledged.
success!
ADC:888
ADC:894
ADC:894
BAT:1006
3.24VBAT:1006
3.24VBAT:1006
3.24VID010209 REPLY : SOIL INEDX:0 H:39.58 T:25.84 ADC:894 BAT:1006
[Set]Sleep Mode Set
[Watch dog]0


etc. etc.....
I have the board setup as Arduino UNO with processor ATmega328P
here is the error message when i try to upload code:


Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Arduino Nano, ATmega328P"

Sketch uses 23508 bytes (76%) of program storage space. Maximum is 30720 bytes.

Global variables use 1028 bytes (50%) of dynamic memory, leaving 1020 bytes for local variables. Maximum is 2048 bytes.

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x53

avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x6f

avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x69

avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x6c

avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x20

avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x73

avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x74

avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x61

avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x72

avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x74

An error occurred while uploading the sketch


please tell me what i'm doing wrong?

ESP32-Receiver.ino doesn't compile

Hi,

The code given on V3/example/ESP32-Receiver/ESP32-Receiver.ino doesn't compile in Arduino IDE, giving an error (on the web page heading construction part) at line:
client.println(str);
'str was not declared in this scope'

I'm using a "MaESP ESP32 Lora Gateway" as a receiver.
If I comment the faulty line, I can upload the code, everything works well on the OLED screen, but of course the string (ID, temp, ...) is not displayed on the published web page.

Can someone please help me in fixing that ?
Thanks in advance!

ESP32 [SX1278] Initializing ... failed, code -2

Hi,

I'm trying to get the ESP32 receiver to work with the Lora Soil Moisture Sensor. I have RadioLib 4.6.0, though it doesn't specify anywhere exactly what version I should use. I'm in the U.S.

The relevant part of my code is:

//SX1278 radio = new Module(LORA_CS, DIO0, LORA_RST, DIO1);
// SX1278 radio = new Module(LORA_CS, DIO0, LORA_RST, DIO1, SPI, SPISettings());  //433Mhz
SX1276 radio = new Module(LORA_CS, DIO0, LORA_RST, DIO1, SPI, SPISettings()); //868Mhz or 915Mhz

// or using RadioShield
// https://github.com/jgromes/RadioShield
//SX1278 radio = RadioShield.ModuleA;

void setup()
{
    Serial.begin(115200);

    // initialize SX1278 with default settings
    Serial.print(F("[SX1278] Initializing ... "));
    SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
    int state = radio.begin(FREQUENCY, BANDWIDTH, SPREADING_FACTOR, CODING_RATE, SX127X_SYNC_WORD, OUTPUT_POWER, PREAMBLE_LEN, GAIN);
    //int state = radio.begin();
    if (state == ERR_NONE)
    {
        Serial.println(F("success!"));
    }
    else
    {
        Serial.print(F("failed, code "));
        Serial.println(state);
        while (true)
            ;
    }

I've also tried the first line SX1278 radio = new Module(LORA_CS, DIO0, LORA_RST, DIO1); instead of the third line. In each case I get [SX1278] Initializing ... failed, code -2

Thanks

Watchdog wakes up directly

I have a problem with the deep sleep watch dog of the v2.1. SLEEP_CYCLE is set to 105 (~15 Minutes). For some days it works perfect. But since last night it doesnt sleep anymore and send every 5-7 seconds.
A reset brings no improvment.

Boot Loader update

I managed to damage the boot loader of my "Lora Temperature/ Humidity/ Soil Moisture Sensor V3" . Is there any standard programmer and/or adapter that I can use to upload/refresh the boot loader ?

Any suggestion will be well appreciated.

How to order & build (PCB fabrication and SMT assembly)

Hello,

Thank you for this wonderful project !
I was wondering : how to order and build the LoRa Soil Moisture Sensor with the help of companies such as JLCPCB, PCBWay or OSH Park ?

Step 1 - Printed circuit board (PCB) fabrication
Step 2 - SMT assembly

  1. The bill of materials (BOM) file
  2. The pick-and-place file

I am missing : Gerber files, bill of materials (BOM) in English and the pick-and-place file.
I would like ideally to be able to build it in Europe, if this is possible, because I am worried about customs taxes and shipment delays.

Thank you for your help!

Change Frequency of Moisture Sensor

Hi,

i mistakenly ordered the 915Mhz version, is it possible to change the frequency to 868Mhz with just changing the variable in the code or is the built in hardware just supporting the frequency i bought? I would appreciate if anybody can give me some information. Thanks!

Connect to LoraWan / TheThingsNetwork

Hi,

I'm experimenting with my sensor, however it is not completely clear to me how I would proceed with connecting the sensor to LoraWan. Is this a possibility of completely out of scope of this project?

Thanks.

Connection Issue to Receiver

I've got the SX1262 868M LoRa HAT for receiving lora packages.
It seems that i cant receive packages from the V3 Sensor with this device?

Do you think i can configure something to make it work?

Thanks!

Code for Lilygo TTGO Lora32 ESP Module as a receiver

/*********
Rui Santos
Complete project details at https://RandomNerdTutorials.com/ttgo-lora32-sx1276-arduino-ide/
needs LoRa library be sandeep mistry

lora32-receiver
https://github.com/sandeepmistry/arduino-LoRa/blob/master/API.md
https://github.com/sandeepmistry/arduino-LoRa
*********/

//Libraries for LoRa
#include <SPI.h>
#include <LoRa.h>

//Libraries for OLED Display
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

//define the pins used by the LoRa transceiver module
#define SCK 5
#define MISO 19
#define MOSI 27
#define SS 18
#define RST 14
#define DIO0 26

//433E6 for Asia
//866E6 for Europe
//915E6 for North America
#define BAND 866E6

//OLED pins
#define OLED_SDA 4
#define OLED_SCL 15
#define OLED_RST 16
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RST);

String LoRaData;

void setup() {
//reset OLED display via software
pinMode(OLED_RST, OUTPUT);
digitalWrite(OLED_RST, LOW);
delay(20);
digitalWrite(OLED_RST, HIGH);

//initialize OLED
Wire.begin(OLED_SDA, OLED_SCL);
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3c, false, false)) { // Address 0x3C for 128x32
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}

display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
display.setCursor(0,0);
display.print("LORA RECEIVER ");
display.display();

//initialize Serial Monitor
Serial.begin(115200);

//SPI LoRa pins
SPI.begin(SCK, MISO, MOSI, SS);
//setup LoRa transceiver module
LoRa.setPins(SS, RST, DIO0);

if (!LoRa.begin(BAND)) {
Serial.println("Starting LoRa failed!");
while (1);
}
LoRa.setSpreadingFactor(9 /SF9/);

//Serial.println("LoRa Initializing OK!");
display.setCursor(0,10);
display.println("LoRa Initializing OK!");
display.display();
}

void loop() {

//try to parse packet
int packetSize = LoRa.parsePacket();

if (packetSize) {
//received a packet
Serial.println("Received packet: ");

LoRaData = "";

while (LoRa.available()) {
  LoRaData += (char)LoRa.read();
}

Serial.println("Message: " + LoRaData);
Serial.println("RSSI: " + String(LoRa.packetRssi()));
Serial.println("Snr: " + String(LoRa.packetSnr()));
Serial.println();

// Dsiplay information
display.clearDisplay();
display.setCursor(0,0);
display.print("LORA RECEIVER");
display.setCursor(0,20);
display.print("Received packet:");
display.setCursor(0,30);
display.print(LoRaData);
display.setCursor(0,40);
display.print("RSSI:");
display.setCursor(30,40);
display.print(LoRa.packetRssi());
display.display();   

}
}

ADC: sensorValue

Any table that based on the sensor value to get the soil moisture in % ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.