Idiots guide to electronics?

Ask and answer questions, share tips and resources for installing lighting and other electronics in your models.

Moderators: Sparky, Moderators

Post Reply
User avatar
Gauge
Posts: 52
Joined: Wed Dec 31, 2008 4:50 pm
Location: Right of Center

Idiots guide to electronics?

Post by Gauge »

I'm looking for some sort of tutorial to explain everything I need to know about LEDs and fiber optics, and all the diffrent parts I'll need to get everything to work. I've never lit a model so I know less than zero. Thanks.
"There's only ONE ~'Return'~,.. and its NOT ~'Of The King'~... its ~'Of The Jedi'~.
Confucius 479 B.C.E
seam-filler
Posts: 3895
Joined: Thu Apr 17, 2003 11:05 am
Location: Aberdeen, Scotland

Post by seam-filler »

Now this is a great idea - especially if it has some circuit diagrams - you know - circuits that are actually going to be useful to a modeller.

I have a smattering of knowledge and I have lit one or two models with simple, off-the-shelf circuits. I would quite like to learn a bit more and build circuits myself, but you guys sure like your acronyms and jargon, making it pretty hard for the novice to get anywhere.
"I'd just like to say that building large smooth-skinned models should be avoided at all costs. I now see why people want to stick kit-parts all over their designs as it covers up a lot of problems." - David Sisson
User avatar
tetsujin
Posts: 2350
Joined: Mon Feb 28, 2005 6:08 pm
Contact:

Post by tetsujin »

seam-filler wrote:I would quite like to learn a bit more and build circuits myself, but you guys sure like your acronyms and jargon, making it pretty hard for the novice to get anywhere.
If you have any specific questions about things that come up, ask them. You can PM me if you don't want to bother the group.

To me the basics that everybody needs to know when dealing with simple circuits (model lighting circuits, etc.) are Kirchoff's Laws - along with a basic understanding of how voltage and current work.

Voltage is a way of measuring the level of electrical potential in a given part of the circuit - how much "push" there is to make current flow into or out of a given point in the circuit. Voltage of a point in the circuit must always be measured relative to some other point in the circuit - usually a circuit will have a reference point (commonly called "ground", even if it's not actually grounded) that is considered the "zero voltage" for the circuit.

Current measures the rate at which electrical charge moves from one area of a circuit to another. It is generally measured in Amperes.

To test voltage of a point in your circuit, you can simply hook up a meter between that point and another point you'd like to compare it with. To test current, you need to hook up the meter in-line with the circuit you want to test. (The current you're measuring has to flow through the meter.)

Kirchoff's Current Law states that the amount of current flowing into a point on a circuit is equal to the amount of current flowing out of that point. From this, it's easy to see that a line of components strung end-to-end will always have the same current flowing through all the components - and that your circuit must form a loop in order to function.

Kirchoff's Voltage Law states that when you measure the voltages across components in a loop, the sum of those voltages will be zero. (Of course, this depends on you measuring these voltages consistently, so the polarity of the voltage is reflected in the sum...) The battery driving the circuit would give you some amount of positive voltage - and each component in the loop will give you some amount of voltage drop - add all the voltage drops and they balance out the driving voltage and the whole thing sums to zero.


Now, what this means in practice:
Normally your power source (battery, power supply, etc.) will nominally drive the circuit at a particular voltage (or in some cases, a particular level of current). The components in your circuit will have a particular relationship between the voltage drop across them and the current running through them - the overall behavior of the circuit is then known from KVL and KCL.

For instance - the voltage across a resistor increases proportional to the amount of current running through it.
the voltage across an LED has a different behavior - its voltage drop doesn't increase as quickly as the current through it does... Doubling the voltage across an LED could increase the current through it by a factor of ten or something - with the result that your LED will burn out. Diodes (including LEDs) also have an interesting property in that their behavior depends on the polarity of the voltage across them - basically, current can flow through a diode in one direction only. When you hook up an LED, if it's connected backwards, it'll just block the flow of current. The "cathode" connection of the LED must be the one with lower voltage in order for the LED to operate.

