Jump to content
 

Arduino colour light signal control


Recommended Posts

OK, I have a horrible feeling that this is going to be a "Doh!" moment, but here goes...

 

I want to use a DCC Concepts lever to act as a "trigger" for colour light signals so I can change them via an Arduino. The Arduino controls the operation of a level crossing and the associated signals. I want to connect the lever so that I can set the signals regardless of whether the crossing gates have been told to open to rail traffic.

 

I have managed to make the Arduino detect whether the lever has been moved by wiring an "on/off" output from the DCC Concepts lever to one of the Arduino pins and its ground. It's easy for the Arduino sketch to then invoke a routine which looks at the current state of a signal and change it.

 

The problem I have is that the "common" wire of the 3 from my colour light signal is positive rather than ground. If it was the other way round I could just wire the "red" wire to one pin, the "green" wire to another and the common to an Arduino ground, then set one or the other of the pins HIGH or LOW to set the signal "red" or "green".

 

As  things stand though, the only way I can get my "change signal" routine to work is with either the green being on or off (with the "green" lead from the signal connected to Arduino ground) or vice versa with the "red" lead connected to ground. Obviously, connecting both "red" and "green" signal leads to Arduino ground doesn't solve the problem.

 

Any help will be really appreciated, even if I end up kicking myself!

 

Cheers

 

Steve

 

Edited by SealionSteve
Link to post
Share on other sites

  • RMweb Premium

What make/type of signal is it? It seems odd for the signal to be wired up that way round - normally we expect to switch the dc positive, not the dc negative. Have you tried touching the signal wires to a battery (any small battery should be fine) to confirm the operation?

Link to post
Share on other sites

  • RMweb Gold

Could you use the Arduino to trigger two relays. Probably not the most elegant solution but fairly easy to achieve.

Edited by BoD
Link to post
Share on other sites

4 hours ago, SealionSteve said:

OK, I have a horrible feeling that this is going to be a "Doh!" moment, but here goes...

 

I want to use a DCC Concepts lever to act as a "trigger" for colour light signals so I can change them via an Arduino. The Arduino controls the operation of a level crossing and the associated signals. I want to connect the lever so that I can set the signals regardless of whether the crossing gates have been told to open to rail traffic.

 

I have managed to make the Arduino detect whether the lever has been moved by wiring an "on/off" output from the DCC Concepts lever to one of the Arduino pins and its ground. It's easy for the Arduino sketch to then invoke a routine which looks at the current state of a signal and change it.

 

The problem I have is that the "common" wire of the 3 from my colour light signal is positive rather than ground. If it was the other way round I could just wire the "red" wire to one pin, the "green" wire to another and the common to an Arduino ground, then set one or the other of the pins HIGH or LOW to set the signal "red" or "green".

 

As  things stand though, the only way I can get my "change signal" routine to work is with either the green being on or off (with the "green" lead from the signal connected to Arduino ground) or vice versa with the "red" lead connected to ground. Obviously, connecting both "red" and "green" signal leads to Arduino ground doesn't solve the problem.

 

Any help will be really appreciated, even if I end up kicking myself!

 

Cheers

 

Steve

 

Hi Steve,

 

I think if you connect the common postive wire to a 5v pin on the Arduino and the two 'colour' wires into two of the Arduino Ouputs, and then have the outputs configured as 'LOW' is lamp lit and 'HIGH' is lamp out, then I think that should work, based on my own understanding.

 

Simon

Link to post
Share on other sites

I've got some signals like this, it's a bit of a nuisance. Theoretically you can just wire the common to 5v and the signal wires to the output channels so setting them to 0 turns them off, but often output lines are able to source current but not sink it so this won't work. I'm not sure what the Arduino does in this respect.

 

I'm driving mine through a PCA9685 servo / led driver board, and that has an "invert" mode that switches it between conventional (load is between driven output and 0v) and inverted (load is between driven output and 5v). My controller sets that mode on startup and then it all works fine after that.

 

The advantage of using a servo controller board is that you have a lot more outputs, especially as they can be daisy chained, and the brightness is fully controllable as well.

Link to post
Share on other sites

Thank you so much for the advice, everyone. I followed the suggestions of connecting the common lead to the voltage supply rather than the GND and hey presto - all working fine now.

 

I am fine on the software side but it always seems to be the hardware which flummoxes me!

 

Many thanks again to all for your help.

 

Regards

 

Steve

  • Like 1
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...