Find all your DIY electronics in the MakerShed. 3D Printing, Kits, Arduino, Raspberry Pi, Books & more!

I am a big fan of garage sales, flea markets, and thrift stores. They are great places to find used parts and materials for your next project. But one problem that I often run into is not being able to test battery powered electronics to see if they work. Because there are so many different combinations of batteries that are used in portable electronics, it isn’t really practical to carry around batteries for testing. One device may need 6 AA’s and another may require 4 D’s. So I came up with this simple pocket-sized variable power supply. It can plug into either a 9V battery or a 12V battery pack. You can then adjust the output voltage to match the device that you want to test and attach the output wires to the end terminals on the device’s battery connectors. This lets you power the device long enough to see if it works.

Steps

Step #1: Materials

PrevNext
Pocket-Sized Power Supply
  • LM317 Adjustable Voltage Regulator, 0.1 µF Capacitor, 1 µF Capacitor, 220 ohm Resistor, 7 x 270 ohm Resistor (preferably 1/8 watt), 8-Position DIP Switch, Perf Board, 9V Battery Connector, 2 x Alligator Clip Wires,
  • Note: All these parts are available at Radio Shack. I highly recommend using 1/8 watt resistor because they take up less space on the board which makes it easier to fit everything into a smaller space. Unfortunately I only had five 1/8 watt resistor so, I had to use two 1/4 watt resistors.

Step #2: The Circuit

PrevNext
Pocket-Sized Power SupplyPocket-Sized Power SupplyPocket-Sized Power Supply
  • The standard LM317 regulator circuit uses two resistors to set the output voltage according to this formula: Vout = 1.25V x (1 + (R2/R1)) + (Iadj x R2). Since Iadj is small (about 0.1 mA), the formula can be simplified to Vout = 1.25V x (1 + (R2/R1)) as long as R1 is also relatively small. Because of this, R1 is generally kept to about 240 ohms. R2 is then selected to get the desired output voltage. Often a a variable resistor is used for R2 to make the circuit adjustable.
  • The circuit for this project has one major modification to it. The variable resistor R2 is replaced by an array of resistors and switches. This allows the output to be adjusted in discrete increments. I did this to more easily simulate individual batteries. Each switch effectively represents a battery being connected or disconnected.
  • Turing on switch 1 turns on the circuit and brings the output up to 1.25V. Then with switches 2 through 8, turning the switches off in order will each increase the output voltage by about 1.53 volts. Example: Initially switch 1 is off and switches 2 through 8 are on. Turning on switch 1 gives an output of 1.25V. Then turning off switch 2 gives an output of 2.80V. Then turning off switch 3 gives an output of 4.33 and so on.
  • The circuit can use either a 9V battery or a 12V battery pack as a supply voltage. The output will max out at about 1.5V below the supply voltage (7.5V for a 9V battery or 10.5 for a 12V battery pack.) But this isn't a problem because if you need the full supply voltage of the battery, then you can just hook the battery up to the circuit directly.

Step #3: Solder the Circuit Together

PrevNext
Pocket-Sized Power SupplyPocket-Sized Power SupplyPocket-Sized Power Supply

After testing the circuit on a breadboard, I soldered the circuit together on a small perf board. You can either follow my layout or make your own.

Step #4: Finished Circuit

PrevNext
Pocket-Sized Power SupplyPocket-Sized Power SupplyPocket-Sized Power SupplyPocket-Sized Power Supply

Now you have a miniature power supply. Wrap the wires and the battery connector around the circuit board and it will easily fit in your pocket. To use it, connect the battery, dial in the desired voltage and attach the alligator clips to the battery terminals on the device. This should let you power it long enough to test it to see if it works properly.

Jason Poel Smith

My name is Jason Poel Smith. I have an undergraduate degree in Engineering that is 50% Mechanical Engineering and 50% Electrical Engineering. I have worked in a variety of industries from hydraulic aerial lifts to aircraft tooling. I currently spend most of my time chasing around my new baby. In my spare time I make the how-to series "DIY Hacks and How Tos."


