concept led in category javascript

appears as: n LED, LEDs, LED, LED, An LED, The LED, LEDs, Leds
JavaScript on Things: Hacking hardware for web developers

This is an excerpt from Manning's book JavaScript on Things: Hacking hardware for web developers.

On our adventure, you’ll get a fundamental understanding of the few basic relationships that make electronic circuits work. Not mathy? Don’t fret, neither am I. You’ll meet some helpful characters on the way: components and modules, different kinds of boards and software. We’ll try out different combinations of things and learn how to dust ourselves off and try again when we blow up an LED.

Figure 3.8. A common real-world Ohm’s law problem: what resistor value is needed to provide an LED with 20 mA of current in a circuit with a 6 V supply voltage?

If those steps don’t do the trick, try swapping out your LED with a fresh one on the off chance that the LED is dead. On occasion, a breadboard’s connections can be wonky (though this is more typical for breadboards you’ve been using for a long time). As a last resort, try wiring the components onto a different part of the breadboard or try with another breadboard.

A 220 V resistor is close enough in value to be just dandy—rounding up to the next common resistor value as per convention. Now, 220 V is more resistance than 160 V, so you might wonder what effect using a higher resistance value has on the LED and the circuit. Higher resistance with steady voltage means the current goes down (because, as always, Ohm’s law):

I = V / R
I = 3.2 / 220 V
I = 0.0145 A

In the end, the LED gets less current than 20 mA—about 15 mA (.0145 A). The amount of current provided to an LED is directly proportional to its brightness: an LED getting 15 mA will not be as blindingly bright as one receiving 20 mA.

In the simple LED series circuit you wired, all of the current runs through the LED, then through the resistor, and then to ground (figure 3.14). A single gap in a series circuit will cause the entire circuit to stop working, because it’s a gap in the only path through the circuit. That makes it possible to activate and deactivate the whole circuit with one switch.