That circuit is missing a few important components, like the bypass cap you mentioned and a filter cap at the input. The datasheet for the opto specifically says you need a .1uF capacitor across power and ground, so not sure why anyone would omit that. Yet is works for some depending on what it is connected to, the voltage and the length of the wires. Also, that choice of the resistor going into the opto-isolator is important and depends on your track voltage. If it is too low it will burn out the led inside the opto. I tell people the easiest solution is to go here: https://model-railroad-hobbyist.com/node/24316 There is a schematic and a board already made you can get so you don't have to do point to point soldering on a breadboard. This is a good option for people who may be willing to solder, but aren't into electronics design. Then it is paint by numbers; solder only the parts needed for either an optoisolator powered from the tracks by including a voltage regulator, or just an optoisolator powered by something else, or a full decoder and even motor controller The bottom is the bare board, the top is populated with a rectifier, regulator, the caps you need and the optoisolator. It also has an Arduino Pro Mini so you can use that to hold a sketch if you want like a 17 function accessory decoder, or a packet sniffer, or whatever else. This person sells the boards if you don't want to download a cad file and upload it to a fabricator like Oshpark and get them that way. http://www.modelrailroadcontrolsyst...s-low-cost-17-channel-dcc-decoder-bare-board/ I keep finding uses for them. I am getting ready to order 3 of the high current versions for a project.