M4 Express + Airlift + PMSA0031 For Tutorial?

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
scotch1
 
Posts: 246
Joined: Mon Nov 26, 2012 12:13 am

M4 Express + Airlift + PMSA0031 For Tutorial?

Post by scotch1 »

Believe I have parts for this tutorialhttps://learn.adafruit.com/remote-iot-e ... tal-sensor, except the AirQualitySensor trying to substitute is this onehttps://learn.adafruit.com/pmsa003i/arduino using the Stemma QT and I2C. THe tutorial appears to use the 3V,GND and TX of this airqualitysensor https://www.adafruit.com/product/3686.

Q1: Can the AirQuality Substitution work with this tutorial?
Q2: 2 sensors on I2C: Is it a major code change to adapt to these components?
Q3: Underatanding that 0x12 for AQ Sensor, 0x76 or 0x77 for BME280, how to integrate into code?

Reference:
I2C chaining: https://learn.adafruit.com/i2c-addresses/the-list
Circuit python I2C: https://learn.adafruit.com/circuitpytho ... 2c-devices

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

Re: M4 Express + Airlift + PMSA0031 For Tutorial?

Post by dastels »

Yes, the I2C version of the air quality sensor can be used. You would have to rewrite the air_quality.py file to use I2C to interact with the sensor.

No, I2C is designed to support multiple devices, with the caveat that they mush have different addresses.

No real integration required as they are separate devices with different addresses. All the would need to change is the interface to the air quality sensor. That's encapsulated in the AirQualitySensor class. You would use the Adafruit_CircuitPython_PM25 library/module to get the data from it instead of reading it from the uart.

Very little changes... just the bits that use the uart to get the data from the air quality sensor.

Dave

User avatar
scotch1
 
Posts: 246
Joined: Mon Nov 26, 2012 12:13 am

Re: M4 Express + Airlift + PMSA0031 For Tutorial?

Post by scotch1 »

A polite Request for an adaption to the tutorial for the I2C version :)
Not a coder, I'd struggle way too much to adapt standalone python files and see most of the air_quality.py file is about extracting and formatting the serial text: Would it be better to eliminate that air_quality.py file and include the air q sensor in the code.py file?

Like ?

Code: Select all

from adafruit_pm25.i2c import PM25_I2C
i2c = busio.I2C(board.SCL, board.SDA, frequency=100000)
pm25 = PM25_I2C(i2c, reset_pin)
aqdata = pm25.read()
print("PM2.5:", aqdata["pm25 standard"])
But I wouldn't be sure how to add the specific address to avoid the BME280 and the overall architecture of the programming :(

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

Return to “Itsy Bitsy Boards”