Skip to main content

I have reached the point in the construction of my layout where I know my track plan isn't going to change. I am now ready to start adding signals to my layout. My plan is to use an arduino uno, a small programmable micro controller, to detect trains passing over an infrared sensor. Hopefully, this will be easier to execute and cheaper than the traditional method of using insulated track section to power a signal. I already wrote a code for the system, what I need is a simple LED two aspect signal (green and red) to connect to the micro controller. Does anyone know where I can find such a signal or how i could build one myself.

 

-skinorth

 

 

Original Post

Replies sorted oldest to newest

Skinorth -

 

I also use an Arduino for train control, though I built an interface board to read third-rail sensors via the SPI interface.

 

What I did for signals was cannibalize modern MTH signals; remove the control board and you can control the LEDs directly.

 

However, they are 3-aspect signals, and the wiring is a little funky because of the way the LEDs are connected. But you can get RGY signaling with three wires total.

Last edited by Professor Chaos
Originally Posted by skinorth:

Also, I saw the signals mentioned above for sale on ebay. Does anyone know if the seller is reputable. I don't want to spend money on something I will never recieve.

With almost 42,000 transactions and a 99.9% rating, I think you are safe. I have ordered electronic stuff from this supplier as well as other like suppliers from China without ever having a problem, so far anyway. In fact I had a bad item from one and they immediately sent me another, no questions asked and they didn't even have me return the bad part. Pretty good service, probably much better than most ebay sellers.

 

Also you might check this thread: Which would you prefer of these three choices? 

It's possible that Inginerio No1 may be offering some single lamp signals sometime in the future?

 

I too am interested in Arduino and would like to see the progress on your project, please keep us updated as you progress. I think others here would have interest also.

Last edited by rtr12

** my last post had some unnecessary variables in the code

 

If anyone is interested here is the code I wrote. I am substituting an infra red reflector for a photo-resistor. The formatting is a bit strange since I copied and pasted it.

 

void setup()
{
Serial.begin(9600);
int photo = A1;
pinMode(photo,INPUT);
int Clear = 5;
int Block = 3;
pinMode(Clear, OUTPUT);
pinMode(Block, OUTPUT);
}

void loop()
{
int Clear = 5;// green led
int Block = 3;// red led
int photo = A1;
int photovalue = 0;// set value to zero
photovalue = analogRead(photo);// read photoresistor
Serial.println(photovalue);// print value to screen
delay(100); // the number of milliseconds between readings


if (photovalue < 30)// train is over sensor
{
analogWrite(Block, 255);// turn red led on
analogWrite(Clear, 0);// turn green led off
delay(10000);// wait 10 seconds, this acts as a delay that keeps the signal red when the train has passed
}

else
{
analogWrite(Block, 0);// red led off
analogWrite(Clear, 255);// green led on
}
}

Last edited by skinorth
Post
×
×
×
×
Link copied to your clipboard.
×
×