BME280 on NodeMCU - how to add sleep?

I have a BME 280 working on a NODE and sending data to a simple web page.
Having assembled it in a plastic box with ventialtion holes its reading the wrong temperature because its close to the NODE which is running warm.
The BME280 connects via software SPI (I couldnt get an I2C connection to it working) and there is no other circuitry.

I’ve attached the code I’m using
bme280wstationAsync1.ino (9.6 KB) .

I would like to reduce the power consumption by putting the NODE to sleep, but I cant see how to wake it up as needed. Any advice well received thanks.

Perhaps, ESP8266 API non-OS, section 3.3.9 would be of interest to you?

1 Like

Look at LowPowerDemo in the IDE’s examples for the ESP8266 Arduino/libraries/esp8266/examples/LowPowerDemo at master · esp8266/Arduino · GitHub You can “deep sleep” and wake up via a timer you set…for any time up to about 3 hours. There are lots of examples of this on the web, too.

1 Like

Hello,
I have seen in your sketch that the webserver is runing also on the same ESP. So in that case it make no sence to go to deep Sleep mode because in that case the Webserver is not existing for any Brauser the most of time.

I have build a system with tow ESP . The first is working outdoor with an BME280 using deep sleep mode. Powerd by a Acu and a smale solarpanel. every 30 min he wake up for one messurement and sending the data via TCP to the second ESP. This need about less than 10sec. The second ESP is running all the time and works as Webserver and TCP server.

1 Like

Thanks for your replies, the low power demo looks as if it will be a lot of help. I’ll run through it later today. @Rentner the values should not change rapidly so I’m not desperate for a fast response to a bowser, I’ll need to test what happens when the server is offline.
Failing all other possibilities I may have to mount the BME separate to the Node but that would be cheating. I think light sleep will be enough but time will tell.

For my weather station, I have the BME680 in a different, small, box that sits on top of the case containing the MCU. The bottom of the BME case is sealed, where the wires come through, and packed with insulation. The top part of the case is open to the air and goes into the attic of a Stevenson’s Shield. So far the scheme of isolation, insulation, exposure to large volumes of outside air has worked well to keep the influence of the MCU heat output away from the BME.
The case containing the MCU has its own filtered vent holes and is, also, located in the Stevenson’s Shield body.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.