I'm glad you liked my idea. I was thinking a bit more basic than your description though. I was thinking of simply detecting/using the voltage somehow; when a locomotive first bridges the insulating gap from the powered rail to the frog (same side of the locomotive) the frog will either have ~14v or 0v applied to it
I've got it!!! The solution hit me out of the blue last night - a voltage divider network. I'll whip up a schematic later but here is the general idea: A series network consisting of 2 sense resistors sized to develop a 1.7 volt drop at 20mA and 2 limit resistors sized (combined) to limit current to 10mA at 14.2V.
Arranged thusly: V
CC --> R
SENSE --> R
LIMIT --> Frog --> R
LIMIT --> R
SENSE --> Gnd
Connect an optoisolator across each sense resistor. When no wheel is on frog then only 5mA flows across the network. Insufficient R
SENSE V
DROP to meet optoisolator LED turn-on voltage. When a wheel connects frog to either polarity rail then effectively the network is cut in half raising the current flow to 20mA creating a 1.7V drop across the corresponding R
SENSE and firing the respective optoisolator.
Now with a clean optoisolator output signal we can trigger anything we want. I'm thinking a pair of NAND gates controlling a quad switch like a CMOS4066 that disconnects the R
NETWORK from the frog to solve the permanently-on problem. The logic output would initiate the correct charge pump MOSFET combination and start a short duration timer to temporarily hold 1/2 network at 20mA. The logic gates serve to prevent both polarity transistors from being on at the same time.
Wheel bridges rail to frog --> current jumps on one side of resistor network --> optoisolator triggers --> timer starts --> frog to network disconnect --> charge pump fires transistor --> timer expires --> transistor shuts down --> frog to network connect.
Tim, you are a genius!