Overview
The ads1x15 node reads analog voltages using Texas Instruments ADS1015/ADS1115 ADCs.
These provide high-precision analog-to-digital conversion for sensors that output analog voltages -
essential since Raspberry Pi has no built-in ADC. Use with soil moisture, potentiometers, analog temperature sensors, and more.
16-bit
Resolution (ADS1115)
4
Channels
±6.144V
Max Range
I2C
Interface
ADS1015 vs ADS1115
| Feature | ADS1015 | ADS1115 |
|---|---|---|
| Resolution | 12-bit | 16-bit |
| Max Sample Rate | 3300 SPS | 860 SPS |
| Best For | Fast readings | High precision |
| Price | ~$1 | ~$2 |
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| address | number | 0x48 | I2C address (0x48, 0x49, 0x4A, 0x4B) |
| chip | string | "1115" | "1015" or "1115" |
| channel | number | 0 | Channel to read (0-3) or "all" |
| gain | number | 1 | PGA gain (2/3, 1, 2, 4, 8, 16) |
| interval | number | 1000 | Reading interval (ms) |
Gain Settings
| Gain | Voltage Range | Resolution (ADS1115) |
|---|---|---|
| 2/3 | ±6.144V | 187.5 µV |
| 1 | ±4.096V | 125 µV |
| 2 | ±2.048V | 62.5 µV |
| 4 | ±1.024V | 31.25 µV |
| 8 | ±0.512V | 15.625 µV |
| 16 | ±0.256V | 7.8125 µV |
Output
{
"payload": 2.543,
"channel": 0,
"raw": 20344,
"voltage": 2.543,
"percent": 62.1,
"timestamp": 1640000000000
} Example: Soil Moisture Monitor
Read multiple soil moisture sensors and trigger watering.
// Function node: Convert voltage to moisture %
// Capacitive sensor: ~3V dry, ~1.5V wet
var voltage = msg.voltage;
var channel = msg.channel;
// Map voltage to percentage (inverted - lower voltage = wetter)
var dryVoltage = 3.0;
var wetVoltage = 1.5;
var moisture = ((dryVoltage - voltage) / (dryVoltage - wetVoltage)) * 100;
moisture = Math.max(0, Math.min(100, moisture));
var status = "ok";
if (moisture < 30) status = "dry";
if (moisture > 80) status = "wet";
msg.payload = {
channel: channel,
voltage: voltage.toFixed(3),
moisture: moisture.toFixed(0),
status: status,
needsWater: moisture < 30
};
return msg;