HY-M154/PC817 module not working as expected

Hi,

To control my railway I use a module from Tams-Elektrinik, called WRM-4 - 4 fold turnout detector.
WRM-4-a

The connections are shown in the next picture:
WRM-4

I don't wont to connect a led on A1a , A1b, A2a, A2b, A3a, ... and so on, but I want to get the signal into my Arduino to control and track the trains.

As the WRM-4 module has an output of +/- 20v (measured) I can't connected it directly to the Arduino. So I try to use an optocoupler.
Here pin assignment of the WRM-4 module.

The optocoupler is the module HY-M154 or 817 module, also known as PC817 as shown here.

Inputs of 817 module

  • IN1
  • G1 (further mention as IG1)
  • IN2
  • G2 (IG2)
  • IN3
  • G3 (IG3)
  • IN4
  • G4 (IG4)

Outputs of 817 module

  • V1
  • G1 (further mentioned as OG1)
  • V2
  • G2 (OG2)
  • V3
  • G3 (OG3)
  • V4
  • G4 (OG4)

The WRM-4 module delivers on RL (X2/3) a "reverse conductor for the outputs). I don't understand this 200%, But when I measure the current between RL and 1 of the A1a, A1b etc, I got the +/-20V.
Important the RL = the "+" and the AXy is the "-".

So I have to connect the WRM-4 - RL to the 817 module IN1, IN2, IN3 and IN4.
the WRM-4 A1a goes to IG1 and so on.
Here the complete list of connections

WRM-4 - 817 module

The problem is no that the Optocouplers on the 817 module goes to high/active/ closed (I don't know how to call it) the led is on, When the WRM-4 RL (+ Voltage) is connected to the IN1.
Even when the A1a is not on.

Resulting that all the 4 ports are on.

I would expect to connect the WRM-4 RL to the Gnd of each input in the 817 module and the A1a, A2a, A3a, A4a, each to 1 input of the 817 module. But that's not working. (probably --> Reverse conductor for the outputs)

Who can Help ?

Thanks

Are you measuring DC voltage (using a voltmeter), or AC voltage? I ask because both the transformer and the WRM-4 module show a designation of ~|+.

Not sure if this is a DCC system or the old-style AC transformer, but the "~" symbol makes me think this is an AC voltage, and the +|- symbols are just there so you can have a common "ground" side that goes round your track, while the "+" side is transferred to the "hot" rail via the switches.

The 817 modules will only respond to DC signals, so if you're interfacing to this using AC, this isn't going to work.

Can you connect an LED between both rails on a known-hot section of track (maybe with a 10K resistor on one LED leg) and get it to light up? If not, you're dealing with AC.

I use AC voltage for the switches (or turnouts). They won't work with DC voltage.

That's correct, The A1a, A2a, A3a and A4a of the WRM-4 module is a DC signal.

With my 817 modules the IN grounds, you have named them IGx, are all tied together. If thats the case with yours, the effect is obvious.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.