So a typical circuit is to run three components - a battery, LED, and resistor, in a loop. The goal is to get the LED to stay within its operating range - usually up to 20mA of current and somewhere between 1.5V and 3V drop. According to KCL, the current through the resistor must be the same as the current through the LED - and according to KVL, the voltage across the resistor must be such that the sum of voltages in the loop will be zero.

So if we're running on a 9V battery, trying to operate an LED at 3V and 20mA, then we know the resistor must drop 6V at 20mA current. I mentioned before that the resistor has a linear relationship between voltage and current - this is known as Ohm's Law.

V=IR (Voltage equals Current times Resistance - using units of Volts, Amperes, and Ohms, respectively.)

So to make that circuit work without burning out the LED, you want a resistor that satisfies this equation:

6V = 20mA * R (or...)
R = 6V / 20mA

So R = 300 Ohms.


For virtually anything more complicated than that (in terms of making the lights blink, for instance) I would use a microcontroller - specifically a PIC (a specific family of microcontrollers, manufactured by Microchip). A microcontroller is a cheap, one-chip computer. The ones I use are around $2-$3 each, contain a kilobyte or so of RAM, and run at speeds up to 20MHz. I am more of a computer programmer than an electrical engineer, so it's easier to use something like that to control dynamic behavior through a computer program, rather than put together a bunch of single-job discrete ICs or other components to do the job.
---GEC (三面図流の初段)
There are no rats.
The skulls eat them.
jdeleonardis
Posts: 57
Joined: Fri Jan 02, 2009 11:49 pm

Post by jdeleonardis »

Im in the middle of lighting my first model - a star destroyer - that has a very simple circuit. So far, things seem to be going well, but Im still waiting for the disaster to happen and kill it all, so take this post with a grain of salt...

Gauge, like you, I knew absolutely NOTHING about lighting, or really anything electrical in general. I found it extremely hard to find anything that really said 'do this, then that' etc. I did a million searches on the net and I was able to piece together enough to at least get started.

Ill try to post everything that I came up with (which will probably make many of the people on this board cringe :oops: but maybe they can correct anything Im doing/said that is wrong and teach me something in the process) and maybe it will lead you in the right direction. Maybe we can sort of learn this together, because there is still a ton I know nothing about.

First of all, keep in mind that everything that Tetsujin said is completely correct. But, if you are anything like me, that was a complete foreign language to me when I first started. The equation at the bottom of his explanation is very important...it tells you the type of resistor you will need (which you have to have, because like it was mentioned previously, an LED without the resistor will fry almost instantly). You can go to this website http://led.linear1.org/1led.wiz and have the calculation done for you (click on the question marks if you need to). So, say for example you want to run one green led that has 20mA (that is usually listed with the LED when you buy it) and you are using a 9V battery to run it. You would put 9 in the Source Voltage, 2.2 for the diode forward voltage (although this could be different - also usually given in the specs for the LED), and 20 for the diode forward current. This will calculate to a resistor that is 390ohms (Ohms law that Tetsujin mentions). So, you need one green led, one 390ohm resistor, a 9v battery, and a 9v battery connector to power your LED. At this point, in theory, you be be able to get one green light lit up.

Also, I bought a 'breadboard' which is like a practice circuit board. It allows you to just monkey around with things - putting in lights, and resistors and such without having to do any serious work. It just allows you to look at different configurations. Im not gonna go into this too much - do a search on 'using a breadboard' on google, and you should get lots of stuff to look at. I even found some tutorials on YouTube that showed how to do some things step by step. You dont have to have this at all - it just really helped me understand what I was doing by seeing the circuit laid out. Oh yeah - all of this stuff is cheap - you can probably buy everything I have just mentioned for under 10 bucks (US dollars if you are somewhere else).

You also could get a wire cutter/stripper and some stranded wire (stranded is the kind that is pliable - you can twist it around things pretty easily)...both cheap in a hardware store.

