You might use some kind of relay that is sensitive enough to trigger on low voltage but accept peak track voltage, and use it to switch a circuit that powers the LED from independent correct voltage.
There are inexpensive buck/boost cards -- one very recently referenced in another thread [Just Plug System] -- that I think can be set up to operate as constant-voltage supplies from variable DC source. That ought to be perfect to run a LED of choice. Someone will give you the information on these in better form than I can.
Note that a typical red/green LED inherently shows polarity: this is two light-emitting diode cores of opposite polarity in series. The diode functionality ensures only one of the two conducts when DC of either polarity is applied; the light-emitting functionality makes the diode in conduction light up. The problem here is that like a valve the color-coding shows absolute position rather than 'what it ought to be to match what you want'. Some of the people who have wired color-light signals will have answers to setting up the logic involved in showing an appropriate 'clear' signal for an approaching train-in-block, which could be used as an indicator for matching the 'approached' polarity correctly. But unless you're interested in signals, which I doubt, that would likely be too difficult or too expensive.
You're better off learning how to wire the blocks so the cab automatically determines the correct polarity, which is more complicated but well worth learning.
josephbw Or a bi-color led.
Or a bi-color led.
rrebell Use two LED's.
Use two LED's.
I am looking for a solution that uses only 1 light.
I am operating in DC
I am in the process of wiring lights on my control panel to show polarity on the different blocks on the layout.
The approach I am taking right now is to solder a wire on the track on one block (let's call it A) and solder the other wire on the adjoining block on the same side of track ( let's call that B). So when a train is in block A heading to block B and the light is on I know I need to change the polarity in block B.
Here is the problem I have come up with -
Using a multimeter I notice that the range of volts going through the track when operating trains is around 3 to maybe 11 or so. With that range an incadescent at 3 volts is hardly visible.
I originially used an LED but as you pros already would have known that if I am using only one rail it would only illuminate when there is a complete circuit in one direction, not the other.
Is there another approach that I can take to accomplish my goal?
Hope I explained properly my conundrum.
Thanks,
charles