I am in the process of designing a solar PWM lead acid battery charger with a Arduino Uno as the linear charger wastes to much energy.
I built it on breadboard but when using the RC PWM to voltage converter, referenced to ground the readings are incorrect. When the Arduino is set to output 255 the voltage measured is zero. When set to zero the voltage measured is the nearly the full supply voltage.
If I reference to the supply voltage the voltages measured are correct.
The easiest thing is to invert the logic in your code. If you're mapping 0-255, map 255-0.
Or, you can "reverse" the connections to your opto-coupler. Connect pin 1 to 5V and pin 2 to PWM (the resistor can go to whichever side is more convenient as long as it's in series with the LED inside the opto-coupler).
Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Hard to read schematic as you don't use normal symbols for that MOSFET or the optocoupler, and everything else is drawn in non-standard ways.
Anyway, in this circuit: PWM signal 255 (i.e. pin is simply HIGH), IC1 output is conducting, gate of Q2 is pulled to 5V, Q2 conducts and switches on, and the "analogue voltage" point (which I assume is where you're measuring) will be at ground potential.
PWM signal 0 (i.e. pin is LOW), IC1 is off, gate is pulled low, Q2 switches off, and the "analogue voltage" is at "battery negative" potential.
Indeed a reversal in code, or the optocoupler, is the easy fix.
BTW If your solar panel and battery are < 20 Volts you do not need the 5V regulator.
In fact, for the RFP50n06 to its rated on resistance, the gate voltage should be ~ 10 Volts. Given the opto has some voltage drop you are likely only reaching 4.5V on the gate.
So you are effectively using the PV panel as a constant current charging source, then using PWM to
back-off the rate of charge as the battery gets fully charged?
The most efficient method is MPPT charger, neither a CV or CC charge scheme can be optimal from a PV
panel, especially in changing light conditions.
Your circuit has no blocking diode so unless the PV panel has one the battery will be discharging heavily
through the MOSFET's body diode at night and flattening the battery rapidly.
aj777:
I am in the process of designing a solar PWM lead acid battery charger with a Arduino Uno as the linear charger wastes to much energy.
A PWM charger wastes the same energy as a linear regulator.
The only difference is that the excess power/heat is now generated in the solar panel.
MPPT is the only way to reduce 'energy waste', as MarkT said.
But that might not be worth the extra parts and/or increase efficiency if a small panel is used.
Leo..