Now, to try to make this as simple as I can, lets just do a simple example with the green led. The objective is that we want to make a circuit (basically a circle) of power moving from positive to negative with a light in the middle of the circuit to light it. Plug the 9V battery into the battery connector. The connector will have a red wire (the positive lead) and a black wire (the negative lead). Plug the red wire up to the resistor (when you are just fooling around, you can wrap the red wire around the resistor wire). Then, connect the resistor to the positive lead of the LED (an LED has a long post and a short post - long is positive and short is negative - supposedly this is not always the case though). Then, connect the negative lead of the lead to the black wire of the battery...and voila, you have a circuit, and your green light should light up.
jdeleonardis
Posts: 57
Joined: Fri Jan 02, 2009 11:49 pm

Post by jdeleonardis »

To get a little more complicated, now say you wanted multiple lights to feed from your 9v battery. You can have serial circuits and parallel circuits. In a serial circuit, you connect all the LEDs to each other where you have the negative post of one LED connecting to the positive post of the next LED and so on. Using this method, you add up the volts (so, say you wanted to connect 3 green LEDs this way, you would draw 6.6 volts (2.2 x 3) of power from the battery). The other way is by using a parallel circuit which allows you to connect any number of LEDs by hanging all of the positive leads off of the positive wire and all of the negative leads off of the negative wire. In this way, each LED is pulling 2.2 volts. This allows you to run, say 10 green LEDs, at one time, but will drain the battery much faster.

Check this website out for what Im trying to explain, but with pictures http://www.instructables.com/id/LEDs-for-Beginners/

Even more complicated, and steps that I havent tried, is using a circuit board, a microcontroller, and a soldering iron. By using solder and the circuit board, you are making the same connections I mention above, but making them 'permanent' with solder. The microcontroller that Tet mentions allows you to connect the lights and wires in a way that allows you to get blinking lights, fading on and off, and even sounds. Like I said, I havent gotten that far yet, but I have found tutorials from people on YouTube that show this step by step.

Now that you have green light, you could get some fiber optic wire and just point it at the green light. The other end of the fiber optic wire lights up. I bought some fiber optics from here http://www.fiberopticproducts.com/. Inside your model, you can mount the fiber optics so they are pointing directly at a bright LED light causing the other ends of the fibers to light up. I am drilling holes in my SD, and running the FO through those holes.

Does it all make sense? I know its probably a lot to take in, and my explanation is completely 'un'technical. I think your best bet is to spend 10 bucks and see what you can get to light up!

EDIT

One more thing - there are lots of good places on the net to buy LEDs and components listed in the stickies at the top of this section. However, I have used http://www.goldmine-elec-products.com/ twice now, and have been very satisfied with prices and the speed at which things get sent out and delivered.
Last edited by jdeleonardis on Thu Jan 15, 2009 2:58 pm, edited 1 time in total.
jdeleonardis
Posts: 57
Joined: Fri Jan 02, 2009 11:49 pm

Post by jdeleonardis »

Oh yeah, feel free to ask any questions and Ill do my best to answer, as Im sure will most of the people who see this post.
User avatar
tetsujin
Posts: 2350
Joined: Mon Feb 28, 2005 6:08 pm
Contact:

Post by tetsujin »

jdeleonardis wrote:To get a little more complicated, now say you wanted multiple lights to feed from your 9v battery. You can have serial circuits and parallel circuits. In a serial circuit, you connect all the LEDs to each other where you have the negative post of one LED connecting to the positive post of the next LED and so on. Using this method, you add up the volts (so, say you wanted to connect 3 green LEDs this way, you would draw 6.6 volts (2.2 x 3) of power from the battery). The other way is by using a parallel circuit which allows you to connect any number of LEDs by hanging all of the positive leads off of the positive wire and all of the negative leads off of the negative wire. In this way, each LED is pulling 2.2 volts. This allows you to run, say 10 green LEDs, at one time, but will drain the battery much faster.
Now, if anybody doesn't understand why putting the LEDs in parallel uses more power, I will explain...

A simple perspective is to simply think of this in terms of KCL - each parallel branch of the circuit is taking enough current for one LED - that means to drive three LEDs this way you're using three times the current from the battery.

A slightly more sophisticated perspective: the power consumed by a given device in the circuit, as measured in Watts, is (in a direct-current circuit) calculated as the voltage drop across the device multiplied by the current through the device:

P=V*I (Power in Watts equals Voltage times Current)