Comments

  1. tim dolan says:

    Good project but why is this here twice?

  2. joe says:

    I like it.. I would be sure to add a label to remind me which way the switches flip for each voltage. It would suck feeding 6V into a device that only needs 3v.

  3. Bob says:

    I don’t test. Most stuff works. Plus you can dicker the price down and get it cheaper untested. “I don”t know that it works or not, how about 0.50?”

  4. jarrad says:

    would it be possible to connect this to like a usb wallcharger using a usb connector. I work at a thrift store and this will help:)

    1. Odomus says:

      Yes it will, I have already done this, and if you do it right you can have a 9v input, and a USB input, going in so you can have a choice. Although, you will only be able to go upto 5v in switching ability since you dont have a DC-DC converter on there and/or not 9v(or 12v if you have the bigger battery) to get the power you need for the output from the regulator itself. But yes it can be done since i have done it.

      ALTHOUGH you can get a battery holder from DigiKey for the 12v garage door Size A23.
      Which I did… Plastic N Cell Battery Holder: It is a perfect size for a 12v.
      http://www.digikey.com/product-detail/en/BHNL/BHNL-ND/25075 This is the single,
      and there are Double holders as well for 24v(for those in need of 24v to power something)
      http://www.digikey.com/scripts/dksearch/dksus.dll?vendor=0&keywords=BH2NL-ND

      Because the 12v batteries are small really small and they are really cheap .95c at biglots, for a 2pack(here in AriZona), These come in handy either to take apart for individual batteries or use 12v for projects like this, they decently last a while and in a project like this the smaller you can get the easier it is to take with you.

      Hope this helps…. it is a really good project for those in need of a really small switching on the fly PS.

    2. tachyon1 says:

      Not a USB Charger, but if you could find a sufficient wall wart in your thrift store’s wall wart pile, use that. I’d recommend something 9-16v DC with .5 to 1 amp output.

      1. Odomus says:

        Actually you can. I use both my Computer Port USB port, and a straight USB power charger ranging from 500mAh, which is made for my JAWBONE to my BB charger which is 1A. And I also use my Richardsolo USB battery Chargers, so it IS possible. But Kinda defeating the purpose when alot of electronics are above 5v. If you are making one for just a 5v or less it will be perfect and fine you just cant get anymore current out of it without putting more in it. Or using an on board DC-DCwith it. So sorry tachyon1 you are wrong you can, as I said before you just wont get anything above 5v out of it.

        1. tachyon1 says:

          I am not wrong. The functionality of the original, as powered by a 9v battery, circuit cannot be duplicated with a USB charger. To say otherwise would imply to people not versed in electronics that this circuit has some magical hidden voltage boost capability which it does not.
          The LM317 has a 3v minimum voltage differential. This means with a 5v input from a USB charger it’s maximum output is 2v, which isn’t going to be useful for much of anything, especially since the LM317′s minimum rated output voltage is 1.25v, giving you a 0.75v usable voltage range. Essentially this configuration would allow you to replace a single 1.5v battery.
          This is why I recommended a wall wart with 16v output which would give you a clean output from 1.25v up to 12v from the LM317. That would power the majority of battery powered toys and electronics.

  5. Odomus says:

    Kinda funny since I have it right in front of me made and working, and it works perfectly fine. You really need to verse yourself in electronics and actually put it into practice before sayng anything, IE: Applied before Theory. It works perfectly fine. Just like I said before there is a drop in it, My input is 5.103, and my output is 4.711, with a 1A input and outputting a 959mAh, yes a slight drop but still powers 5v electronics and can still power and charge a phone. But there is always a loss when doing this, and it is respectable for what it does and what it is intended for. YOUR theoretical statements are incorrect, try it and build one and you will see for yourself it does work, and your ‘facts’ as I am calling them are based upon your datasheet, not the applied version of it. It goes to flat out application and the making of the item what arises and what actually happens. Than what can be written down.

    1. Tom says:

      Odomus its good you have your circuit woking for you, but everything tachyon1 said is correct and was stated from the datasheet. I am not sure how much you have designed, but you really have to follow the datasheet. The datasheet gives you a guidelines on average components. So you were able to get yours to work with very little voltage drop, but if this were a production item using thousands it would not be advised to deviate that much from the spec. The tolerance of that regulator and the components around it would cause the circuit not to be reliable.

    2. Dustin says:

      Odomus could you email me a spec sheet on what you made its similar to what I am making and I would to try what you did

  6. Michael says:

    Really? A gadget for picking up garage sale items and your slamming him with a production line.

  7. Octmic says:

    D’ont forget TESLA !!!

  8. michaelshiloh says:

    What a great project to have in your toolkit. I’m going to have each of my students build one. Some day they may buy a bench power supply, but meanwhile, this is a super handy device.
    For the workbench, this could be modified with a rotary knob instead of the DIP switch, and other fancy features when portability is not an issue.

    Thanks for a great project!

  9. I will things {summary|conspectus|brief|rum two kinds of people in the zune owners: are currently all things upgrading, people troublesome to take between zune and is much more important.(and some other players is usefulness taking into consideration, such as X SONY walkman, but I promise this gives you plenty information to convert clear-sighted decisions and other than the zune punter iPod line.)
    Parajumpers Sverige http://se.parajumperseblog.com/