555 timer circuit design

sghioto

Joined Dec 31, 2017
8,634
I'm not sure what you mean re: correct LED status upon power up. Shouldn't sensor 1 and 2 relays control that?
If I'm understanding the sensor operation correctly the Signal status would depend on which direction the first train enters the loop.
When first power up Signal 1 has to be either green or red and vice versa for Signal 2 correct?
I have tested the circuit and it functions correctly to the design parameters as I understand.
 
Last edited:

Thread Starter

Jibebuoy

Joined Nov 5, 2025
59
I just mean when the relay contact opens. It only takes a brief closure to start the timer.
Not sure either how long the relay contacts actually stay closed when the sensor is activated.
I suppose you could check that out but probably not that important.
The S1 and S2 relay contacts alternate between open and closed depending on which way the train is going. They stay in that position while the train is in the loop and don't change their position until an exiting train activates an IR sensor.
 

Thread Starter

Jibebuoy

Joined Nov 5, 2025
59
If I'm understanding the sensor operation correctly the Signal status would depend on which direction the first train enters the loop.
When first power up Signal 1 has to be either green or red and vice versa for Signal 2 correct?
I have tested the circuit and it functions correctly to the design parameters as I understand.
Yes, on initial power-up, Signal 1 has to be either green or red and vice versa for Signal 2. However, this LED signal orientation should be consistent with the train track switch and I believe the key to controlling that is the orientation of the S1 and S2 relay contacts. The S1 and S2 relay contacts alternate between open and closed depending on which way the train is going in the loop. They stay in that position while the train is in the loop and don't change their position until an exiting train activates an IT sensor. Please see below. Thank you again for your help.ok delete.jpg
 

Thread Starter

Jibebuoy

Joined Nov 5, 2025
59
HI

Here's an alternate circuit to consider. It hasn't been tested, but uses NE555's and three 2N7000 mosfets.
Initially, whenever the entrance signal1 is green, exit signal2 is red. Entrance signal1 changes to red, behind the train, after 10 seconds. Note in the graph the signals do not change until after 10 seconds, once detected by the sensor.


View attachment 358516
Thank you, I appreciate your effort.
 

sghioto

Joined Dec 31, 2017
8,634
Please see below. Thank you again for your help.
Where did you get this schematic?
I ask because all the LEDs and diodes are in backwards.
If the relay contacts stay closed while the train is on the track might need to re-think the design.
Are you saying when S1 relay closes S2 relay opens simultaneously and vice versa?
When first powered up are not both relay contacts open?

1762699609583.png
 
Last edited:

Thread Starter

Jibebuoy

Joined Nov 5, 2025
59
  1. Where did you get this schematic? I ask because all the LEDs and diodes are in backwards.
    1. I made it and yes, the components are backwards. My bad.
  2. If the relay contacts stay closed while the train is on the track might need to re-think the design. Are you saying when S1 relay closes S2 relay opens simultaneously and vice versa?
    1. Yes, correct.
  3. When first powered up are not both relay contacts open?
    1. No, one is open and the other is closed. They alternate between open and closed. They can never both be opened or closed at the same time.



My apologizes for any mis-understandings.
 

sghioto

Joined Dec 31, 2017
8,634
When first powered up are not both relay contacts open?
  1. No, one is open and the other is closed. They alternate between open and closed. They can never both be opened or closed at the same time.
In that case I think going back to a modified version of my original design will work.
1762703046697.png
 

AnalogKid

Joined Aug 1, 2013
12,131
If I've read this thread correctly, you need *2* latches; one to latch the sensor states at the start of the 10 second delay, and one at the end of the delay to hold the output states until the next sensor state change. Sensor status is transferred from the input latch to the output latch at the end of the delay. This prevents the lights from changing until after the delay, but has the data available even if the triggering sensor returns to its "off" state during the delay.

