Sensebender Micro + button
-
@Pierre-P How do you find the battery life please? I am planning to fit Sensebender with nrf24l01+ SMD and CR2032, but I wonder how long the battery is going to survive? Appreciate if depends on your sketch, but given one is conservative (i.e. no need to send temp/hum every 30-60 sec, but probably every 5-10mins or so), what's your estimate please?
-
I can't tell you for the moment, I haven't check the real voltage of the CR2032 at the beginning. I'll try to make two mesure between 30 days.
But my sketch is 1800000ms or 30min sleeping (if no-one press the button). Because it's a redundant information, my Jeedom controler have a meteo plugin who's working good. (i'll use it for the mini-night-temperature to have a message if there is glass on my car's windows). -
If I undefine: //#define BATT_SENSOR 199
it's working.
But your code still not 100% so we have to find why.
But... but, i think i'm making a mistake: yes i plan to use 3volts power. But, i don't want it as a sensor ! I wan't it as a battery level like the very first SensebenderMicro sketch. So... I have to undefine BATT_SENSOR ? And i will not have it set to 3Vcc=100% ?

-
@martinhjelmare Any idea why siVolt is reporting values rounding up to either 2V or 3V in Domoticz? All I'd like to have is something like 2.9V
-
@martinhjelmare Any idea why siVolt is reporting values rounding up to either 2V or 3V in Domoticz? All I'd like to have is something like 2.9V
How are you calculating and sending it? Did you change to float? There was a bug in my original sketch.
Make sure at least one of the operands is a float in the division.
float siVolt = vcc / 1000.0; -
How are you calculating and sending it? Did you change to float? There was a bug in my original sketch.
Make sure at least one of the operands is a float in the division.
float siVolt = vcc / 1000.0;Yes, it is declared as float
void sendBattLevel(bool force) { if (force) lastBattery = -1; long vcc = readVcc(); if (vcc != lastBattery) { lastBattery = vcc; float siVolt = vcc / 1000; #ifdef BATT_SENSOR gw.send(msgBatt.set(siVolt, 2)); #endifIt is reported as either 2.000V (battery) or 3.000V (USB) in Domoticz
Changing siVolt to int or changing 2 in set does not change anything. -
Yes, it is declared as float
void sendBattLevel(bool force) { if (force) lastBattery = -1; long vcc = readVcc(); if (vcc != lastBattery) { lastBattery = vcc; float siVolt = vcc / 1000; #ifdef BATT_SENSOR gw.send(msgBatt.set(siVolt, 2)); #endifIt is reported as either 2.000V (battery) or 3.000V (USB) in Domoticz
Changing siVolt to int or changing 2 in set does not change anything.@alexsh1 said:
float siVolt = vcc / 1000;You should change 1000 to 1000.0, i.e. a float. Float math will be used if any of the operands is a float.
https://www.arduino.cc/en/Reference/Arithmetic -
@martinhjelmare Stupid me! Thanks for bringing this up - these issues are so simple, but very easy to overlook. I was about to start pulling my hair out....