Jump to content
Drunkenclam

My attempt at basic signals

Recommended Posts

Drunkenclam

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.

signal.thumb.jpg.0b3e3a0db24386d64c3efe5e8bd5d875.jpg

 

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 by Drunkenclam
spelling
  • Like 3

Share this post


Link to post
Drunkenclam

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 by Drunkenclam
  • Like 4

Share this post


Link to post
JR 500系

Wow that's pretty neat~ Now you can have a load of these on your layout! Thanks for sharing! 

  • Like 1

Share this post


Link to post
Drunkenclam

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.

scheme.thumb.jpg.9b6c722347a40125d14e385c0a99086d.jpg

 

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.

 

1937270558_siganlboard.thumb.jpg.bda2d5fd5f1babe43487aa78a94827b0.jpg

 

During this stage lock down happened. Although I was still out working. Overtime plummetted and so did my pay packet.

 

Edited by Drunkenclam
spelling
  • Like 2

Share this post


Link to post
Drunkenclam

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)

 

20200603_083245_resized.thumb.jpg.b7035def6a28325a10f5217283935b23.jpg

 

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,

 

DSC00713.thumb.JPG.1661672295d63f612bc994ef71fd39c2.JPG

 

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)

 

DSC00708.thumb.JPG.f3beddac9029024dd81cbdc6774b3393.JPG

 

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.

 

DSC00712.thumb.JPG.fdde64dddcd6c1816208f8e68722d63c.JPG

 

 

DSC00711.thumb.JPG.eec640b1214063cda71c3dbf3132e019.JPG

 

And of course the hall sensors and 3 aspect signals. I'm still umming about painting the sensors a dark grey.

 

DSC00709.thumb.JPG.1e44e5d418edf320f82298f8bd9612be.JPG

 

DSC00710.thumb.JPG.a2a5861b7f52e0ccf994c9646a0b518e.JPG

 

Edited by Drunkenclam
  • Like 3

Share this post


Link to post
Madsing

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...😀

  • Like 1

Share this post


Link to post
inobu

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

 

  • Like 2

Share this post


Link to post
NX:

 

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)

 

20200603_083245_resized.thumb.jpg.b7035def6a28325a10f5217283935b23.jpg

 

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,

 

DSC00713.thumb.JPG.1661672295d63f612bc994ef71fd39c2.JPG

 

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)

 

DSC00708.thumb.JPG.f3beddac9029024dd81cbdc6774b3393.JPG

 

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.

 

DSC00712.thumb.JPG.fdde64dddcd6c1816208f8e68722d63c.JPG

 

 

DSC00711.thumb.JPG.eec640b1214063cda71c3dbf3132e019.JPG

 

And of course the hall sensors and 3 aspect signals. I'm still umming about painting the sensors a dark grey.

 

DSC00709.thumb.JPG.1e44e5d418edf320f82298f8bd9612be.JPG

 

DSC00710.thumb.JPG.a2a5861b7f52e0ccf994c9646a0b518e.JPG

 

 

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,

  • Like 1

Share this post


Link to post
NX:

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,

 

1377888249_hallNX.thumb.jpg.beae6e3dd3b8317f222b9e12b555d7be.jpg

  • Like 1

Share this post


Link to post
Drunkenclam

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. 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...