¿ªÔÆÌåÓý

Locked BD20 crossing signals


 

I am, as usual, seriously confusing myself. ?
I have double tracks and want to put on a crossing signal and mp3 player.
There are about 6 BD20s fitted on this section. They go to an AIU and then JMRI My Layout.
I have been trying to figure out how to connect a 5 volt relay to the BD20s. I am about to give up and just use ir sensors to operate an Arduino. This will work and I know I have the ability/skills to do it, but it is not ideal. I want the lights flashing no matter the speed of the locomotives but always when the track is occupied.
I thought a relay to the BD would work, sounds good, but I have just really confused myself. How do I send Logic to the AIU and the relay at the same time? How do I ground them, power them urgh.
Track detection in sensors on JMRI is working on my panel. Would it be possible to use this to send a signal to a dcc decoder or a relay or an Arduino?
Thanks
Richard, Tasmania


 

Richard,

On 10 Nov 2019, at 6:39 PM, Richard_vanRaay via Groups.Io <richard_vanraay@...> wrote:

Track detection in sensors on JMRI is working on my panel. Would it be possible to use this to send a signal to a dcc decoder or a relay or an Arduino?
Now you're thinking on a better track. (This topic started on the NCE DCC list.)

I'm sure it's not difficult to make JMRI send accessory decoder commands to turn on when any track is occupied and turn off when all are unoccupied. I'll leave that explanation to the PanelPro experts.

For hardware, I suggest a cheap NCE Light-It decoder. Configure it as a DCC Accessory decoder and it activates three LED outputs when ON. Instead of a normal LED, connect the internal LED of a cheap optocoupler chip and connect the optocoupler output to pull down an Arduino pin.

Better still, use a dual optocoupler chip, one coupler connected to the Y output and the Arduino, the other to the R output and your MP3 player. Leave the onboard White LED connected as a visual indicator.

Cheap and easy, but it looks like the minimum quantity for a Light-It is a 3 pack for ~$24. Even with that quantity and the optocouplers you'll have change out of $30 and you can find another use for the two spare Light-Its.

Dave in Australia


 

Thanks Dave, I have a Light-It decoder on hand and the thought did cross my mind that it could be tied in with JMRI to operate the Arduino, 5 volt relay, or 12 volt crossing signals.?

I don't comprehend a lot of your post. It is above my level of experience. I appreciate you trying to assist but think it might be best to just go with the IR sensors and the Arduino. I am comfortable there and that will still be a challenge coding/sketching. It is not ideal though. I really wanted to utilise the BD20s.

Thanks again
Richard


 

Richard,

Since JMRI has all the sensors, and can perform fancy logic as needed, use
it. Your task is picking what sort of output to trigger the lights/sounds.
Light-It can be configured in different ways. I would likely set it as a
signal head or accessory decoder. Granted this means it works via the track
outputs, so the commands have to go to the command station, so they get
relayed to the track bus for the device. But you could have it be the
cross-buck lamps directly. Then another Light-It output to an opto to
trigger the sound.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.org
www.syracusemodelrr.org


 

Richard,

On 10 Nov 2019, at 10:41 PM, Richard_vanRaay via Groups.Io <richard_vanraay@...> wrote:

Thanks Dave, I have a Light-It decoder on hand and the thought did cross my mind that it could be tied in with JMRI to operate the Arduino, 5 volt relay, or 12 volt crossing signals.
It can.


I don't comprehend a lot of your post. It is above my level of experience. I appreciate you trying to assist but think it might be best to just go with the IR sensors and the Arduino. I am comfortable there and that will still be a challenge coding/sketching. It is not ideal though. I really wanted to utilise the BD20s.
The circuit is trivial, a lot simpler than your IR Sensors and Arduino.

Buy a 10K Resistor and a 4N25/4N26/4N27/4N27/4N28 (whatever you can get). Ask Google for a pinout diagram.

- Connect pin 1 to the +5V pad on the Light-It.
- Connect pin 2 to the Y pad on the Light-It.
- Connect pin 4 to the Arduino GND.
- Connect pin 5 to the Arduino Input pin.
- Connect the 10K resistor between the Arduino +5V and pin 5 of the optocoupler.

Dave in Australia


 

I have arduinos reading BD20 directly.
Takes special code to set baseline and detect changes.
If the BD20 is already connected, use what it is connected to. Otherwise you will need separate BD20.
Thomas
DeSoto, TX


 

Thomas,

On 11 Nov 2019, at 10:20 AM, thomasmclae via Groups.Io <mclae5-lists@...> wrote:

I have arduinos reading BD20 directly.
Takes special code to set baseline and detect changes.
More complexity comes if you try to share the BD20 between an Arduino and an NCE AIU.

