AHT20 led on but not found on i2c

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ckdake
 
Posts: 3
Joined: Thu May 12, 2022 6:59 pm

AHT20 led on but not found on i2c

Post by ckdake »

Hello! First project with some adafruit bits, and first snag:

This is a https://www.adafruit.com/product/4566 connected via a https://www.adafruit.com/product/4210 to a https://www.adafruit.com/product/4463 to a pi B+. Green led is on on the sensor so i know it is getting power at least. Photo attached of setup.

I've followed steps on https://learn.adafruit.com/circuitpytho ... spberry-pi and i2c looks like it is up and running:

Code: Select all

$ python3 blinkatest.py 
Hello blinka!
Digital IO ok!
I2C ok!
SPI ok!
done!
But alas, when I try and use the AHT20 with:

Code: Select all

import time
import board
import adafruit_ahtx0

# Create sensor object, communicating over the board's default I2C bus
i2c = board.I2C()  # uses board.SCL and board.SDA
sensor = adafruit_ahtx0.AHTx0(i2c)

while True:
    print("\nTemperature: %0.1f C" % sensor.temperature)
    print("Humidity: %
I get:

Code: Select all

ValueError: No I2C device at address: 0x38
First boot I had the cable on the wrong side of the AHT20 and the LED didn't turn on, but correcting that -> the LED on the sensor is on. I tried reversing the cable, no change there either.

I've spent some time poking around to troubleshoot, but I'm at a loss here. Any ideas/suggestions?
Attachments
IMG_2671.jpeg
IMG_2671.jpeg (617.15 KiB) Viewed 124 times

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: AHT20 led on but not found on i2c

Post by dastels »

I'm very skeptical of those "skim" boards, especially for a high speed data signal like I2C. Do you have something like https://www.adafruit.com/product/4397 that you can connect the sensor with, i.e. not using the shim? that will give you a better connection and give a better idea what the problem is. You would need to connect the STEMMA_QT power line to the Pi's 3.3v pin. Alternatively you could solder some female header on the bottom of the shim.

Dave

User avatar
ckdake
 
Posts: 3
Joined: Thu May 12, 2022 6:59 pm

Re: AHT20 led on but not found on i2c

Post by ckdake »

Thanks, it does seem like a not-quite-snug connection. The cable you linked has been out of stock so I didn't order one, and my parts bin here is limited to wires and shrinkwrap at this point. I'll see if I can get my hands on something else to get a better connection and report back.

User avatar
ckdake
 
Posts: 3
Joined: Thu May 12, 2022 6:59 pm

Re: AHT20 led on but not found on i2c

Post by ckdake »

Yep, proper wires did the trick and I have temperature and humidity now!

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: AHT20 led on but not found on i2c

Post by dastels »

Awesome! Those shims are sound great in theory but in practice have too many potential points of failure.

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”