@skywatch Thank you very much! Your advice helped. Not shure what it was on BOTH devices - my mistake or some corruption of fuses/program.
On first device (where i found problem) - there were different fuse bits (but according to my eyes BOD was even disabed, but not shure). On the second (where i tested) fuses were checked and were correct. I tried to play with fuses and erase chip... and something strange happened - or chip memory was broken or i can't verify program when box "erase flash and eeprom" is checked... so i took fresh nano, programmed it and resoldered MCU into the second device.
So both devices now are fixed and tested - both work till ~1.9V.
Thanks, you saved my brains!
nekitoss
@nekitoss
Best posts made by nekitoss
-
RE: 💬 Battery Powered Sensors
-
RE: MYSBootloader 1.3 pre-release & MYSController 1.0.0beta
Today i suddenly find out, that Tekka updated app. Old app said "there is an update" and i've clicked link, which lead me to dropbox page.
So anyone, who previously blocked all traffic for program (@iguaan , @nfj25 , @Mac65 , @tplet) - you may want unblock it in your firewall and update.
I just replaced MYSController.exe and MYSController.ini files, leaving all other - it worked! Did not yet tested all functionality. But still make backup of all files for sure before dong that. Also you may need click on sensor and choose "settings->offline FOTA update" in order OTA to work. I'm wondering what does "online" version mean...
Thank you very much, Tekka!
Latest posts made by nekitoss
-
RE: 💬 Battery Powered Sensors
@skywatch If your project is free and open, where i can look at it? At the moment i need to solve same problem. On your graph what will be 0% ? For mine devices it is minimum 1.9v, for few it is 2.2v
-
RE: MYSBootloader 1.3 pre-release & MYSController 1.0.0beta
Today i suddenly find out, that Tekka updated app. Old app said "there is an update" and i've clicked link, which lead me to dropbox page.
So anyone, who previously blocked all traffic for program (@iguaan , @nfj25 , @Mac65 , @tplet) - you may want unblock it in your firewall and update.
I just replaced MYSController.exe and MYSController.ini files, leaving all other - it worked! Did not yet tested all functionality. But still make backup of all files for sure before dong that. Also you may need click on sensor and choose "settings->offline FOTA update" in order OTA to work. I'm wondering what does "online" version mean...
Thank you very much, Tekka! -
RE: Use of BH1750 light sensor in low power node
@gerritv Thank you for pointing the problem. I was updating my code, while library was updated and found that i had funtion, that does not exists in library - i've added it in local copy in library, then it updated and my local patch was gone.
I've investigated previosly mentioned PR - and must admit that later they removed that re-initialisation when reading.
I will try a PR to slightly improve that behaviour, but looks like library is becoming abandoned.Now look it should work next way: after previous measurement done you must run
lightSensor.configure(ONE_TIME_)
so it starts measuring - this is shown in their example BH1750onetime.ino. Then we have to wait, butmeasurementReady()
relies on_delay_ms
, which (as i remember) won't tick during sleep so you can't sleep. We can sleep but we can't get exact measurement time for current settings. Soto save battery we sleep max time - which, according to library is 180ms. Then we get reading. On next cycle - repeat.As i understand maximum battery saving code will look like:
void setup() { Wire.begin(); // Initialize the I2C bus (BH1750 library doesn't do this automatically) lux_init_status = lightMeter.begin(BH1750::ONE_TIME_LOW_RES_MODE); //init ONE_TIME - at same time it will start measuring, but we will ignore this and double-call start measuring if (lux_init_status == false) { send(deb_msg.set("ErrorInitLux")); //notify us about failure } } void loop() { if (lux_init_status) { //making it fail-safe - if BH1750 brokes then other sensors will still work lightMeter.configure(BH1750::ONE_TIME_LOW_RES_MODE); //this will start measuring, after it sensor will go into power-down mode //note, that configure has 10ms sleep built-in sleep(180); //this is guarantee time in this library with any config. We can't get that externally as for v1.3.0 long lux = lightMeter.readLightLevel(); //actually get results } sleep(SLEEP_TIME);//sleep between measurements }
note that
.configure()
that is also called by.begin
has built-in 10ms delay -
RE: 💬 Battery Powered Sensors
@skywatch Thank you very much! Your advice helped. Not shure what it was on BOTH devices - my mistake or some corruption of fuses/program.
On first device (where i found problem) - there were different fuse bits (but according to my eyes BOD was even disabed, but not shure). On the second (where i tested) fuses were checked and were correct. I tried to play with fuses and erase chip... and something strange happened - or chip memory was broken or i can't verify program when box "erase flash and eeprom" is checked... so i took fresh nano, programmed it and resoldered MCU into the second device.
So both devices now are fixed and tested - both work till ~1.9V.
Thanks, you saved my brains! -
RE: 💬 Battery Powered Sensors
@nekitoss said in Battery Powered Sensors:
It would be great to add to this arctle that if you want to be battery powered outdoors with temperature below zero - you have to use lithium batteries (FR6 for AA) (yes, batteries, not li-ion accumulators!) (for example ultimate lithium energizer, also could be found lithium batteries from other vendors), because Alkaline (LR6 for AA) will be frozen and loose their capacity heavily. If i remember it is >50% at -10 C and death at -20 C. Same problem for li-ion accumulators - when liquid is frozen - electrons are stucked...
Also would be great to add some link about battery/accumulator types, advanteges and disadvantages, but i have no links in english, easy-to-read and in one place...But i have very great link about battery-powering that really should be added here, but in advanced section:
http://www.gammon.com.au/power@zboblamont how your alkaline batteries experience after 2 years(temperatures, lasting time)? my freshly installed (yes, it was long develop and test...) Lithium AA - when few weeks ago it was -20 .. stopped transmitting! Fixed resetting power when it become little warmer. Possibly same problem with 2.7V or exactly there may be wrong BOD...
-
RE: 💬 Battery Powered Sensors
I have a problem: when batteries go around 2.7V radio will stop transmitting. Board still take current, but no messages.
I'm using own board with barebone 328p (8mHz internal) and SMD/mini nrf24l01 (pretty shure china)
Did anyone had same issues?I've checked programmaticaly (yes, it is possible!) my fuse bits: Low=0xE2, High=0xD2, Extended=0xFE (0x06)
(BOD = 1.8V)
I've have three same boards (water leak) and used other not-yet-installed with specially made low-voltage regulated source (with 2200 uF capacitor and resistor load to eliminate voltage drop at transmission) to test - same result.
Sometimes i can go lower to 2.5V but not guaranteed, sometimes even corrupted messages (i.e. node id 168 instead 8).
Tests were without UART, only MYSController to monitor messages flooding each 5sec to approve life.Did anyone had same problems with nrf24l01 modules? All i see people say the can go to around 2.0 V.
According to article https://www.gammon.com.au/power (and datasheet)
at 8mHz i'm safe down to 2.4V (something like that i also measured)
nrf should go down to 1.9...Also it would be great to add into advanced section possible voltages and problems with NiMh, china modules & 2.7V(if not only me), [not]possible currents from coin cells and metioned article.
-
RE: Own action on heatbeat request
@wimd Could you share how you done that?
I also want to check if gate is alive (backup-batterypowered node - if mains or gateway died, send me a message).
I also use domoticz. -
RE: Problem with battery powered temperature sensor
Hi, @waspie !
First of all i'd like to say about value "85" - according to DS18B20 datasheet page 6, note after table 4.1:
*The power-on reset value of the temperature register is +85°C.
Your code looks fine and similar to my mains-powered DS18B20 sensor (because we used same example).
I have some thoughts:
-
you may have power problems:
a. from logs i see that you have 1 sensor, but you left defined#define MAX_ATTACHED_DS18B20 16
. If (suddenly) you would have 16 sensors - when you ask them for conversion they would consume 16* 1.5mA(max at 5v) = 24mA which is above recomended 20mA for atmega pin
b. you are powering from battery: DS18B20 oficially requres minimum of 3 v (as for datasheet). People say that with lower voltage it may have strange readings or even do not work at all
c. you are powering from battery through pin: is voltage raise fast enougth before start reading? is voltage drop low enought so voltage supplied to ds18b20 is >=3v?
i'd suggest you to measure voltages (but multimeter won't show you short drop-outs when start conmsuming) and try to feed VCC of DS18b20 directly from power source. If not possible - at least measure voltage and try to add some wait() after powering up pin (or also before measure start or after sleep). -
When running from 3v, what frequency of atmega processor is? If it is 16mHz - that it is not in safe operating area for that voltage. you should run 8 mHz. (>=2.4v for 8mHz and >=3.78v for 16mHz)
Also i suggest you try to change
sleep(conversionTime);
withwait(conversionTime);
and check if it will change anything (especially when ds18b20 directly powered from source). Also try with fresh batteries.If nothing helped, then for "85" value simple solution will be
if (temperature != 85) send();
because it is very rarely that people need to measure 85 degrees of Celsius at home...
~~ ~~
For advanced battery-powering i highly recommend to read this. Also you can find there about frequency vs voltage.And for internal battery voltage reading:
i don't remember where i found it: here1 or here2 or somwhere else..
but you may want to get more accurate readings by measuring and setting Internal Reference Voltage value and using it in the code, and give it some time to stabilize and/or use some type of averaging. -
-
RE: Detect missing/unresponsive sensor.
Hi, @grumpazoid !
PossiblysendHeartbeat();
could help you, but currently domoticz doesn't work correctly with it (without sending data).
I've opened an issue on github, at latest beta gizmocuz make a fix, but as i tested - heartbeat will update last seen time only in devices, not in hardware. - But that if you don't send sensor data, but you are. So try it, but remeber it is beta...
Also check last seen in hardware, not in devices. They may differ.
You may create additional switch, and send opposite bool each time (1-0-1-0-1-0), if you want to do some scripting...
Or just change to a switch type and create dummy alert dvice and update it via script (if switch is 1, then activate alert, and do not deactivate on switch 0) -
RE: sonda PH
Hi, @szybki946 !
Code in your post is working or not?
If yes - you want to someone modify it, so it will send yourpH
to domoticz from MySensors node?
If yes - if you use nrf24l01+ radio - maybe you want this code:#include <Average.h> #define MY_NODE_ID 100 //set node fixed id #define MY_BAUD_RATE 9600 //set serial baud rate #define MY_RADIO_RF24 //if you use nrf24l01+ #include <MySensors.h> #define PH_CHILD_ID 0 MyMessage ph_msg(PH_CHILD_ID, V_PH); Average<float> sredniaPH(100); //średnia ze 100 pomiarów void presentation() { sendSketchInfo("PH_meter", "1.0"); // Send the sketch version information to the gateway and Controller present(PH_CHILD_ID, S_WATER_QUALITY, "average_ph"); } void setup() { //Serial.begin(9600); //don't need it because of #define MY_BAUD_RATE 9600 } void loop() { int Volty = analogRead(A7); float V =(float) Volty * 5.0 / 1024.0; float peha =(float) V*3.5; sredniaPH.push(peha); sredniaPH.mean(); float pH =((float) sredniaPH.mean()); Serial.println(pH); send(ph_msg.set(pH, 2)); //2 = number of digits after comma wait(1000); //in mysensors do not use delay - use wait() or sleep() }
(change IDs, texts and numbers of digits after comma as you want)