Batteries drained overnight

Hi, Ive just retired and taken up electronics and Arduino Iot projects in particular as a hobby -new to both. I'm "lovin it!" as they say. My first project is the ubiquitous plant watering system, its basic and has a low learning curve. It works, I'm very pleased with it so I set it up to water the pot plants on my small terrace (about 12 pots) It consists of an Arduino Pro mini(5.5V), a generic soil moisture sensor (attached to an analog pin), an L298 motor driver which is used for the H bridge aspect to control a latching solenoid valve(9v), a couple of LEDs for an "On" indicator and a valve open indicator, and 3 potentiometers (one controls the sensor threshold sensitivity, one that determines the frequency of the sensor reads and one that controls the valve open time) As the valve is a latching solenoid a pulse of current is sent through one pin of L298 to open the valve (for 200ms) and another (opposite polarity) to the pin to close it (200ms) The valve is open for 1 minute (adjustable by a pot) then there's a delay (adjustable with a pot) of 12 hours. Aaaaand when I come back after 12 hours the batteries (battery pack of 8 AAs) is flat. I've done some research and it seems that there's a sleep mode for the Arduino plus the onboard voltage regulator can be removed and the trace for the LED can be cut, all of which can reduce the power consumption to the microamp range. My question is: what about the L298? Can similar modifications be carried out? Or would I be better going with the Texas instruments DRV8838 (which I've just read about). Thank you.

Have you used an ammeter to measure the actual current draw? How much current does it take to switch the valve? How often is it switching?

Just about anything is better than the ancient and inefficient L298. The DRV8838 can handle more current while dissipating much less power and has a sleep input to disable the output drivers.

Hi Tim2155,

You also need to design your circuit so that you can power down everything, not just the CPU.

Even without taking "complex" precautions I am surprised that the batteries were depleted so quickly.

You should explore the different parts to see how much current each of them is consuming.

If you can power the Arduino from a pack of 3 x AA cells (4.5v) connected to the 5v pin you won't be wasting energy stepping down from 12v.

...R

The TB6612FNG is another great H-bridge, a dual one so you can control two solenoids with it.

For the Pro Mini: there are 3.3V models out there, running at 8 MHz, and they run fine on two AA batteries. Remove the power LED and use sleep modes and you may get one to run for years.

Though another problem is your analog soil moisture sensors. They continuously use power unless powered off. So not only you waste power, if it's the one that's basically an exposed PCB for direct contact with your soil this copper will dissolve very quickly (weeks to months at most), and the copper ends up in your soil. To power them off you best connect both power and ground to digital pins, and set those pins to INPUT when not in use.

Tim2155:
Hi,
Ive just retired and taken up electronics and Arduino Iot projects in particular as a hobby -new to both.
I’m “lovin it!” as they say.
My first project is the ubiquitous plant watering system, its basic and has a low learning curve.
It works, I’m very pleased with it so I set it up to water the pot plants on my small terrace (about 12 pots).
It consists of
an Arduino Pro mini(5.5V),
a generic soil moisture sensor (attached to an analog pin),
an L298 motor driver which is used for the H bridge aspect to control
a latching solenoid valve(9v),
a couple of LEDs for an “On” indicator and a valve open indicator,
and 3 potentiometers (one controls the sensor threshold sensitivity, one that determines the frequency of the sensor reads and one that controls the valve open time)

As the valve is a latching solenoid a pulse of current is sent through one pin of L298 to open the valve (for 200ms) and another (opposite polarity) to the pin to close it (200ms)
The valve is open for 1 minute (adjustable by a pot) then there’s a delay (adjustable with a pot) of 12 hours.
Aaaaand when I come back after 12 hours the batteries (battery pack of 8 AAs) is flat.
I’ve done some research and it seems that there’s a sleep mode for the Arduino plus the onboard voltage regulator can be removed and the trace for the LED can be cut,
all of which can reduce the power consumption to the microamp range.

My question is: what about the L298?
Can similar modifications be carried out?
Or would I be better going with the Texas instruments DRV8838 (which I’ve just read about).
Thank you.

Welcome to the forum.
Sorry I had to edit your post to itemize your hardware and question.

Have you got a DMM to measure the current consumption of your project?

Tom… :slight_smile:

Thanks for the replies. It seems Ive got something wrong on the Arduino. The arduino is powered from the 5v screw of the L298. Ive checked the total current draw and its 198ma and the L298 by itself is drawing 37ma so the arduino is pulling the rest I assume (161ma). I'll try to post a sketch of the circuit asap

Hi. Just found the culprit, or at least one of them. I had a wire connecting the digital pin on the moisture sensor connected although it was redundant. So total draw now reduced to 100ma which means the Arduino is now pulling 63ma, which is a whole lot better. I didn’t realise that a dead wire could cause so much trouble! Now I’ll check the rest of the circuit.