Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By seaurchin
#87429 I have ads1115 connected to wemos board as
ADS - WEMOS
SDA -SDA
SCL - SCL
VDD - 5v
GND -GND
A0 - Soil Moisture sensor signal pin
A1 - Soil Moisture sensor signal pin
A2 - Soil Moisture sensor signal pin
A3 - Soil Moisture sensor signal pin

but the problem is when I put the soil senor in wet soil I get value around 8000
if I take sensor out of soil it bumps up to 11000 or 15000
if soil gets drier the value starts to fall below 8000
soil moisture also are connected to wemos 5 volt

This is my code:

Code: Select all#include <Wire.h>
#include <Adafruit_ADS1015.h>
#include "read_sensor_data.h"

Adafruit_ADS1115 ads;

namespace SensorData
{
void read_sensor_data::initializeADC() {
  ads.begin();
}

int* read_sensor_data::analogValues()
  {
 
      int* arr = new int[4];
      int16_t adc0, adc1, adc2, adc3;
      adc0 = ads.readADC_SingleEnded(0);
      adc1 = ads.readADC_SingleEnded(1);
      adc2 = ads.readADC_SingleEnded(2);
      adc3 = ads.readADC_SingleEnded(3);
     
      arr[0] = adc0;
      arr[1] = adc1;
      arr[2] = adc2;
      arr[3] = adc3;
      return arr;
  }

}


and main sketch.

Code: Select all#include "read_sensor_data.h"

void setup() {
  Serial.begin(115200);
 
  SensorData::read_sensor_data::initializeADC();
}

void loop() {
  //  SensorData::read_sensor_data::analogValues();
}



So I do not know what is going on. Please help
User avatar
By Bonzo
#87438 Out of interest I get all sorts of output from my soils sensors also with a ads1115 and gave up with them.

I calibrated mine in a jar of water and dry on the floor which give you your wet and dry settings.

The problem with my sensors is they seem to be effected by a light sensor I also have on the board. Although I wonder now if it could be heat related as I put the electronic part of the sensor into a box to protect it from water.

This was calibrated and worked perfectly for a few days and look at it now:
Image