𝗨𝗻𝗱𝗲𝗿𝘀𝘁𝗮𝗻𝗱𝗶𝗻𝗴 𝗔𝗗𝗖𝘀 𝗮𝗻𝗱 𝘁𝗵𝗲 𝗔𝗗𝗦𝟭𝟭𝟭𝟱 𝘄𝗶𝘁𝗵 𝗥𝗮𝘀𝗽𝗯𝗲𝗿𝗿𝘆 𝗣𝗶
The Raspberry Pi lacks a built-in Analog-to-Digital Converter (ADC).
This means you cannot read analog sensors directly. You cannot connect these devices to a Pi by themselves:
- Potentiometers
- Light sensors
- Gas sensors
- Soil moisture sensors
You need an external ADC to bridge this gap. The ADS1115 is a high-precision 16-bit ADC. It connects to your Raspberry Pi via the I2C protocol.
How an ADC works: An ADC converts varying voltage into digital numbers. It follows three steps:
- Sampling: The ADC captures voltage at specific moments.
- Quantization: The ADC divides the voltage range into discrete levels.
- Encoding: The ADC converts the level into a binary number.
Resolution matters. Higher resolution means better precision.
- 8-bit provides 256 levels.
- 12-bit provides 4,096 levels.
- 16-bit (like the ADS1115) provides 65,536 levels.
Why use the ADS1115?
- 16-bit resolution for high precision.
- Four analog input channels.
- Programmable Gain Amplifier (PGA) to amplify small signals.
- Differential measurements to find the difference between two voltages.
How to connect it:
- VDD to 3.3V
- GND to GND
- SDA to GPIO2
- SCL to GPIO3
Setup steps:
- Enable I2C in raspi-config.
- Install i2c-tools to verify the device.
- Run i2cdetect -y 1. You should see address 0x48.
- Install the Adafruit ADS1x15 library using pip.
You can use this module for smart agriculture, battery management, and industrial automation. It turns physical sensor data into digital information your code can use.
Source: https://dev.to/kenryikegbo/understanding-adcs-and-using-the-ads1115-with-raspberry-pi-40m6
Optional learning community: https://t.me/GyaanSetuAi