#Air quality sensorness

1 messages ยท Page 1 of 1 (latest)

surreal fossil
#

If you're using forced calibration then it doesn't actually need 24 hours before doing it, only about 5 minutes IIRC (my code gives it that +2 minutes I think). I think if you turn on automatic after it'll use the existing value as a base. Here's my code for it, though you'll need to point it to a couple of fonts to work, can chuck you those too if you want.

kindred raven
#

now you've got me curious ๐Ÿ™‚ I thought you'd need, after auto_calbration_enabled = false, to call scd4x_device.force_calibration() with a known value then persist settings, then possibly reinit. There's a pdf I was reading just the other day, but on my phone so no idea the link, but the sensirion scd linked guidance.

#

It's called Testing Guidance, on the scd41 page

surreal fossil
kindred raven
#

ah got you, somehow I missed that, maybe time of night ๐Ÿ™‚

surreal fossil
kindred raven
#

So my hope was to do that to all the sensors, then ship them out as part of kits with the code set for ABC off, and a written reminder, then all should be good. Also I heard it's lowest CO2 about 5am, as the dusk changes and before traffic. Yeah that's the board

#

Crucial difference ๐Ÿ˜‰

surreal fossil
#

I forgot that one existed, would make it a bit easier, though I'm still a little tempted by the board Adafruit sell that's totally plug + play, but the Sensirion sensor is rated for 3x longer life and does NOx

#

Are you powering them over USB?

kindred raven
#

so it turns out to be a massive unit, and theyve as good as admitted its just the sgp41 in there plus PPM. So look at other ppm to. Yeah over usb. Battery would suck for the sen5x, it internally poles at 1hz. You can persist its auto-learning but only for ten minutes before You should consider it invalid (after deepsleep / recharge)

surreal fossil
#

Hmm it does seem bigger than the Adafruit/Plantower one

#

what is up with PM sensors having weird connectors

kindred raven
#

I used them, and the panasonic/philips one (smaller and quite nice). So annoying, and this latching one is a right pain, but readin the previous version having bad connection problems makes some sense

surreal fossil
#

this uses I2C so it seems so odd

#

latching?

kindred raven
#

Looks like it was meant to be uart too, as you have to enable i2c

#

yeah latching jst

#

jst GHR i think

surreal fossil
#

ahh

kindred raven
#

I'm very disattisfied with the sen5x only having a gas "index" for voc and nox instead of ppb, but they downrated their earlier sensors to say similar. At least it has onboard smarts, hence the 1hz internal polling

surreal fossil
#

huh, the sgp41 doesn't do an actual NOx number?

kindred raven
#

nor voc, and if you check the sgp3X (VOC) and update notice from sensirion they say it aint ppb it's worth thinking of it as an index ๐Ÿ˜†

#

haven't found any realiable cheap mems gas sensors.

surreal fossil
#

ah, just found that

kindred raven
#

This is the panasonic one (I got a sample) and it uses the same latching but less pins. If you snip a pin of the sen5x cables it fits nicely.
https://industry.panasonic.eu/products/components/sensors/particulate-matter-sensor
So much smaller. Add an SGP41 and you've beaten the sen5x for size and matched features.
Just heard theres a co2 sensor from company begining with I (sorry forgot name), they've got a competition running on hackster.io and free hardware which mentioned it.

surreal fossil
#

yeah I got a Honeywell one years ago but I think it's UART only IIRC and has a maddeningly tiny little connector

kindred raven
#

i2c all the way ๐Ÿ™‚

#

except distance...

surreal fossil
#

the Sensirion ones are for at least 10 years, probably helps that they have a self cleaning thing

kindred raven
#

ooh good spot. I figured my rating would be 2 at best for any of them. Amount of dust / humidity before a quick swap every x years or once data looks anomalous

#

(smoking house, but also I imagine clients / real world abuse)

surreal fossil
#

Not sure I've run into any issues with the board itself making much heat though, you sure that's why the temp readings are wrong?

kindred raven
#

I'm curious, I have a load of the SHT3x and 4x too, all the models with differing accuracies, and then some other si7021 + htu21 (all mems humidity too), and they read hotter than some DS18b20's and other i2c only reasonbly high accuracy temp sensors.
I think the mems humidty sensors report higher generally.
Separately to that my first box had no holes, and compared to another identical set of components with no box showed massive heating. You can feel the screen is hot generally (I must have max brightness). And then one box with holes showed an improvement compared to sealed box, but still degrees above the loose in air components setup. I now have two other boxes that are more holes than box (the sensor is only a few cm away from esp32), but still show increase compared to in-air setup.

surreal fossil
#

try adding a dedicated sensor and seeing what it reads

kindred raven
#

This was my thought, have another reference, but I know technically I should be doing loads of enclosure testing then adding a correct offset, or even using the esp32's core temp to influence the scd4x offset ๐Ÿ™‚

surreal fossil
#

