Detecting Power Loss and enabling a battery powered pump

I am working on an Arduino aquarium controller. As part of this i would like to have a circuit detect that power has been lost to the main system.

If the Arduino is not running then I want to turn on a separate battery powered air pump to keep the oxygen in the aquarium in case of power failure.

Other things like heating the water will drop over time but lack of oxygen and kill pretty quick.

The battery powered air pump has its own batteries so all I need to to insert a “logical switch” into the circuit to enable the air pump when power loss is detected.

If power comes back on then the air pump should stop working until the next power failure - hopefully never.

Obviously I want something that will not really use any power from the air pump unless it is needed.

I was thinking of having an Hex Invertor

Something like a 74HC04 - https://www.nxp.com/documents/data_sheet/74HC_HCT04.pdf

I do not know if this is efficient and something better should be used.

This seems to support 7v max for VIN and my battery air pump could deliver 6v or thereabouts.

The Logic is

5V from Arduino to the Input of the Hex Invertor.

5v in = 0v out
0v in = 5v out

This 0v or 5v would then be used to control a transistor to turn on the logical switch to enable current to flow in the air pump or not flow depending on the signal.

I am not sure of the transistor to use or how to connect it but I think this would work - I am going to look through Transistors - learn.sparkfun.com

Can anyone agree or disagree with this?

Chris

Maybe just a simple relay with Normally Open and Normally Closed contacts. Use a wall wart that will deliver the power necessary to keep the relay operated and wire the Common and Normally Closed contacts, which will remain open as long as there is power, to your pump. When the power fails the relay drops and the Common and Normally Closed contacts close and complete the circuit for the pump. Power comes back, the relay operates and opens the circuit.
The benefit here is simplicity since power interruptions are not always a clean break and the wavering power could send your Arduino off into the enchanted forest, contemplating its navel until a clean restart occurs.

The thing is I do not want to power the pump at all from the circuit when there is normal power. The main pump is controlled by 240v.

This is just a backup air pump - so I want it to work 100% from battery and I only want it to work when the main power (lack of say 5v from Arduino being detected)

Chris

I'm not sure how to better explain it. The wall wart provides "normal" power to a relay that keeps the backup pump OFF while there is "normal" power available. The relay will ONLY turn the backup pump on when there is no "normal" power available.

When there is no "normal" power available the relay contacts are closed and the backup pump is turned on 100%.
When there is "normal" power available the relay contacts are open and the backup pump is kept off 100%.

Hi,
I think this might help.
PUMPMOTOR.JPG

Tom… :slight_smile:

Thank you, Tom! A picture is indeed worth a thousand words!

Thanks for your help. Yes I understand better now and I guess I could still drive the relay from arduino instead of wall plug.

Cheers

Chris