Introduction: Power Your Arduino From Your Car
The Arduino -- and AVRs in general -- have a wide range of power supply options ranging from around 1.8V to 5.5V. The choice of voltage is usually determined by the desired clock speed or power consumption requirements. The Arduino and its many variants have power jacks that allow connections from big, clunky "wall warts." Alternatively, some boards can get their power from external power supply pins, either regulated externally or on board. But what about if you're in a parking lot at a convention or coffee shop and want to show your geeky friends your new Arduino or AVR-based invention? Well, I've got an answer for that!
This instructuable will show you how to build your own vehicle-based regulated power supply that will power an Arduino or any AVR up to 5V. It's an inexpensive and easy to build project that you can have up and going in no time, and additionally, with very few external components. This device makes use of your car's cigarette lighter socket for power and then performs a DC/DC step-down to 5Vs while regulating the power.
Go to the next step to get started!
Step 1: Bill of Material
What You'll NeedAs I mentioned in the intro, this project has very few requirements or external components. Here's what you'll need:
- Auto power plug (www.mouser.com #171-A1378-EX $2.33)
- 0.1uF 0805 capacitor (www.avnet.com #08051C102JAT2A $0.09) (Thanks to David O. for correcting this part #)
- 0.33uF 0805 capacitor (www.avnet.com #0805YC33rKAT2A $0.04)
- 1uF 0805 capacitor (www.avnet.net #08053C105KAT2A $0.10)
- 5V regulator DPAK MC7805CD (www.avnet.com $0.22)
Various SundriesBesides the items mentioned above, you should have a soldering iron, solder, maybe some flux, tweezers, wire cutters, snippers, crimper, etc. But you probably already have this stuff laying around.
Turn the page to get started on the design.
Step 2: PCB Design
There is a small space within the auto power jack shown in step 2 that can fit a small PCB. And yes, I do mean small. The board should measure really no larger than 29mm x 10mm (although my board is exactly 29.21 x 10.16 mm). This size really screams for the use of SMD components. Luckily, we can use SMD packages that are small, but not too small for us to work with manually.
OverviewThe design here is very simple and follows a standard linear power regulator setup. We take in the 12V or so from the car and pass it to a 5V linear regulator with a few capacitors attached to handle transients and unwanted frequencies, helping to reduce ripple voltage in the output. Finally, we output this regulated 5V through a set of wires that will connect to the Arduino or AVR board.
Schematics and BoardCheck out the included pictures of the schematic and board to get an idea of how this is all setup. It's very straight forward and shouldn't offer too many surprises for those of you that have built your own power supplies for microcontrollers before. Also, find attached the actual schematic and board file (*.sch and *.brd) for use in Eagle, if you want to change or modify anything. Finally, if you do choose the option of having your board custom fabricated, I've also attached a zip file of the necessary files you will need to send to Seeedstudio to have them build the PCB. From time of order to the time I received my PCBs was about 2 weeks. Cheap and speedy.
Step 3: Build It!
Ok, this is, of course, the fun part. Now we build our vehicle-based Arduino power supply.
Solder PCB ComponentsI started off by soldering the components on the top of the board. This includes the 0.33uF capacitor and the MC7805 voltage regulator (in DPAK package). I found it helps if you pre-solder the pads, as shown in the picture below. Then you can use tweezers to place the capacitor over the soldered pads and use your soldering iron to melt the solder and secure the capacitor in place. Same goes with the voltage regulator. You may want to add a ribbon of solder around the top edge of the voltage regulator after its been secured.
Next, flip the board over and do the same on the bottom side. Pre-solder the pads, then use tweezers to locate the capacitors where you want them and use your soldering iron to melt the solder to secure the connection.
N.B. None of the capacitors are polarized, so it doesn't matter how you place them on the pads.
Car Power ConnectionWith the PCB components securely soldered in place, next we turn to the car-to-board section. I cut two wires about 1.5" in length and stripped about 3/4" from both wires and then the normal amount from the other ends (for the solder pad holes).
N.B. The center pin is the positive (+) and the side clips are negative (-).
Note that the cap of the auto plug (ie cigarette lighter plug) pushes in and on the opposite side it raises a metal rod. This is what you will wrap the red wire 3/4" stripped around. Just push in the detent and wrap tightly then depress. It should hold itself in place quite well. Check out the picture below.
Move on to the metal clip. Wrap the longest stripped portion of your black wire around the straight center bottom of the clip and secure as best you can. Now, what I did next was to coat the wrapped portion in solder flux and solder it to the clip. You can see this in the pictures below. Once you have done these two things, you are ready to solder the other ends of the wires to the PCB. Solder the red (+) wire to the 12V pad and the black (-) wire to the GND pad as shown in the picture below.
Arduino/AVR ConnectionCut a red and black wire to about 13". Strip one end of each and thread them through the back of the main plug housing. Check out the picture below. Now solder each wire to their respective solder pad: red to 5V pad and black to GND pad.
Grab the wires from the back of the plug housing and pull them until the board fits inside the housing and the negative clip sits in its groove. Squeeze both sides of the clip and screw the top of the housing onto the plug. Check for any protruding wires and slip them back in if necessary. Now is an opportune time to test your creation. As you can see in the picture below, after plugging the auto plug into a car outlet, the output is 5V as read on my multimeter. That's a good sign!
If you're dying to try it out, go ahead and connect your red wire to the 5v header and the black wire to the GND header on your Arduino. It should power up and start executing whatever code is in its flash.
The rest is optional, but I think it really polishes your creation if you do it. Take the next step!
Step 4: Conclussion
Right now the two wires (red and black) are just hanging out there and their ends are probably frazzled or frayed. We can fix that in two easy steps.
Shrink Wrap the WiresIf you are unfamiliar with shrink tubing, it's a plastic-like tube that your wires go into that, after the appropriate heat is applied, shrinks to fit your wires like a glove. It not only helps protect your wires, but gives it a more professional appearance.
N.B. You can get shrink tubing from almost any electronics shop. They come in different diameters so get one that is appropriate for two wires.
Go ahead and slip your two wires through the appropriate length of shrink tubing, leaving maybe an inch or so of wire exposed at the end. Grab your hair dryer and blast the shrink tubing until it shrinks tightly around the wires.
Crimp the Wire EndsNow, what to do about these frayed ends? Why, crimp them, of course! To do this you'll need crimping ends and a crimper. I got a nice package of crimping ends from www.futurlec.com for cheap. You'll want to strip the ends of the wires and then trim it down to fit into the crimped end. Next, fit the wire into the crimped end and use a crimper to secure the crimp to the wire. Do this for both wires.
As an added piece of stability and security for your crimped ends, I coat the small exposed portion of wire with flux and solder it. This ensures a good connection and provides a bit more strength to the crimped end and reduces the chance it will come off.
Check out the pictures below.
In this instructable, I have shown you how to design a PCB, as well as given you my pre-tested design schematics and gerber files, that will fit inside a vehicle power receptacle plug and convert 12V from the car's power into a regulated 5V for use in powering an Arduino or other AVR board. I've also provided you with some tips to polish off your creation and make it more professional looking and durable. You should now have everything you need to be able to power your Arduino while on the go in your vehicle.
I hope you enjoyed this instructable, and if so, don't forget to rate it. As always, I am open to your suggestions and questions about this project or any of my other projects on this site.
Have fun building!
Participated in the