The 1N4148 is a standard switching diode that has been used for many years. It switches faster than say a 1N4000 series diode. A Schottky diode is faster but I have never found it to be necessary. The circuit I show comes from a DCC site. Not an original idea of mine. I guess you can put the diode across the LED if you prefer.
Rich
If you ever fall over in public, pick yourself up and say “sorry it’s been a while since I inhabited a body.” And just walk away.
I assume the standard diode is to protect the LED from excessive reverse voltage. In that case it would be better to wire the standard diode anti-parallel with the LED.
Or just use a common 2-wire bicolor LED and the resistor.
--Randy
Modeling the Reading Railroad in the 1950's
Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.
Don't know if this has been posted before. For those who want to park locos on sidings and remove the power with a switch, here is a simple circuit using a standard 20 ma LED.
With non-sound locos, it can be an aid with multiple locos parked when you want a particular loco.