Advice- Project for my solar

Hey guys. I'm new to Arduino. In fact, I'm so new my Arduino kit wont even be here for 3 more days. I'm spending time learning a bit about codes, hardware etc. for a project I would like to make for my solar.

If this is like any other forum, before I get flamed and told study, practice, learn etc, let me start by saying I fully plan on learning as much as possible over the long run. I'll start with the hello world blinking light sketch and work my way along.

My first big project (which may not seem big to you) will be to create a circuit that will sense my solar batteries and run a 500 watt grid tie inverter.

Basically, I want it to turn on my inverter when my batteries are charged within a certain voltage, and turn off the inverter when the batteries get too low. (similar to a diverter on bigger charge controllers).

I've started looking into how to run a 30 amp relay on the Arduino which seems fairly simple.

Could someone direct me on an idea of how to map this out? I wont need any LCD readings yet. as I get more familiar with Arduino and the programming, my ultimate goal is to have a fully automated solar system that sends data to a dedicated server for viewing outputs.

But for now, I just want to figure out how to use Arduino to turn on and off my inverter based on battery voltage.

Any help will be appreciated.

Keith

Keith,

I know lots of Arduino folks are working on solar. Roger Clark, stm32duino.com, in Australia has designed units in Australia and England. Roger is slso on this forum, but I an unaware of how often he checks in.

A search of this forum may get a number of hits, too.

Welcome to the forum!

Ray

Grid tie inverters are not toys and a rather decent understanding of how to connect and operate them safely is absolutely required.

In the U.S., electrical utilities REQUIRE inverters to be installed and connected to the line by a licensed technician, and to be inspected by the utility for safety before operation.

There are people on this forum who can advise you, but they will require a link to the data sheet or product page of the inverter, detailed information about the battery bank, etc.

j0ker31m:
when my batteries are charged within a certain voltage,

This may sound simple but it is not. It is perfectly easy to measure the voltage on a battery but it will not necessarily give you a good indication that the battery is fully charged.

Assuming you are using lead-acid batteries it is very important to charge them fully about once a week to ensure a long battery life.

The only way to know if a battery is fully charged by measuring the voltage is to leave it disconnected from everything for 12 hours or more and then measure the voltage - this allows time for the internal chemistry to even out. And I do realize that this is a rather impractical requirment. I deal with it by having 2 separate batteries one in use and one being topped up. (Most of my charge comes from a generator and I use the solar panels to reduce fuel consumption).

My concern is that if you rely simply on measuring the voltage while the battery is being charged you will be consistently under-charging the batteries.

...R

Grid tie invertors are designed for grid connection, they have to sense the grid supply normally for a minute or so before they start to operate.

j0ker31m:
But for now, I just want to figure out how to use Arduino to turn on and off my inverter based on battery voltage.

Keith

Link to inverter please, a relay may not be needed anyway.

Boardburner2:
Link to inverter please, a relay may not be needed anyway.

Its just a cheap inverter. My solar setup is just a hobby. Currently i have to turn my inverter on and off with an AC outlet timer. But when it clouds up outside, the inverter drains my battery bank if it runs for a few hours on a cloudy day.

I have a bit of understanding on how relays work, and ill be using a 120v relay on the AC side of the inverter.

My battery bank is used as a backup in case the power goes out we have a dedicated wire running to a few lights and outlets around the house that connects to a modified syne wave inverter.

Instead of just letting the batteries sit in float and the solar panels sit idle for weeks or months on end, i bought a grid tie inverter to help make use of the solar panels on a day to day basis.

Basically, when the battery voltage reaches float stage, id like to kick the inverter on for about an hour (which will drain the batteries about 10-15%). Then the solar charger can recharge the batteries... rinse, repeat.

j0ker31m:
Basically, when the battery voltage reaches float stage,

How do you detect that?

...R

j0ker31m:
Its just a cheap inverter.

j0ker31m:
batteries and run a 500 watt grid tie inverter.

Keith

Those two statements seem to contradict however,-

Solar grid tie inverters normally require upwards of 100V DC to start , can your battery bank do that ?

I mentioned earlier a start up delay , the purpose of that in the event of a power cut you do not electrocute the guy trying to fix the lines.

I am suspicious that you may be trying to operate in island or bi-modal configuration.
That is dangerous if not done correctly.
The cost of doing that to the satisfaction of the utility co runs to thousands and is appropriate only for large installations.

I have re read your posts, my concern is your use of the term grid tie converter , is your converter connected to the incoming mains in any way ?

That includes the use of a relay to switch between them.

If your CONVERTER is connected to a totally separate distribution circuit i see no problem.

A simple block diagram would help.