You using an off the shelf enclosure? I've been trying to work out what I'll use for an outdoor sensor because I live in an apartment very high up, so it's a bit unclear if I should put it on the outdoor windowsill or try and mount it to my window or what, plus I'd like to weather seal it but obviously that won't work if I'm going to do humidity and/or PM

kindred raven
#

Not currently, some laser cut madness, and was experimenting with 3d printed. I wanted people to be able to use different suppliers modules and swap them out / replace one small piece.
I'm indoors mentally for most of the devices. Got a greenhouse that does the high humidty testing, but most don't like it. The si7021 has PTFE membrane and is so say 100%. They all say non-condensing humidity usually. I'm pretty sure there's a cap, sensirion SF2, but it brings the co2 response time to 2minutes, and no-one sells them fitted, and there's an SMT level gluing job (possible by hand with syringe or just skill, but they recommend you try a few with precise amounts and verify squidge / coverage afterwards, pick best and continue, like your not a hobbyist but an SMT line)

surreal fossil
kindred raven
#

Yeah, they've got a cool name too. My mental issue is microclimate accuracy (very different from 1corner to next in greenhouse)

surreal fossil
#

I mean right now I mostly just want to know when it's actually cooler outside than inside so I can open the windows heh

kindred raven
#

hah, yeah, it's got unreasonably hot everywhere

#

mustn't grumble

surreal fossil
kindred raven
#

ah good spot, the end of the more info says "The particulate matter sensing component is available as a part of the SEN6x."

surreal fossil
#

..though I can't work out what is actually upgraded

shut flax
#

they've combined the certification of the 42 for californ

#

*ia, and clarified the low power stuff, but basically same

surreal fossil
#

Just coming back to this now and wondering if I should order a SEN55 hmm. Tempted by the Adafruit board because I know it'll be super duper easy to use, just trying to go over your code and pick out just the SEN55 related bits

kindred raven
#

Go sen54, the nox won't offer you anything

#

Takes a flame under a saucepan to react

surreal fossil
#

I mean the difference is like ยฃ4

kindred raven
surreal fossil
#

ahhhhhh I missed the example

kindred raven
#

Took me weeks to see it and update it ๐Ÿ™ƒ

surreal fossil
#

oh and FWIW I found a sparkfun cable adapter for it

#

you aware of ESPNOW btw?

kindred raven
#

Yeah, there's a cool components (uk) cable with dupont, and I got a bunch of double ended cables to cut in half. Someone's doing a grove version, probably seeed, and now sensirion say cable coming soon

#

Yeah not tried in cpy yet, I'm blessed with slow but okay WiFi over garden too

surreal fossil
#

I need to tidy it up a lot, but I've got code for it if you want it, the big thing for me is that you can use it to potentially massively improve battery life by using it with another ESP32 board connected to power as a relay

kindred raven
surreal fossil
kindred raven
#

that's significant. I still wonder if wifi can ever be low power enough, but if BLE can then the frequency works, just needs to be something like espNOW or I want to play with LongRange wifi (ESP only too)

surreal fossil
#

I mean best case scenario is probably Thread or LoRa

#

but Thread isn't supported in CP yet and LoRa comes with some extra challenges and you have to very actively pick boards that have it, while WiFi means you can use it or ESPNOW

kindred raven
#

yeah waiting for the new H series chips to be volume and bigger ram/flash etc, then matter here I come.

#

the license thing with most lora meant chip price fixed at $12

#

maddening

surreal fossil
#

also be aware that last I checked, the TFT boards had a bug which made it hard to fully turn off the I2C regulator for deep sleep

#

You got a PPK2?

kindred raven
#

nooo, shoestring budget. still want a nice scope+logic analyser

surreal fossil
#

I'm a big fan of it heh

kindred raven
#

super good, but only once I need to power optimise, worth buying then for sure

#

the sen5x didn't seem great for low power due to the internal algorithm preferring continuous data and polling at 1hz, but I did stick it straight on one ๐Ÿ˜„

surreal fossil
#

it can prefer whatever it wants right up until I kill power to the I2C regulator ๐Ÿ˜›

kindred raven
#

hah, yeah, absolutely right, down with you LDO

surreal fossil
#

while I get the ease of use thing, I hate the LEDs on STEMMA QT boards, good that some of the newer ones have a pad you can cut

#

also I am still dreaming of Adafruit finally making the ABLIC low power timer board they teased last year

kindred raven
#

oh yeah same, like to see it working, then desperate for the pads to cut.
Ooh not heard of that

surreal fossil
#

the ABLIC promo video is a lot

#

it's a super low power timer chip that's programmed over I2C

kindred raven
#

okay save that for later. In my head the esp with correctly disabled LDOs should be enough to get super-low levels.

#

okay the numbers speak volumes

surreal fossil
#

What's the two ground pin thing about?

kindred raven
#

interface select to i2c, pin 5. man that took a while

surreal fossil
#

ahh, this probably means I can't just use the Sparkfun cable + a dupont-> stemma cable

kindred raven
#

the stemma running 5v?

surreal fossil
#

yeah was gonna use the boost board

kindred raven
#

