Small +5 volt 1 Amp Li-Ion Power Supply

The original circuit, hacked circuit and battery and charger
(click any image for a slideshow of larger images)

This is another project born of necessity. A new costume with a bunch of LEDs needed a +5 volt power supply. After burning out a Sparkfun boost converter module I turned to hacking one of my own circuit designs. For a series of gifts I had designed a small LED controller that drove commonly available +12 volt flexible LED arrays. It used a Linear Technology LT1935 boost converter IC to step the voltage from a Li-Ion CR123A cell up to 12 volts. I had some spare boards and parts laying around so I figured I could just repurpose the converter circuit to generate +5 volts with a change in the feedback circuit. Of course the empty pads where the PIC 16F1825 microcontroller went was too inviting and I ended up writing some code to display the current battery level and provide an automatic low-voltage shutdown so the Li-Ion battery wouldn't be damaged. This circuit can supply up to about an amp of power but don't short the outputs as you may damage the LT1935.
Hardware
  • Battery: Lithium Ion CR123A cell (3.6 volt) [Reasonable batteries and cheap chargers can be had at Deal Extreme among other places - be sure to buy the 3.6V version, not the 3.0V version]
  • Battery Enclosure: MPD BH2/3A-3 (I bought these from Digi-Key)
  • Boost Converter: Linear Technology LT1935
  • Controller: PIC 16F1825
  • Inductor: Bourns SRR5028-4R2Y (I bought these from Mouser)
  • Controls: 2 momentary push buttons
  • Display: 3 LEDs (green, yellow, red)
Interface
  • Power Button: Press and release to shut down the converter, press again to turn the converter on.
  • Batt Check Button: Press to display the current battery voltage on the LEDs (Can also press when the converter is off to turn it back on).
  • LED Display: Displays the battery level when the Batt Check Button is pressed (Green, Green-Yellow, Yellow, Yellow-Red, Red). The Red LED also blinks when the voltage is below 3.2 volts.
Downloads
  • Schematic (Note: This schematic is a slightly cleaned-up version of the hack I implemented so for those of you with eagle eyes, you will see it doesn't exactly match the close up image of the board).
  • Firmware (Source .asm and hex file - can be compiled or programmed using Microchip's MPLAB IDE and programmed using many different PIC programmers including the ICD-3)
Notes
  • Power control is handled through the EN signal. Driving this signal high enables the LT1935 and switches Q1 on to connect the load. Q1 is necessary because power can flow through L1 and D1 when the boost converter is disabled. When disabled the PIC also puts itself to sleep.
  • R1 and R2 present about a 100 uA load when the converter is disabled (the sleeping PIC and disabled LT1935 also require a few uA). So be sure to remove the battery if the converter is not being used for any length of time because you do not want to over discharge a Li-Ion battery. The value of R1 and R2 can be increased to reduce this load. From the LT1935 datasheet it can be calculated that R1 = R2*(5 - 1.265) / 1.265.
  • The PIC firmware is currently configured for a low-battery shutdown at around 3.0 volts. This value and the values used to display the various battery levels are held in constants in the source code if you want to adjust them.
  • The boost converter generates a fair amount of ripple on the battery input that is used by the PIC to measure the battery voltage (using its internal voltage reference). The firmware deals with this in a pretty brute force manner. It uses a large average (32 values) and requires 100 consecutive readings above the cut-off ADC value before shutting down the converter for a low-voltage condition.
  • I didn't include the Eagle source file for the schematic but will be happy to send it to you. Just email me. I haven't designed a PCB for this schematic.
Stacks Image 468
Close-up of the hacked board. Note the addition of a n-channel MOSFET transistor on the ground leg of the load and the LEDs and series resistors. Because the original board had ground pads in the location I wanted to put the LEDs I configured the firmware to drive an active high signal to light a LED. This is not ideal. A better solution is to sink current in the PIC to turn the LEDs on (active low signal with the LED anodes connected to V+). This is because the act of driving current to a LED momentarily affects the ADC readings being made to measure the battery voltage. The firmware can easily be modified to do this. Just reverse the polarity of the ENABLE and DISABLE macros and remember to set the PORTC_OFF values to '1' so the LEDs are disabled when the PIC is asleep.
Stacks Image 473
The Batt Check button being pressed with a fully charged battery while powering my own version of a "Pixel" smart LED module.