Yavaris Forge Posted October 1, 2020 Share Posted October 1, 2020 Hello there, I acquired some cheap signals on Ebay for my layout and now I'm not sure how to operate them. Basically it would be enough if I had a switch that when I press it changes the color of the signal (green - red - yellow - yellow/green). I don't necessarily want to use an Arduino with sensors or something else as it would be enough for me to just switch the signals by hand. Is there an easy way to do this? Link to comment
cteno4 Posted October 1, 2020 Share Posted October 1, 2020 You are going to need some sort of a logic circuit if you want to make the lights cycle thru the colors with repeated presses of the signal button. I’ve not see a premade or even a plan for this sort of hardware ic circuit but it’s possible to do something like this in hardware ic plans may be out there, but then you will need to breadboard the appropriate circuit. Arduino is of course a more flexible solution with little roll or no your own hardware but will need programming to make it so. Arduino Nano’s are like $2 and can directly control a half dozen leds and take a push button input. Pretty simple program and the just clone he whole thing for each one if you want simplest. jeff Link to comment
Yavaris Forge Posted October 1, 2020 Author Share Posted October 1, 2020 (edited) Thanks for your answer! Maybe i should get a bit into programming Arduinos then. I don't know how many ports a nano has but maybe i can hook up two or three switches and control two signals at once. Edited October 1, 2020 by Yavaris Forge Link to comment
NXCALE Posted October 1, 2020 Share Posted October 1, 2020 4 hours ago, Yavaris Forge said: Hello there, I acquired some cheap signals on Ebay for my layout and now I'm not sure how to operate them. Basically it would be enough if I had a switch that when I press it changes the color of the signal (green - red - yellow - yellow/green). I don't necessarily want to use an Arduino with sensors or something else as it would be enough for me to just switch the signals by hand. Is there an easy way to do this? Signals look always great in layouts! The switch, that you just mentioned, sounds like a good option. So, LED, resistor and switch in series Cheers, 1 Link to comment
Yavaris Forge Posted October 1, 2020 Author Share Posted October 1, 2020 Yes that sounds like a good idea but to rotate through the different signal colors with just one switch you would need at least some bit of a micro controller as far as i know. I don't want a switch for each individual LED. I've now ordered an Arduino Nano to test how that works out. Link to comment
Madsing Posted October 1, 2020 Share Posted October 1, 2020 Using an Arduino Nano is the best option. https://www.teachmemicro.com/arduino-nano-pinout-diagram/ It has 14 (D0 to D13) plus 8 (A0 to A7) GPIO pins. Don’t use D0 and D1 as they are also used to communicate with the PC. That leaves you with 20 pins for the signal LEDs and the switches or sensors to control them. 2 Link to comment
cteno4 Posted October 1, 2020 Share Posted October 1, 2020 Ah I forgot you can use the second bank as well! I remembered two were reserved for serial. i like the nano, I messed with it a few years back but put lighting automation aside for now as one too many projects! but simple setup for a beginner project and an all in one solution. jeff 1 Link to comment
matt_d10 Posted October 3, 2020 Share Posted October 3, 2020 Ive just started playing with arduinos and have set up an uno to detect a passing train, change a LED to red and then back to green again when the block is clear. it’s very satisfying teaching yourself basic code and seeing the results! There are loads of tutorials online and you could probably just borrow ideas from them. In it’s simplest form you could set the signal to red with a button and it could cycle back through based on a time delay? Look forward to seeing how you get on! 2 Link to comment
NXCALE Posted October 3, 2020 Share Posted October 3, 2020 13 hours ago, matt_d10 said: Ive just started playing with arduinos and have set up an uno to detect a passing train, change a LED to red and then back to green again when the block is clear. it’s very satisfying teaching yourself basic code and seeing the results! There are loads of tutorials online and you could probably just borrow ideas from them. In it’s simplest form you could set the signal to red with a button and it could cycle back through based on a time delay? Look forward to seeing how you get on! Which sensor are you using? Cheers. Link to comment
matt_d10 Posted October 4, 2020 Share Posted October 4, 2020 10 hours ago, NX: said: Which sensor are you using? Cheers I’m using reed switches and very small magnets under the train. Mainly because I had them to hand, but the system works as intended. IR may be a better long term solution. 1 Link to comment
maihama eki Posted October 4, 2020 Share Posted October 4, 2020 If you want simple, you could wire it up to a 3 position slide or toggle switch (SP3T). I don't know how your signal is wired out, but I assume there is either 3 wires for each light and a common or 3 pairs of wires. Link to comment
Yavaris Forge Posted October 4, 2020 Author Share Posted October 4, 2020 I'll try to do it with an Arduino first, maybe I'm going to use some sensors in the future too. If that fails these switches really are a good solution in my opinion. But the ones I found online are more expensive than an Arduino Nano.😅 Link to comment
NXCALE Posted October 4, 2020 Share Posted October 4, 2020 3 hours ago, maihama eki said: If you want simple, you could wire it up to a 3 position slide or toggle switch (SP3T). I don't know how your signal is wired out, but I assume there is either 3 wires for each light and a common or 3 pairs of wires. 2 hours ago, Yavaris Forge said: I'll try to do it with an Arduino first, maybe I'm going to use some sensors in the future too. If that fails these switches really are a good solution in my opinion. But the ones I found online are more expensive than an Arduino Nano.😅 A switch is a simple and good solution. However, probably arduinos are a best fit since they are more versatile. If you want to try something unnecessary complex and fun, you could play with some 555 timer module and relay modules (i.e. latch and unlatch relay). Modules cost more but it is interesting to think and find the way of achieving the signal functionality with relays. 1 Link to comment
Yavaris Forge Posted October 6, 2020 Author Share Posted October 6, 2020 Okay so the Arduino arrived yesterday and i hooked it up to my PC today to see if it works. The standard test program where the onboard LED is blinking works fine but so far i haven't been able to put together a circuit with spare LEDs i had laying around. I will have to do some proper research on Arduino basics😅. 2 Link to comment
Yavaris Forge Posted October 21, 2020 Author Share Posted October 21, 2020 Finally some new progress! I had a few exams coming up and didn't have much time for other stuff but today I hooked one of my signals up to the arduino and got it working. I wrote a rather simple program with some delays so the signal is now changing its color. Next step would be to add a button to simulate a sensor on the track. I still haven't figured out how I am going to control the signal. I could just use a button and press it when the train drives by but that is going to get annoying I guess. So the easiest would be to place sensors on the track but i don't know if there are any sensors that don't involve magnets under the train or housings to hide light barrier diodes. Funny how i said in the beginning of this thread how i didn't necessarily wanted to use an arduino and here I am thinking about sensors and stuff😅 Link to comment
cteno4 Posted October 21, 2020 Share Posted October 21, 2020 You can use a photoresistor in the roadbed looking up to sense. Works well except if you want night running. You can even have a loop to check the Phototresistor level at startup to set the open state and then look for resistance increase for a trigger. This way room light level does not matter (except of course dark!) cheers jeff 2 Link to comment
Madsing Posted October 21, 2020 Share Posted October 21, 2020 I’d recommend using an infrared sensor with its LED integrated in a module such as the TCRT5000 (search for it on AliExpress for exemple). The output can be directly connected to the Arduino. A while ago, I used two of them to make a speed measurement sensor (described here: https://shin-yukari.weebly.com/blog/train-speed-measurement), they work very well. 3 Link to comment
Yavaris Forge Posted October 22, 2020 Author Share Posted October 22, 2020 Thanks you two! @MadsingThis should work in the dark as well because on LED emits light and the other detects it, right? So maybe i can build it into the trackbed so i won't need some kind of housing to hide it. Given that these things are quite cheap I'll buy one and when that arrives in a few weeks I'm gonna test if it works for me. Link to comment
Madsing Posted October 22, 2020 Share Posted October 22, 2020 Yes. Correct. I confirm that this IR sensor works equally well in the dark. I have not tried to insert it into the track (between sleepers) because I wanted to use it on an elevated track, but this must be possible too. 1 Link to comment
NXCALE Posted January 8, 2021 Share Posted January 8, 2021 On 10/22/2020 at 11:41 PM, Yavaris Forge said: Thanks you two! @MadsingThis should work in the dark as well because on LED emits light and the other detects it, right? So maybe i can build it into the trackbed so i won't need some kind of housing to hide it. Given that these things are quite cheap I'll buy one and when that arrives in a few weeks I'm gonna test if it works for me. How did it go? 1 Link to comment
Yavaris Forge Posted January 10, 2021 Author Share Posted January 10, 2021 I was busy doing other stuff and I have to admit that I lost track of the project. I will look into it again in the next few days. Link to comment
Yavaris Forge Posted January 11, 2021 Author Share Posted January 11, 2021 So I tested the sensor today and found out that the infrared light it emits doesn't get reflected from the underside of my models as well as I hoped it would be. Could have thought about that beforehand actually. But it does work most of the time. I will test it with the rest of the fleet when I actually build it into the layout. The easiest way now would be to attach the signal to the digital outputs of the arduino. My signals, however aren't wired right for the use on arduino as they have a common anode and different cathodes and that doesn't work with digital pins. So I will have to work around that with the analog pins as I did some time ago. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now