oh fine then, thats what ive done too, just merge the grounds

surreal fossil
#

yeah just thinking about the best way to do it physically

#

surprised that nobody seems to have thought to stick a boost chip in the sensors themselves so you can run them at 3V

kindred raven
#

left is double-ended (cheapest), then one joined to 4pin header, then 3xQwiic/StemmaQT direct connections (for the qwiic boost boards)

#

oh and bag of sparkfun at top. Someone also sells the female dupont version

surreal fossil
#

I should probably think about getting heatshrink heh

#

I keep meaning to buy electrical tape but then have trouble finding any that isn't PVC

kindred raven
#

to be fair hotglue and some backing paper from stickers/tape works so well for diy cables, strain relief too

surreal fossil
#

oh and are you aware of WAGO connectors btw?

#

they're what I usually end up using instead of heatshrink/soldering wires together heh

kindred raven
#

yeah, and the clones ๐Ÿ™‚

#

thought you meant higo conectors, not cool, very good but hard to seperate

surreal fossil
#

ah no

kindred raven
#

They look good in proper mounts, my sticky pads are good-enough but not great cleanup

surreal fossil
#

yeah it's the inline 221s I really like, but it is weird to me they still haven't made ones akin to the knock-offs that are joined but connect multiple separate things

kindred raven
#

ha, really? I love the inlines too. Got some crazy ones for i2c, 4 to 12, coloured too, but the spings soo strong if you open all the contacts at once it's case separates / detonates

surreal fossil
#

yeah this is the downside of knockoffs heh

kindred raven
#

I consider it a feature? or sign the springs will retain force for years to come ๐Ÿ˜†

surreal fossil
#

it's like WAGO, just make this as one item pls

kindred raven
#

I found that style easily / cheaply, but these are always crazy money

surreal fossil
#

yuup

#

I'm like pls WAGO make a good version of the knockoffs people made heh

kindred raven
#

still, a dollar a piece or whatever saves you so much faff

surreal fossil
#

also small thing but Sparkfun sell silicone wire versions of stemma qt cables

#

love me some silicone wires

kindred raven
#

oh nice. I wish that was legally required labelling, material type.

surreal fossil
#

I'm looking forward to the EU banning PVC in the years to come, though the flexibility of materials usually tells you

#

I got a fancy USB 4 cable and it's TPU and oh my god it's so flexible it's glorious

surreal fossil
surreal fossil
#

seems to use a lot less power than the SCD4x

kindred raven
#

Interesting, not seen that exact one but sense air is familiar. Got some Winsen too, but they're all quite big. Its the no soldering element that blows the design size

#

Want to try the infineon one, only saw last month, but similar small i2c.

surreal fossil
#

Yeah I'm mostly interested it in terms of the seemingly much lower power consumption

#

should make longer battery powered operation for CO2 a lot more feasible

#

though looks like it can't work under 0C interestingly

kindred raven
#

Ah good spot. The other one for me is ideally high humidity. Most won't take condensing humidity ๐Ÿ˜’

#

There is the SF2 filter cap for sensirion scd4x, but raises response time from 30s to 2mins. (Obviously its more responsive than 30s/2min but they say for settling time and to guarantee accuracy at stated percentages.)

#

Makes it waterproof, so say, 100% humidity and condensing too, instead of non-condensing only. The app notes to glue it on show some expensive trial and error and precision. Not worth my time probably...but no one sells assembled units

#

I only get to high 90s but its condensing. Think greenhouse or bathroom.

surreal fossil
#

I'm still trying to work out how to deal with the extra wire. Ugh, why can't it be I2C by default?

kindred raven
#

ha, had those thoughts too many times. right old pain. but also maybe the ,metal case was grounded so you could just wedge it under the metal case (i unclipped one and it has a spring connecting the metal clip case to the inner circuit board)

surreal fossil
#

..so is it grounded or not?

kindred raven
#

can't remember ๐Ÿคฆโ€โ™€๏ธ

#

I think it was, or at least I guessed it was to improve shielding or whatever

surreal fossil
#

lol Adafruit are now selling the cable for the SEN54/55 and are apparently making a breakout for it soon

#

Same day I order one and a sea of cables from Digikey heh

surreal fossil
#

"We might have a breakout board that lets you connect to those in the future.."

#

aand it already shipped darnit

surreal fossil
#

Just got my SEN55 though the boost board isn't going to be here until tomorrow. Until then, am I right to assume I could do:

USB pin on USB-powered Feather (so 5V output) -> VDD on SEN55
GND pin from Stemma QT connector on Feather -> GND on SEN55, bridged to the SEL pin
SCL pin from Stemma QT connector on Feather -> SCL on SEN55
SDA pin from Stemma QT connector on Feather -> SDA on SEN55

kindred raven
#

Got one connected exactly like that.

#

The boost makes the qwiic cables possible, but that's a custom cable I made, and battery powered mode. Otherwise what you have now is easiest

surreal fossil
#

cool

#

oh and I think the metal is indeed grounded yeah

