Robo-Tank DIY Aquarium Controller Forum
Extra safety for dosing pumps... - Printable Version

+- Robo-Tank DIY Aquarium Controller Forum (https://www.robo-tank.ca/forum)
+-- Forum: Robo-Tank Arduino Based - NO LONGER AVAILABLE (https://www.robo-tank.ca/forum/forum-16.html)
+--- Forum: Comments & Suggestions (https://www.robo-tank.ca/forum/forum-21.html)
+--- Thread: Extra safety for dosing pumps... (/thread-228.html)



Extra safety for dosing pumps... - Arne - 05-26-2017

With the possibility for dosing more times a day and even at night the thought of something going wrong with the dosing pumps scared me a little.
Of course a hardware failure couls occur but I was thinking:
is it possible to monitor the dosing pump output and intervene when dosing "hangs"...


RE: Extra safety for dosing pumps... - Rob F - 05-26-2017

Hi Arne, yes I hear you. One thing you might try is running a pump manually and while its running power down the controller completely, then power it up again and the pump shouldn't be running. With that said, the last update I added a watchdog timer, this monitors the Arduino main loop. The Arduino runs in a constant loop over and over and everytime the loop runs (takes a couple milliseconds) it resets the watchdog timer. If the timer doesn't get reset within 15 seconds the Arduino restarts. So if something was to hang the controller the maximum time the dosing pump would run is 15 seconds.

I do have plans to add logs for all the equipment, for the dosing pumps I'll probably have it show the time the pump ran and how long it ran for.

If you can think of something else that might help I can think about adding it.


RE: Extra safety for dosing pumps... - Arne - 05-26-2017

I have to go out for an 1 1/2 hour now Rob, I will get back to you when I'm home again...


RE: Extra safety for dosing pumps... - Arne - 05-26-2017

Hi Rob,

It is great you already implemented the watchdog... ;-)
What I mean, and you see this also in medical dosing, that no matter what, the dosing pump cannot run longer then XXX seconds.
I'm not a programmer but when I think about this, I think of an extra monitor on the dosing pump output, completely separated from the scheduler/timer or whatever...


RE: Extra safety for dosing pumps... - Rob F - 05-27-2017

I'll think about it more and see if I can add a backup, this is how its setup and has changed over time. Obviously the Arduino on the controller turns the dosing pumps on/off, in the main loop that runs over and over, its always going through code to shut down the dosing pumps. When a pump starts up a flag is set so the controller knows its running and the timer to turn it off begins. The code to turn off the code sees the flag was set and shuts down the pump when the timer expires. So basically the controller is always trying to turn them off and if it happens to lock up while a pump is running the Arduino should restart stopping the pumps.


RE: Extra safety for dosing pumps... - Arne - 05-27-2017

Okay Rob, that already sound great to me.
You're the expert so I leave it up to you to decide whether it would bring something or not... ;-)


RE: Extra safety for dosing pumps... - Rob F - 05-28-2017

I am confident the pumps won't keep running especially with the watchdog. Only reason it wouldn't stop is if controller locked up but watchdog should solve that. I'm always thinking of ways to improve the code, if I think of something I'll definitely make changes.


RE: Extra safety for dosing pumps... - Arne - 05-28-2017

Good to hear that Rob, thanks !