@AWI This is the BME280 module I'm using, and looks like it's got an LDO built-in, am I correct? Vin is 1.8 - 5V DC. Maybe I should just bypass the voltage booster and supply power to the module directly from the battery...?
Posts made by gogopotato
-
RE: BME280 Temp/Hum sensor on battery power increasingly skips(?) operation
-
RE: BME280 Temp/Hum sensor on battery power increasingly skips(?) operation
@warmaniac yeah I think my BME280 is about +2 F than real temp. Anyway, do you have any suggestions as to resolving the issue? Maybe I should just replace it with DHT22.
-
RE: BME280 Temp/Hum sensor on battery power increasingly skips(?) operation
@Yveaux If step-up converter would only reduce the battery lifetime, why does Mysensors.org page suggest using one to extend battery life? I'm new to electronics so please bear with me!
-
RE: BME280 Temp/Hum sensor on battery power increasingly skips(?) operation
@warmaniac hmm now that I am reviewing my code, I have "do nothing if value is error" logic.
if (TF < 0 || H == 100 || H == 0) { // if sensor values are in error, do nothing. } else { send(msgT1.set(TF, 1)); send(msgH1.set(H, 1));
Perhaps the voltage booster is causing BME280 to behave badly? But then why would it work fine for the first few days? Do you think adding a bulk capacitor to BME280 would to stabilize power hence reducing errant readings? If so how big of a capacitor would I need? The mystery continues....
-
RE: BME280 Temp/Hum sensor on battery power increasingly skips(?) operation
@warmaniac Here's my code:
// Enable and select radio type attached #define MY_RADIO_NRF24 #define MY_NODE_ID 11 //#define MY_PARENT_NODE_ID #include <SPI.h> #include <MySensors.h> #include <avr/wdt.h> //watchdog timer lib #include <Adafruit_Sensor.h> #include <Adafruit_BME280.h> // Change I2C address in Adafruit_BME280 library to "0x76" (line 32 in the library file) #include "Wire.h" Adafruit_BME280 bme; // I2C #define CHILD_ID_HUM 0 // RH #define CHILD_ID_TEMP_F 1 // temp in F // MyMessage to controler MyMessage msgT1(CHILD_ID_TEMP_F, V_TEMP); MyMessage msgH1(CHILD_ID_HUM, V_HUM); MyMessage msgE1(255, V_TEXT); // Debug message void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Nursery", "1.2"); present(CHILD_ID_TEMP_F, S_TEMP); present(CHILD_ID_HUM, S_HUM); } void setup() { startBME(); ServerUpdate(); // for first data reading and sending to controler } void loop() { smartSleep(600000); // sleep for 10 mins ServerUpdate(); } void startBME() { delay(1000); //just in case if (!bme.begin()) { send(msgE1.set("BME280 INIT FAIL")); #ifdef MY_DEBUG Serial.println("BME280 initialization failed!"); #endif while (1); } else send(msgE1.set("BME280 INIT SUCCESS")); delay(5000); //delay for 5 second before the 1st reading; prevents errant spike in sensor value #ifdef MY_DEBUG Serial.println("BME280 initialization success!"); #endif } void ServerUpdate() // used to read sensor data and send it to controller { bme.begin(); //re-initialize for each reading double TF, TC, P, H; TC = bme.readTemperature(); //read temp in C TF = TC * 9 / 5 + 32; // convert default Celcius reading to Fahrenheit H = bme.readHumidity(); if (TF < 0 || H == 100 || H == 0) { // if sensor values are in error, do nothing. } else { send(msgT1.set(TF, 1)); send(msgH1.set(H, 1)); } #ifdef MY_DEBUG Serial.print("T = \t"); Serial.print(TF, 1); Serial.print(" degF\t"); //Serial.print("T = \t"); Serial.print(TC, 1); Serial.print(" degC\t"); Serial.print("H = \t"); Serial.print(H, 1); Serial.print(" percent"); //Serial.print("P = \t"); Serial.print(P, 1); Serial.print(" mBar\t"); #endif }
-
RE: BME280 Temp/Hum sensor on battery power increasingly skips(?) operation
@Yveaux Are you running the system with only the LEDs removed, and you are using the Arduino built-in voltage regulator? My concern with this setup is that it wouldn't last long since you are starting at already-low 3.0v at max. How long do you think it would last?
I am thinking of just using 4x AAs with built-in regulator if all else fails.
-
RE: [SOLVED] Pro Mini 3.3v with DS18B20 sensor getting (-)127 Celsius!
@AWI Turns out, I was using 47k resistor instead of 4.7k resistor. Now it's working with no issue
-
RE: [SOLVED] Pro Mini 3.3v with DS18B20 sensor getting (-)127 Celsius!
@AWI I will try that. Thanks!
-
BME280 Temp/Hum sensor on battery power increasingly skips(?) operation
Hi,
I have a battery-operated temp/humidty sensor running on 2x AA batteries. Components are:
- Arduino Pro 3.3v clone with 47uF bulk cap (LEDs and volt regulator removed)
- BME280
- NRF24L01+ radio with 47uF bulk cap
- 3.3v voltage booster/regulator w/ 100uF bulk cap and 0.1uF ceramic cap
It's set to report temp/hum every 10 minutes. Upon reset, it works flawlessly for 3 to 4 days, and then it'd start skipping an operation maybe once every a few hours (i.e. no update received). As time progresses such skips get worse, sending updates once per hour to every few hours. Eventually it'd just stop updating. Funny thing is, upon reset it'd work fine again for another few days only to get worse again following the exact same pattern described above. I'm unsure whether it's "self-resetting" I do not see the typical MySensors presentation messages when the sensor goes live again. But the smartSleep() integer counter sometimes gets reset.
I have two other identical sensors that are each powered via a 5v wall wart, and they NEVER display this symptom. So I'm pretty sure it's related to it being battery powered.
The battery is connected to a 3.3v voltage booster along with 100uF electrolyte bulk capacitor AND 0.1uF ceramic capacitor, as instructed by MySensors.org website. All components (Arduino, sensor, and radio) are powered by the output from the same voltage booster.
Has anyone experience a similar issue? What could be the culprit, and what can I do to fix this?
Thanks!
-
RE: [SOLVED] Pro Mini 3.3v with DS18B20 sensor getting (-)127 Celsius!
@AWI I'm using the example provided in https://www.mysensors.org/build/temp
numSensors = sensors.getDeviceCount();
The above statement is returning zero. So perhaps I have a faulty/dead sensor? I should have tested the sensor before soldering it in...
-
[SOLVED] Pro Mini 3.3v with DS18B20 sensor getting (-)127 Celsius!
I hooked up DS18B20 to Pro Mini 3.3v using Vcc (3.3v). But the temp reading is constant at -127 degree Celsius. Below is my wiring with 4k7 Ohm resistor across data and vcc. I did some googling and some say -127 C reading means incorrect wiring. Is my wiring wrong?
-
RE: Do sleep() or smartsleep() also send sleep/power-down command to NRF24L01+ ?
Nice. Thanks for the info. Just out of curiosity, is the radio sleep done by the mysensors library as part of the sleep()/smartsleep() or is it the radio HW's feature?
-
Do sleep() or smartsleep() also send sleep/power-down command to NRF24L01+ ?
I'm using the latest MySensors library with NRF24L01+. The RF module is powered directly from two AA batteries via DC-DC booster. In fact, the arduino, wireless, and sensor are all connected directly to the booster.
I understand that using
sleep()
andsmartsleep()
will make the arduino board to go into low-power mode, but what about the NRF24L01+ module? Do I have to send another wireless-module-specific sleep command to put the radio also to sleep? -
RE: I_DEBUG variable is sent via "set" command, instead of "internal" command
@mfalkvidd Great. Thanks for the help!
-
RE: I_DEBUG variable is sent via "set" command, instead of "internal" command
@mfalkvidd Makes sense. Is there another "free-form" message type I can use instead?
-
I_DEBUG variable is sent via "set" command, instead of "internal" command
In the latest version, I noticed that when a node is sending out a
I_DEBUG
type payload, it's being sent out as set (1) command instead of internal (3) command. The type value is correctly set to "28" in both cases.Example:
// Debug msg container declaration MyMessage msgE1(255, I_DEBUG); // Send Debug payload send(msgE1.set("BME280 INIT SUCCESS"));
Expected message sent to gateway:
mygateway1-out/11/255/3/0/28 BME280 INIT SUCCESS
Actual message sent to gateway:
mygateway1-out/11/255/1/0/28 BME280 INIT SUCCESS
-
RE: BME280 failing to initialize after spikes in readings
@DavidZH Thanks for your input.
So am I calling
BME.begin()
for each sensor reading within the loop, and yourstartBME()
is called only once during setup? Would the sensor remember the config values set duringstartBME()
after waking up from the sleep? As I understand the power to the sensor is cut during the sleep... maybe I'm mistaken.Also, can you please show me how you defined
I2C_Mode
andBMEaddr
? Looks like it's part of a different BME280 library.Thanks!
-
RE: !TSM:FPAR:FAIL
Sorry, looks like some of the other files may actually need the MY_NODE_ID declared in order to function properly. Just comment it out from this file only and see what happens.
C:\Users\Michael\Documents\Arduino\libraries\MySensors/MyConfig.h
-
RE: !TSM:FPAR:FAIL
Open this file:
C:\Users\Michael\Documents\Arduino\libraries\MySensors/MyConfig.h
...and comment out this line.
#define MY_NODE_ID AUTO
Compiler is complaining about "MY_NODE_ID" being defined multiple times (AUTO and 5). Actually, if you want to be absolutely sure, check other libraries (all .h files listed in your error msg) and comment out the same line if found.
-
RE: !TSM:FPAR:FAIL
Have you tried hardcoding the sensor node ID? I've had a same issue and after hardcoding the ID the node was able to communicate with GW. Not sure why, maybe a bug?
#define MY_NODE_ID <node ID here>
ex) #define MY_NODE_ID 11
-
BME280 failing to initialize after spikes in readings
Hi all!
I am using a Pro Mini clone (3V3, 8Mhz) with a BME280 sourced from ebay. It's got I2C interface and no SPI. When I first set this up it worked fine for about 12 hours. Then suddenly it would begin to get massive spikes in TEMP & HUM readings like over -200 F and 100% RH, where normal readings are typically ~70 F and ~35% RH.
Here's a picture of my BME280 sensor:
So I reset the arduino and now it's failing to initialize the BME280. Thought maybe the sensor died so I replaced it with another unit. But it too is failing to initialize. As for the power, I tried using both a breadboard power supply as well as two AA batteries connected in series w/ a 3V3 boost up module.
Similar spikes happened a couple of time before and normally a reset would make the readings return to normally. But now I am unable to initialize the sensor. Could this be power related? Or do I have a faulty arduino or sensor?
Here's my code (it's a simplified version of a code uploaded by another user here. I forgot his/her username...):
// Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 // Hard-coding sensor node ID #define MY_NODE_ID 11 #include <SPI.h> #include <MySensors.h> #include <Adafruit_Sensor.h> #include <Adafruit_BME280.h> // Change I2C address in Adafruit_BME280 library to "0x76" (line 32 in the library file) #include "Wire.h" Adafruit_BME280 bme; // I2C #define CHILD_ID_HUM 0 #define CHILD_ID_TEMP 1 MyMessage msgT1(CHILD_ID_TEMP, V_TEMP); MyMessage msgH1(CHILD_ID_HUM, V_HUM); void presentation() { sendSketchInfo("Nursery", "1.0"); present(CHILD_ID_TEMP, S_TEMP); present(CHILD_ID_HUM, S_HUM); } void setup() { delay(5000);// just in case if (!bme.begin()) { Serial.println("BME280 initialization failed!"); while (1); } else Serial.println("BME280 initialization success!"); ServerUpdate(); // for first data reading and sending to controler } void loop() { smartSleep(60000); ServerUpdate(); } void ServerUpdate() // used to read sensor data and send it to controller { double T, P, H; T=bme.readTemperature() * 9 / 5 + 32; // convert default Celcius reading to Fahrenheit H=bme.readHumidity(); send(msgT1.set(T, 1)); send(msgH1.set(H,1)); #ifdef MY_DEBUG Serial.print("T = \t"); Serial.print(T, 1); Serial.print(" degC\t"); Serial.print("H = \t"); Serial.print(H, 1); Serial.print(" percent"); #endif }