A PIC based boost converter

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

A PIC based boost converter
Update.
Circuit diagram:
 
http://panteltje.com/pub/sc2_pwr-0.3_diagram_img_3251.jpg

I am using pencil again,
as I cannot be bothered to draw a new diagram in ink for every change I make.

The changes:
The MOSFET switch Q1 is moved into the battery + lead.

The system is started by pressing switch S1,
this shorts the source drain of the Q1 MOSFET battery switch.

When battery voltage is above the cut-off threshold,
then pin 5 of the PIC carries a 50 mS squarewave, and pin 6 goes to +5V,
this causes about +9 V to be created by the diode multiplier D1, D2,
this is applied to the gate of MOSFET Q1, keeping it in conduction mode
when the start up button is released.
Voltage drop at full load is then 30mV or less over the MOSFET.

Battery voltage is measured via PIC pin 3, ADC channel 3.
and output voltage via PIC pin 8, ADC channel 8.

When battery voltage drops below the specified value found in the PIC EEPROM,
then the AC signal on pin 5 and the DC signal on pin 6 are removed, and the
MOSFET Q1
gate drive goes low, and the system isolates the battery, everything off.

To display system status, and set the battery low threshold, a RS232 interface
is available.

Panteltje (c) sc2_pwr-0.3 power supply PIC.

This is the RS232 dialog, things speak for themselves, this is what you get of
you type 'h' for help:

RS232 commands 115200 Bd 1 start bit, 8 data bits, 1 stop bit:
                                                              
CnnnENTER    set battery low voltage cutoff level in mV, default is 1700 for 1.7
V, saved in EEPROM.
DnnENTER     set DAC, this sets the output voltage, minimum is about Vin -,
maximum is 5 V, 31 steps of 1 / 31 V, default 31, saved in EEPROM.
GnnnENTER    set clock calibration, set timer1 reload, default 175, saved in
EEPROM.                                                          
HnnENTER     set hour.                                                          
  
h            help, this help.
MnnENTER     set minute.    
s            prints status: PWM, PWM max, battery voltage, output voltage, clock
calibration, time, dac_value, battery low voltage cutoff level in 10 mV steps.
Z            switch off battery, power down.                                    
                                                                              


This is the reply to 's' for status:                                            

PWMmax. 150
PWM 150
Ubat 2.3 V
Uout 4.9 V
clock calbration 175
time 0:19
DAC value 31
Low battery cutoff 1700 mV


Maybe I will think of some use for the clock....

There is a power down button on pin 2 of the PIC.
Pressing this button 4 seconds also removes the AC on pin 5 and the DC on pin 6,
and causes shutdown.
This is better than the original red button that would immediately shut down the
system.

Oops I now remember I should have added a clear power_down_seconds_counter
somewhere if that button is NOT pressed,
else pressed times accumulate...
OK, version 4.
But you can do also that yerzelv no?

BTW I could not get the internal pullup of the PIC 18F14K22 working on pin 2,
so I added a resistor to Vdd. Bug in the PIC? Dunno.
 
The 'DnnENTER' command has 31 steps, so depending one what output voltage you
want, you can make 220 mV steps.
But stay within the PIC operating voltage, or if higher, use a voltage divider
or zener plus emitter follower to supply the PIC.
I used huge diodes for the PIC supply, and also huge electrolytic capacitors,
for one reason
to get a more stable ADC reading[1], but the other reason was that that is what
came up when I grabbed into the junk box,
as with most of the component values, calculations are for the weak.
Grabbing in the box, and using what you get as the right component is fun.
At least a bit of a challenge.
So if you are a math scribbler or a spice player, optimise away.

[1] I had all sorts of variations in the ADC readout for output and input.
Finally scoping found an AM radio station that faded in and out with more than
10 mV on almost every pin of the PIC.
Probably via the mains as antenna.. should be better when all this is in a metal
box.
Adding the big caps helped a bit.
mm I should have demodulated it with the OA91 to hear what language it was.

The software, remember to add that clrf power_down_seconds_counter somewhere,
preferably the right place.
OK that will be you homework for today.
I'v dun my part.
 http://panteltje.com/pub/sc2_pwr-0.3.asm





Site Timeline