#

Still find it odd nobody seems to just stick a boost chip onto these sensors so they can run from 3V

kindred raven
surreal fossil
#

ooh that's like a constallation of test pads

kindred raven
#

I'm tempted to make an inline cable version like that

surreal fossil
#

you saw that Adafruit are gonna make a breakout for it btw?

kindred raven
#

I heard yeah, so they use the double ended jst GHR cables.

#

Thats why I thought maybe the inline qwiic boost cable made more sense, get a tiny inline package

surreal fossil
#

to be clear, I figure their breakout will be like their one for the Plantower sensor, with an integrated boost

#

also the sparkfun adapter cable's colors vs this thing are surreal, VDD is green okay then

kindred raven
#

Yeah and to sit flat etc. Makes more sense. I like the cable for replacing after x years, imagining a more industrial setting like HVAC vent

surreal fossil
#

not sure why the cable is better than an integrated connector on a board tbh

kindred raven
#

My cables are random rainbow, and using a double ended cable as two singles means ones always wrong. Very confusing.

kindred raven
surreal fossil
#

ah makes sense for that

#

small thing but you have 2.4MB total storage space on your Feather TFT right?

kindred raven
#

They vary sometimes if not erased between large version upgrades, but yeah (no i have a 900kb font but yeah)

surreal fossil
#

oh boy your code.py likes resetting things

kindred raven
#

I never wanted to come back to a frozen device, rather see the line number in the log file

surreal fossil
#

oh yeah I should probably try the simple sample code not the full code.py

kindred raven
#

A lot of that code relates to being throttled on adafruit IO, makes the file huge

surreal fossil
#

should NameError: name 'SEN5X_DEFAULT_ADDRESS' is not defined not be an issue once I actually plug it in?

kindred raven
#

No, that's an issue. I haven't actually run the quickstart code. Fudge it to be similar to my code.py
In theory that should be part of the sen5x library in that repo

surreal fossil
#

Hmm should the fan spin as long as it has 5V?

kindred raven
#

oh its missing from the import

surreal fossil
#

though the fan not spinning is worrying me a bit, also:
Note, that there is an internal electrical connection between GND pin (2) and metal shielding. Keep this metal shielding electrically floating to avoid any unintended currents through this internal connection. If this is not an option, proper external potential equalization between GND pin and any potential connected to the shielding is mandatory. Any current though the connection between GND and metal shielding may damage the product and poses a safety risk through overheating.

#

Hoping that means it's fine that I copper taped the SEL pin to it..

kindred raven
#

refresh, fixed the quickstart. Import is there, and device corrected to sen5x_device

surreal fossil
kindred raven
#

sorry my bad, there is no default address

#

it's a default argument, i've removed from quickstart

#

glad someones finally testing it ๐Ÿ˜‰

surreal fossil
#

File "code.py", line 9, in <module> TypeError: function takes 3 positional arguments but 2 were given

kindred raven
#

which module and whats line 9 do

surreal fossil
kindred raven
#

Change the import and that to CircuitPythonI2cTransceiver, but I think my code.py does it like that with just i2ctransciever

#

CircuitPythonI2cTransceiver

surreal fossil
#

so
`from sensirion_i2c_sen5x import Sen5xI2cDevice
from sensirion_i2c_driver import circuitpython_i2c_transceiver,I2cConnection
import board

setup i2c - see CircuitPython docs, or get from board

i2c = board.I2C()
transceiver = circuitpython_i2c_transceiver(i2c)
sen5x_device = Sen5xI2cDevice(I2cConnection(transceiver))`

kindred raven
#

No as I wrote it, not underscored

surreal fossil
#

ImportError: no module named 'sensirion_i2c_driver.CircuitPythonI2cTransceiver'

#

