I’ve just shared a new tutorial: “PiicoDev Atmospheric Sensor BME280 - Raspberry Pi Guide”
This guide will help you read weather data from your PiicoDev® Atmospheric Sensor and a Raspberry Pi single-board computer
Read more
I’ve just shared a new tutorial: “PiicoDev Atmospheric Sensor BME280 - Raspberry Pi Guide”
This guide will help you read weather data from your PiicoDev® Atmospheric Sensor and a Raspberry Pi single-board computer
Read more
Very impressive. I tried the BME280 on a headless Rasperry Pi Zero W and it was going in no time.
I then tried the advanced example to get more accurate valuesfrom:
Python crashed in the lines:
sdaPin=machine.Pin(6)
sclPin=machine.Pin(7)
NameError: name ‘machine’ is not defined
From the notes the SDA & SCL Pin are only implemented on the Raspberry Pi Pico.
I tried commenting the lines out, inserting dummy values but nothing seemed to work.
Has anyone managed to get this code to work on the Pi as distinct from the Pi Pico?
Thanks for raising this!
Yes it appears this demo was written with Raspberry Pi Pico in mind because it is relying on calls to machine
, and changes the default I2C pins - something we can’t yet do on a raspberry pi.
However, you can still play with the ‘advanced features’ like the IIR filter. Here’s something to get you started - I’ve just stripped out the code that is doesn’t play well on a Pi.
The really useful parameters in this example are the pressure_sea_level
argument which allows you to null-out your local mean-sea-level-pressure, and iir
which filters pressure samples.
from PiicoDev_BME280 import PiicoDev_BME280
from PiicoDev_Unified import sleep_ms
sensor = PiicoDev_BME280(t_mode=2, p_mode=5, h_mode=1,iir=2)
zeroAlt = sensor.altitude(pressure_sea_level=1013.25)
while True:
tempC, presPa, humRH = sensor.values()
pres_hPa = presPa / 100
print(str(tempC)+" °C " + str(pres_hPa)+" hPa " + str(humRH)+" %RH")
print(sensor.altitude() - zeroAlt)
sleep_ms(100)
This updated code will likely become an exact replacement for the advanced demo.
We’ll update the documentation to be more platform-agnostic - I’ve opened an issue in the repo on your behalf.
Hi Michael
Once again thanks for your prompt reply. I was interested in the advanced features to improve accuracy, especially for temperature. The pressure_sea_level argument could be useful for calibrating to official BOM readings.
I have used the BME280 sensor before and have noticed a couple of things wih readings which are also on the PiicoDev board.
The first is it seems to need about 30 minutes to “burn in”. For example when first used you can see the temperature measurement gradually go lower even in a stable environment.
The other is that the first few readings are often wild.
The first issue takes care of itself. With the second issue I get around this in the code. After power up I take five fairly rapid throw away readings before starting actual recording.
I cannot find any mention of this in the data sheets. Pimoroni noticed the same thing “In our testing, we’ve found that the sensor requires some burn-in time (at least 20 minutes) and that readings may take a couple of minutes to stabilise after beginning measurements”.
Note this is a comment on the BME280 sensor and not on the PiicoDev board which is absolutely superb!
I’ve ordered a PiicoDev BME280 board that I plan to use with a Raspberry pi. I didn’t order the connecting cable instead I plan to solder header pins to the board. I have downloaded the sample software and the problem is that I don’t know which board pin connects the which Raspberry pi pin. Can anyone help?
Thank you Michael and sorry to have bothered you. Being a long-time
Raspberry pi owner I should have known the answer. At the time I was
thinking that there are two pairs of I2C pins.
No problem @Phil196453 - the PiicoDev examples leave out pin numbering on purpose to remove as much ‘noise’ as possible for beginners since they’ll be using the default pins broken out by the PiicoDev adapters.
Which, Michael, brings up another question. Does the PiicoDev board use
the Pi Pico’s I2C 0 or 1. I’m guessing it’s I2C 0 which is pin 1 and 2.
I know it would be just a matter of trial and error to find out.
The machine
package uses I2C0, GPIO8 and 9 by default, so PiicoDev also uses these by default too. See the readme for changing the i2c bus or pins.
Thank you Michael and I’m looking forward to having the PiicoDev board
in my hand.
19 posts were split to a new topic: Using PiicoDev BME280 on the Pi 5
Hey Michael, I’ve had my Piicodev Atmospheric Sensor (plus a few other piicodev sensors) for over a year now in a fairly humid environment. My humidity is now reporting roughly 40 to 50% more than some other hygrometers I have (so basically maxed out at 100% most of the time), which leads me to think it needs reconditioning (as per the BME280 manual). Is there any reason the PiicoDev board couldnt handle that? Or can I go ahead and bake/rehydrate it.
P.s. all three of my piicodev sensors (precise temp, atmospheric, and ambient light) have lost their little green LED over time. Is this common?
The BME280 is only rated to ~80% humidity, anything higher than this and the sensor tends to get condensation in it that will give false results until it has dried out, if you’re looking for a sensor that is better suited to high humidity situations the SHT range of sensors will be a better fit, as it has a heating element built in that helps with preventing the condensation build up.
As for the LED failing, its not something that we have encountered, although it may be due to the high humidity conditions the boards are in.
Thanks Dan, I’ll have a look at the SHT range for my external sensors. Yeah the full exposure to the Australian outback is harsh on these little boards!
I have been running a number of BME280 Piicodev Atmospheric Sensors for a long period. I have been puzzled that the humidity readings became inaccurate by gradually increasing to the point that they now read 100% all the time. I was unaware of the reconditioning procedure to restore the calibration state so many thanks to @ProgrammerScum for pointing that out. The BME280’s have been operating within the spec viz 0-60degC and 0-100% humidity so theoretically reconditioning should not be necessary. One of the BME280’s has been used indoors and with the lower humidity exposure there is no excuse for it to have also moved to 100% readings.
Previously I reported that the BME280 was quite inaccurate for temperature readings and I moved to the TMP117. With the discovery of the problem with humidity readings I am very disappointed with the BME280 sensor.
If anyone is trying the SHT range of sensors would appreciate any feedback.
Hi @ProgrammerScum and @Fractal,
Thank you for sharing your observations on the BME280 sensor. It sounds like the issues you’ve encountered are not isolated, as similar experiences have been noted by other Makers around the net.
The BME280 remains a valuable tool for beginners seeking approximate measurements, and we appreciate your feedback as it helps us improve our product descriptions. We plan to update our product page to include information on long-term stability (with your findings) and further internal testing.
Not at all, all of the components are rated for well above this range - though any radiated heat or hot spots from an element may damage plastic components (i.e. in an oven).
I understand your disappointment with the BME280’s performance. We’ll perform long term tests in house and compare them to similar devices (SHTx and DHTx)
Could you please specify the measurement periods used during your tests? We’ll use the same in our setup
Thanks for letting us know - feel free to get in touch via email if you have any other concerns!
Liam
Hi @Liam
According to Section 7.9 of the manual the reconditioning procedure requires dry-baking 120degC at <5%rH for 2 hours and I would like to know if this would damage components on the PiicoDev board. I am not worried about the led but could this damage say the connectors?
I do not have a hygrometer but have been using an adjacent BOM weather station which gives accurate readings every 30 minutes for comparison.
Readings on the BME280 have been taken every 5 minutes.
Hey @Fractal,
I’ve checked with our production team, these boards go through our manufacturing process at ~280°C. The connectors are placed during this process, so all the components should be perfectly fine for the reconditioning.
SMD components can typically handle fairly high temperatures while not powered, though their electrical characteristics will change wildly past the 100°C mark.