Model Train-related Notes (a.k.a. “blog”) -- these are personal notes and musings on the subject of model train control, automation, electronics, or whatever I find interesting.

2019-09-29 - NCE AIU and NCE EB1 Circuit Breakers

Category Train

One issue I have on the Randall layout is that operators or automation sometimes short the layout. Then the NCE EB1 circuit breakers take over and of course shut down their corresponding power district. Then operators or staff ask me why things do not work, yet a lot of them fail to check the circuit breakers to see if they are shorting.

One idea I had a while ago was to use an NCE AIU to monitor the NCE EB1 circuit breakers. Then I could feed that into my automation software and get reporting of actual shorts right on my status web page.

The proposed solution is:

  • HCPL2630/TLP2630 optocouplers
  • TLP2630 = Toshiba (direct download datasheet).
    • IF max is 20 mA. Recommended input current is 6.3 - 20 mA. May want to reduce to 10 mA for continuous usage.
  • The EB1 doc indicates a LED (-) should be on terminal pos 4 (outer side) and thus logically the (+) on the inner terminal pos 3. Contrary to what the EB1 doc says, on the EB1 I took to experiment with, Terminal 3 (inner, lower) is LED -, and Terminal 4 (outer, lower) is LED +.
  • The on-board LED and the external LED terminal are connected to what looks like a PIC 12F683 (pdf link) on what looks like Pin 7 (GP0). The on-board LED is connected between that same pin and Vdd (positive power supply) [Reminder: Vss=Ground, Vdd=+Voltage]. Thus keeping GP0 low would by default light up the LED (which seems to be the default behavior).
  • The TLP2630 optocoupler works as an inverter.
  • EB1 is ON by default (no short) ⇒ Opto output = Low ⇒ AIU bit == 0.
  • According to the EB1 doc: “300Ω 5 V”  = 17 mA.

There is one design question here. The EB1 don’t just “turn off” the status LED, they have it blinking as a short is detected. Being a self-reset device, the EB1 just keep trying to re-apply power every few seconds. Thus the status LED blinks, which is a nice side effect allowing for easier visual identification. However the NCE cab bus has a rather pathetic refresh rate for these AIU01 cards, so it could well be that it may miss the “blinking” part of the sensor -- that is exactly the issue I had with missed button presses last year. This needs to be identified and tested first. If that’s an issue, it can be solved by just adding a capacitor on the output.

This is the TLP2630 optocoupler I plan to use:

For testing I can also use the 6N137 optocouplers I have around (basically the same as the 2630, but only one per chip). These are “open drain” meaning they need a pull up and when on; they actual drain to ground. This actually works perfectly with the NCE AIU which provides such 10k pull-ups.

Two EB1 are connected to each opto-coupler (preliminary notes based on schema, to be verified):

  • EB1 #1 terminal 4 (outer) = LED+ ⇒ 200Ω ⇒ Opto pin 1 // pin 7 ⇒ AIU pin 1
  • EB1 #1 terminal 3 (inner) = LED- ⇒ Opto pin 2
  • EB1 #2 terminal 4 (outer) = LED+ ⇒ 200Ω ⇒ Opto pin 4 // pin 6 ⇒ AIU pin 2
  • EB1 #2 terminal 3 (inner) = LED- ⇒ Opto pin 3
  • Opto pin 8 Vcc to AIU +5V from 7805
  • Opto pin 5 GND to AIU GND

AIU01 address: 62

JMRI Address / Number = (AIU01 address - 1) * 16 + (AIU01 input - 1)

JMRI Address from 976 (62:1) up to 989 (62:14), included.

Mapping from NCE AIU to EB1 (or others):

JMRI address

AIU pin

EB1

Optocoupler

976

1

P1 V1

O1 pin 1+2⇒7

977

2

P1 STKYD

O1 pin 3+4⇒6

978

3

P2 V2

O2 pin 1+2⇒7

979

4

P2 NAPA

O2 pin 3+4⇒6

980

5

P2 TOWN LODI

O3 pin 1+2⇒7

981

6

P2 FAIRFIELD (*)

O3 pin 3+4⇒6

982

7

P3 MTN

O4 pin 1+2⇒7

983

8

P3 BRN RCH-2

O4 pin 3+4⇒6

984

9

P4 MTN-2

O5 pin 1+2⇒7

985

10

P4 BRPORT

O5 pin 3+4⇒6

986

11

P4 SIA RND

O6 pin 1+2⇒7

987

12

P4 STK STN (*)

O6 pin 3+4⇒6

988

13

O7 pin 1+2⇒7

989

14

O7 pin 3+4⇒6

Now the AIU has 2 terminals of 8 positions (1 GND + 7 inputs). I’d like to find 7 or 8-wire ribbon cables and use that to connect a little board containing all the optocouplers to the AIU and attach them both together. I should look at old floppy or ATA ribbon cables that I have around.

Originally I was going to use AIU inputs 13 and 14 to monitor mains voltage. One for the layout mains, and the other for the DCC switch. But since this AIU will be read by the PC that is powered by the DCC switch, there’s little point. They would always be on. Still I should wire optocoupler #7 in case I want to add 2 inputs later.

(*) EB1 for P2 Fairfield does not exist yet, and my original plan was to mount it next to Fairfield, not by the DCC command station. I may revisit this and place it with the other EB1s for consistency.

(*) EB1 for P4 Stockton Station does not exist yet, however the plan is to have it with the other EB1s.


 Generated on 2020-01-27 by Rig4j 0.1-Exp-febf662