If the BD20 is already connected, use what it is connected to. Otherwise you will need separate BD20.
That's what we're suggesting. Use the already-defined sensors in JMRI and create logic to send on-off commands to the Arduino via an already-available NCE Light-It. It's simply a matter of connecting an optocoupler between any LED output of the Light-It and an Arduino input pin.

Needs someone with an Arduino to draw up the simple circuit diagram for Richard...

Dave in Australia


Steve Spence
 

here is an opto arduino input interface. connect V0 to a digital input.


Steve Spence, KK4HFJ



On Mon, Nov 11, 2019 at 7:27 AM Dave Heap <dgheap@...> wrote:
Thomas,

> On 11 Nov 2019, at 10:20 AM, thomasmclae via Groups.Io <mclae5-lists=[email protected]> wrote:
>
> I have arduinos reading BD20 directly.
> Takes special code to set baseline and detect changes.

More complexity comes if you try to share the BD20 between an Arduino and an NCE AIU.

> If the BD20 is already connected, use what it is connected to. Otherwise you will need separate BD20.

That's what we're suggesting. Use the already-defined sensors in JMRI and create logic to send on-off commands to the Arduino via an already-available NCE Light-It. It's simply a matter of connecting an optocoupler between any LED output of the Light-It and an Arduino input pin.

Needs someone with an Arduino to draw up the simple circuit diagram for Richard...

Dave in Australia





 

Dave and Ken. I have set up ?Light-It that is switching on and off through the PowerCab Accy. I have tested it to turn on an LED then a Nano. Success for me! It has an address of 555 .

I have connected a 4N25. I think this separates two circuits. The Nano does not light up anymore. Why do I need this??

I have researched and browsed through JMRI and looked through PanelPro, Option, Tables and gone through everything to try to work out where to go next.?
I guess I am moving forward.?
Thanks for your help.
I will reread the previous posts and keep trying to work out how to switch the Light-It through JMRI.


 

Richard,

On 11 Nov 2019, at 6:28 PM, Richard_vanRaay via Groups.Io <richard_vanraay@...> wrote:

Dave and Ken. I have set up Light-It that is switching on and off through the PowerCab Accy. I have tested it to turn on an LED then a Nano. Success for me! It has an address of 555 .
That's good but I suspect you haven't isolated the Nano from the DCC bus this time.

I have connected a 4N25. I think this separates two circuits. The Nano does not light up anymore. Why do I need this?
Richard, you need to draw a rough circuit of what you have done, photograph or scan it and upload it to a new album in the Photos area of this group.

Steve Spence tried to show you a suitable circuit but must have attached it to an email. Attachments are stripped. Steve, could you please upload it to a new album in the Photos area?

I have researched and browsed through JMRI and looked through PanelPro, Option, Tables and gone through everything to try to work out where to go next.
I guess I am moving forward.
Thanks for your help.
I will reread the previous posts and keep trying to work out how to switch the Light-It through JMRI.
No one has yet posted how to connect your Sensors to the Light-It pseudo-turnout you need to create (with an address of 555) in the Turnouts Table. I'm afraid I can't help there, but there are plenty of others who should be able to help you.

Dave in Australia


 

Thanks Dave, you are correct. When it lit the 4n25 was not connected.?
I have uploaded a drawing of the circuit so far.
A turnout, NT555, has beed created.
My gosh, th Light-It lights up when I click on State! ??
The Nano does not light up. It might be a loose connection?
Is the 4N25 there for the MP3 because it might be best if I just kept it simple and left the MP3 out of it for the time being?
Thanks very much Dave.?


Steve Spence
 


On Mon, Nov 11, 2019 at 12:01 PM Dave Heap <dgheap@...> wrote:
Richard,

> On 11 Nov 2019, at 6:28 PM, Richard_vanRaay via Groups.Io <richard_vanraay=[email protected]> wrote:
>
> Dave and Ken. I have set up? Light-It that is switching on and off through the PowerCab Accy. I have tested it to turn on an LED then a Nano. Success for me! It has an address of 555 .

That's good but I suspect you haven't isolated the Nano from the DCC bus this time.
>
> I have connected a 4N25. I think this separates two circuits. The Nano does not light up anymore. Why do I need this?

Richard, you need to draw a rough circuit of what you have done, photograph or scan it and upload it to a new album in the Photos area of this group.

Steve Spence tried to show you a suitable circuit but must have attached it to an email. Attachments are stripped. Steve, could you please upload it to a new album in the Photos area?
>
> I have researched and browsed through JMRI and looked through PanelPro, Option, Tables and gone through everything to try to work out where to go next.
> I guess I am moving forward.
> Thanks for your help.
> I will reread the previous posts and keep trying to work out how to switch the Light-It through JMRI.

No one has yet posted how to connect your Sensors to the Light-It pseudo-turnout you need to create (with an address of 555) in the Turnouts Table.? I'm afraid I can't help there, but there are plenty of others who should be able to help you.

Dave in Australia





 

¿ªÔÆÌåÓý

