Battery powered water flow data logger help.

I am trying to work around the limitations of the ATmega32u4's external interrupts to data log.

Project Goals:
Remotely gather data on water flow over 1 month period using no more than two 8,000mAH LiPo Batteries. Arduino counts number of pulses for 1 second and writes to the SD card with a timestamp. No data is written when flow is zero. The monitored system will have several hours of no flow, where the sensor can "sleep" to conserve power. The first 8-10 seconds of the flow data after flow is detected is critical with the next 30min to 4 hours of flow less critical.

What's Worked So Far:

  • With an arduino micro (ATmega32u4), Adafruit SD breakout, hall effect flow sensor, and two LiPo 8,000mAH batteries I am able to log flow data for about 6 days before the batteries die. Pin 7 (Int4) is used monitor flow and count pulses every second, logging to SD card while water is flowing.

Problems:

  • Insufficient battery life (too much power consumption).
  • Timestamp reference is based on when the arduino was compiled. The Micro is compiled, then unplugged from laptop, transported to monitoring site and plugged into sensor/battery.
  • Sensor consumes 25mA at idle state (plan to replace sensor with 8uA version).

What's been tried so far:

  • Moved the sensor to Pin 2 (Int0) and direct powered sensor from battery to allow the arduino to enter power down state and wake to record on flow start.
  • Added ChronoDot for time stamp accuracy but this means the sensor has to move back to Pin 7(Int4) because the RTC uses Pins 2&3 (SCL and SDA). Int4 only works when arduino is awake or in "Idle" mode (Pin Change); or a "LOW" state when in power down mode. Sensor does not pull Pin 7 "LOW" long enough for wakeup from power down mode.
  • Added a second arduino to act as a trigger to the first arduino. Arduino #1 has the SD Card, RTC, input from arduino #2, and sensor input. Arduino #2 has only a sensor input attached to Int0 and output to Arduino #1. Thinking is that Arduino #2 wakes when flow starts, setting Pin 4 to low which Pin 7 on Arduino #1 senses and wakes up Arduino #1. Arduino #2 would fall back asleep waiting for flow start again, while Arduino #1 records pulses from sensor on an open digital pin while there is flow. I can get Arduino #2 to wake up Arduino #1 but, I have not been able to get Arduino #1 to record data (i.e. count pulses) after it wakes up.

Questions:

  • Am I on the right track by using the second Arduino as a "Watchdog"... or is there another way?
  • Assuming the second Arduino is the path forward, how do I record the data on the first arduino? I've seen code examples that count "pulses" without an interrupt, but they are geared toward button presses, which tend to be slow events. I don't see how that would work here. Seems like I could miss pulse counts do to speed, or the program would hang if sensor stops on a "High" signal.

Sensor consumes 25mA at idle state (plan to replace sensor with 8uA version).

So if you power the sensor alone the battery will last about 2 weeks.

Moved the sensor to Pin 2 (Int0) and direct powered sensor from battery to allow the arduino to enter power down state and wake to record on flow start.

You don't have to power the sensor by the battery directly (it's even dangerous to do so) as the voltage regulator is operating even if the Micro is in power down sleep. Using a DC/DC converter instead of the linear regulator of the Micro might save some energy.

Added ChronoDot for time stamp accuracy but this means the sensor has to move back to Pin 7(Int4) because the RTC uses Pins 2&3 (SCL and SDA). Int4 only works when arduino is awake or in "Idle" mode (Pin Change); or a "LOW" state when in power down mode. Sensor does not pull Pin 7 "LOW" long enough for wakeup from power down mode.

There are also RTC chips that communicates by SPI with the MCU. SPI doesn't waste the same amount of power as the I2C pullups do.

Added a second arduino to act as a trigger to the first arduino. Arduino #1 has the SD Card, RTC, input from arduino #2, and sensor input. Arduino #2 has only a sensor input attached to Int0 and output to Arduino #1. Thinking is that Arduino #2 wakes when flow starts, setting Pin 4 to low which Pin 7 on Arduino #1 senses and wakes up Arduino #1. Arduino #2 would fall back asleep waiting for flow start again, while Arduino #1 records pulses from sensor on an open digital pin while there is flow. I can get Arduino #2 to wake up Arduino #1 but, I have not been able to get Arduino #1 to record data (i.e. count pulses) after it wakes up.

Adding another Arduino doesn't help in power consumption.

Am I on the right track by using the second Arduino as a "Watchdog"... or is there another way?

I don't think so, I see no advantage in this architecture.

Save energy wherever you can. One important way is to save many values in RAM and write them out in bigger blocks. A Nano (ATmega328p) might be more power efficient than the Micro.

Is there enough energy in the water stream to cause a small alternator to generate energy to partially recharge the batteries when the water is flowing? Solar cells can also help. We do not know anything except is is what appears to be a senior project. Using a external counter chip for the watchdog will use less energy. You can use one of the internal timers as a counter if that helps and it will not hang the system if implemented properly. You appear to be having hardware problems as to where to connect things, it appears most of the pins are already used. A schematic, not a frizzy thing, would be a big help as well as what this is targeted for.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.