Hi guys!
We are working trying to use water flow sensor (hall sensor) with emonTH using only batteries.
We have improved the fireware code to integrate it (based on hall sensor for emonTx power measurement definition published on github by open energy monitor team)
We know is pretty impossible but we are trying to setup the microprocessor in order to count pluses with the board switched off. We think it is impossible because of the hardware and finally we will introduce an AC adapter
This work will be used as a water consumption metering outside of the home so, AC adapter is so annoying because we don't have a socket close to the meter.
Thanks in advance!
Re: Water flow sensor with emonTH
I think you are right - it is impossible. Your problem is you not only need to know that a pulse has arrived - that is easy with a 'wake on interrupt', but you also need to know how long it has been since the last pulse, and you cannot know that because you have been asleep. The only way I think you could do it is with an external real time clock chip that is permanently powered, and when you wake the Atmel processor with the pulse, it gets the time from the clock chip and, because you saved the time of the last pulse before you went to sleep, you can then do the maths to determine the flow rate, and you know the total flow quantity.
There should be no problem with extending the low voltage power, the current required is quite small and a long cable run should not be a problem.
Re: Water flow sensor with emonTH
One question:
I don´t know how to do "wake on interrupt", if i know the pulse number is enough for me, because, if i sleep for a minute i save this number of pulses and I know the water consumption of this period. I don't mind to know exactly when the water was consumed
How i can do "wake on interrupt"? We are trying some methods but we are not achieving anything useful?
Thanks!
Re: Water flow sensor with emonTH
Berna,
I think you can learn a lot about using external interrupts in sleep mode in the example code for the EmonTH. The relevant file is 'emonTH_PulseCounting.ino'.
More about using the different modes of external interrupts can be found on the Arduino website (attchinterrupt()).
BR, Jörg.
PS: you possibly have to combine this with the code from the other EmonTh examples. Such a lot of functionality is 'buried' in libs, that it is not so easy to see what the code is really doing.