October 17, 2009

5 Volts on a Saturday Afternoon

I have a streak I'm sure some of you out there can identify with. The streak goes like this: I start something, get bored with the basics, jump to the super-advanced part, build some monstrously awesomely advanced thing which then causes an unintended, yet epic conflagration or disaster. Seems crazy, but I have convinced myself the fun doesn't start until I'm knee-deep in something. After the fire department leaves, I always feel like maybe I should have maybe finished studying all that boring basic stuff. So this time no skipping through. I decided to go back and start my re-learning process with something we can all roll our eyes at: making a simple 5 volt DC power source. Yeah yeah, it doesn't get simpler, but hey later on we'll sure enjoy knowing that the problem were troubleshooting on our micro isn't rooted in the power supply. I can even tell the fire chief that my power supply was built with current-limiting awesomeness if he happens on by to see what the hell I'm doing this month.


I chose Sparkfun's "Beginning Embedded Electronics - 1" tutorial as it is nicely written and very easy to follow. It also contains some really nice supporting info, descriptions, and suggestions. I ordered all the parts from the convenient link included in the writeup. The kit arrived in my mailbox a couple days later, containing a breadboard, some 18ga. wire, a 9V wall wart, a switch, a barrel connector, 2 elecroltic capacitors, a 5V regulator, 2 LEDs, a diode, 2 resistors and an, ahm, a thingy? (We'll get to that thing later) So time to roll up the sleeves and put this together.


Note that I am selling my house and have already moved away. I am living in a small 2 bedroom apartment. At the house I had access to my workshop. Here I am working out of a "bare essentials" toolbox. So those of you out there doing this on your kitchen table - I'm right there with you. The tools used today are: needle nose pliers, an el cheapo DVM, wire strippers, and alligator clips. I don't have my nice soldering station (it's in a box floating around somewhere) so I made a trip to the local Radio Shack and picked up a 25W iron good for meatball joinery. Also grabbed flux and solder. Since we're not going to be soldering anything super sensitive, I'm not worried about my hot-ass iron. If you plan on soldering near or on sensitive stuff in the future however (ICs, micros, etc), you may want to splurge on a good digital temperature-controlled soldering station. I love mine (wherever it is).

Upon unpacking, I noticed the breadboard came "assembly required" which is no biggie, but I wish the adhesive for the rubber feet hadn't all dryed up and blown away in the packaging. I guess I'll take care of that with some spray adhesive later. There were no instructions, but I figured out how everything on the breadboard goes together just fine. If you don't, post or e-mail me and I'll help where I can.


Plugged in the wall wart and measured my voltage at around 9 volts. I don't have an o-scope to see how clean this is, but as the tutorial says, it's reasonable to assume a fair amount of ripple on the output of the wall wart. Who cares? We're going to fix it up with some caps later anyway like good boys and girls.



I like the idea of putting a jack on the board for nice power connect/disconnect. Soldering the barrel jack looked like it would be straightforward, but I encountered a few issues. Number one was keeping it still while soldering. If you have a set of clips or "helping hands", use 'em. I opted for something soft and pliable that I could smush the barrel into securely while soldering, yeah, that's a piece of bread. It's the end, which noone in this place will touch anyway. I imagine modeling clay, play-doh, plastic explosive, or other pliable and non-flammable material will work as well. I just won't eat the bread when I'm done - Not only are bread ends crusty and undesirable to most, on top of that solder for electronics is made with a host of nasty and/or poisonous stuff such as arsenic and lead. I have enough mutant powers alreadt, So I just tossed the bread.
Ran into a samll gotcha when assembling the barrel: the side lead on the barrel is not a ground lead like I thought it was. The end lead is 9V, the middle lead out the bottom is GND, and the side one is neither. Don't connect this one to GND like I did. I connected this to the breadboard afterwards and re-measured to ensure I saw 9V on the board.


After putting the 5V regulator on the breadboard, installing the switch and caps, and jumping the gaps in the GND and VCC rails, I took an extra step and verified 5 volts on the top rail. A small step, I realize but I crazy Ivan a lot when working to ensure all the details are in order. I could've just wired up the LED and resistor to verify (like the tutorial did), but then I couldn't be all paranoid. Just to mention, my paranoia is completely irrational; Sparkfun sent me an extra LED and resistor, probably on purpose.


Hey! it works!

The cathode of the LED is indicated on the schematic with a flat line and in real life manufacturers print a band or a cast a flat side to mark it. A casting flaw in my LED obscured the flat side, but I noted the cathode leg is usually shorter than the anode leg. This is minor stuff, as putting one in backwards usually doesn't damage much, as the tutorial reaffirms. It's still nice to get it in right on the first try (that's what SHE said!?)!

The regular diode was never really shown anywhere but on the schematic, I included a picture of it installed and working just because.

I encountered an interesting extra device I suspected was the PTC discussed in the tutorial. The labeling was a little cryptic but a little googling of the markings affirmed my suspicions, and a data sheet! Now I know it's what I think it is, I installed it in circuit.

Well that's it. 5 volts, VCC, whatever you want to call it. Next week I will hook it up to an ATMega168 and attempt to make something blink. Hopefully between now and then I can figure out who is telling the dev manufacturers that parallel cables are the way to go for uploading programs. Yeesh.

--chux0r

1 comment:

--== chux0r ==-- said...

Just saw this nice variable voltage breadboard psu on maker shed BTW - very cool: https://www.makershed.com/ProductDetails.asp?ProductCode=MKCI1