Black Lives Matter - Action and Equality. ... Adafruit is part of the Stop Hate for Profit campaign. Adafruit is open and shipping.
0

My Raspberry Pi Can't Detect My I2C Chip
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

My Raspberry Pi Can't Detect My I2C Chip

by Israeletu on Fri May 29, 2020 9:01 am

Hello Forum Members,

I want to use ADS1015 ADC chip with Raspberry Pi Zero W. I set up the circuit as shown on the guide, did full upgrade of the Pi and installed the chip's library with: sudo pip3 install adafruit-circuitpython-ads1x15. Everything went successfully.

Then to initialize the ADC chip I went to the IDE of the Pi and typed as follows:

import board
import busio
import adafruit_ads1x15.ads1015 as ADS
from adafruit_ads1x15_in import AnalogIn
i2c = busio.I2C(board.SCL, board.SDA)
ads = ADS.ADS1015(i2c)
chan = AnalogIn(ads, ADS.P0)
print(chan.value, chan.voltage)

The print command is intended to display the raw value and voltage on the P0 input of the ADC chip (because I fed a voltage of 1.16V to it) but the system is complaining of the line:

i2c = busio.I2C(board.SCL, board.SDA)

It says that board has no attribute SCL and SDA.

Please what can I do to initialize the ADC chip and read values from it?
Thank you.

Israeletu
 
Posts: 6
Joined: Fri May 29, 2020 8:36 am

Re: My Raspberry Pi Can't Detect My I2C Chip

by adafruit_support_carter on Fri May 29, 2020 12:03 pm

It sounds like you may have skipped the step to install Blinka:
https://learn.adafruit.com/circuitpytho ... rypi-linux

But based on the error message you are getting, it also sounds like you already have a board module installed. See here for that issue:
https://learn.adafruit.com/circuitpytho ... aq-3055911

adafruit_support_carter
 
Posts: 15955
Joined: Tue Nov 29, 2016 2:45 pm

Re: My Raspberry Pi Can't Detect My I2C Chip

by Israeletu on Fri May 29, 2020 4:34 pm

Dear Admin,

Thank you very much for your response. Thanks for responding promptly also. I will take time to follow your advice in detail and thereafter get back to your.

Thanks.

Israeletu
 
Posts: 6
Joined: Fri May 29, 2020 8:36 am

Re: My Raspberry Pi Can't Detect My I2C Chip

by Israeletu on Sun May 31, 2020 7:00 am

Dear Admin, I have done what you advised and it is now working.
Thank you very much.

Israeletu
 
Posts: 6
Joined: Fri May 29, 2020 8:36 am

Please be positive and constructive with your questions and comments.