My raspberry 3Bs seem to have problems with their I2C and SPI bus.

a. I tried MCP3008 using SPI connected with light sensor and temp sensor, the output on channel 0 &1 is only outputting zeros and 255s. I've replaced jumper wires 3 times, replaced with another Raspberry pi 3B, replaced with 4 different mcp3008, replaced light sensor and temp sensors. NOTHING WORKS.

b. Then I tried ADS1115 using I2C connected with temp sensor. I then used adafruit's example simpletest.py following the exact step. Get an erro: 'remote I/O error'

Basically I've replace everything else but my laptop and the software itself(raspbian). Anyone that can help will be very much appreciated.

[![enter image description here][1]][1]

code and result

ADS1115 result

  • Could you add a diagram to your question? You may use the schematic tool for this. Once your edit space is open, click the schematic icon, or Ctrl-m on your keyboard. The diagram will help us help you.
    – Seamus
    Commented Jun 1, 2018 at 17:21
  • just updated the images.
    – June Wang
    Commented Jun 2, 2018 at 19:51

2 Answers 2


A possible solution that has worked for me was adding the following line after the spi.open() statement:

spi.max_speed_hz = 1350000

There seems to have been some changes in recent Raspbian Systems, that caused different clock speeds.


  • Thank you. It seemed to work since the numbers are now outputing 1000-1023s, and 850-880s. However, the data doesn't seem to change much when light/ temperature changes.
    – June Wang
    Commented Jun 3, 2018 at 3:05

Problem solved.

  1. for mcp3008, I was able to get some readings by adding

    spi.max_speed_hz = 1350000

It was giving me certain range of readings although it doesn't seem to read proper sensor readings.

  1. for ADS1115, it turns out the pin header connection to sensor is weak. When wired directly to raspi, the problem was solved.

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.