The good news is that **because the two output states are mutually exclusive,** each latch needs only 1 bit. The first latch is triggered by an OR of the two sensors (post #32), but has to latch the status of only one of them.

Yes / No - ?

IF Yes THEN

1 - CD4013 - two, 1-bit latches
1 - CD4093 - delay monostable plus glue

ak
 
Last edited:

AnalogKid

Joined Aug 1, 2013
12,131
First pass at a concept schematic.

SW1 and 2 represent the train sensors. They can be switches, relays, or open-collector / open-drain outputs.

U1A functions as an inverted-input OR gate - if either inputs goes low, the output goes high. U1B inverts this for the proper trigger polarity for the monostable.

The OR-ed inputs clock U1A, the storage of the next state. Because the sensors are mutually exclusive, it doesn't matter which switch state is stored; the output can interpret either one. Q1 is turned on by SW1; Q2 is turned on by SW2.

If switch bounce is a problem, a short R-C delay can be inserted between U1A and U2A.

U1C and D form a true monostable that will time out correctly no matter the state of its input when the timing period ends. The trailing edge of the output pulse is positive-going and clocks the output latch. U2B is not clocked until the end of the delay period, so the lights retain the current state throughout the delay.

R4-C4 form a power-on reset (POR) so the circuit starts up in a known state. For the circuit as shown, it powers up with Q1 on. If either switch is closed when power is applied, that switch's output will be on for the delay period.

ak


!!Train-Switch-1-c.gif

Click on the schematic for a larger image.
 
Last edited:

sghioto

Joined Dec 31, 2017
8,634
No, one is open and the other is closed. They alternate between open and closed. They can never both be opened or closed at the same time.
When first powered ON which ever Sensor contact is close will start a 10 second delay before the Signal LEDs light up.
Full schematic with both Sensors and Signals.
1762736987902.png
 
Last edited:

eetech00

Joined Jun 8, 2013
4,705
The train's direction in the loop alternates between CW and CCW. Only the IR sensors for a train exiting the loop activate the switch and my new signals, S1 and S2.
As others have wrote, use of CW and CCW is confusing terminology.
I think it would be clearer to identify the switch position, in your description, as "NOR(normal) or REV(reverse)", and use that for describing a train entering and exiting the loop. For a standard turnout, "Normal" is the switch set for the straight position, "Reverse" is the switch set for the turnout position. Draw the switch in your diagram as a "standard turnout" for discussion purposes. That is, draw the switch with a straight horizontal line representing "normal" position, and an angled line representing the "reverse" position, even though it may actually be some other type switch (Y config, for example).

That way...for example, signal operation for an EB (eastbound) train, about to enter the loop, could be described in this way:

1.0 Initial conditions:
1.1. Signals are arranged so that both signal1 and signal2 face east (and therefore, both R/G LEDs in each signal)
The signals cannot be seen from the train when entering the loop.
1.2. When train is not present: Switch is normal, signal1 is red, signal2 is green.

EB train entering the loop:
2.0 When train enters the loop:
2.1 Switch is normal, signal1 is red, signal2 is green.

3.0 After train enters the loop and clears the switch:
3.1 Sensor1 closes, Switch moves reverse, signal1 is red, signal2 is green.

4.0 Train is clear of switch and occupies the loop:
4.1 Switch is reverse, signal1 is red, signal2 is green, 10s timeout begins.
4.2 10Sec timeout expires, then signal1 goes green, signal2 goes red.

Blah blah blah.....
I don't know if the items above are correct (probably not) but I think you'll get the idea.

Just trying to help...
 
Last edited:

AnalogKid

Joined Aug 1, 2013
12,131
According to the TS they do which was just known today.
See post #44.
Hmmm ... That changes things.

IF the two switch states *always* are complimentary

AND IF there is essentially zero deadband between the switches changing state

THEN this is a problem for my monostable

AND You don't need a true monostable. A simple boxcar will work. (the circuit, not the train car)

#52 should work if you add a discharge path for the timing capacitors.

ak
 

sghioto

Joined Dec 31, 2017
8,634
[QUOTE="AnalogKid, post: 2009087,
#52 should work if you add a discharge path for the timing capacitors.
ak

[/QUOTE]
The caps will discharge through the 555.
Didn't see the need for a reverse diode across the timing resistor.
 

eetech00

Joined Jun 8, 2013
4,705
The train's direction in the loop alternates between CW and CCW. Only the IR sensors for a train exiting the loop activate the switch and my new signals, S1 and S2.
Unfortunately doesn't tell me much.
Anytime you light a signal on a railroad automatically, you need to know the direction of traffic. If sensor1 and sensor2 are "occupancy detectors", then the direction can be "implied" based on the train occupancy sequence.
Initial state:
Sensor1=0, Sensor2=0 = unknown

Enter at Sig1:
Sensor1=1, Sensor2=0 = entered at Sig1
Sensor1=0, Sensor2=1 = exiting at Sig2

Enter at Sig2:
Sensor1=0, Sensor2=1 = entered at Sig2
Sensor1=1, Sensor2=0 = exiting at Sig1

These are implied conditions as there is no positive way to know if the whole train is in the loop and clear of the turnout. This state would be:
Sensor1=1, Sensor2=1, OS=0

where "OS" would be the turnout occupancy detector
(turnout is locked from movement during occupancy).

Please comment.
 
Top