I'm looking at creating something to monitor my water usage. My water meter can be monitored with a Hall Effect Sensor, which is simple. Getting the data back to my computer is going to involve either running some wire out through my front yard, or wireless something (which I'll figure out later).
My big question is one of counting the pulses from the hall effect sensor, or rather, the most efficient way to do it. I assume the unit, unless I run wire, will run off some AA batteries, so I'll need to have the arduino (or ATTINY) sleep between readings. So, do I A. set the hall effect sensor to an interrupt pin, and have the unit wake ALL THE TIME, or do I use something like a 74HC590 to count pulses, then have the arduino wake every minute (or 5), read the 590, send the count (or count difference), and maybe reset the 590 (or not) (and obviously it could calculate rate of flow based on how often it's reading, and whatever the change in counts is). The latter option seems like it would use less power, since the 590 should use next to no power except during increments and is not going to have any issue if it loses power.
The other question/option would be, the Arduino (and ATTINY) both seem to have counters built in, but can they be incremented if the micro is sleeping?
You can select different sleep modes, with counter enabled or disabled.
You don't need a ATtiny (or Trinket), the ATmega328P as used in the Arduino Uno is just as efficient.
A complete Arduino Uno board is not very efficient, due to everything that is on the board.
A good sleep mode puts the ATtiny/ATmega into sleep for a long time, even if that means that the long time is only 10ms.
Therefor using an interrupt to wakeup is no problem at all.
Everything you add to the circuit, like the 590 counter, needs current to operate. Try to do it all in the ATtiny/ATmega itself.
What about the hall sensor, does it require a current to operate ?
You don't need a ATtiny (or Trinket), the ATmega328P as used in the Arduino Uno is just as efficient.
A complete Arduino Uno board is not very efficient, due to everything that is on the board.
A good sleep mode puts the ATtiny/ATmega into sleep for a long time, even if that means that the long time is only 10ms.
Therefor using an interrupt to wakeup is no problem at all.
Everything you add to the circuit, like the 590 counter, needs current to operate. Try to do it all in the ATtiny/ATmega itself.
What about the hall sensor, does it require a current to operate ?
Awesome. I'll have to try this and monitor the power usage. Obviously I'd like to get the power usage down to the point where a couple (or 4, whatever it takes) AA batteries will power it for a while (would love 3-6 months or more).
Didn't even think about the hall effect. I have a Honeywell SS494B sitting around, but it looks like it might draw 4mA, which is going to kill my battery runtime I would think. Or is that only when it's outputting a pulse, because the one sparkfun sells (Hall-Effect Sensor - US1881 (Latching) - COM-09312 - SparkFun Electronics) requires 5mA as well... I see one that draws down to 3.5mA, but all the really low current ones are all surface mount, and I'm not sure about the proximity requirement for them to get good readings off the meter.
You need 3 AA batteries.
Therefor the sensor should still work at 3V.
If you use a transmitter (switched on once per 5 minutes) it should last for a year.
And lets assign half the current for the sensor.
Suppose AA battery of 1500mAh, I use 1000mAh for safety. One year is 24*365 hours.
Current is 114uA. Half of that is about 60uA.
Perhaps a sensor like the AN48841B or the SL353LT.
Peter_n:
You need 3 AA batteries.
Therefor the sensor should still work at 3V.
If you use a transmitter (switched on once per 5 minutes) it should last for a year.
And lets assign half the current for the sensor.
Suppose AA battery of 1500mAh, I use 1000mAh for safety. One year is 24*365 hours.
Current is 114uA. Half of that is about 60uA.
Perhaps a sensor like the AN48841B or the SL353LT.
okie, I'll look into that. Still need to figure out how to use the counter on the 328, but that's my problem. =)
3AA batts would put me at 4.5V, which is the lowest voltage the 328P at 16Mhz will run at. Wouldn't give me much room for sag. So I'd probably want an 8mhz 328P, Hmm...