What is the correct way to connect an LED to a logic circuit?
The obvious thing to do is this:
simulate this circuit – Schematic created using CircuitLab
I have two concerns:
- Can the logic gate's output actually deliver enough power to drive the LED? (Sure, LEDs are very low-power. But so are logic gates!)
- Will the load from the LED distort the output so much that I can't connect it to any other gates?
The second problem looks like it ought to be trivial (if inconvenient) to solve:
Now only the output of the buffer has to deal with the load from the LED; the AND gate is blissfully unaware that anything has happened.
Trouble is, I'm planning to use 74HCxx logic running at 5 V, whereas it looks like most LEDs want to run at ~2 V. Also, it appears 74HCxx can only supply up to 4 mA, whereas most LEDs seems to draw drastically more current than that.
So now what?
Perhaps I could use a resistor to work around the voltage difference. (My knowledge of analogue electronics is far too weak to know if that would work.) Alternatively I could just run all the logic at 2 V instead. (The 74HCxx series seems to support that.) All of which does nothing to solve the current problem.
Do I need one of the level-translating logic gates? Or do I need to build something even more elaborate than that?