battery powered sensor / watchdog?



  • Here I am again. I swear this forum is beginning to feel like home lol

    So I made a little battery powered temp sensor for my pool. Works great (see graph) hehe
    0_1527173096763_bf581b1e-3ea6-4c9c-9e8f-8e84a7bf8e86-image.png

    so here is what I have run in to. The node is battery powered. It goes to sleep for 90 minutes at a time, wakes up, checks temp/battery sends changes and goes back to sleep.

    So yesterday, first time in like 2 weeks the node reported just before noon and then it didn't respond at all the rest of the day. I got home last last night. Reset it and it was good.

    So is there a correct way to do watchdog on a battery node? Any suggestions?

    Thanks!



  • Excuse me but I go a little OT ..... What dashboard and this are you using?



  • Grafana šŸ™‚



  • I'm not sure the max time for the built in WDT but I know it is limited. In addition it adds to the battery drain. You might look at a TPL5010.

    John



  • any other thoughts on maybe something i can do in code or anything?



  • that TPL5010 looks like it could do a 2 hour watch dog. Not bad. gonna look in to that some more too.



  • @crankycoder I am not using watchdog in the battery powered nodes. I have had an odd problem like you. I think it has to do with the quality of parts since I am ordering most from Aliexpress.



  • oh don't say that. aliexpress is my addiction!!!!



  • @crankycoder said in battery powered sensor / watchdog?:

    oh don't say that. aliexpress is my addiction!!!!

    I do like most people - its easier and one does not have to spend 50 bucks to get a free shipping. No brainer. However, quality may be compromised too.



  • did you do anything to try to over come it? or do you think either spending more for better quality or maybe an external watch dog chip?



  • @crankycoder I think the biggest issue for me is that Iā€™m not ordering in large quantities. AliExpress or ebay are really competitive if you need a few components.

    Digi-key for example wants me to have a minimum spending of Ā£30 for free shipping (AliExpress is offering free shipping).



  • agreed. hard to beat aliexpress for pricing.



  • @crankycoder

    Speaking of pricing, a Pro Mini 3.3Mhz can be had for as little as $2-$3. Couldn't that be used to provide all the functionality (and more) of a TPL5010? Of course, it would require a small programming with a small script that uses low power sleep, removing the LED, maybe regulator too.



  • that's where the problem is. the whole sensor is a pro mini. it periodically stops doing it's thing.



  • @crankycoder
    What I meant was that keep the sensor as is (whether it is a pro mini or anything else), and use a different pro mini as the watchdog - in place of the TPL5010. In this case, it would take a double board failure in order to have a complete failure.



  • hmmm possible. power consumption would be a concern. having a second node running granted it wouldn't have a radio. I could potentially do the same thing with an attiny85 as it's smaller and lower power. It gets the cost down a little too... about to the same price as as the TPL5010. lol. in a pinch a pro mini would definitely work. Since I have some attiny85s that may be my option right now since i have them and don't have to buy the TPL5010's.

    I think Jon Oxer did something with a hardware external watchdog like that. I am now wondering if i could use the attiny85, have it sleep as well. Wakeup hourly to see if it should reset the sensor. But also wake up on interrupt, where in the sensor if it's running well would pulse to the attiny. The tiny would reset the counter. Then each hour if the tiny wakes up, and the sensor hasn't reported in a couple hours, it would just reset it.

    This is an actual possibility. lol



  • IMHO, a watchdog reset is something that shouldn't occur normally. If it does, something is wrong in your code and that should be fixed...
    Or are there maybe packets that get lost?



  • i fully agree. But my sensor bombs out after a week or so of running. It's just a temp sensor used from the examples. Only thing I did was change the sleep timeout. So i am thinking either there is something with the cheap pro mini clones. Or something with the radio not sending. Which could be it, for all I know it's waking up and the arduino is saying everything is good but the radio isn't working. The only thing I know for certain is a reset brings it all back online.

    Quite possible the packets are lost in the RF transmission. Just difficult to leave a serial monitor hooked up to it outside for a week till it dies lol.

    šŸ˜‚



  • Yes I understand. It is hard to find the cause in these cases. Do you have the possibility to move the node closer to the gateway or add a repeater to see if the problem persists?
    Edit: or hookup the serial monitor, but place the node inside somewhere šŸ™‚



  • I have definitely thought of throwing a repeater in the room closest to where it is outside. That could definitely help. Can't move it closer since it's a temp sensor in my pool lol.

    Wonder if i made a connector out of rj45 if it would work over that length to something inside šŸ™‚



  • so just to make sure I understand. Is the node also in the pool? Or just the sensor?



  • just the sensor. Node is in box outside of the pool.



  • Put an esp wifi node in the box with a beefier battery, or another box next to the first one if it isn't large enough. There is an "esp bridge" app that can easily do serial monitoring over wifi. That way you should have console output from the node when ot craps out. I've used it to debug some app that controls some contactors via a 5v relay board, turning contactors off sent the w5500 to Valhalla, the debug output via the esp saved the day since the device is located in a cielling a few meters up.



  • This is a cool idea. Definitely worth throwing some bigger batteries at it for debugging. I am looking for this bridge stuff now šŸ™‚




  • Mod

    I eneble wdt on pretty much all my nodes. Just remember to disable it before entering sleep. How did you setup the node? Do you have any booster running?



  • Where do you put your enable/disable watchdog? My node sleeps for 90 minutes at a time. Do you mean like a voltage booster? no, but i am monitoring the battery voltage so i know when it gets close to the 3.3 that the radio needs.


  • Mod

    I enable it at beginning of loop and disable it before the sleep. What battery do you use? Btw the nrf24 radio can go down to 1.8V



  • Im using an 18650. currently it's sitting around 3.9v.

    Do you have a link to the proper "mysensors" way of handling watch dog? Im not opposed to trying it. Especially if it gets hung up trying to do something then maybe the WDT while it's awake may help.


Log in to reply
 

Suggested Topics

  • 3
  • 6
  • 1
  • 5
  • 2

53
Online

11.4k
Users

11.1k
Topics

112.6k
Posts