-
Notifications
You must be signed in to change notification settings - Fork 11
Enviro+ tests #17
Comments
Normally, the PMS5003 should work, but I must admit I have concentrate in the Adafruit library for that sensor: https://github.com/adafruit/Adafruit_CircuitPython_PM25 so you may want to give that a try. I am partially responsible for making this code more robust, and ported some of Pimoroni enhancement to it, so I am interested if something goes wrong with that code. For the gas sensor, I have not used it in a while, but if I had to spend time on that part, I would give a try to @Gadgetoid new library: https://github.com/pimoroni/Pimoroni_CircuitPython_MICS6814 From memory, the gas sensor is just enabling the sensor, reading from three analogue input and doing some math. None of this is supposed to break in 6.0.0. I tested with 5.3 and early version of 6.0, but not since a long time. Could you give one or both of those a try? I have exactly the same hardware as you, so if time permit I can give it a new, but the future is in those new libraries and this repo should try to do the switch and provide new instruction. |
PM25 demo code in the Adafruit library likely default to their I2C sensor, but the one used in FeatherWing Enviro+ is UART. So you have to look into code.py and modify. Typically Adafruit simpletest demo code do comment out alternative configuration (using other pin or other variation of the hardware, like SPI vs I2C). |
I made a "quick" with the stable 6.0.0 and latest libraries. When you say that plotter only show the label, the default refresh time is to fill the screen in 24H so it is normal to only see the first pixel, but you can edit those exemple to refresh faster. I'll try a few other exemple, but so far, so good for me.
|
I did edit the polling interval from filling the whole screen to 1 second. |
Ok, so with test_all.py I have a problem with I2C for ltr559.
My best bet will be to get away from the old ltr559 and try the new library https://github.com/pimoroni/Pimoroni_CircuitPython_LTR559/ |
Ok, so I went for test_all.py and removed the ltr part, and I have similar result as you (except that my PM25 is not making error).
I don't know what is the range of value to expect from that library, but the following assertion are the trigger for those error message.
|
The new LRT559 works great for me with ltr559_simpletest.py
What need to be done in this repo is to:
|
For your PM25, it could be a bad serial connection: the cable, the connector, the sensor. |
Sorry, I am confused... you are using a "Feather M4 Express" so that would be running CircuitPython 6.0.0. |
Regarding Python version, you are correct and I was confused, sorry. |
BTW, I got the standard combined plotter code running using Version 1.0 libraries on CircuitPython All of these devices with temperature sensors suffer from some degree of self-heating and from heating from components nearby. Many have noticed this with Adafruit boards (Adafruit Forums: Offering calibrated temperature property). It's interesting to note the micro:bit DAL has a temperature adjustment feature to allow for very basic compensation. I've never looked through the Bosch datasheets but there's a very interesting comment on a YouTube video (TheHWcave: Review of Pimoroni's Enviro+ board - Part1 gas, temp., humidity, pressure and particulate matter) about these particular temperature sensors being designed to monitor the device temperature and not ambient air temperature. That's confimed in the replies in the YouTube comments. I'm going to have a look at some other options for external temperature sensing. There's plenty of cheap, decent-looking options out there and they can be positioned well away from the board (and its convection currents). Let me know if you beat me to it. |
Hey Kevin, |
Maybe putting the sensor directly on the board was not such a smart choice. Another issue I have with the Feather is that the screen and the sensor are at the same place, so you can only monitor inside. Having the screen and a few button inside, and all the sensor on an external board would make sense. Having a Stemma connector and a Stemma sensor a bit further could help. |
Yes David, I think that would help. |
Wait, are you stacking the FeatherWing on top of the Feather? |
I'm stacking. I think any board like this will always have limitations on sensor placement but they are a good platform to start with and experiment. BTW, the gas sensors work best with controlled airflow. There might be some neat ways to using the pms5003 in an enclosure to create that flow. I think I've worked out the pins and it looks like there's some spare, the names in brackets are Pimoroni's names.
|
Yes, I have it stacked too, that's how Adafruit shows it on their page. But it is not permanent I can unplug the Enviro and test it on another proto board. |
I plugged in a PMS5003 today and it works but it's pretty flaky. That's with the Version 1.0 download recommended in the docs. I missed a pin on the previous list:
|
My experience with PMS5003 is that the serial connection is difficult to have right. Right now I believe the best way to gather data from PMS5003 is to use the Adafruit Library and this PR: It enable a mode where the PMS5003 will only send values when we send a request and this is a much better way than to try to sync with the constant push of frame of data. Please give that a try and maybe give your feedback on the code or result. |
@dglaude Yes, there is a problem with producer vs consumer rates here. I've attached a logic analyser and for one run I can see for |
A bit of a rush job but I've put together Instructables: Using the Pimoroni Enviro+ FeatherWing With the Adafruit Feather NRF52840 Express to describe using the Feather nRF52840 Express with this board. I'm busy mid week but I'll see what I can do to get the PMS5003 comms into tip top shape. |
Thank you Kevin. |
There's no hardware flow control. |
This is from the Pimoroni github python library for RaspberryPi: It seems they are sitting in a loop and waiting for a signal from the sensor: then read how many bytes where sent Not very efficient but maybe they can get away with it on a multi threaded cpu. |
Thank you for the guide, I wish I could have read that earlier as I did not protect the gas sensor... I wonder if that was recommended by Pimoroni. For the serial communication with the PMS5003, I believe the proper way is that Pending PR. |
What do you mean by Pending PR David? According to https://github.com/adafruit/Adafruit_CircuitPython_PM25/blob/master/adafruit_pm25/__init__.py And, in the example provided, they are doing the same thing, sit in a 1 second loop reading the uart buffer. |
@dglaude You're ahead of me, I'd spotted that FeatherS2 but I knew I shouldn't buy one until I had time to use it! I've got something like a humble TMP36 somewhere and I was going to give that a go on the temperature side of things. If you go analogue there's a reasonably-well-known issue with reading from multiple pins with high impedance sources and multiplexed inputs. This is very likely to happen with Enviro+ with analogue external temperature sensor as the Enviro+ board has analogue outputs. It gets a mention at the bottom of https://learn.adafruit.com/tmp36-temperature-sensor and is discussed in https://electronics.stackexchange.com/questions/67171/input-impedance-of-arduino-uno-analog-pins |
For comparison, the CLUE suffers from heating from the backlight but it's not the only source. You have to scroll through the output but you can see a temperature drop from 30.88 to 28.74 in my second post on Adafruit Forums: CLUE temperature off a few degrees?. I started the discussion Adafruit Forums: CLUE temperature off a few degrees? |
The gas sensor has 3 independent heaters. Maybe the heat is dissipating through the ground layer to the temp sensor? |
I confirm it is the heater(s) from the gas sensor that influence the most the temperature measured by the bme280 and the following trick seems to avoid the issue:
I also disabled the backlight (but maybe that was not needed) but here is the code for that trick:
Now I need to decide what is the most important part of the Enviro+ between the Gas sensor and the temperature+pressure+humidity. But it seems that using both simultaneously is not an option. But at least now the temperature of both sensor (the bme280 and the external pct2075). |
That gas sensor is far more interesting. In conjunction with the PMS5003 sensor, it is providing much more interesting data. And the temperature is only marginally influencing pressure readings. I tried the code, it does not work for me. First error was about the missing import pimoroni_physical_feather_pins. I added that to the working code of the 3 plotters. Basically this is what I was trying:
|
Not sure what the problem is, need to try your code. For physical pin, I made this for FeatherS2: My plan is to use the deep sleep function of CircuitPython on ESP32S2 to wake, gather data, upload to adafruit IO, and sleep. I have to figure out the time to warm the gas sensor, so I could take the temperature before. I don't think I will use the screen as this would require remembering data during the sleep and the splotter code does not work like that. |
The specs don't say how long before the sensor is ready for measurment. |
Ok, I had something strange in my code... and your version has it too. So somehow, by setting this pin to false, it also turn the screen off: But I was also playing with the backlight in test just before or after Did I confuse pin9 and D9? (remember, I made the pin mapping myself for the ESP32S2). What Feather are you using for your test? |
Adafruit Feather M4 Express, yes there is a schematic for it, here: I take it back. A4 is pin 13. I got confused by the breakouts image. I can't find a schematic for the Enviro+ plus. |
I've probably power cycled the board 50 times now so this is rare but watch out for this one that affects the operation of the PMS5003: Pimoroni Forums: Enviro+ FeatherWing fails to produce 5V until power-cycled. |
It would be nice to have a schematic of the Enviro+. There is a buck converter power supply on the Enviro, looking at the bottom. |
Hi,
I have recently aquired the Enviro+ board and a feather M4 express from Adafruit.
I have istalled the latest CircuitPython 6 and the latest circuit python library.
After a few days, these are the results:
-the bme280 works, the bme280_simple.py works as expected
-the simple screen.py works as expected
-the plotter example don't work but the label is added on the screen
-the test_all.py will not complete unless I comment out the light/prox sensor code. the error reported is failure in I2C init
-if comment out the code this is the result:
bme280 and sound detector work because they use the adafruit library and analog input i assume.
I need some help going forward.
The text was updated successfully, but these errors were encountered: