I was on another site where someone was asking what the name of a relay was
that would turn off his inverter with low battery and transfer the refrigerator to
grid power. Then revert back to batteries when battery recovered. Another had
his inverter shutting off with alarm, but he manually had to reset the inverter
to restart. So what was the name of this magic relay they asked. I forget all the
trade names for devices, but I used to make them and got on the company website.
I couldn't find them. I know they still make them, but 90% of what they make is
custom and the standard products are there to just bait and switch to something
private label. Surely ebay had this under some name for cheap. Searching key words
came up with nothing. The item is just a voltage set/reset relay that drops out at
a low voltage and pulls in at a higher reset voltage.
I later found it as Low voltage Disconnect, don't know why these didn't show up in my initial search.
A few less features.
http://www.ebay.com/itm/371798342224?ssPageName=STRK%3AMEBIDX%3AIT&fromMakeTrack=trueSeemed like a nice project for a UNO. I started programming a complex one that had
timers to prevent hot starts, and sequencers to control a transfer relay and turn on
the inverter separately. His application was for a refrigerator. Do you do a hot swap
with everything running or transfer power lines and then start the inverter. There
are reasons for both. So, that program is tabled for a while. I did repurpose it for
a simpler program that could be useful. My first refrigerator control worked on a
similar idea.
This program operates the inverter any time switch pin #2 is left open to common.
That switch could be a float switch or thermostat contact. It can be left unconnected
as the micro has an internal pull up. It then just operates as a low voltage disconnect,
just better. I waits till the battery has significantly recovered and for startup battery
slumps of motors, it requires the low voltage to exist for continuously for 25 seconds.
Any voltage rise resets the timer. Also, the relay state can change no faster than that.
This lockout can be easily changed. This is a must for any voltage relay to prevent
false triggering and short cycling when the battery is in a fairly discharged condition.
A debug screen displays all the variables so program operation can be watched. The relay
driver is PWM reducing heat and power consumption. Quite useful as it is presented and
other options could be added to this program.
The restart voltage is arbitrarily set to 13.5 volts. I use a higher restart voltage
in my system. It is fairly easy to get a nearly dead battery up to that voltage with
a moderate charge current. I feel it is better to wait till the battery has a fuller
charge than keep cycling at a discharged state. This voltage is highly dependent on
your situation such as battery and panel size. A second analog input has been stubbed
in. A radiance sensor could be added. With a larger array and bright sun, the inverter
could be turned on at a lower voltage if charging could also be supported. Grid power
could also be monitored. In a power outage the dropout voltage could be lowered to
power critical devices longer. A grid/inverter transfer relay can be easily added.
Just use a 120V AC DPDT relay powered from the inverter. This will transfer the power
any time the inverter is operating. I prefer software controls to prevent hot starts
of refrigerators, but they are designed to withstand short voltage outages. Statistically
these hot starts will be a fairly rare occurrence anyway.
heck your inverter manual to see at what over voltage it trips out at. The over voltage
trip in this software is intentionally quick. You don't want to get into a situation
where the inverter trips and then it has to be manually reset. It might be a good idea
to add an extra LED saving that trip. It could be an early alert that a problem exists
like a bad connection. The same could be said for the low voltage drop out. There are
plenty of pins to add a few extra LED. Light an additional one for each drop out. A PWM
output could do the same thing by changing voltage. This could indicate when batteries
are aging or more panels are needed. Data can give insight to your system. There are
lots of possibilities. Add that automatic outdoor light or add ventilation when batteries
are full.
The optional switch input is on pin #2 to GND. Leave this open and the inverter will
run till an under or over voltage condition exists. Close the contact and the inverter
will turn off. Battery voltage is read on pin A0 from a voltage divider creating about
3.5 volt. The debug screen allows you to adjust a pot till the voltage reads correctly.
The miltiplier can be changed to adjust to the divider. Have at least 47K, high side
resistor, between the battery and the analog input pin. Avoid having potentially more
than 5V on that pin. A 1-4.7uF capacitor should be placed at the analog input to GND to
filter noise spikes and smooth out voltage changes that may be caused by the charge
controller pulses. PWM output is at pin #10. Drive a FET through a 100 ohm resistor.
The relay MUST have a diode across the coil. Ideal supply for the uno is about 8v. Those
little LM2596 switching regulators selling for $1 are ideal for this because it will
reduce current draw. Always make multiple GND pin connections to the board.
Again this is a demonstrator program. It seems to work as designed, but hasn't been
extensively tested. I hope you will load it into your, try to follow the code and
logic using the debug screen. Decisions are made by identifying all the possible
conditions and testing those for each case. Think of it like being in a room and watching
meters and lights. Just think what you would do given what you were seeing. That becomes
the program. If there is some part that is hard to understand, pick out six or so lines
and post them. I will explain what is happening in more detail. It is hard to anticipate
sticking points a new learner will have.
1 and 0 are ON and OFF. That is becoming universal for powered devices. If it makes reading
the code easier these could be changed to variables YES and NO. That may make it easier
to read the logic, if(INVERTERon == YES) digitalWrite(LED13, ON; may be more obvious at
first glance. Directly using numbers instead of making the screen look like alphabet soup
may work for you. Assigning names to numbers will make it easier in large programs to make
changes. If a number is used multiple times in a program, it is easier to change it in one
place rather than searching through the program for where it could have been used. Choosing
names is difficult when the same type operation is done in multiple parts of the program.
Inhibit, delay, lockout, dropout can be applied to similar operations. It is easy to lose
your reference. I often go back and change variable names when a better one comes to mind.
Make it self explanatory. Six months or a year later those self explanatory names will keep
you from wondering what the program is doing. A lot to juggle in your head. It just gets
easier the more times you look at different programs. This is a language. You can't be just
dropped in a new country and start speaking. Give it a chance to sink in.
The other day I was looking at a post where a resistive temperature sensor was used to
turn a LED on and off. I had used the same temperature sensor in my water heater program.
What he was doing could be bought on ebay for $2.50 shipped. OK, he wanted to do a project.
This could be done in 6 lines of program. I looked at the code and initially couldn't
figure out what he was doing. It was all very proper and correct. He must have just finished
a programming class and wanted to look like a real programmer. He still lacked any practical
experience as his A/D readings weren't averaged. Random converter noise would drive that LED
crazy. The point is you will see a lot of programming on the internet and it will look like
a whole page of swearing. First thought is I'm dumb as a stump and will never learn to
program. Top notch programming is a beautiful thing to see. A lot like a mathematician who
spends 20 years trying to prove the existence of zero. We know what zero is. There are
shortcuts with characters that seem to defy understanding. You can write programs without
getting into any of that clever stuff ever. Don't let those programs intimidate you. They
probably don't work that well in an application anyway.
"Nobody's so damn well educated that you can't learn ninety percent of what he knows
in six weeks. The other ten percent is decoration."
Kurt Vonnegut, Player Piano
On a side note, my summer home is only a half mile from where he wrote that.