Each LED is going to dissipate the same amount of power regardless of whether they're in parallel or series - what changes is the amount of power dissipated by the resistors:

For a series circuit, the resistor is dropping less voltage, and carrying enough current to drive one LED. (In the example above, the resistor for the series circuit would drop 2.4 volts and carry a current of about 20mA = a total of 48mW power) The total power draw of the circuit would be 9V * 20mA = 180mW, so the waste there is 30%.

For a parallel circuit, you would need one resistor in series with each LED - and to form the parallel circuit you'd wire the end points of each of those series circuits to form the parallel circuit which you'd connect to your battery. Each of those resistors would need to drop enough voltage to reduce the battery's 9V down to the 2.2 used by the single LED - so a 6.8V drop. Each resistor would still carry 20mA of current - so each resistor would dissipate almost three times as much power as the one in the series circuit, and there's three resistors instead of one... The overall circuit would use 9V * 60mA = 540mW, with resistors accounting for 438mW of that - around 80% wasted power.

Note that the resistors are important in either circuit, because the operating voltages of the LED circuits don't match the voltage of the battery... If you were to connect three 2.2V LEDs to a 9V battery without a resistor, the result would be that you would overdrive the LEDs (driving each at about 3V - at which point those LEDs might pass way more current than is healthy for them) - and they would possibly burn out. When you connect a component to a 9V battery, you can't take just the 2.2V you need. The battery naturally has a 9V drop across its terminals - according to KVL, something has to account for all nine Volts. So you take the voltage the battery delivers, and either consume it or waste it to get the current flow you need. Current flow is more of a "take what you need" sort of thing. It's generally possible (and quite safe) to design a circuit that takes less current than the power supply is capable of - but not more.


I did circuit projects for a few years as a hobby before learning Kirchoff's Laws in high school physics class... I found that learning that stuff was very enlightening. They're very simple principles, and it's the very essence of being able to understand circuits - I really can't stress enough the value of understanding them. Without that knowledge, I could play with units of Volts and Amperes - I could work with Ohm's law and build things - but I was lacking an important piece of fundamental understanding - what Volts and Amps are, how they behave, and how they're measured.
---GEC (三面図流の初段)
There are no rats.
The skulls eat them.
User avatar
Gauge
Posts: 52
Joined: Wed Dec 31, 2008 4:50 pm
Location: Right of Center

Post by Gauge »

Thanks very much to everyone. I feel a lot more comfortable than I did yesterday. If I have any problems along the way I'll be sure to ask you guys for help.
Thanks again!
G. :D
"There's only ONE ~'Return'~,.. and its NOT ~'Of The King'~... its ~'Of The Jedi'~.
Confucius 479 B.C.E
User avatar
Rogviler
Posts: 4379
Joined: Thu Jan 15, 2009 7:04 pm
Location: Colorado

Post by Rogviler »

I just thought I'd share one of my secrets... I recently discovered the Texas Instruments site. That might not sound like anything profound, but if you go under Samples they'll send you electronic parts for free. This is especially useful when you need, say, an LED driver or microcontroller that only TI makes and don't want to put in an order for 10,000 or them.

Now, you do have to have a little more advanced knowledge, especially of teeny tiny solder points, but the nice thing about their site also is that they have full diagrams for what each connection is going to give you.

And hey, since it's free you can afford to experiment. :)

-Rog
User avatar
starmanmm
Posts: 2539
Joined: Sat Jul 13, 2002 12:59 am
Location: New Bedford, MA

Post by starmanmm »

Now, according to what I have read so far, even when you use one led... a resistor is still needed.

I have seen lit kits with only one led and they had no reisistors (from what they tell me).

So why does it work without it?
User avatar
USS Atlantis
Posts: 2388
Joined: Sat Sep 08, 2007 6:44 pm
Location: Galaxy 217, Orion Arm, Sol System, Sol III, 44° 53' N 93° 13' W (Local coordinate system)
Contact:

Post by USS Atlantis »

starmanmm wrote:Now, according to what I have read so far, even when you use one led... a resistor is still needed.

I have seen lit kits with only one led and they had no reisistors (from what they tell me).

