Repair of Lionel LED Accessory Help Request

TLDR; Where is the fault in the attached schematic? I think a ground needs to be added on one side of R1/R2 that doesn’t seem to exist on the physical board. What else could be a potential fix?

Background:
New User. I will try to attach KiCad schematic if permissions allow me to. See link instead.
KiCad Files
My Dad has a Lionel train layout. He acquired a used Microwave Tower accessory at a swap meet. The tower had one blinking LED at the top but it quit blinking. I took a look at it and it actually has 3 LED’s, two side white “lights” that should stay on, in addition to the red blinking LED on top. I wasn’t able to find any information about the schematic for this tower. This seemed like a good opportunity for me to learn ngspice simulation with KiCad as the front end. The idea was to learn how the circuit was supposed to work so that I would have some idea of how to go about troubleshooting it.

Using the visible traces on the top and bottom of the board, along with checking continuity, I was able to use KiCad to model the circuit. Most of the components were identifiable except for a SMD capacitor.

My own observations and research findings:

  1. The board has obviously been worked before. There are three electrolytic capacitors that look new’ish. All three are the same physical size and value, 100 uF. However, the outline circles drawn on the board indicate that C1 was meant to be a larger diameter capacitor than C2 and C3 which have the same size outlines. More about C1 in note 3) below.

There at 3 sets of pads on the board for connection of the LED leads. However, the wires were all soldered to the same pad, i.e. all grounds on a single ground pad and power wires on one power pad (or maybe two, I don’t recall exactly). I removed all the LED wire leads, clean up the board and soldered in some test LED’s (white). All three now light up, but still no blinking on any of them. I expect one of them to blink.

  1. Lionel trains and accessories operate on AC supply. Accessories are about 18 volts. But the design probably allows for direct track connection which would be a max of about 24 volts. The small transformer I’m using to power the board measures about 12-13 volts RMS on my multimeter. I set the VSOURCE ngspice model to 18 volts sinusoidal.

  2. The AC power input is put through a bridge rectifier chip. The result is used as input to a voltage regulator with capacitor C1 in between them. I believe that a larger capacitor might have originally been used to provide smoother input to the voltage regulator. Board does work, as is, to power the 3 LED’s.

  3. The output of the 5 volt voltage regulator seems to be the main power supply. It powers the two side LED’s (non-blinking) via 330 ohm resistors. It provides power to the Op Amp chip. There are also two capacitors hanging on the power line, one of the electrolytic, C2, and the SMD C4. I’m not certain of their intended function. The SMD is located close to the Op Amp power input pin. So I assume it supports the Op Amp. Finally, the power line is fed to a NPN transistor that drives the blinking LED light that is also on a 330 ohm resistor. The NPN transistor is controlled by a complicated Op Amp circuit.

  4. The operation of the Op Amps, how they work, and why it was used to blink the LED, is what took me the longest to puzzle out and gave me the most trouble with KiCad/Ngspice. I got lucky here, because I ran across a comment on one of the data sheet web pages from someone asking about the “breathing LED circuit”. That gave me the search term needed to avoid all the simple LED blinker circuits. It involves two Op Amps with one working as an integrator and the other as a comparator (at least that’s what I think I learned about it). KiCad/Ngspice was very useful in observing how this all works…once I finally got it to work. The third electrolytic capacitor, C3, is the feedback for the integrator Op Amp and part of the RC time constant used to control the blink rate.

Dilemma:
I wanted a working circuit model to troubleshoot a failed board. But I seem to have just replicated the bad board. Where is it going wrong?

The model does indicate that it would power up the LED’s (which matches reality), but not blink the top LED (which matches reality but is not expected behavior). The Op Amp breather circuits that I’ve researched online, and modeled separately, require a reference voltage of about half the supply connected to each Op Amp. The examples I’ve seen use a voltage divider to provide the reference voltage. R1 and R2 look like they could be the voltage divider that would do this. However, the voltage on each end are wrong.

This is related to the voltage regulator configuration. If the “COMMON” pin of the voltage regulator was grounded, then the output, “VO”, would be a nice clean 5 volts to power the devices and make R1 and R2 provide 2.5 volts as the reference input to the Op Amps. The model then oscillates like it was intended to. But the actual layout of the board does not have a ground connection there. Instead “VO” is a noisy ten’ish volts on one end of the voltage regulator and the “COMMON” is a slightly higher noisy ten’ish. So there is very little actual voltage difference across R1 and R2 for it to divide. This means that the Op Amps don’t oscillate. I can’t seem to identify any damage on the board that would indicate an open from the voltage regulator “COMMON” connection to ground.

