Circuit to randomly select one of three outputs...
-
- Web Team
- Posts: 1092
- Joined: Fri Mar 16, 2012 7:03 pm
Circuit to randomly select one of three outputs...
More electronics that electrics but I'm wondering if such a circuit can be built/is available. I know that I could do this with a Arduino and a little bit of coding and that may well the route I eventually go down as I do have some experience with that.
So, down to what I need, the photo below shows one of the signals on my main line. The 3 aspect signal head replaced an earlier distant semaphore arm and it relates to a home signal about half a mile or so down the line but one that is not modelled the layout. When the home is at danger, none of the aspects are lit but when the signal is pulled off, depending on the signal further down the line, the colour light can show either green, amber or double amber.
The semaphore is operated from a DCC Concepts lever and I will make use of one the built in switches to power the colour light and, in my mind, I'd have that switch connected to a circuit that would randomly be able to select one of 3 outputs which would then provide power to light up the relevant aspect on the signal.
So, does such a circuit exist or can it be built?
John
So, down to what I need, the photo below shows one of the signals on my main line. The 3 aspect signal head replaced an earlier distant semaphore arm and it relates to a home signal about half a mile or so down the line but one that is not modelled the layout. When the home is at danger, none of the aspects are lit but when the signal is pulled off, depending on the signal further down the line, the colour light can show either green, amber or double amber.
The semaphore is operated from a DCC Concepts lever and I will make use of one the built in switches to power the colour light and, in my mind, I'd have that switch connected to a circuit that would randomly be able to select one of 3 outputs which would then provide power to light up the relevant aspect on the signal.
So, does such a circuit exist or can it be built?
John
-
- Posts: 2868
- Joined: Tue Jul 29, 2008 4:40 pm
Re: Circuit to randomy select one of three outputs...
I don't understand why it should be random, since it indicates the state of the next block?
Tim V
(Not all railways in Somerset went to Dorset)
(Not all railways in Somerset went to Dorset)
-
- Web Team
- Posts: 1092
- Joined: Fri Mar 16, 2012 7:03 pm
Re: Circuit to randomy select one of three outputs...
Tim V wrote:I don't understand why it should be random, since it indicates the state of the next block?
As the next block isn't modelled (the scenic break is the bridge), it's state is unknown so rather than, for example, the aspect always showing green, I'd like it to be random.
-
- Posts: 847
- Joined: Thu Mar 20, 2014 12:19 pm
Re: Circuit to randomy select one of three outputs...
MERG PMP12 - Random Lights
Kit Number: 812
Switches up to 10 lights on and off randomly. £1.81
That's all it says about it in the kit locker. The problem for your application might be after selecting a random colour then keeping just that one on after the semaphore was changed. Would it prototypically only show a light when the semaphore permitted passage?
i seem to recall you are a member, so a visit to their forum might be the place to get more information.
Kit Number: 812
Switches up to 10 lights on and off randomly. £1.81
That's all it says about it in the kit locker. The problem for your application might be after selecting a random colour then keeping just that one on after the semaphore was changed. Would it prototypically only show a light when the semaphore permitted passage?
i seem to recall you are a member, so a visit to their forum might be the place to get more information.
-
- Posts: 1976
- Joined: Wed Jun 23, 2010 1:04 pm
Re: Circuit to randomy select one of three outputs...
John Donnelly wrote:rather than, for example, the aspect always showing green, I'd like it to be random.
Possibly with the aspects changing while the home is clear, i.e. Y to YY to G?
Regards
Noel
Noel
-
- Posts: 814
- Joined: Tue Mar 20, 2012 3:57 pm
Re: Circuit to randomy select one of three outputs...
Hi John.
Sounds like a job for a timer / counter circuit with a binary output counting 2, 3, 4. Bit 2 to give a Y aspect, Bits 1 and 2 for Y Y and Bit 3 to give G. Its randomly setting the initial condition that's the tricky bit. Probably easier to do in software.
Regards
Tony.
Sounds like a job for a timer / counter circuit with a binary output counting 2, 3, 4. Bit 2 to give a Y aspect, Bits 1 and 2 for Y Y and Bit 3 to give G. Its randomly setting the initial condition that's the tricky bit. Probably easier to do in software.
Regards
Tony.
Inspiration from the past. Dreams for the future.
-
- Posts: 377
- Joined: Sun Jun 17, 2018 8:26 am
Re: Circuit to randomy select one of three outputs...
It would be perfectly reasonable for such a signal to always go Y > YY > G once the semaphore which provides the red aspect has cleared. 4-aspect colour light signals would only be installed where train density is sufficiently high to justify the extra costs involved so much of the time the next colour-light signal would still be at red when the semaphore is cleared. To be totally realistic, you could set up a 0 > Y > YY > G timer circuit which is triggered whenever a train passes but which only actually illuminates the relevant colour light aspects when the semaphore arm is off.
Incidentally, although the red aspect is created through the spectacle plate of the semaphore signal, the intensity of that red light should match the intensity of the three c/l aspects, normally this was done by using an electric, rather than oil, lamp. The green spectacle of the semaphore signal would be blanked off.
Incidentally, although the red aspect is created through the spectacle plate of the semaphore signal, the intensity of that red light should match the intensity of the three c/l aspects, normally this was done by using an electric, rather than oil, lamp. The green spectacle of the semaphore signal would be blanked off.
-
- Web Team
- Posts: 1092
- Joined: Fri Mar 16, 2012 7:03 pm
Re: Circuit to randomy select one of three outputs...
Thanks all for the replies so far.
I don't know if the aspects need to cycle as every prototype photo I have of this particular signal, and I have quite a few, show no lit aspects when the semaphore arm is at danger. It has always been my feeling ,although I have no written evidence that, as soon as a train passed the signal and the arm went back to danger, the lights went out regardless of the aspect they were showing when the arm was up...
I don't know if the aspects need to cycle as every prototype photo I have of this particular signal, and I have quite a few, show no lit aspects when the semaphore arm is at danger. It has always been my feeling ,although I have no written evidence that, as soon as a train passed the signal and the arm went back to danger, the lights went out regardless of the aspect they were showing when the arm was up...
-
- Forum Team
- Posts: 3918
- Joined: Sun Jun 29, 2008 8:02 pm
Re: Circuit to randomy select one of three outputs...
Indeed, the colour lights would be extinguished whenever the semaphore went to stop, but it could still be lit for some time, ideally a random aspect to start with and step up after a couple of minutes if not already green. A job for the Arduino I would think, or a small PIC. It should be easy enough to find a random number sketch for Arduino. MERG has a PIC operated random lights unit (PMP 12) kit that could be adapted if you can program the PIC. Its under £2.
-
- Web Team
- Posts: 1092
- Joined: Fri Mar 16, 2012 7:03 pm
Re: Circuit to randomy select one of three outputs...
grovenor-2685 wrote:A job for the Arduino I would think
I'm thinking that's the way to go, there is already a random number function available to use in a sketch.
-
- Posts: 131
- Joined: Wed Apr 11, 2012 4:55 pm
Re: Circuit to randomy select one of three outputs...
John Donnelly wrote:
I'm thinking that's the way to go, there is already a random number function available to use in a sketch.
Didn't realise you'd asked this question elsewhere after asking about it last Saturday.
Would this be the type of thing? Still needs some improved discrete component selection to even up the LED illumination or to adapt it to the hardware you have used. Randomness over eighteen cycles.
I'll have a look at your components tomorrow.
https://www.youtube.com/watch?v=QELcjsdBmbU
P
-
- Web Team
- Posts: 1092
- Joined: Fri Mar 16, 2012 7:03 pm
Re: Circuit to randomy select one of three outputs...
Porcy Mane wrote:John Donnelly wrote:
I'm thinking that's the way to go, there is already a random number function available to use in a sketch.
Didn't realise you'd asked this question elsewhere after asking about it last Saturday.
Would this be the type of thing? Still needs some improved discrete component selection to even up the LED illumination or to adapt it to the hardware you have used. Randomness over eighteen cycles.
I'll have a look at your components tomorrow.
https://www.youtube.com/watch?v=QELcjsdBmbU
P
Cheers Paul, that looks like exactly the sort of thing I'm looking for...
See you tomorrow.
-
- Web Team
- Posts: 1092
- Joined: Fri Mar 16, 2012 7:03 pm
Re: Circuit to randomly select one of three outputs...
Decided to go down the Arduino Nano route and as of tonight on the test bench, I've programmed the Arduino to send an output randomly to one of three outputs when a switch is thrown and to turn the power off to all three when the switch is off.
I may, later, add some code to sequence the aspect automatically if the semaphore is off for long enough.
I may, later, add some code to sequence the aspect automatically if the semaphore is off for long enough.
-
- Web Team
- Posts: 1092
- Joined: Fri Mar 16, 2012 7:03 pm
Re: Circuit to randomly select one of three outputs...
For anyone who may be interested, here is the result of the programming of the Arduino. When the semaphore signal is 'off', I've programmed the Arduino to randomly select one of the three possible aspects for the colour light signal. If the arm remains off, the lights cycle back to green after a pre-determined number of seconds (set to 5 for the purpose of the video):
-
- Web Team
- Posts: 1092
- Joined: Fri Mar 16, 2012 7:03 pm
Re: Circuit to randomly select one of three outputs...
Oops, it appears I have the Amber aspects the wrong way round, this will be corrected with a programming tweak.
Who is online
Users browsing this forum: ClaudeBot and 0 guests