PWM output from a Basic Stamp to power a battery to charge it
sam_sam_sam
Posts: 2,286
What set up would I need as a starting point Just to see if it can be done as far as writing the code for the Basic Stamp
I want to built a PWM circuit type output to control battery charging with an ADC chip watching the Battery Voltage
I am going to use a MAX186 ADC chip
I saw the post Balance Charger Design Idea which got me thinking about this again
this time I what to take it further and try something my self
I want to built a PWM circuit type output to control battery charging with an ADC chip watching the Battery Voltage
I am going to use a MAX186 ADC chip
I saw the post Balance Charger Design Idea which got me thinking about this again
this time I what to take it further and try something my self
Comments
It would certainly help to know what kind of battery, what voltage, and what capacity you are looking at.
As you well know, the Forum gets a lot of 'What's the best....?' questions when there is really no best solution without a very precise context for design.
This is the most important part for now
Ni cads battery's at max of 7 amp hour
Ni MH battery's at max of 4 amp hour
Li po pack battery' battery's will be done later how ever I want to keep this in circuit type output lay out to use this later
http://www.qsl.net/eb4eqa/batt_charger/batt_charger.htm
http://talkingelectronics.com/projects/ChargingNiMH/ChargingNiMH.html
Several pages with good info.
Thanks for posting this Link I am going to try the circuit where the LM317 and the BC548 and the 1N5404 are and see how this works
http://www.angelfire.com/electronic/hayles/charge1.html
I have to wait until I order some BC548 and the 1N5404 I do not have any right now But I will post what happen with my testing
I built the LM317 proto board part today to see if this work or not which it dose work
I did not look a data sheet for this 1N5004 diode it has a voltage drop of 1.2 volts
I did not have one so I used a 1N4001 which has a voltage drop of .6 volts which I need two to get a 1.2 voltage drop
Here is the data sheet..... http://media.digikey.com/pdf/Data%20Sheets/Fairchild%20PDFs/1N5400.pdf
My mistake
Here is the data sheet .... http://media.digikey.com/pdf/Data%20Sheets/Fairchild%20PDFs/1N5400.pdf
' {$PBASIC 2.5}
'
'
'
[ Program Description ]
'
' Purpose....PWM cycles to see their effect on a LM317T regulator using a 2N3904 transistor and two set of 2N4004 rectifier diode instead of a 1N5004 .
' Author.....sam_sam_sam
' E-mail..... sam1030@comcast.net
' Started.... 12-29-10
' Updated....
'
' Parts use LM317T, 2 @ 1.8 ohms resister, 2N3904 transistor to do this test
'
' On the base of 2N3904 transistor to the Basic Stamp Pin I used a 470 ohm resister instead of a 1k ohm resister
'
' With full ON is set a 370 milliamps by default
'
'
[ Variables ]
'
laps VAR Word
'
'
'
[ Program Code ]
'
DO
'GOSUB Full_OFF
'GOSUB millamp_C_10
GOSUB millamp_C_120
'GOSUB Full_ON
LOOP
'
[ Subroutines ]
'
'
'These are the commands for full ON and full OFF
'
Full_ON: ' Charging at 370 milliamps
DO
FOR laps = 0 TO 1000 ' The for and next is used to keep the from switching from high to Low on the LM317
PWM 0, 0, 0 '(PWM Pin ,Duty, Duration) (Pin 0, Duty = 0, Duration = 0) = Full ON
NEXT
LOOP
Full_OFF: ' Full OFF still charges a very little with 12 volts INPUT with no load 3.14 volt
DO
FOR laps = 0 TO 1000 ' The for and next is used to keep the from switching from high to Low on the LM317
PWM 0, 255, 255 '(PWM Pin ,Duty, Duration) (Pin 0, Duty = 255, Duration = 255) = Full OFF
NEXT
LOOP
millamp_C_10: ' 10 mill-amp charge rate
DO
FOR laps = 0 TO 1000 ' The for and next is used to keep the from switching from high to Low on the LM317
PWM 0, 255, 40 '(PWM Pin ,Duty, Duration) (Pin 0, Duty = 255, Duration = 40) = 10 millamp charge rate
NEXT
LOOP
millamp_C_120: ' 120 millamp charge rate
DO
FOR laps = 0 TO 1000 ' The for and next is used to keep the from switching from high to Low on the LM317
PWM 0, 250, 1 '(PWM Pin ,Duty, Duration) (Pin 0, Duty = 250, Duration = 1) = millamp_C_120
NEXT
LOOP
A few notes
One there Full ON
Second there is mill-amp_C_120 this range can be adj down but NO higher other than FULL ON
Third there is mill-amp_C_10 this range can be adj up or down
Fourth there is Full_OFF
Back to the man cave again to work on a new board