Instead of just letting the batteries sit in float and the solar panels sit idle for weeks or months on end, i bought a grid tie inverter to help make use of the solar panels on a day to day basis.

To repeat, a grid tie inverter MUST be installed by a licensed technician and inspected by your electric utility.

Ok, for arguements sake, my solar setup is fully functional. My grid tie inverter has 0 modifications. The grid tie shuts down when the power on the grid goes out. Thats the way it is supposed to be and i am not trying to change that.

I have a modified syne inverter for running electricity into a dedicated (isolated from mains) set of lights and outlets throughout my house in case the mains goes down. My grid tie inverter plugs directly into mains. I only use it so i can put the solar to use in times when the grid is functioning normally. When the grid goes down from a storm or other causes, my home still has a backup set of lights and a few outlets to power small equipment if needed via a modified syne wave inverter.

since everyone seems to be focused on the legalities of my inverter instead of my project...

Lets pretend i want to run a 500 watt DC 'fan' off my battery bank once my batteries are fully charged. I would like to run the 'fan' until my battery bank reaches a certain voltage and then shut off until my battery bank is fully charged again.

I've started looking into how to run a 30 amp relay on the Arduino, and iv found sample sketches to help set me in the right direction.

But for now, I just want to figure out how to flip the relay on based on voltage sensor data. Im also having troubles finding a sensor that will detect 12v dc battery voltage.

As iv stated before, my solar setup is just a hobby project. Introducing arduino into the setup is simply a project idea i have and it will be fully experimental for hobby/curiosity/ trial and error.

Any help will be appreciated.

j0ker31m:
since everyone seems to be focused on the legalities of my inverter instead of my project...

Any help will be appreciated.

For a good reason.
Your safety .

If we give advice on a potentially dangerous project in an open forum , whatever the risks you take if something goes wrong we could be held accountable.

I relate a story of a fellow caravanner.
He used a cheap inverter with a suicide extension lead (plug at both ends) to power his 250V freezer.
The inevitable happened, he forgot and his inverter exploded.
Luckily it was underneath and he managed to put out the fire.
He got the idea from someone else so there is at least one other accident waiting to happen out there.

His reasoning,- well boats do it when they moor up.

Also hypothoretical problems are not well liked by myself.
I like to see some effort by the poster to show a diagram of their ideas.

Photograph of a hand drawn diagram is perfectly acceptable.

Also i do not see the point of your grid tie converter , it will not save electricity without proper metering arrangements.

On sunny days, with no draw, my battery bank is in float by 11am regardless, so that is when i have my ‘fan’ set to turn on. Im not sure if i will program a timer into it ore use a physical timer but my idea is something this:

At 11am, i would have it start sensing data every 15 minutes like:

If v => 13.5 then activate relay
And
If v =< 12.5 then deactivate relay

I would set this on a 15 minute loop. Then

Then at 6pm i would have it deactivate relay for the day. This gives it a few hours in the evening and morning to fully charge the batteries.

Right now i just have a timer turn it on from 11am -6pm which works great when its sunny. But on cloudy days it has drained my battery bank too far a couple of times iver the years. This is why i am looking into automating based on battery voltage.

After 6pm and before 11pm, the solar panals always put my bank into float mode no matter the weather conditions. On sunny days they spend at least 2-3 hours in float mode. So i know that before the ‘fan’ is set to turn on, my batteries are always fully charged

j0ker31m:
everyone seems to be focused on the legalities of my inverter instead of my project...

That's because you have failed to focus on what I posted :slight_smile:

(Not that I disagree for a moment with the need for caution)

...R

j0ker31m:
Im also having troubles finding a sensor that will detect 12v dc battery voltage.

Arduino has a built in a to d converter that can do that easily.

Unlike Robin my arrangement has only one battery.
I use a relay to disconnect the charge circuit and a Nano in sleep mode to periodicaly monitor terminal voltage.
It is connected to ignore voltage drops when lights are switched on periodicaly.
The relay is latching to remove the current draw of a normal one.

This is in my shed.
If i wish to use power machinery i run an extension lead which energises a relay to disconnect the inverter.
I think this is what you are attempting to do.

However this is UNAPPROVED and if my shed burned down because of it i would be uninsured.
I would not contemplate doing this in my house.

In case of doubt, my system is NOT connected to the Grid.

(If I could connect to the grid I would not need solar panels. They only pay for themselves because diesel generated electricity is so expensive :slight_smile: )

...R

This is an old video of my setup. Fuses, disconnects have been added, the solar panels have been rewired and reinforced and a grounding rod has been attached to panels and all equipment. The little 400 watt modified syne wave inverter has been upgraded to a more reliable/ higher wattage inverter. The grid tied inverter is the same as the video though. Im posting this just to satisfy all the people choosing to judge me rather than help me.

