Funhouse problem with PM25 module.

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
davidb21
 
Posts: 49
Joined: Mon Mar 24, 2014 9:13 am

Funhouse problem with PM25 module.

Post by davidb21 »

I added a pm25 module to the stemma QT i2c interface and get the following error (below). Any ideas how to fix this?

# Create library object, use 'slow' 100KHz frequency!
i2c = busio.I2C(board.SCL, board.SDA, frequency=100000)
# Connect to a PM2.5 sensor over I2C
pm25 = PM25_I2C(i2c, reset_pin)

print("Found PM2.5 sensor, reading data...")


====

code.py output:
Traceback (most recent call last):
File "code.py", line 25, in <module>
ValueError: SCL in use

User avatar
davidb21
 
Posts: 49
Joined: Mon Mar 24, 2014 9:13 am

Re: Funhouse problem with PM25 module.

Post by davidb21 »

IMG_1230.jpg
IMG_1230.jpg (440.32 KiB) Viewed 121 times
I was able to get the default pm25 code working, but would like an example that uses the funhouse temp and humidity. I used double sided tape to mount the pm25 module.

User avatar
tannewt
 
Posts: 3298
Joined: Thu Oct 06, 2016 8:48 pm

Re: Funhouse problem with PM25 module.

Post by tannewt »

Try using `board.I2C()` instead of a separate `busio.I2C`. The board version is a singleton which means it's created once and then shared with anything else that tries to make it. That's not how `busio.I2C` works.

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

Return to “Adafruit CircuitPython”