So why does it work without it?
If it's an LED that takes 3v, and you're using a 3v power supply, then no resistor is needed

Most White and Blue (and a couple other) LEDs want 3v, power them with a pair of 1.5v batteries, and you don't need a resistor
Atlantis (Ken)

Build Blog
User avatar
starmanmm
Posts: 2539
Joined: Sat Jul 13, 2002 12:59 am
Location: New Bedford, MA

Post by starmanmm »

Ok, that makes sense.
macfrank
Posts: 8726
Joined: Fri Oct 11, 2002 6:55 pm
Location: Los Angeles, CA
Contact:

Post by macfrank »

SCC-7107 USS Atlantis wrote:
If it's an LED that takes 3v, and you're using a 3v power supply, then no resistor is needed

Most White and Blue (and a couple other) LEDs want 3v, power them with a pair of 1.5v batteries, and you don't need a resistor
LEDs do not have a linear relationship between current and voltage. At a certain voltage, the current drawn by an LED will become exponential, so a tiny change in voltage will become a huge change in current. This will heat up the LED and eventually destroy it.

That voltage/current "knee" is usually very close to the LED's typical operating ratings. The knee part will vary by a small amount between manufacturers and even between batches from the same manufacturer.

So if the typical rating on an LED is 3.2V @ 30ma and you run it from a 3V battery, there's a small chance (especially when the battery is new and it puts out more than the listed voltage) that your LED will go into the non-linear range. With a battery, no big deal - the LED will probably drain the battery before it overheats.
With a poorly (or non) regulated DC power supply, you'll end up damaging or destroying the LED.

So if you measure the voltage of the battery or power supply under a similar load and it's under 3.2V new, then no problem. If it's 3.3 or 3.4 volts under load, there's a good chance taht there will be a problem.
User avatar
tetsujin
Posts: 2350
Joined: Mon Feb 28, 2005 6:08 pm
Contact:

Post by tetsujin »

macfrank wrote: With a poorly (or non) regulated DC power supply, you'll end up damaging or destroying the LED.
Now's maybe a good time to introduce a few important facts about power supplies...

When you have a regulated DC power supply, that means the supply contains extra circuitry to stabilize the supply's output voltage at the specified level. Most often this is done by starting with a higher DC voltage, and then wasting power to get it down to the specified output voltage. But the upshot of this waste is, as long as you're within the power supply's operating range (not drawing more current than it can supply) there's a strong guarantee that its output voltage will be what's specified.

When you have an unregulated DC power supply, often this will mean that the power supply's output is simply "enough power that you could easily add a voltage regulator to get the specified voltage as output." In other words, a 5V unregulated DC power supply may put out more than 5V DC - possibly as much as 7V or 8V. The output will also vary depending on the load much more than a regulated supply would. (It could put out 9V at 10mA, and then fall to 6V as your load increases to 200mA...)

Alternately, the unregulated DC power supply's ratings could simply specify one possible operating point - like if it said it supplies 9V at 200mA, then it could be that you get 9V when you're drawing 200mA... and 11V when you're drawing 10mA, etc.


As for the whole "3V LED on a 3V battery" thing...

I would test it, first of all. See how much current goes through the circuit with a brand-new battery. If it's under the LED's operating limit, then the circuit's OK.

As the current draw on a battery increases, the voltage of the battery decreases - this is sometimes described as the battery's "internal resistance" - depending on your application and the size of the battery, it may or may not be safe to depend on this "internal resistance" to protect a simple LED circuit from overload. With watch batteries it's probably safe. With AA's I wouldn't be too sure, I'd at least test it first.

When you're doing model lighting, it's worth remembering that in all likelihood, if an LED goes out you're not going to be able to replace it. For that reason I almost always use resistors on LEDs - wasting a little bit of power to give the circuit a more linear behavior... I also don't often run LEDs at their full output (which is often too bright for model lighting, anyway...) - running an LED at an operating point well within its operating limits means that you'd have to increase the input voltage that much more in order to drive the LED into an unsafe condition...
---GEC (三面図流の初段)
There are no rats.
The skulls eat them.
Post Reply