(can you tell I'm basic and also sleep deprived?)

kindred raven
#

hmm

#

do you have that library there?

#

can you import sensirion_i2c_driver

#

man I should have tested that better. I would have before release, and it's still not released to community bundle cos I need to fix/generate docs etc.

surreal fossil
#

I copied all the stuff from the lib folder into my one

#

though I used underscores because in it, it's circuitpython_i2c_transceiver

surreal fossil
#

though if I use the underscore version (from sensirion_i2c_driver import circuitpython_i2c_transceiver,I2cConnection) I instead get:

  File "/lib/sensirion_i2c_sen5x/device.py", line 121, in device_reset
  File "/lib/sensirion_i2c_driver/device.py", line 61, in execute
  File "/lib/sensirion_i2c_driver/connection.py", line 115, in execute
  File "/lib/sensirion_i2c_driver/connection.py", line 131, in _transceive
AttributeError: 'module' object has no attribute 'API_VERSION'```
#

(line 13 is sen5x_device.device_reset())

kindred raven
#

from sensirion_i2c_sen5x import Sen5xI2cDevice
from sensirion_i2c_driver import I2cTransceiver,I2cConnection
That's all I use in code.py, but I do define the default address and pass it into the contructor
https://github.com/good-enough-technology/Good-Enough_Air-Quality-Device_CO2-SCD4x_PM-SEN5x_CircuitPython/blob/main/code.py#L433C1-L433C1

https://github.com/good-enough-technology/Good-Enough_Air-Quality-Device_CO2-SCD4x_PM-SEN5x_CircuitPython/blob/main/code.py#L466

GitHub

Circuitpython code for the adafruit ESP32-S2 Reverse TFT (240x135) with Sensirion SCD4x CO2 sensor and SEN5x Particulate/Gas sensor - Good-Enough_Air-Quality-Device_CO2-SCD4x_PM-SEN5x_CircuitPython...

surreal fossil
#

what do I do?

#

If I do:

from sensirion_i2c_driver import I2cTransceiver,I2cConnection


# setup i2c - see CircuitPython docs, or get from board
i2c = board.I2C()
transceiver = I2cTransceiver
sen5x_device = Sen5xI2cDevice(I2cConnection(transceiver))```
I get this for the device reset line:
```  File "code.py", line 13, in <module>
  File "/lib/sensirion_i2c_sen5x/device.py", line 121, in device_reset
  File "/lib/sensirion_i2c_driver/device.py", line 61, in execute
  File "/lib/sensirion_i2c_driver/connection.py", line 115, in execute
  File "/lib/sensirion_i2c_driver/connection.py", line 141, in _transceive
  File "/lib/sensirion_i2c_driver/connection.py", line 162, in _transceive_v1
TypeError: function missing required positional argument #0```
#

If I modify it to be:

transceiver = I2cTransceiver(i2c, SEN5X_DEFAULT_ADDRESS)```

then I get:
```  File "code.py", line 22, in <module>
NameError: name 'device' is not defined```
kindred raven
surreal fossil
#

ooh shiny

kindred raven
#

do careful manually find and replace for device and sen5x_device

surreal fossil
# kindred raven do *careful manually* find and replace for `device` and `sen5x_device`

I then get:

  File "/lib/sensirion_i2c_sen5x/device.py", line 99, in get_version
  File "/lib/sensirion_i2c_driver/device.py", line 61, in execute
  File "/lib/sensirion_i2c_driver/connection.py", line 121, in execute
  File "/lib/sensirion_i2c_driver/connection.py", line 210, in _interpret_response
  File "/lib/sensirion_i2c_driver/connection.py", line 224, in _interpret_single_response
  File "/lib/sensirion_i2c_sen5x/commands/wrapped.py", line 266, in interpret_response
  File "/lib/sensirion_i2c_sen5x/commands/generated.py", line 1129, in interpret_response
ValueError: bad typecode```
kindred raven
#

whats this running on?

surreal fossil
#

S2 TFT Feather

kindred raven
#

cool

surreal fossil
#

Just did an basic I2C scan to check and it finds it

#

just realised, if Adafruit are looking at making a breakout, maybe they're working on a library too?

#

okay amusingly if I comment out the print device info section, it gets data, though not any NOx or VOC data weirdly

#
Mass Concentration PM1.0:    2.8 ยตg/m^3
Mass Concentration PM2.5:    2.9 ยตg/m^3
Mass Concentration PM4.0:    2.9 ยตg/m^3
Mass Concentration PM10.0:   2.9 ยตg/m^3
Ambient Humidity:            32.69 %RH
Ambient Temperature:         27.42 ยฐC
VOC Index:                   0.0
NOx Index:                   0.0
Device Status: 0x00000000 [OK]```
#

Do I need to do something to tell it it's a SEN55 and it can do that?

kindred raven
#

they take ages to settle

#

like 30s

surreal fossil
#

ahhh

#

seeing it come in now

kindred raven
#

then nox = 1 and voc=~100

#

so whats the code you ahve, basically the quickstart only?

surreal fossil
#
import board
from sensirion_i2c_sen5x import Sen5xI2cDevice
from sensirion_i2c_driver import I2cTransceiver,I2cConnection

# setup i2c - see CircuitPython docs, or get from board
i2c = board.I2C()

SEN5X_DEFAULT_ADDRESS = 0x69
transceiver = I2cTransceiver(i2c, SEN5X_DEFAULT_ADDRESS)
sen5x_device = Sen5xI2cDevice(I2cConnection(transceiver))

# Perform a device reset (reboot firmware)
sen5x_device.device_reset()

""" sen5x_product = sen5x_device.get_product_name()
# Print some device information
print("Version: {}".format(sen5x_device.get_version()))
print("Product Name: {}".format(sen5x_device.get_product_name()))
print("Serial Number: {}".format(sen5x_device.get_serial_number())) """


# Start measurement
sen5x_device.start_measurement()
while True:
    # Wait until next result is available
    print("Waiting for new data...")
    while sen5x_device.read_data_ready() is False:
        time.sleep(0.3)

    # Read measured values -> clears the "data ready" flag
    values = sen5x_device.read_measured_values()
    print(values)

    # Access a specific value separately (see Sen5xMeasuredValues)
    mass_concentration = values.mass_concentration_2p5.physical
    ambient_temperature = values.ambient_temperature.degrees_celsius

    # Read device status
    status = sen5x_device.read_device_status()
    print("Device Status: {}\n".format(status))
    time.sleep(5)```
kindred raven
#

curious, all those get-product name and serial etc work for me

#

not recently tested, but I check the serial each time

#

and product name ( so i can skip not available metrics and know if thats due to errors or missing features)

surreal fossil
#

Have you got the SEN55 specifically?

surreal fossil
kindred raven
#

cool, don't do that then ๐Ÿ˜‰

#

I'll look into it this weekend

surreal fossil
#

I was wondering why the readings were going up and now I think I can smell a neighbour smoking weed

kindred raven
#

oh the best rope... its funny that there's so much stigma

surreal fossil
#

or maybe just cooking..

#

either way, ah thanks for the data points haha

kindred raven
#

ha, pleasure. Thanks for the impromptu testing ๐Ÿ˜‰

surreal fossil
#

heh I meant the neighbour, but you're welcome, thanks for the library/code

#

oh yeah, I remember you mentioned heating from the chip, have you tried dimming/disabling the display backlight to see if that's related?

kindred raven
#

too much lettuce for me too.
Definitely related, but the qtpy gets hot too, the esp32's all do in my experience. Full backlit display just makes it a lot worse

#

30mm fan 5v super low power but solved as it were.

surreal fossil
#

are you time.sleeping when you can?

#

asking because I know it drops power usage basically to the same level as light sleep when you invoke that

kindred raven
#

i got a person sensor with the plan to turn off display until ppl, but I dont like the idea of not being able to glance from afar. Probably be an RGB LED and E-Ink display for stats in future versions

surreal fossil
#

also wondering if I need to construct a little bit of cardboard or something to thing to try to make the air inlet/outlets distinct from one another

kindred raven
#

so if directly exposed then its okay

surreal fossil
kindred raven
#

if not then you want a channel

surreal fossil
#

ah yeah it's just gonna be in free air is the plan

kindred raven
surreal fossil
#

yeah I wish they weren't so pricey

#

but instant updates with zero lag or display flashing

#

eink flashing isn't compatible with ADHD heh

kindred raven
#

exaclty. I get upset about $10 for a couple of inches, be a long time before I have some

surreal fossil
kindred raven
#

oh yeah good point. Maybe some e-ink hybrid without the strobing refresh

surreal fossil
#

also, you aware of the Oddly Specific Objects displays?

kindred raven
#

yeah nice one

#

made me want to make an LCD.

surreal fossil
#

yeah he's making a Stemma QT version right now

kindred raven
#

but shocked the product page doesnt show all the symbols, only the video does

surreal fossil
#

pretty sure it's in the docs

kindred raven
#

shows the moon and time, but no wifi etc I think

#

I was surprised when I saw about 5 extra things I hadn't known were there

kindred raven
#

oh yeah, sorry meant the adafruit product page for it. new new new was where i saw it

#

Just had a thought, might be related to no delay after resetting device. I have a 1.1second delay in my code before interrogating the device, but I also don't use get_Version

surreal fossil
#

hmm

#

nope, still crashes

kindred raven
#

thanks for testing it

surreal fossil
kindred raven
#

hmm, can't remember if it was part of the datasheet or just bad habit

surreal fossil
#

also the VOC and NOx indexes aren't changing from 100 and 1

#

okay lighting a match got the VOC one to shoot up at least

kindred raven
#

Stick under a cooking pan or tub, light the match under the pan/tub, make sure to have shut pan/lid back down, NOx will rise.

#

Watch their YouTube video on it

surreal fossil
#

I've got no gas

surreal fossil
#

also me forgetting to order a Stemma QT multiport = the most absurd cable spaghetti I've ever seen now

kindred raven
#

Ha, my home made adapters are like spikeballs of pins and headers with qt cables winding out. Then imagine sensors protruding. Spaghetti is being generous

surreal fossil
#

it's annoying that cable making tools are so pricey

#

Would be lovely to be able to make lots of little silicone cables with Stemma QT/JST PH/header pins on each end

kindred raven
#

Got the kit eventually, although not many of the qt ph ends, but so much faff. Still, worth it for a few. Was desperate to do some jst battery connectors, plus more dupont cables.

surreal fossil
#

Is it bad I'm almost sorta disappointed that the PM levels in my bedroom seem pretty low? mostly sub 5?

#

also is it normal that almost all of the measures are around the sound, only the PM1 varies and even then it's marginal

kindred raven
#

Thats fair. I did see sometimes higher with pollen or after fabric/paper microfibres released. Also any kind of aerosol / dust / smoke.
They have poor resolution changes at lower values it appeared to me

kindred raven
#

Been waiting 6months for that announcement, includes co2 sensing. Sadly mid 2024 release date

surreal fossil
#

yeah I saw it a while ago, thought it was meant to be later this year though

#

Any chance you have the code so it doesn't have to relearn the VOC index again?

surreal fossil
#

sen5x_device.Sen5xI2cDevice.get_voc_state() before sen5x_device.start_measurement()?

kindred raven
#

No sorry, after reading its only valid for a short time I skipped it.

surreal fossil
#

Itโ€™s about 10 minutes I think

kindred raven
#

yeah that sounds right.

#

maybe can be useful for deep sleep application but not my current need

#

Once it goes onto battery then it's a requirement

surreal fossil
# kindred raven maybe can be useful for deep sleep application but not my current need
GitHub

Circuitpython code for the adafruit ESP32-S2 Reverse TFT (240x135) with Sensirion SCD4x CO2 sensor and SEN5x Particulate/Gas sensor - good-enough-technology/Good-Enough_Air-Quality-Device_CO2-SCD4x...

kindred raven
#

oh sorry the driver includes all code, it's a fork of the official one. check the other repos

surreal fossil
#

I think sen5x_device.get_voc_state() did it, I mean, it didn't crash

#

though it also seems weird as a command to be just get state

kindred raven
#

you need persist settings and all that stuff, there's a good flow chart in one doc. (might be thinking of another sensor)

surreal fossil
kindred raven
surreal fossil
kindred raven
#

to the datasheets batman!

#

or tech docs anyway ๐Ÿ™‚

surreal fossil
#

yeah it didn't help heh

kindred raven
#

oh fair, it's a bit like swimming through mud sometimes

surreal fossil
#

so maybe I need to get that string and feed it to it?

kindred raven
#

usually I goto the offical arduino implementaiton, see whats going on there, and then do some googleing for the commands I don't understand. searching github occasionally yields results too.
I thought you could only use that data for passing to the set command, and maybe there were two, one for nox too

#

or to some init equivalent instead of set

kindred raven
#

could also try searching through the pdfs on the tech downloads section for that command or some parts of the words and you should see what to do

surreal fossil
#

I mean I think the link explains it I'm just bad at reading docs ๐Ÿ˜‰

kindred raven
#

got a feeling there's something about the order of things, maybe that's just about the legnth of time the data is valid, but I wonder if there was more in one of the docs. I'll shout if I revisit and find at some point.

surreal fossil
#

sure, the reason I care about this is that I'm currently moving it between rooms a couple of times a day with power cycling and it'd be nice to not have it be useless for ages

#

If I do sen5x_device.set_voc_state() I get: TypeError: function takes 2 positional arguments but 1 were given

kindred raven
#

check the offical examples

surreal fossil
#

where are those?

kindred raven
#

all on the product page in theory

#

what did it print from the Get command

#

surely it's two hexy stuff things as you put it, which could be passed in

surreal fossil
kindred raven
#

it only takes two arguments to set, in the sense that the first argument is self and is implicit, so you only pass in one argument, the value from get command

kindred raven
#

a = sen.getwhatever

#

sen.setwhatevre(a)

surreal fossil
kindred raven
#

it's the same

#

the sen5x is an SGP4x plus ppm sensor

surreal fossil
#

yeah that's why I checked it

kindred raven
#

all the tech docs are similar, but the information will be in the docs linked from the SEN54 product page.

#

not a specific python code example though

surreal fossil
#

if I do this, I get None printed, does that seem right?

#
print(sen5x_device.set_voc_state(a))```
kindred raven
#

if you look it doesn't return anything as it's return type in the doc comment above the method

#
GitHub

Circuitpython code for the adafruit ESP32-S2 Reverse TFT (240x135) with Sensirion SCD4x CO2 sensor and SEN5x Particulate/Gas sensor - good-enough-technology/Good-Enough_Air-Quality-Device_CO2-SCD4x...

surreal fossil
#

just trying to work out a way to see if I've actually done it correctly, have stuck a sen5x_device.get_voc_state() inside my loop later on as well

kindred raven
#

the key is, save it somewhere permenant, and then reboot the device and read it from the permenant storage and use it before starting readings, then VOC should stabilise very quickly and be accurate more quickly (no idea, it could be straight away)

surreal fossil
#

It's not super clear to me if the sensor has memory that is being used here or if I have to provide that myself

kindred raven
#

no it doesnt

#

no memory

#

after sensor reset it needs that value setting

#

i think it might help to read some more docs, but maybe fresh and not today

surreal fossil
#

need to work out how to get it to save this into a file and read it then hmm

kindred raven
#

lol, I need it, locked in a greenhouse, smoke central, bound to be depleted o2 in here

#

save to flash, or sleepmemory or nvm storage. You could also test by asking for the value over serial before letting the sensor start readings, but that's only to test not any real use

surreal fossil
#

also Royal Mail seem to have decided not to bother trying to deliver my boost board ๐Ÿ˜ฆ

kindred raven
#

ah dont, they've got more sen5x's for me too

surreal fossil
kindred raven
#

do we have store command?

surreal fossil
#

not seemingly, but I thought if the SGP40 has it then this would too

#

Unless it's just something the svm40 eval kit has

#

hmm I think it might be

kindred raven
#

ignore the SVM, it has extra components. probably like nvm / flash storage chip. They have specific software for it, but it's a combined SHT and SGP with the extra components, so just look at the SGP40 docs, or more sensibly, just the SEN55/54 technical links on the product page

surreal fossil
#

Hmm, so I got code that I thought should work, but even after an hour or two the VOC index was still showing as 1

kindred raven
#

There's some advice for some sensors about not using the baseline for the first X hours, like a settling in period

surreal fossil
#

was doing sen5x_device.set_voc_state(microcontroller.nvm[0:8]) before starting measurement, then microcontroller.nvm[0:8] = sen5x_device.get_voc_state() in my loop later on

#

yeah I thought doing it like this would ensure it updated it as time went on

kindred raven
#

You may have set a bad value too soon and won't see normal again until you reset sensor and don't set baseline.
I think it's 12 or 24hrs before the baseline is considered valid, and should be re obtained and saved somewhere every hour. Those times might be wrong

surreal fossil
#

and when I had it plugged in it seemed to be doing that

kindred raven
#

Every time it boots it's setting and starting with a bad value.

surreal fossil
kindred raven
#

I think you need to set it off initially and only set it on after a time period where you can be sure the value is valid.

surreal fossil
#

hmm

surreal fossil
kindred raven
#

think you want to double check data sheet but it might be fine. I know the panasonic one I have states 5V VCC but only 3v logic

surreal fossil
#

I'm not completely sure what bit tells me this

#

Input high level voltage?

kindred raven
#

yep

surreal fossil
#

so it should be able to handle 5V logic?

kindred raven
#

thats my interpretation

surreal fossil
#

ah the interface pins thing sounds like yeah it should be fine I think

surreal fossil
#

yup, worked fine though had to push all the jumper wires from my now absurd series of different wires, together properly

surreal fossil
#

kinda wishing I'd ordered a second cable for the sensor from Digikey so I could try making a custom cable without worrying too much that I'd mess it up and be left unable to operate it

surreal fossil
#

Oh and if you ever want to test a VOC sensor, filling the cap of a bottle of vanilla extract with it and then putting it next to it, works rather well..

kindred raven
#

Anything you can smell is usually a volatile organic compound. You can usually detect human breath too

shut flax
# surreal fossil just checked and it's the Version one specifically that fails

Update line 1129 in generated.py to this:


        firmware_debug = bool(checked_data[2])  # bool
        #firmware_debug = bool(unpack(">?", checked_data[2:3])[0])  # bool

fixed here:
https://github.com/good-enough-technology/CircuitPython_sensirion_i2c_sen5x

GitHub

Python I2C sensor driver for Sensirion's SEN54, SEN55 and SEN50 sensors - GitHub - good-enough-technology/CircuitPython_sensirion_i2c_sen5x: Python I2C sensor driver for Sensirion's...

surreal fossil
#

Is there some kind of combined value for PM I can get out of it? Sen5xMassConcentration?

kindred raven
surreal fossil
#

Just realised that with some cable surgery, the boost board should fit onto the top of the sensor, which should make it much tidier

surreal fossil
#

Oh yeah, what crimp tool did you get? Wondering if I can get one that'll let me make custom PH and SH cables

kindred raven
#

just a cheap-ish kit that included the standard model with changeable heads (only 1 supplied tho - but with box and connectors). Not got all those tiny jst connectors tho, some are too small and fiddly. I;ll do the odd one but well worth buying instead.

kindred raven
#

Most common on Amazon and AliExpress, with ratchet, not for ferrules. Changeable teeth / crimp jaws.

surreal fossil
#

hmmmm

surreal fossil
#

guess who just got an electric air duster..

kindred raven
#

an air duster? whats that then

surreal fossil
#

I have the model this guy is using to clean his vacuum cleaner: https://www.youtube.com/watch?v=fiC_K18MfVg&t=647s

This small but powerful air duster is designed to keep computers and other I.T. equipment dust free, but it also has multiple uses around the home. See why I wanted this machine and watch as I blast a load of dust out of my Dyson V10 cordless vacuum cleaner.

Check out current prices and availability from the Amazon affiliate links:

Amazon UK: ...

โ–ถ Play video
kindred raven
#

Ah brilliant, thank you. I want to clean an air filter and don't have access to compressed air (I have one can but wouldn't waste it on that). I thought about vacuuming it but awkward as ribbed.

surreal fossil
#

just be aware the filter on the bottom will often get filled with dust quicker than you expect, you just pull it out, remove the dust, then shove it back in (there's no door etc.), and that if something is really dusty, you really should do it outside and/or wear a good quality mask

surreal fossil
#

Hey, any chance you know what size of heatshrink works well for joining Stemma QT cables to the SEN5X cables?

kindred raven
#

Smallest one I have is a bit tight, one up only good for the double wire. About 1.5-2mm I'd guess

surreal fossil
#

Need to order some and would prefer not to get a big kit with sizes I won't use

surreal fossil
surreal fossil