Sleep mode for bmp280
-
Hello,
I try to build a battery powered temperature sensor but I only found one sensor who works with low power under 2 volt. This is the bmp280 from bosch. But in i2c mode he need a power from 0,6mA so my battery life are only 2 month. Now the library from adafruit runs the sensor in normal mode and so I insert two new functions in the library:
void Adafruit_BMP280::sleep() {
write8(BMP280_REGISTER_CONTROL, 0x3C);
}void Adafruit_BMP280::wakeup() {
write8(BMP280_REGISTER_CONTROL, 0x3F);
}The first one write 00 to the first bits in the data register - the sleep mode.
The wakeup function rewrite the first bits with 11 - the normal mode.void loop() {
...
...Temp = bmp.readTemperature();
Press = bmp.readPressure() / 100.0;
Altit = bmp.readAltitude(1013.25);bmp.sleep();
sleep(30000);
bmp.wakeup();
}Now the sketch needs only 0,2µA in the sleep mode - it is much more better than 0,6mA.
Best regards
Elmar
-
If you don't want to deal with low voltages, you could get some LiFePO4 batteries that run at 3.3V
-
Another hack is to power it from a mcu digital pin and set the pin high/low.
-
@sundberg84 if it is really 0,2µA it is actually astonishing already
-
Oh no it is 2µA
-
it is still better then the 5-6 uA I get from mine
-
Just wanted to say thanks for this, it is still relevant and useful six years later !