Showing posts with label LM2585. Show all posts
Showing posts with label LM2585. Show all posts

Thursday, January 02, 2014

Trailer Lights Version 3.1 Schematic

I am revisiting the trailer lights explained in several previous posts. I am implementing a few improvements. 
  • Twice as many LEDs. 
  • Real Lead-Acid battery charger built in. 
  • Lower "burden" current. 
The appropriate data sheets are linked to throughout this post. Figure 1 shows the version 3.1 schematic.

Figure 1. Trailer lights complete schematic.

Let's start with the input circuit as zoomed in on in figure 2. A 5A fuse protects the trailer battery from any short circuits. The boost switch-mode power supply at the input will convert the truck battery that may be between 10V and 16V to a steady 18V. If the truck battery is higher than expected, it will effectively pass through the boost circuit. A LM2587-ADJ is used in its default configuration for the boost. The Schottky diode (D1) in the boost regulator also forms a nice protection from too much voltage somehow getting produced on the circuit side feeding back into the truck battery. The parallel 3kΩ resistors (R18 and R19) were just to create a 1.5kΩ resistor and avoid getting yet another value of resistor.

Figure 2. Input boost regulator schematic.

A UC3906 forms the base of the charger section highlighted in figure 3. The two parallel resistors R20 and R21 set the maximum charging current. I couldn't find a reasonably priced ⅛Ω 2W surface mount current sense resistor, so I am using two ¼Ω 1W resistors instead. Note that 2A through a ⅛Ω resistor is ½W of continuous power dissipation; I think quadruple that is a reasonable safety margin since I want to avoid self-heating effects. The MJE15035G Bipolar (Q1) may drop up to 8V in the 2A charge state. Since that's 16W, a pretty hefty bipolar was chosen. The resistors are sized per the UC3906 data sheet with modifications from the application note. The Schottky diode D5 and connecting the bottom of the resistor string to the PWRIND (pin 7) pin instead of ground are hints from the application note to save power when the truck battery is not present.

The sense and power leads to the trailer battery are separate in the plug. The connection to the battery positive lead can be a single or double wire depending on how much trouble I feel like taking when constructing wiring harnesses. Given the effort needed to connect three wires to a four wire socket, I'll probably not run a separate sense lead all the way to the trailer battery, but the option is there. The fuse is in the power lead, of course, but this means the sense input to the charger controller is on the sense side of the fuse. If somehow the fuse blows but the trailer battery voltage is low enough for the charger controller to try to charge the battery but not so low that it senses an error (between about 10V and 13.8V), then the pass transistor Q1 could be turned on pretty solidly. If the truck battery is attached, this would drive the BATTRL power rail to about 17V (18V from the boost regulator minus a bipolar drop and a Schottky drop). This condition is not ideal, but all of the components connected directly to that rail are rated for continuous operation at that voltage.

Figure 3. Charger schematic.

The digital control section is zoomed in on in figure 4. I am using a TPS70950 linear voltage regulator because it has a 2μA bias current and is stable even when supplying less than 100μA. The good old LM7805 has a 6mA bias current and is not happy supplying less than 10mA current. The Microchip PIC12F609 run with a 32kHz crystal may consume only 60μA (2μA when asleep); since this is in the neighborhood of the battery's self-discharge current, it won't effect the working time between charges much. R1 and R2 are really just pads and holes to allow for any tuning needed to get the crystal oscillating. The resistor divider formed by R7 and R4 will force POWFB to 0.6V when BATTRL is 10V. A ±1% variation in R7 and R4 will mean 10.27V to 9.87V will cause the sense voltage of 0.6V. There is an additional ±50mV in the PIC reference voltage and ±10mV in the PIC comparator. This inaccuracy (call it ±10%) is acceptable since I'm just concerned with warning the user when the trailer battery is getting low. The bipolars Q3 and Q4 are a standard low current power switch. I'll discuss the program in the microcontoller in the next post.
The sharp eyed among you will notice the PIC12F609 cannot be configured with GP3 (pin 4) as a general purpose digital input and have the internal weak pull-up enabled. This is only true for GP3 (pin 4). So 1MΩ or so pull-up resistor will be "blue-wired" between BUTT and DIG (5V power). This was an oversight on my part that I didn't catch until after the PCBs were layed out and ordered. 

