Drunkenclam Posted June 27, 2020 Share Posted June 27, 2020 (edited) I'd like to point out at the start of this that I am certainly no expert. But I read tutorials and modify what I see for my own purposes. I'm sure others with more knowledge and skill would do it another or better way. So I saw these 2 and 3 aspect signals whiilst browsing YJA. (I have now also seen the on ebay as well) Pre wired with common anode. So I ordered a couple of sets. First I set one up on the bread board with a hall effect sensor to detect the magnetic field of the train motor passing over to trigger the sensor and an arduino uno with a basic program to trigger the light pattern. signal code.txt I did run into a little problem in that some of the pins didn't like being set low to drive the LED and had to do a little swapping around. Here's the first sucessful attempt. Edited June 27, 2020 by Drunkenclam spelling 4 Link to comment
Drunkenclam Posted June 27, 2020 Author Share Posted June 27, 2020 (edited) Next I tried it with a sensor and test track with different trains This had limited success, (otherwise know as a failure) This is also in another thread from last year. But putting small earth magnets on the bottom of the train cured this issue. Edited June 27, 2020 by Drunkenclam 5 Link to comment
JR 500系 Posted June 27, 2020 Share Posted June 27, 2020 Wow that's pretty neat~ Now you can have a load of these on your layout! Thanks for sharing! 1 Link to comment
Drunkenclam Posted June 27, 2020 Author Share Posted June 27, 2020 (edited) My original idea is to use the 3 aspect signals on the main lines with the simple red, yellow, green done by a time delay and the 2 aspect signal on my single track local lines. showing if the line or station platforms are blocked. red or green. If I want to to do this I want it a lot neater than this. Like a circuit board with the arduino on it and I just need to connect the signals and track sensors. Then change the arduino progam to suit locations. For this I want a custom board. Now in all my years repairing auto doors I have seen some badly designed boards (from a user point of view) with limited connections and power to run all the sensors. Like having to try to squueze 8 wires in a terminal meant for 1 or 2. So taking this into account I wanted each sensor and signal to have its own power connection. The program I use for circuit board design is a free program called Kicad. You start by designing the schematic of your project. Then you assign a circuit board footprint to your components (here it is very easy to make a mistake) Next you place all the components and try to route the connections. (the old version of Kicad had an auto route function, but for some reason it was removed on the latest version. But they do link you to another program that will do it for you. called free routing) Here is an image of the schematic. Its a little over the top, But I hope in future it might make life easier if something unexpected crops up The top LH is a voltage regulator with AC/DC input power up to 30V. being converted to a 5V DC supply. The block of identical components is the connections for each of the 6 track sensors. This includes a jumper connected to the sesnor input that can pull the signal either high or low. Then the main part in the middle is the output for 7 LEDS spilt of 3 connections with a current resistor in place. This is driven by a darlington array thats controlled by the arduino nano. Although probably not needed for this. It helps reduce the power load on the arduino. It also removes the strange glitch I was getting when trying to give a low signal to switch the LED on. After running it through the auto route and moving componnets around, trying to make it as small as I could. (reduces production costs), then remembering to put some mounting holes in it. I have the finished design. I added graphics to the board to assist in wiring and connections. Those with a keen eye will spot. That I labelled the signal outputs as + R G Y This was on purpose so I only need a 3 pin plug for the 2 aspect signal. During this stage lock down happened. Although I was still out working. Overtime plummetted and so did my pay packet. Edited June 27, 2020 by Drunkenclam spelling 2 Link to comment
Drunkenclam Posted June 27, 2020 Author Share Posted June 27, 2020 (edited) So I sent the pcb designs as generated by Kicad off to a manafacturer in China and they were made in about 3 days. 2 weeks later they arrive at my door. They have a minimum order of 5 boards. I now wished I ordered 6. But I'll be safe in case this doesn't work. (from past experience its easy to make and miss a silly mistake) Now I have them, I now find slight issues. First is I designed these to have the same socket and connectors we have on our equipment at work. Then I found out who expensive they are. taking into account I'll need 30 3 pin sockets. 5 2 pin sockets and 10 6 pin sockets. These don't come with plugs either, so they need to be ordered. Lucky for me I already had the power barrel jack and screw connectors at home. So there is some saving there. Next is that jumper per sensor that pulls the sensor signal high or low. To save space. i went for the 1.27mm pitch pins. Now I see them. I don't know if I'm skilled enough to solder that close togehter, But I have started putting components on the boards. All the resistors and diodes are on. I'm waiting on delivery of the darlington arrays and bridge rectifer. (I hope today) In the mean time. I have started putting sensors in track. For stationary trains in the station. I have used a photo reflector instead of the hall sensor. These need a current limting resistor. But I can squeeze that and the sensor under the track. And of course the hall sensors and 3 aspect signals. I'm still umming about painting the sensors a dark grey. Edited June 27, 2020 by Drunkenclam 4 Link to comment
Madsing Posted June 28, 2020 Share Posted June 28, 2020 Well done. That’s what Arduinos are made for! And it’s so good that we can now get PCBs manufactured in a few days for a few dollars...😀 1 Link to comment
inobu Posted June 28, 2020 Share Posted June 28, 2020 DClam, I know you are deep into the project but a Raspberry PI with JMRI will move you ahead by leaps and bounds. You can load it with JMRI and use the GPIO pins to drive the LEDS. JMRI has its signaling logic built in and you can make the association to the GPIO pins via a sensor table. From there you can build your graphical display of your layout in Panel Pro. Inobu 2 Link to comment
NXCALE Posted June 29, 2020 Share Posted June 29, 2020 On 6/27/2020 at 8:07 PM, Drunkenclam said: I'd like to point out at the start of this that I am certainly no expert. But I read tutorials and modify what I see for my own purposes. I'm sure others with more knowledge and skill would do it another or better way. So I saw these 2 and 3 aspect signals whiilst browsing YJA. (I have now also seen the on ebay as well) Pre wired with common anode. So I ordered a couple of sets. First I set one up on the bread board with a hall effect sensor to detect the magnetic field of the train motor passing over to trigger the sensor and an arduino uno with a basic program to trigger the light pattern. signal code.txt 2.14 kB · 1 download I did run into a little problem in that some of the pins didn't like being set low to drive the LED and had to do a little swapping around. Here's the first sucessful attempt. Great project! Working signals give something special to a layout. Btw, nice "signal code" using millis() On 6/27/2020 at 8:25 PM, Drunkenclam said: Next I tried it with a sensor and test track with different trains This had limited success, (otherwise know as a failure) This is also in another thread from last year But putting small earth magnets on the bottom of the train cured this issue. earth magnets is the way to go... they solve all "magnetic problems" in projects... hahaha On 6/27/2020 at 9:54 PM, Drunkenclam said: So I sent the pcb designs as generated by Kicad off to a manafacturer in China and they were made in about 3 days. 2 weeks later they arrive at my door. They have a minimum order of 5 boards. I now wished I ordered 6. But I'll be safe in case this doesn't work. (from past experience its easy to make and miss a silly mistake) Now I have them, I now find slight issues. First is I designed these to have the same socket and connectors we have on our equipment at work. Then I found out who expensive they are. taking into account I'll need 30 3 pin sockets. 5 2 pin sockets and 10 6 pin sockets. These don't come with plugs either, so they need to be ordered. Lucky for me I already had the power barrel jack and screw connectors at home. So there is some saving there. Next is that jumper per sensor that pulls the sensor signal high or low. To save space. i went for the 1.27mm pitch pins. Now I see them. I don't know if I'm skilled enough to solder that close togehter, But I have started putting components on the boards. All the resistors and diodes are on. I'm waiting on delivery of the darlington arrays and bridge rectifer. (I hope today) In the mean time. I have started putting sensors in track. For stationary trains in the station. I have used a photo reflector instead of the hall sensor. These need a current limting resistor. But I can squeeze that and the sensor under the track. And of course the hall sensors and 3 aspect signals. I'm still umming about painting the sensors a dark grey. Nice design of boards. I was working on my signals lately (until I got busy at work and purchased a new board game and borrowed some videogames...) and an idea is to use the hall sensors as "to detect the entry and exit of a train on each track section. That is, a sensor at the entry and another at the exit. In that way , signals do not be just timed but it will really show if a train is in that section of the track. Later you could work your way to implement a bit of interlocking among signals and points. I made a test and it works (i.e. sensing the entering and exit of the train in a track section) hall NX.txt This draft example only shows how hall sensors work with a counter so the above can be achieved. I think I will come back to work on my project. Those last pictures of the signal next to the tracks are looking good. Cheers, 1 Link to comment
NXCALE Posted June 30, 2020 Share Posted June 30, 2020 I was being interrupted while writing my last post so I forgot to ask: what sensor model are you using? This because I tested the 3144 hall sensors placed under Tomix track and they work without the need of cutting/modifying the track. To activate the sensors, I use earth magnets attached under a train. Cheers, 1 Link to comment
Drunkenclam Posted June 30, 2020 Author Share Posted June 30, 2020 I'm using the A3213 omipolar sensors. It's useful to know they read through the track. Although I think they look cool being viable 😁 I will also be using the sensors to check if the single sections of track are clear or occupied. Which will be fun coding. 1 Link to comment
Drunkenclam Posted July 7, 2020 Author Share Posted July 7, 2020 A few little parts turned up. So got a little.done. but did find a big boo-boo on my part. It seemed that when I did my plan for the bridge rectifer to convert to DC. I put down the wrong footprint. As the pins don't line up. Something to do with a dil-4 footprint but the component fits a dil-6 with no middle pins. As a stop gap. I got some dil 6 sockets and soldered the middle pins to one end and can plug the component straight in. So if I get some more made. I'll alter the footprint. Change the plug and socket connectors for screw terminals the add 2 optocouplers so if blocking can send a signal to the next/previous board. 1 Link to comment
Drunkenclam Posted August 25, 2020 Author Share Posted August 25, 2020 Well. I had a clear out of some things on ebay and spent some of the money on components. So all boards now built. Just got to finish off putting the sensors to track and start the coding. 7 Link to comment
Drunkenclam Posted September 3, 2020 Author Share Posted September 3, 2020 Finally got my nano clone to work. Lots of articles online about installing or updating the bootloader. But they all seem to miss a step. But got my one and only nano (at the moment) to accept a sketch. I went for the easy one of the time delay 3 aspect signal. Running off a 12vdc power supply. I'll get a few more nanos and start the more complex code of the single branch line to the station with 2 platforms. 5 Link to comment
Drunkenclam Posted September 13, 2020 Author Share Posted September 13, 2020 In the above video. I duplicated the code with a 1 or 2 suffix to enable 2 channels. 3ASIGx2.txt This made the code rather bulky and messy. So I rewrote it using the array function. Which shortens it. If any of you can see any improvements, Please let me know. But be kind 😄 3ASIGx2ver2.txt I had fixed the board to the underside of the layout and connected it up to the sensors and signals already in place. For my shame. I haven't run any trains in quite a while. So I only cleaned on set of rails for testing. To top it off, I couldn't find where I put my magnets. So what you see here is just the magnetic field from the motor in car 6 causing the signal to change. If I put a magnet in every other car/ Then the delay sequence doesn't start till the last magnet has gone by. Here it starts to change whilst the train is still going through. Also my station isn't long enough for the full 11 cars. So this is just for effect 😄 3 Link to comment
NXCALE Posted September 16, 2020 Share Posted September 16, 2020 On 9/14/2020 at 4:08 AM, Drunkenclam said: I couldn't find where I put my magnets. So what you see here is just the magnetic field from the motor in car 6 causing the signal to change. If I put a magnet in every other car/ Then the delay sequence doesn't start till the last magnet has gone by. Here it starts to change whilst the train is still going through. Perhaps you can place the magnet on each end of the train. Then, you can modify the code so after a sensor is activated, that sensor is disable for some period of time, this to prevent picking up the motor's field or the magnet at the other end of the train. You can calculate or find the "disabling time" by checking how many seconds your longest train take to fully pass the signal. 1 Link to comment
NXCALE Posted January 8, 2021 Share Posted January 8, 2021 On 9/14/2020 at 4:08 AM, Drunkenclam said: any update on this one? Cheers Link to comment
Drunkenclam Posted January 9, 2021 Author Share Posted January 9, 2021 Not yet. Despite everything. I've been busy at work and trying to get the houses in with LEDs 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