Reducing power consumption

I have project for monitoring wildlife. It's based on an arduino mega.

It's triggered by an animal brushing past a sensitive microswitch connected to an input pin. The project all works ok, except for the fact that the location is remote and the battery goes flat quite quickly - it's not that it's actually doing anything 99% of the time, but the standby current alone can drain the batteries after a while.

I'm looking to modify the project so that the trigger (microswitch) is connected to a low power timer, which will in turn switch on the arduino to do it's stuff before switching off after a determined period (a few seconds).

The timer would be permanently energised (with a very low power consumption), it would be triggered by the microswitch closing, which would supply power to the arduino for just as long as is needed.

I've been looking for an off-the-shelf timer. First try was this one, but it's designed to switch itself on at regular intervals, (rather than be switched on by a trigger), then there's this which seems to work in the same manner.

Are there any other ways to turn this into a low power project? My first choice would be an off-the-shelf module, the 2nd would be a method to hack/modify an off-the-shelf module, followed by my least-favourite choice of building something from scratch.

do you really need 50 pins and 4 UARTs?

Unnecessary. The logical way to do this is to use a PMOS which blocks current from the battery to the Arduino. The microswitch then pulls the gate of the PMOS down, allowing the battery to power the Arduino. The Arduino then pulls down the PMOS gate while it does its work, and when it's done, the gate is left to float back up and the Arduino disconnects itself from power.

There are numerous examples including schematics for this online. They involve a PMOS, an additional small signal transistor, one or two diodes and a handful of resistors. It's pretty simple and straightforward, and works very well, too.

Here's an example: [SOLVED] - Power switch PMOS controlled by button or Microcontroller (or both) | Forum for Electronics (see post #2).

There are some boards that when put to sleep can have a current consumption of 10uA or so, they can then be woken up by a switch generating an interrupt.

But its not so simple with a Mega, it has components that consume quite a bit of power even if the processor itself is asleep.

So do you need all the IO pins that a Mega has ?

The project is modular - the simplest variant probably doesn't, but at it's most complex it will attempt to detect an animal, weigh it, measure it, log details to an SD card and transmit a message about it.

hmmm.... I think we have different ideas of 'simple and straightforward' :wink:

I'm sure there's a ready-made module somewhere that does this. I never looked. Maybe someone else can link you to one.

What I suggest really is simple and straightforward. You can do this. Get a breadboard, a few suitable components and build a circuit. If it works, buy some protoboard and solder the thing together. This isn't rocket science. It's really a down-to-earth, beginner-friendly 'project'.

Why not a simple soft latch?
Eevblog has explained the circuit.

Here's another simple circuit - my mailbox notifier:

In your case your microswitch would ground the mosfet gate, which turns it on, and the Arduino powers up. The first thing it does it turn on the GPIO which turns on the NPN, which continues to ground the gate after the microswitch turns off. Then when it's done its work, it brings the GPIO low, thus turning off its power until the next passing critter. No timer needed.

Next - solar charging. :slight_smile:

Exactly what you need

Switch to a NANO, find the circuit that powers off the NANO totally then use a genuine DS3231 (NOT the defective commonly mentioned ZS-042) Use the DS3231 SQW pin (I like the chronodot module but also use raw chips) to periodically wake the NANO. You can also use the code from Gannon, I think it's called PowerDown. Using the RTC makes the sensor time sliced, so if it is off 50% of the time the battery lasts 2x but it can NOT detect at all during that sleep. Gannon's code is very power frugal, I have one in my kitchen and will measure a real use. I would use a combo of totally off x% of the time maybe during specific hours (the DS3231 can do all that) then Gannon's low power code.

The soft latch circuit mentioned several times above is superior in virtually every way.

Thanks Jim-p - looks that that should do the trick.

I think we have a different view of impersonating a long standing member of the forum.

You are welcome
Have a nice day!

oh dear. Quite right. I'll see what the settings will allow me.