Hello together, I'm currently trying to read values from a pH-probe via an ADS1115 and the Adafruit_Circuitpython_ADS1x15 library connected to my Raspberry Pi 4. Using the instructions on https://learn.adafruit.com/adafruit-4-channel-adc-breakouts/python-circuitpython I got it to run with this simple code (not by me)

import time, board, busio
import adafruit_ads1x15.ads1115 as ADS
from adafruit_ads1x15.analog_in import AnalogIn

i2c = busio.I2C(board.SCL, board.SDA) # Create the I2C bus

ads = ADS.ADS1115(i2c) # Create the ADC object using the I2C bus

chan = AnalogIn(ads, ADS.P0) # Create single-ended input on channel 0

print("{:>5}\t{:>5}".format('raw', 'v'))

while True:
    print("{:>5}\t{:>5.3f}".format(chan.value, chan.voltage))

However, if I change the time.sleep() to anything greater than 2s I get an [Errno 121] Remote I/O error.

 Traceback (most recent call last):
  File "simpletestadc.py", line 22, in <module>
    print("{:>5}\t{:>5.3f}".format(chan.value, chan.voltage))
  File "/home/pi/.local/lib/python3.7/site-packages/adafruit_ads1x15/analog_in.py", line 64, in value
    self._pin_setting, is_differential=self.is_differential
  File "/home/pi/.local/lib/python3.7/site-packages/adafruit_ads1x15/ads1x15.py", line 144, in read
    return self._read(pin)
  File "/home/pi/.local/lib/python3.7/site-packages/adafruit_ads1x15/ads1x15.py", line 172, in _read
    self._write_register(_ADS1X15_POINTER_CONFIG, config)
  File "/home/pi/.local/lib/python3.7/site-packages/adafruit_ads1x15/ads1x15.py", line 205, in _write_register
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 102, in write
    self.i2c.writeto(self.device_address, buf, start=start, end=end)
  File "/usr/local/lib/python3.7/dist-packages/busio.py", line 115, in writeto
    return self._i2c.writeto(address, memoryview(buffer)[start:end], stop=stop)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 49, in writeto
    self._i2c_bus.write_bytes(address, buffer[start:end])
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO/smbus.py", line 308, in write_bytes
OSError: [Errno 121] Remote I/O error

This seems very counterintuitive to me, especially since a simple print(i2c.scan()) inside the loop seems to prevent crashing (output being [72] btw) though now speed is going down drastically. In my project I'm not interested in getting values every tenth of a second but instead getting ten values in very quick succession every 1 minute or so.

Every question I have seen so far seems to in one way or another indicate a faulty connection between ADC and board, but I'm confident it's not that in my case.

BTW: sudo i2cdetect -y 1 yields an established connection at 0x48 at all times.

By now I'm so confused and in doubt what's wrong. Also, please be aware this is my first serious attempt at RaspberryPi.

I would appreciate any help.

Thank you!

  • 1
    Have you tried a different library? This sounds like a problem specific to the Adafruit code.
    – joan
    Commented Jan 9, 2021 at 21:09
  • @joan Which one do you suggest? Although the old Adafruit_ADS1x15 (link import Adafruit_ADS1x15 vs. import adafruit_ads1x15) is deprecated, I have also tried this which didn't work at all. But because it is deprecated and links to the new Adafruit_Circuitpython_ADS1x15 (link) I have not further bothered.
    – RasPi Noob
    Commented Jan 9, 2021 at 21:30
  • I tend to use my own code for this sort of device. I'd search for raspberry pi ads1115 and python and check the results.
    – joan
    Commented Jan 9, 2021 at 21:34

1 Answer 1


I have added ADS1015/ADS1115 Python examples for my lgpio and rgpio Python modules.


They work okay for longer delays.

Python lgpio module example.

#!/usr/bin/env python

import time
import lg_ads1x15

import lgpio as sbc

adc = lg_ads1x15.ads1115(sbc, 1, 0x48)

adc.set_sample_rate(0) # minimum sampling rate

end_time = time.time() + 120

while time.time() < end_time:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.