Figure 4. Digital section schematic.

Finally, figure 5 zooms in on the LED power supply. Another LM2587-ADJ boost controller is configured as a current regulator. The lower current (and slightly cheaper LM2585-ADJ could be used, I just wanted to keep my parts list a little simpler and use the same boost controller that was used on the input. When R15 is 40Ω, about 30mA will be directed through an eight LED string. This current is also mirrored to the other eight LED string because of the mirror formed by Q4 and Q5. This current mirror is a cheap mirror, not a nice single package matched pair. In this application a few percent variation in current just isn't that big of a deal. The zener diodes D2 and D3 have a 36V breakdown. They keep the boost circuit from running away if the LEDs are not plugged in when the circuit is on or if either LED string has an open circuit because of a broken wire or smashed LED or any other reason. The resistors R12 and R13 with a value of "unpop" are not meant to be populated on the board but they do allow lowering the resistor value (and thus increasing the LED current) after the board has been populated. 
Figure 5. LED driver schematic.

The PCB for building this circuit is shown in figure 6. The bottom layer ground plane isn't shown for clarity. I am sticking with 1206 packages for resistors and small capacitors because they are easy for me to solder by hand. I ended up using through hole inductors because they are physically large devices and the through hole versions can be oriented vertically, taking up significantly less board space. The Q1 bipolar is a TO-220 package for power dissipation reasons so it is also through hole. The huge 1500μF capacitor C12 is meant to be leaned over the board, covering the microcontroller as shown in the 3d model in figure 7. The boards are on order and not expected until the end of the week, so I won't have a picture of an assembled board for a couple of posts.

Figure 6. PCB layout.
Figure 7. 3d model of PCB.

There's $88.72 worth of components in this project. The largest cost is
  • $22.89 GP1272F2 Sealed Lead Acid Battery 12V 7.2Ah .250" Faston tabs 
  • $17.78 (2@$8.89) LM2587S-ADJ/NOPB Switching Regulators 5A FLYBACK REG
  • $7.43 UC3906DW Battery Management Lead-Acid Linear Charge Mngt IC
  • $5.02 (16@$0.314) CP41B-WGS-CK0P0154 LEDs Through Hole 90DG C-WT STNDOF P4 LED 9000K 3.6V
  • $4.02 (2@$2.01) 0154005.DR  Surface Mount Fuses Fuseblock w/ fuse 5A OMNI BLOK 154
  • $3.35 RP-SPNS  Pushbutton Switches PUSHBUTTON SWITCH SPST 1A 120VAC 28VDC
  • $3.01 2210-V-RC  Fixed Inductors 56uH 15% Vertical
  • $2.64 (3@$0.88)  STPS5L60S  Schottky Diodes & Rectifiers PWR Schottky rectifier
  • $2.50 2200HT-102-V-RC  Fixed Inductors 1.0mH 15% Vertical
Six prototype boards from Silver Circuits run $105 including shipping ($17.50 each).

Now that I am writing this review I see one thing I should have done differently. I should have provided a 1MΩ in parallel with output capacitor C8 to bleed it off when power is removed.

I also wish I had found some way to move the big bipolar Q1 away from the electrolitic capacitor C12. That bipolar is going to run hot and I would prefer to keep hot components away from electrolitic capacitors.

My next post will cover the PIC program.
The post after that will discuss the case design and printing.
I may do a final post to wrap everything up and show the installation.
I will try to do a post every week so this project is complete by the end of January.

Bruce McLaren

Wednesday, December 05, 2012

Boost Regulator Powering Small White LEDs

My short contract turned out to last from March until November. Great for the paying the bills, lousy for getting anything else done. It was a decent gig, I got to do lots of things. Everything from writing and synthesizing Verilog, to block level analog verification, to top level mixed-signal verification, to Perl/Tk for a simulation environment, and creating a PSpice model to round the contract out. I had never done high level modeling in PSpice before, so I got to do a variety of things I've done before and something new. Not too bad. 

I have decided to publish this blog on a monthly basis; I intend to publish on the first Wednesday of each month. I should be able to keep up that pace even if I am in neck deep in a contract. Since I am briefly between contracts, I will write several blog entries ahead. I might even proofread them if I write them ahead of time like that. 

Enough administravia, on to some design!

I am revisiting and finishing the LED lighting system for a boy scout trailer. As you might recall, the challenge is to place a robust, low power lighting system inside a boy scout troop equipment trailer. The lighting system will be powered by a 12V lead acid battery that may only get charged for a couple of hours each month. the lights need to usable for two nights of camping in between those charges. Low power (30-40mA) white LEDs seem like a good way to handle this. 

To simplify the wiring to the LEDs, the LEDs are connected in series. Only two wires need to be connected to the LEDs from the control box this way. I want to keep the highest potential present in the system below about 40V. The white LEDs I chose have a maximum forward voltage drop of up to 4.4V. So eight in series. 

I am using the National Semiconductor (now Texas Instruments) LM2585 boost regulator controller. It's a nice chip for this application. It is simple to use, has a low pin count, and has more than enough power capability. The LM2585 datasheet recommends using TI's WEBENCH Power Designer. This is a nice tool, I like it's power, it's simplicity, and it's wealth of produced information (even a suggested parts list). However, it requires a more recent version of Adobe Flash than I have bothered to install on my Linux computer, so I had to shift over to my Windows laptop to use it, and I didn't really get the feel of the circuit. Since I am using the regulator in a current feedback mode, the simulations can't be made to do what I'm going to do. So it's a great system but I had to fiddle a bit with it's results before I was comfortable. Of course, I checked the results with hand calculation to make sure they made sense. 


Figure 1. LM2585 30mA LED driver.
There isn't much to say about this. It is close to the standard application schematic except that the feedback point is taken at the top of a 41Ω current setting resistor. The LM2585 will try to control the out voltage to maintain 1.23V at the FB node (1.23V/41Ω=0.03A). The 36V zener diode across the output keeps the voltage from increasing wildly if the chain of LEDs is broken. I have tested this by intentionally opening one of the LED connections. By the slight smell, I can tell this is straining the capacitor and the circuit is none too happy about that operating mode, but it is keeping the circuit from actually blowing up. Bursting into flames is almost always a bad thing.

I put this circuit together on a generic PC board as poorly shown in figure 1. The close up in figure 2 shows that my way of making a surface mount inductor into a through hole inductor. Just solder a couple of wires to it.

Figure 1. The physical implementation. The 1mH inductor is almost as large as the rest of the circuit. 


Figure 2. Now it is a through hole inductor.



Figure 3 shows a scope shot of the circuit in operation.

Figure 3. Scope shot. Channel 1 (yellow) is SWITCH. Channel 2 (blue) is FB. Channel 3 (purple) is OUT. Channel 4 (green) is IN. The too large capacitor (22uF) keeps the output level. 



When I started this project, I assumed getting the LED regulator going would be most of the work. I was wrong. Next time I will show what I came up with for the on/off switch. That turned out to be more complex. In fact, the installment after next will be the program for the micro-controller that is becoming part of the switch. 

Figure 4. The whole circuit on my dining room white board.


Next month, the on/off switch circuit and a complete parts list. Until then, I hope I'm doing someone besides myself some good. Good luck on your own projects!

By the way, does anyone out there know how to submit Design Ideas to EDN? I couldn't quickly find the submission guidelines online or in the print magazine. 

Bruce