How to hookup ADS1115 to ESP8266 on Wemos D1 board
Posted: Sat Jun 06, 2020 12:25 pm
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:
and main sketch.
So I do not know what is going on. Please help
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