Last Updated on June 18, 2026 by pg@petergamma.org
Here is the Instruction: (AI Overview)
To connect the AD8232 ECG Sensor to a Raspberry Pi, you must use an ADS1115 Analog-to-Digital Converter (ADC) because the Pi lacks native analog inputs. This setup translates heart-rate electrical signals into usable digital data. [1, 2, 3, 4, 5]
1. Wiring the Components
You can source the ADS1115 from local Swiss suppliers like Distrelec Schweiz or BerryBase.ch. Connect your components using DuPont jumper wires:
AD8232 to ADS1115:
ADS1115 to Raspberry Pi:
- ADS1115 VDD → Raspberry Pi 3.3V (Pin 1 or 17)
- ADS1115 GND → Raspberry Pi GND (Pin 6 or 9)
- ADS1115 SCL → Raspberry Pi SCL (Pin 5 / GPIO 3)
- ADS1115 SDA → Raspberry Pi SDA (Pin 3 / GPIO 2) [1, 2, 3, 4]
2. Software Configuration
To allow the Pi to communicate with the ADC, you need to enable the I2C interface. [1]
- Open terminal and run:
sudo raspi-config - Go to Interface Options → I2C and select Yes.
- Reboot the Pi:
sudo reboot - Verify the I2C address (default is
0x48) by running:sudo i2cdetect -y 1[1, 2, 3]
3. Install Python Libraries
Install the official Adafruit CircuitPython ADS1x15 library to easily read voltage data. [1]
bash
sudo apt update
sudo apt install python3-pip
sudo pip3 install adafruit-circuitpython-ads1x15
Use code with caution.
4. Reading Data in Python
The AD8232 outputs an analog voltage proportional to the heart’s electrical activity. Use this example Python script to read the data:
python
import time
import board
import busio
import adafruit_ads1x15.ads1115 as ADS
from adafruit_ads1x15.analog_in import AnalogIn
# Initialize the I2C bus
i2c = busio.I2C(board.SCL, board.SDA)
# Create the ADC object
ads = ADS.ADS1115(i2c)
# Create single-ended input on channel 0
chan = AnalogIn(ads, ADS.P0)
print("Reading AD8232 ECG data...")
while True:
print(f"Raw Value: {chan.value} \t Voltage: {chan.voltage:.5f} V")
time.sleep(0.01) # Sample rate
Use code with caution.
5. Practical Considerations
- Sampling Limitations: The ADS1115 caps at about 225-860 samples per second depending on your I2C bus speed. If you need raw, real-time ECG sampling rates > 1000 Hz, using a dedicated microcontroller like an Arduino or a Raspberry Pi Pico as an interface or data logger is highly recommended. [1, 2, 3]
- Noisy Signals: AD8232 ECG signals are incredibly sensitive. Ensure you are well-shielded from 50Hz/60Hz mains hum and the electrode pads are properly placed and secured on the body. [1, 2]
For tips on interpreting AD8232 ECG waveforms, detecting R-peaks, and filtering the data in Python:
Here is a variant using a Raspberry Pi 4:
https://forums.raspberrypi.com/viewtopic.php?t=392012
Then I eventually would add a Spirometer from iWorx. They can be bought used on eBay.
And here is where I stop for the time being.

Since I am a physiologist and not a electronics engineer.
No paper available how to build such a device as an open source device? Why not? Since I am am eventually the only physiologist in the world at the moment who would be interested in such a paper and also to rebuild such a device. So I let it be for the time being. Maybe an electronics engineer from India takes over, builts this device and writes a a paper about it?
Enlightenment is a very simple phenomenon:
No devices necessary for it.