Adding data to my Dashboard from CircuitPython using PMSA003

Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Locked
User avatar
Tom_Henry
 
Posts: 350
Joined: Wed Aug 26, 2020 8:19 pm

Adding data to my Dashboard from CircuitPython using PMSA003

Post by Tom_Henry »

1. Using Metro M4 AirLift Lite and BME280 and PCF8523

See attached Dashboard output for the code below:

while True:

t = rtc.datetime
# print(t) # uncomment for debugging
print()
print("Tom Henry's Sensor Data:")
print()
print("Today is %s: %d/%d/%d" % (days[t.tm_wday], t.tm_mon, t.tm_mday, t.tm_year))
todays_date = "%s: %d/%d/%d" % (days[t.tm_wday], t.tm_mon, t.tm_mday, t.tm_year)
print("The time is %d:%02d:%02d" % (t.tm_hour, t.tm_min, t.tm_sec))
todays_time = "%d:%02d:%02d" % (t.tm_hour, t.tm_min, t.tm_sec)
print()

print("Pressure: %.2f hPa" % sensor.pressure)
print("Pressure: %.2f psi" % psi)
# print("Pressure 2: %0.2f hpa" % bme280.pressure)
# print("Temperature 2: %0.1f C" % bme280.temperature)
print("Temperature: %.2f C" % sensor.temperature)
print("Temperature: %.2f F" % F)
print("Humidity: %.2f %% rH" % sensor.relative_humidity)
# print("Humidity 2: %.2f rH" % bme280.relative_humidity)
print("\n------------------------------------------------\n")
sleep(60)

# publish to adafruit io
io.publish("date", todays_date)
io.publish("time", todays_time)
io.publish("temperature", F)
io.publish("humidity", sensor.relative_humidity)
io.publish("pressure", psi)


2. Using Metro M4 AirLift Lite and PMSA003I

while True:
time.sleep(30)

print()
print("Concentration Units (standard)")
print("---------------------------------------")
print(
"PM 1.0: %d\tPM2.5: %d\tPM10: %d"
% (aqdata["pm10 standard"], aqdata["pm25 standard"], aqdata["pm100 standard"])
)
print()
PM = "%d\tPM2.5: %d\tPM10: %d" % (aqdata["pm10 standard"], aqdata["pm25 standard"], aqdata["pm100 standard"]

print("PM")
print()
print("Concentration Units (environmental)")
print("---------------------------------------")
print(
"PM 1.0: %d\tPM2.5: %d\tPM10: %d"
% (aqdata["pm10 env"], aqdata["pm25 env"], aqdata["pm100 env"])
)
print("---------------------------------------")
print("Particles > 0.3um / 0.1L air:", aqdata["particles 03um"])
print("Particles > 0.5um / 0.1L air:", aqdata["particles 05um"])
print("Particles > 1.0um / 0.1L air:", aqdata["particles 10um"])
print("Particles > 2.5um / 0.1L air:", aqdata["particles 25um"])
print("Particles > 5.0um / 0.1L air:", aqdata["particles 50um"])
print("Particles > 10 um / 0.1L air:", aqdata["particles 100um"])
print(“---------------------------------------")


3. Output from 2. Above

Found PM2.5 sensor, reading data...

Concentration Units (standard)
---------------------------------------
PM 1.0: 0 PM2.5: 0 PM10: 0
Concentration Units (environmental)
---------------------------------------
PM 1.0: 0 PM2.5: 0 PM10: 0
---------------------------------------
Particles > 0.3um / 0.1L air: 36
Particles > 0.5um / 0.1L air: 9
Particles > 1.0um / 0.1L air: 0
Particles > 2.5um / 0.1L air: 0
Particles > 5.0um / 0.1L air: 0
Particles > 10 um / 0.1L air: 0
———————————————————

I will be combining 1 and 2 to send info to Adafruit IO.

I need some help on on how to publish data from the PMSA003I sensor to my dashboard.

See attached to view my current dashboard from 1 above.

I would appreciate any ideas you might have on how to send say this part of the 3 output to my dashboard:

Particles > 0.3um / 0.1L air: 36
Particles > 0.5um / 0.1L air: 9
Particles > 1.0um / 0.1L air: 0
Particles > 2.5um / 0.1L air: 0
Particles > 5.0um / 0.1L air: 0
Particles > 10 um / 0.1L air: 0


Thank you,

Tom Henry
Attachments
Dashboard.png
Dashboard.png (515.01 KiB) Viewed 269 times

User avatar
brubell
Learn User Page
 
Posts: 2010
Joined: Fri Jul 17, 2015 10:33 pm

Re: Adding data to my Dashboard from CircuitPython using PMS

Post by brubell »

I need some help on on how to publish data from the PMSA003I sensor to my dashboard.
Do you need all the readings from the PMSA003I?

Dashboard blocks such as the line chart can display multiple feeds at once, which may be a good solution.

User avatar
Tom_Henry
 
Posts: 350
Joined: Wed Aug 26, 2020 8:19 pm

Re: Adding data to my Dashboard from CircuitPython using PMS

Post by Tom_Henry »

Thanks for your suggestions.

I finally figured out how to separate out the different air quality particles from Adafruit PMSA003I Air Quality Breakout - STEMMA QT / Qwiic.

I am still working on my dashboard but this is how it looks today.

Tom Henry
Attachments
Tom Henry Dashboard.png
Tom Henry Dashboard.png (473.55 KiB) Viewed 135 times

User avatar
brubell
Learn User Page
 
Posts: 2010
Joined: Fri Jul 17, 2015 10:33 pm

Re: Adding data to my Dashboard from CircuitPython using PMS

Post by brubell »

Looking good!

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”