Another configuration that would work is to disconnect R2 from the supply line and ground it instead. This means the devices would be powered by a noisy 12 volts instead of the the clean 5 volts. However, the Op Amps would oscillate and the LED’s would have higher current through them.

It seemed “obvious” that the Voltage Regulator Common should be grounded. What caused me to start second guessing this obvious fact is that the data sheets for the Voltage Regulator show configurations in which the “COMMON” is not grounded for various purposes, adjustable voltage, current control, etc. So the data sheet along with not finding an obvious ground fault on the board has me confused on what to do.

So I’m looking for anything that I might be missing before I attempt to jumper a ground and get on with it. Have I missed another change that would make the Op Amps oscillate? Have I tortured a completely different circuit into looking like a “breather”?

Your post is far to long for me to start reading it all, but I did have a short peek at your schematic.

Euhm, yes, you need to connect the GND pin of your voltage regulator for it to work properly.

You’re nearly there, read this.

1 Like

You’ve done some great detective work here! So I’d just go with what you’ve found and fix the board to do what you want, which is to oscillate the LED nicely. I wonder if the original board was mis-made and they had a bodge wire in there to make it work, and when the PO replaced the bad caps, they removed this obviously wrong wrong since it wasn’t part of the circuit board.

1 Like

That’s certainly one possibility. It’s how I’m probably going to fix it.

Thanks for looking despite my long post.

The regulator graphic says “GND” on the pin, but is actually called “COMMON” in the data sheet. As this page shows, it doesn’t need to be directly grounded.

I’m wondering if an open elsewhere on the board (i.e. missing trace in schematic) would also lead to a working circuit.

I’ve found examples of some oscillator circuits in ngspice that need an initial condition to break out of equilibrium and start oscillations in the simulation. I don’t think that is the case here. But it’s still an open question.

There is no absolute “GND” in electronics. (*1)
If you measure a voltage with your DMM, you always have to use two wires, and your DMM only sees the difference between those two wires.

Normally the designation “GND” is used as a common reference for all parts on a PCB (But there can be isolated sections, things referenced from another voltage etc). But it always works with differences. “GND” can also have other names such as “common” “Vss”, “zero”, or whatever the designer fancies.

This is a very concept to understand if you’re working with electronics. A voltage regulator knows nothing about this world except what it can sense via it’s three wires.


(*1) Best I know there is a “shortage of electrons” in this universe, or at least around this planet, which should give the whole place a positive charge if you have a DMM with long enough wires to poke it in an “external” reference to compare it with.

1 Like

Understood. I was interpreting posters use of ground to mean the usual practice of setting the ground node to the negative of the supply.

I’m starting to think there are some similarities to “my” circuit and the Variable Output regulator shown on this page.


It also has a resistor pair going across the output, VO, and COMMON, with the center going to Op Amp.

No, that does not seem logical.
The “GND” pin of a voltage regulator usually has a low impedance path to some other voltage. In the datasheet it’s directly connected to the output, while in your schematic it’s only connected to R2, which is a 51k resistor.

It’s much more likely to me that R1 and R2 (both 51k) are supposed to be a voltage divider between “GND” and 5V, which means “Vref” is a steady 2.5V.

I tried to read your first post. I get lost somewhere between trains, real PCB’s and simulations.

If you want to get a simulation going, then start with a simple thing. Delete the whole voltage regulator and everything around it, and replace it with a voltage source. Then only delete one of the opamps, and concentrate on the circuit around the other one.

Good advise. Thanks. That was part of my novella :smiley:

I initially had the Op Amp “breather” broken out separately. It took me a few turns through the manual to sort out the Alternate Pin settings, how to make a multi package library file to handle the Op Amp, and how to set an initial condition on the circuit so that it actually oscillated in the simulator.

I don’t know the characteristics of the blinker LED. Before making changes to the circuit board, I think I’ll take a battery and some resistors and make sure the max and min LED currents estimated by the simulator gives a good looking light level at max and is actually turned off on min.

But, yeah, I’m also going to break out the regulator and try some of those alternate layouts from the data sheet in the simulator.

So to close this out, I added a wire to from the negative lead of capacitor C2 to the common lead of the LM7805 and the blinker light is working.

Thanks.

2 Likes