As you can see, no equipment has been modified and everything works the way they were designed to work.

The inverter can be found at https://www.amazon.com/gp/aw/d/B00RWYXVC6/ref=mp_s_a_1_2?ie=UTF8&qid=1471724173&sr=8-2&pi=SY200_QL40&keywords=500+watt+grid+tie+inverter&dpPl=1&dpID=51Qm2b0ylsL&ref=plSrch

The timer on the wall turns on and off which cuts grid power to the sensor in the inverter. When the inverter senses there is no grid power it shuts down as a safety mechanism.

Instead of using a just a timer, i would like to also set up a way to turn on and off the inverter based on battery voltage.

By adding a relay to either the dc wire or the ac wire, when it disconnects power, the inverter will shut down.

My thought is to do it from the ac side since there is less current, but i could do it from the dc side if it makes you sleep better at nite.

I just ordered an arduino kit which will arrive monday. I would like to learn the arduino for many different projects in the future. The solar automation project just seemed the easiest to build for learning the arduino.
I came here asking for guidance on the arduino integration into my solar project. My thought being either i go at it blindly, or i ask for assistance. I chose the latter for safety reasons. I hobby with electronics and gadgets, but this is the first time I'll be building something myself rather than just buying something premanufactured. I could by a low voltage cutoff and it would do everything im needing it to do. But for hobby sake, i would like to attempt to build something myself which can be expanded on later.

As i become more familiar with arduino, eventually id like to build a quadcopter, home automation projects etc. But for now, i figure id stick to something less intricate and more "newbie level".

This seemed more newbie level:

Sense voltage, is it good? Activate relay. Is it bad? Deactivate relay.

So far, iv learned in the comments that there is an arduino sensor for 12v dc batteries. Does anyone know what the sensor is called and where to buy it?

Also any ideas on any sample sketches that may be helpful.

I take full responsibility and accept liability on my solar equipment. If you would like to judge me on my solar, or lecture me on solar laws, utility laws, etc, feel free to do so on my youtube video. If you would like to help guide me on my arduino project, please feel free to do so here.

Thank you

this works for me

500w/ 120v
is less than 5A so no need for such a big relay

int v11 ; 

float v2 ;

void setup ( ) 
{
pinMode(13, OUTPUT);
Serial . begin ( 9600 ) ; //Set the serial bus speed (not needed if your using the nokia LCD)
} 
void loop ( ) 
{ 
float temp ; //Float..
v11 = analogRead (5) ; //Sets analog pin A5 as input
v2 = v11/48.31 ; //V11 convert to volt 22k and 6k8 volt devider
Serial . println (v2) ; //Prints to serial monitor window

if (v2 >= 14.2)
digitalWrite(13, HIGH);

if (v2 <= 11.5)
digitalWrite(13, LOW);


delay (1000 ) ; //Every 1 second(s)
}

And for the record, i will be testing the finished project in a much smaller system outdoors for quite a while before integrating it to the solar system. I will be testing with a 12v lead acid battery, a portable solar charger and my little 400 watt cobra inverter with a fan attached.

I will test it thouroughly under every concievable condition to ensure the hardware and software both function reliably.

It will not be attached to my solar setup until im am fully satisfied that it will be safe to use in an unmonitored situation.

cmcc:
this works for me

500w/ 120v
is less than 5A so no need for such a big relay

int v11 ; 

float v2 ;

void setup ( )
{
pinMode(13, OUTPUT);
Serial . begin ( 9600 ) ; //Set the serial bus speed (not needed if your using the nokia LCD)
}
void loop ( )
{
float temp ; //Float…
v11 = analogRead (5) ; //Sets analog pin A5 as input
v2 = v11/48.31 ; //V11 convert to volt 22k and 6k8 volt devider
Serial . println (v2) ; //Prints to serial monitor window

if (v2 >= 14.2)
digitalWrite(13, HIGH);

if (v2 <= 11.5)
digitalWrite(13, LOW);

delay (1000 ) ; //Every 1 second(s)
}

This looks like a great starting point. I wasnt planning on using a display at first. Was just gonna manually monitor vattery viltage and listen for when relay turns on and off. But a lcd display is included with the kit i ordered. This will make the testing phase much easier.

Im not sure i need it to monitor every second. I was thinking more along the lines of every 15 minutes to test battery state. I can edit the code to suit my needs, but i wonder what your thoughts would be on it. Is there a pro or con to looping the code every minute vs every 15 mins? Other than higher precision?

Many thanks to you for the sample.