Automate start of power generator

Hello all!

I am running a small aquaponic farm, fully automated with my arduino -- relays for pumps, relays for lights and heaters, relays for electric valves, temp sensors, humidity sensors, rain sensors, relays for automatically open and close curtains, motion sensors, pH sensors -- it´s a beautiful system.

BUT --- sometimes the utility power goes out -- now, the Arduino is connected to a Pi getting readings every minute, and both are inside a PC case connected to a UPS, so Arduino never actually looses power --- however, the air and water pumps are connected to the main power, so whenever the lights go out, my fish suffer -- a lot (lost quite a lot lately).

I bought a champion power plant with electric start, and made a manual switch to make sure power is always either coming from the utility, or from the power generator.

Now, I am facing the problem that the lights go out sometimes at midnight, and there is nobody to turn on the power plant and switch the manual system.

Can anyone share any ideas as to how could I make the arduino turn on the power plant when needed?

Or maybe use another arduino just to control this?

I bought a champion power plant with electric start, and made a manual switch to make sure power is always either coming from the utility, or from the power generator.

You can replace both switches with relays. A relay is just an electrically-controlled (and electrically isolated) switch.

You'll need to know the voltage & current requirements and get relays of the required ratings or more. The generator-start switch could be a heavy-duty (high current) switch, or it could be a low-power switch connected to some logic driving a relay.

Assuming the generator-start switch is momentary, you might need some feedback. That is, you may need to confirm the generator has actually started before activating the other relay that switches-over the power. Then if it doesn't start, the software can try again.

Of course, the feedback/voltage sensing as well as the utility power sensing has to be electrically isolated. A (small) relay with an AC coil is the simplest way to detect the presence of AC voltage.

Or maybe use another arduino just to control this?

Yeah... If it was me, I'd use a dedicated Arduino. It makes things easier to build, program, debug/troubleshoot, and repair. The cost savings of building everything around one controller isn't worth it unless you're going into mass-production.

Post the algorithm for the program to do that.

start monitor voltage=> Is it ok ? Yes ? go back to start. No, energize relay. Store realtime (from RTC) in EEPROM etc etc etc.

Also , can you post a schematic of the connections you described ?

Typically for something like that you would have a program that when it detects a power failure (make sure it is not just a glich that triggers it), you would try to start the generator - crank for say 5 seconds. If not started, wait 30 seconds then try again. Try to start some number of times (like 3). If it does not start, then send you a message etc. You also want to have a configuration where if the mains power comes back on, it can transfer back to that again and shut down the generator.

Krantz: I bought a champion power plant with electric start, and made a manual switch to make sure power is always either coming from the utility, or from the power generator.

Now, I am facing the problem that the lights go out sometimes at midnight, and there is nobody to turn on the power plant and switch the manual system.

Can anyone share any ideas as to how could I make the arduino turn on the power plant when needed?

Or maybe use another arduino just to control this?

What you're describing is an Automatic Transfer Switch (ATS). I designed once of these around 2004. A really common way to the start the backup generator is ridiculously simple: A Normally Closed relay would be connected to the generator start, and the relay's coil would be powered by the mains so that it would be open when the mains were present. When the mains went away the ATS electronics would lose power, the relay coil would discharge allowing the relay to close, and the generator would start automatically.

Your bigger problem, however, is how you transfer your load over from the mains to your generator. Right now you have a big manual switch? What are you plans to automate that?

What you're describing is an Automatic Transfer Switch (ATS). I designed once of these around 2004. A really common way to the start the backup generator is ridiculously simple: A Normally Closed relay would be connected to the generator start, and the relay's coil would be powered by the mains so that it would be open when the mains were present. When the mains went away the ATS electronics would lose power, the relay coil would discharge allowing the relay to close, and the generator would start automatically.

Your bigger problem, however, is how you transfer your load over from the mains to your generator. Right now you have a big manual switch? What are you plans to automate that?

Elegant solution. Why not do same thing with a second relay for the load ?

It is a matter of great sorrow that some times your Arduino lose power and your fish suffer a lot . It is very essential to repair your generator or It may be changed .

To answer the question from raschemmel:

