DCC++: How to connct reed-switches and how to define them

Moderator: Moderators

DCC++: How to connct reed-switches and how to define them

Postby peterha » 19.03.2017, 16:23

Hello,

I have just recently discovered DCC++ (so a big newbe) and I would like to use it with my (future) shuttle layout. This will be a small layout with 4 blocks and 1 turnout. I intend to start with 2 reed-switches per block (one for 'enter' and one for 'in').

On the motorshield I have connected pin 5 + 13 and pin 10 + 12. I have also tested it with the Diagnose-program; all works as it should.

In Rocrail I have created my (future) layout and this also works; but now 2 big questions: 1. how to connect the reed-switches and 2. how to define these sensors in Rocrail.

As I can see there are 10 pins IN available: 2, 4, 6, 7, 8, 9, A2, A3, A4 und A5. I have cut the connections in the Brake pads.

1. How to physically connect reed-switches to my Arduino Uno?
I have defined in Rocrail the above mentionned pins and sometimes when I simulate a reed-switch making contact by connecting GND and e.g. pin 4 then sometimes the sensor turns RED and sometimes not. When I then connect pin 4 to GND sometimes it turns OFF but sometimes also not. Hence, it is not so 'sensitive' that each connection triggers ON and/or OFF.
Is connecting a reed-switch from pin x to GND the proper way?

2. How to define these reed-switches/sensors/inputs?
When I go to Rocrail properties > Controller > dccpp > Properties > I/O then every time I click on the button 'Query' each time a different list of inputs appears. Why is this and what are these inputs? I did not add these sensors. So how can I add my sensors/inputs if there are already a whole bunch defined in Arduino? All lists are different....
Are these reed-switch inputs inverted or not?

3. Server window messages.
Also in the server window I get a timestamp with the message: 'Not OK!' and soon after that a message saying: '***READ TIMEOUT*** size=1 rc=0 read=0 errno=0 tries=100'.

I have tried several things but it does not make sense to me.

Can anybody help me, please?

Peter Hagenaars
You do not have the required permissions to view the files attached to this post.
Mac OS X
H0, N.S., TP-4
Digitrax, DCS200, DB200+, PM42, BDL168, DS64, SE8C.
peterha
 

Re: DCC++: How to connct reed-switches and how to define the

Postby rjversluis » 19.03.2017, 16:39

Hi Peter,

maybe this is your solution:
http://wiki.rocrail.net/doku.php?id=dcc ... en#g-ash02
in combination with
http://wiki.rocrail.net/doku.php?id=gca ... _interface

The UNO has limited Memory/IO and can come up with "Not OK" messages.
Better option is to use a Mega.
Best Regards, Rob.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: DCC++: How to connct reed-switches and how to define the

Postby peterha » 20.03.2017, 11:41

Hi Rob,

Thanks for the links, but I already had looked at these items.
For now I intend to experiment on a low cost basis to get the hang of it, so many later.

The Arduino Uno has indeed only a few pins available, that's why I already have ordered an Arduino Mega.
More pins means more fun....

Peter
Mac OS X
H0, N.S., TP-4
Digitrax, DCS200, DB200+, PM42, BDL168, DS64, SE8C.
peterha
 


Return to Installation

cron