Go Down

Topic: Arduino nano v3 Solar pwm controller (Read 4197 times) previous topic - next topic

Wawa

#45
Jul 14, 2018, 12:29 am Last Edit: Jul 14, 2018, 12:36 am by Wawa
A solar panel is a current source, and you're replacing it with a voltage source.
The 16volt supply might shut down when connected (with the mosfet) to a 12.7volt load.

Post the three voltages on the mosfet.

I also would like to know how much that voltage booster is generating.
So the difference between battery voltage and voltage on C2 (the diagram in post#1).
Leo..

bigote

Ok I think I solved that problem (bad mosfet) it seems to be charging now, albeit slowly
Battery just hit 13 volts, I just tried it with a 2 amp 18 volt p/s and mosfet got really hot real fast.
I'm gonna have to get a low RDS mosfet like the one on the original project, problem is living in the third world you don't always have access to parts so you have to hunt in the garbage bin for them.

I wanna thank everyone who reply to this thread specially you Leo and Allan and also ReverseEMF.
Thank you all so much, I'll keep checking in just in case you have any other question.

Happy now

Wawa

#47
Jul 14, 2018, 02:38 am Last Edit: Jul 14, 2018, 02:46 am by Wawa
You might have to play with that setpoint line to get final float charge voltage right (13.5 for sealed SLA).
I would just replace the first line in the code with:

const int setPoint = 542; // 542 should be about 13.5volt

And adjust the value proportionally if needed.

Mosfets are ESD sensitive. You might have damaged it by handling/soldering.
Short all the pins together before soldering (by weaving a bare/thin wire through it's legs).

Things that heat up mosfets are Rsd(on) and switching losses.
A mosfet with a lower Rsd(on) and higher gate charge might make things worse,
since you have very little drive current available.
Which mosfet are you using now.

And, as said, you shouldn't use a constant voltage supply to charge a constant voltage supply.
Use at least a current limiting resistor in the +line of the supply.
A 12volt/20watt car brake lightbulb can be used for that.
Leo..

bigote

All your points are well taken.
The mosfet I'm using now is the IRF530 which has an RDS of 0.16 Ohm which is very high compared  to the IRF3205 that the original project calls for that has only 8 mOhm resistance therefore doesn't even need a heatsink (according to the designer) but that's fine as this is like the proof of concept for me, later I'll rebuild it with better parts.

Again thank you very much.

Luis

TomGeorge

Hi,
Have you got the blocking diode D7 in the original circuit fitted, or is it in the PV array?

You need it to stop the battery discharging back thought your Q3, especially if Q3 is fitted with a protection doide/zener.

Also measure the voltage at the positive of your C2, make sure it is high enough above the battery positive to bias your Q3 fully ON.

Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

bigote

Good point Tom, I decided not to include the blocking diode on the pcb as this almost always go on the solar panel itself, voltage @ C2 is always above 16 volts so I guess I'm good there.
One more thing i wanted to mention if someone cares to elaborate on is:
I might wanna build this circuit for a 24 volt system how would the math change for such application.
Everything else component wise on the circuit is rated for at least 50 volts, so the only difference should be in software.
I'll appreciate anyone commenting
Thanks a bunch.
Luis

Wawa

voltage @ C2 is always above 16 volts so I guess I'm good there.
I have asked this several times.
What is important is the DIFFERENCE between battery voltage and the voltage on C2.
So your black meter lead goes to battery(+) and your red meter lead goes to C2(+).
You should at least have 7volt difference.

I think all you need for 24volt is to change the 82k resistor of the voltage divider.

Losses in the voltage regulator go up, so it might be wise to use a tiny switching buck regulator, set to ~7volt.
Leo..

bigote

#52
Jul 15, 2018, 12:01 am Last Edit: Jul 15, 2018, 12:02 am by bigote
Yes I thought the same thing 78x would generate way too much heat and loss so one of those LM2596 modules from ebay will do fine, I've use a few and they work great.
But the real challenge for me is the exact formula in the software as well as the values for the voltage divider.

Luis


Wawa

LM2596 is old generation, big current, but ok to use.
There are much smaller buck converters on ebay that are more efficient at low current.

The resistor values of the divider are not that critical, because the code compensates.
(tried to tell you that with the 22k resistor)

The designer used 20k:82k for a float (fully charged) voltage of 13.5volt.
That results in a voltage on the Arduino pin of 20/(20+82)*13.5 = ~2.65volt.

The code uses those resistor values to calculate "setPoint" (first line).
const int setPoint = 13.5 * 20 / (20+82) * 1024 / 5;

So about 2.65volt most also fall across the 20k resistor for a 24volt system (27volt float).
And 27-2.65 = 24.35volt must fall across the top resistor.
That's 24.35/2.65 times more than the 20k resistor = 183.77k

We are going to try a 20k:180k divider.
Tap = 20/(20+180)*27 = 2.7volt (about right).

Setpoint line becomes:
const int setPoint = 27.0 * 20 / (20+180) * 1024 / 5;

Leo..

bigote

Very good Leo I think that's a good start, I'll try that in the next few days and see how it goes.

I'll be sure to let u know.

thanks

TomGeorge

#55
Jul 15, 2018, 02:42 am Last Edit: Jul 15, 2018, 02:45 am by TomGeorge
Good point Tom, I decided not to include the blocking diode on the pcb as this almost always go on the solar panel itself, voltage @ C2 is always above 16 volts so I guess I'm good there.
One more thing i wanted to mention if someone cares to elaborate on is:
I might wanna build this circuit for a 24 volt system how would the math change for such application.
Everything else component wise on the circuit is rated for at least 50 volts, so the only difference should be in software.
I'll appreciate anyone commenting
Thanks a bunch.
Luis

What MOSFET are you using, and that 16V means you only have 16 - 13.8 = 2.2V for gate potential when charged, to16 - 12.0 = 4.0V when battery is low.


That is not enough to turn the MOSFET, even a logic level, fully ON.

Can you post the code you are using now please?

Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

TomGeorge

#56
Jul 15, 2018, 02:54 am Last Edit: Jul 15, 2018, 02:59 am by TomGeorge
Hi,

Code: [Select]
void setup() {
  TCCR2A = TCCR2A | 0x30;
  TCCR2B = TCCR2B & 0xF8 | 0x01;
  analogWrite(11, 117);
  analogWrite(3, 137);
  Serial.begin(9600);
  pinMode(led, OUTPUT);
}

You are connected in the schematic to A3 instead of D3......
A3 is not a PWM output connected to the timer.

Look at the original schematic;

Tom.... :)
Everything runs on smoke, let the smoke out, it stops running....

Wawa

Good catch Tom.
That means that the boosted voltage is ~4volt less than it should be.
That will heat up the non logic fet OP is using (IRF530), and reduce charging current.

Have been asking for this voltage many times...
Leo..

bigote

There you go Tom, another one of my newby mistakes, as I'm not very familiar with arduino pinouts.
The other problem is I was following 2 guides the one on my first post and also this one by Adam Welch:http://adamwelch.co.uk/2015/11/arduino-pwm-solar-charge-controller/

He made a few changes including the addition of the pulsing led connected to D5, which I also put in my eagle schematic, but in my board is not working I'm also using his version of the code.

Let my try re rewire tha A3 line to D3 and see what happens


bigote

#59
Jul 15, 2018, 08:04 pm Last Edit: Jul 15, 2018, 08:06 pm by bigote
As usual you guys are right again, the voltage now @ C2 is 21.4 and its charging fine.
Any idea why my led doesn't work? it just sits off no activity except it blink son startup.
The code is on the link of my previous post.
Luis

Go Up