The load may be tens or hundreds of amps and hundreds of volts, we don't know. This can be handled by a contactor, which is a fancy name for a relay that can handle a high current and a high voltage. Add circuit breakers, some wiring, maybe some outlets and lights and buttons and - VOILA! - an automatic transfer switch.

We use high power contactors here at work. Using the proper terminal blocks it is possible to create a 3-PHASE SPDT CONTACTOR by combining two 3-phase contactors, with a timed delay relay. The method of operation is functionally a X-OR circuit. ONE and ONLY one of the two inputs , one output.

Input-A: MAINS (contactor A) input B: GENERATOR (contactor B) Output: LOAD (HOUSE)

sequence of events: 1- Contactor A is energized (120vac coil/600 mA coil) through N.O. contacts of SPDT 120 vac relay (10A contacts@250vac) 2- Mains loses power 3- relay de-energizes 4- Contactor B energized through 2-second delayed Timed relay , which is energized through N.C. contacts SPDT relay. 5- Timed delay relay energized, 2 second count-down begins 6- Timed delay relay times out, energizes Contactor-B, connecting generator to Load. 7- Load running off generator 8- MAINS RETURNS 9- SPDT relay energizes disconnecting power to Contactor-B 10-Timed delay relay for Contactor-A energized through N.O. contacts of SPDT relay 11-2 second countdown begins 12- Contactor-A timed delay relay times out , energizing Contactor-A. END SEQUENCE

raschemmel: We use high power contactors here at work. Using the proper terminal blocks it is possible to create a 3-PHASE SPDT CONTACTOR by combining two 3-phase contactors, with a timed delay relay. The method of operation is functionally a X-OR circuit. ONE and ONLY one of the two inputs , one output.

It's funny you should mention that. That's exactly how it was done in my ATS.

Each contactor actually had a shunt trip which was automatically activated whenever the other contactor was closed (through a delay circuit). The software was only supervisory.

Interlocks like that cut down on the sparks and smoke which is a good thing :)

Jaforali: It is a matter of great sorrow that some times your Arduino lose power and your fish suffer a lot . It is very essential to repair your generator or It may be changed .

?

It is a matter of great sorrow that some times your Arduino lose power and your fish suffer a lot . It is very essential to repair your generator or It may be changed .

?

Either someone gets very attached to their fish or they had a saltwater tank and lost about $500 worth of fish. Trigger fish like the are not cheap either.

Yeah, freshwater tanks are like "well, I guess I need to work on the tank this week" - saltwater tanks are like "I guess I need to work on the tank in the next hour". They upset very quickly and those fish are NOT cheap.

OP says he has a Champion Generator.

Minus the isolation panel ..which is paramount.. Fines for having a uncertified panel around here are $30K plus ..god forbid if a lineman gets hurt..fish loss will be the least of your worries.

Back to the generator..

Generally these are gas powered. which 9.5 times out of 10 ..require a choke to start...then a "human Touch" to reduce or turn of as engine is warmed. before load is put on. Also ,most of these Honda or"Honda Clone" engines have a fuel shut of valve , which generally is shut off when generator not in use ..because the float valve doesn't always close. This can cause the engine to flood and the crank case to fill with gasoline. Very bad Ju-Ju

A battery tender is also recommended when the generator isn't in use.

so as it follows ...

Arduino upon sensing a mains loss..

1: activate Isolation panel. 2 :check generator battery voltage.12+ volt =good 10.8volt =bad no crank 3 :set choke .turn on fuel.. via servo or solenoid. 4 :crank engine 5 : sense engine rpm, sense battery voltage. 6: stop cranking engine upon base speed..say 500rpm or battery voltage 10.8V at which point return to Line #2 7 : remove choke 8: sense rpm @ idle say 650-700 rpm. sense generator alternator output 13.8V good ..12v bad shut off no restart attempt ..Generator wont power its AVR. no point running 9: if 13.8v on alternator apply throttle 10: activate generator

All the while sensing mains' for power restoration at which point Generator powers off engine shuts down. gas turns of

Should also mention ..shutting down this gas engine require putting the spark coil to ground on the engine..Massive back EMF ,and voltage ..upto 28,000 volt..

All fine ..

My preference for generators are Diesel.. Easier starting ,Diesel fuel life is longer than gasoline .. 1yr+ vs Gasoline 3 mths.. No spark suppression needed.