Introduction: Get the Right Polarity Every Time.
I've been teaching myself hobby electronics for a while now, I've had that magical blue smoke that tells me when I've fried something. nothing is more annoying than prototyping on a breadboard for 3 hours only to see it go up in smoke or flames because i put the positive wire on the negative rail and vice versa.
so after thinking about the best way to over engineer the problem i came up with a solution.
Step 1: The First Step, Make Something.
this is the easiest step, I'm getting into the integrated circuits side of electronics so before I can start dumping money into my hobby i want to make sure that I'm not going to destroy what i've already bought. so to start off I'm going to build a simple led black light because i really enjoy black lights!
the materials i am using are simply:
.1: a 9volt 1 amp wall wart
.2:lm7805c 5 volt voltage regulator
.3:electrolytic capacitor, 35volts 10 microfarad
.4:metal film capacitor, 50volts .1 microfarads
.5: 5 100 ohm resisters
.6: 8 ultra violet leds, i forgot the specs to.
.7: brand new large breadboard, fresh out of the pack from Radioshack, the overpriced shop of wonders.
actually most everything is from Radioshack so it's not like i can complain about the price.
Step 2: Something Made.
alright, for the sake of narrative i'm going to just tell you what my circuit is and i'll use the pictures to show how i built it.
the first step is the voltage regulator, i have it up in the corner of the board to keep it out of the way for the most part. between the input and the ground put the electrolytic capacitor making sure to keep the polarity right. then you need to hook up a metal film cap between the ouput pin and the ground.
this is supposed to smooth out the output so we have a steady five volts instead of a chaotic five volts, it isn't necessary for what i'm using it for but it makes for good practice to do it anyways.
the next step is the resisters, they are each one hundred ohms so in order to draw the amount of amps we want, roughly 160 milliamps we want to put them in parallel. this makes the equation for parallel resistance 1/(1/100+1/100+1/100+1/100+1/100)
to save you a bit of math it comes out to roughly 25 ohms or so. ohms law is i=v/r so we plug in our values, 5 volts/25 ohms=roughly 200 milliamps.
the final step in all this is the leds themselves, they are supposed to be around 3 volts and 20 milliamps each, i put them all in parallel in line with the resistors so i'm actually pushing more amps through them than i should, oh well. it works. tah dah!
now in a fit of irony or something close to it in order to demonstrate the circuit worked before my newfangled technique i actually needed to use the diode properties of leds to test which one was positive and negative.
Step 3: The Lazy Fix.
the easiest way to fix this is by simply labeling the wires, which i'm too lazy to do, so in order to save my voltage regulator i'm going to add one simple component to the circuit to make sure that the voltage is always going the direction i need it to go.
a bridge rectifier.
it's that simple really.
here look up and I'll show you a picture of it working like that.
did you see it?
now here's the reasoning, under normal usage a bridge rectifier changes ac current into dc, basically a back and forth flow into an always forth flow. so when you hook up a dc voltage to it all that the rectifier is doing is treating it like a normal ac voltage, and rectifying it to the positive and negative terminals. problem solved!
Step 4: Just a Few Extras.
the wall wart has stranded wire which is a pain in the kiester to try and get into the bread board so to make that easier you can clip the leads off a dead LED and solder them to the wires. no tinning necessary, and instead of dragging out the soldering iron i found it easier just to put it under a lighter. i'm pretty sure they made an instructable for this though so all credit of this small bit to them!
We have a be nice policy.
Please be positive and constructive.