Steve and Richard,

On 11 Nov 2019, at 8:36 PM, Steve Spence <greentrust@...> wrote:

/g/jmriusers/photo/178838/0?p=Created,,,20,2,0,0

Thanks for that Steve. For the Light-It, R1 is not needed as there's already a 330 ohm series resistor on each of the LED outputs. A typical value for R2 would be 10K.

I think the problem is that Richard is trying to turn the whole Nano On or Off rather than simply monitoring ?an input pin.

I know almost nothing about the Arduino or what setup Richard is using for crossing lights so I'm not much help here...

Dave in Australia


Steve Spence
 

drive a mosfet with that isolator and the mosfet can power on/off the nano, but there's no need to do so, as the nano code can just sit in a loop until that i/o pin is active.


Steve Spence, KK4HFJ



On Mon, Nov 11, 2019 at 1:30 PM Dave Heap <dgheap@...> wrote:
Steve and Richard,

On 11 Nov 2019, at 8:36 PM, Steve Spence <greentrust@...> wrote:

/g/jmriusers/photo/178838/0?p=Created,,,20,2,0,0

Thanks for that Steve. For the Light-It, R1 is not needed as there's already a 330 ohm series resistor on each of the LED outputs. A typical value for R2 would be 10K.

I think the problem is that Richard is trying to turn the whole Nano On or Off rather than simply monitoring ?an input pin.

I know almost nothing about the Arduino or what setup Richard is using for crossing lights so I'm not much help here...

Dave in Australia


 

I greatly appreciate your help men but it is clear I am out of my depth again. I might just connect the crossing lights to a 12 volt supply and leave them on. That is the easiest way and will be fine.
I am very excited though to have the Light_It working when I press NT555 in PanelPro, Tools, Tables, Turnouts. Now that is working can I switch it on and off through ?block detector, sensor?

Thanks for trying to help. Sorry for taking so much of your time. I thought it might be a lot more straight forward.
Cheers,
Richard


 

Correct, the VCC connection should go to a digital pin instead. Such as pin 3.
VCC should go to 6V to 12V Auduino power supply. Always on.
The Arduino sketch should monitor the pin, and activate whatever logic when the pin changes. In my sketch, that would be flashing lights, say on pins 4 and 5, and sound module activation on pin 7.
You do not turn on your computer to run a program (usually).
Thomas
DeSoto, TX


 

Richard,

It sounds like making a Logix that will track those blocks around the
crossing and activate the Light-It when needed. Depending on the detector
wiring, like how long the blocks, does the crossing have an 'island' around
the gates, is it single track or multiple, etc... All of those come into
play.

Classic three block setup would also keep internal sensors for the state of
which direction. If the west block tripped first, you would set the west
direction and trigger the signal. Clearing the signal would be when all
blocks are clear OR west direction set and the east and island detectors
clear OR east direction set and the island and west detectors clear. There
are a couple of more statements needed, but this is the idea.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.org
www.syracusemodelrr.org


 

Thanks Ken, I fear you are flogging a dead horse. I really am out of my depth.?

I have a only a slight understanding of what you are saying. I have spent many, many, many, many hours trying to work out signals, masts, routes and it is way over my head. It is a shame as I really wanted to go there.

Can I start by getting the Light-It to switch on one block??


 

Richard,

Ok, one block active == Light-It on.

Open the table for Logix.
Create new Logix, hit the 'Add' button, click checkbox 'Automatically
generate system name, give it a user name "Crossing", push 'create' Logix.
Press "New Conditional", give it a name "One Block"
Click 'Add State Variable'
Select variable type 'Sensor', enter the name for the block sensor, leave
the 'active' for variable state.
Click 'Update'
Click 'Add Action'
Select action type 'Turnout'
Enter name for Light-It as a turnout
Select 'Action Type' as 'Set Turnout'
Select 'Turnout Position' as 'Closed'
Select 'Change Option' as 'On Change to True'
Click 'Update' in the 'Edit Action' window
Now repeat the last couple of steps to create another action but pick
'Turnout Position' as 'Thrown' and 'Change Option' as 'On Change to False'
instead
Click the 'Update' in the 'Edit Conditional'
Click 'Done' in the 'Edit Logix' window.

Note: you may have to reverse which uses 'Closed' and 'Thrown' depending on
the other wiring if it isn't right. Or you could change the action to look
for 'Inactive' instead of 'Active'. You have now made your first Logix.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.org
www.syracusemodelrr.org


 

Thanks very much Ken. I have been successful in making the Light-It switch when a locomotive enters the block!
I have connected the crossing lights directly to the Light-It and they are operating! I think this will not last long as the lights are 12v, and I want to add more crossing lights, perhaps it will damage the Light-It.
I will sit back and think about where to go next.
I am very pleased.

I greatly appreciate you all for taking the time and making the effort to help me learn.
Cheers
Richard