CSXT1534

So, I posted awhile ago about my quest to begin signaling and detection on my current 12x24' Phase 1 Yard and mainline part of my railroad. I decided to go with a Arduino set-up and couple it into JMRI/CMRI and make the entire thing 1 big dispatched piece. I thought it would be easier at this stage doing this versus trying to build the entire road then coming back. I've been working on detection, and have it a bit of a road block. Some people like to use IR sensors with their detection and while I like the concept, I think it's going to be too much to install a billion IR sensors all over the railroad. So, I started looking thru the Little Wicket Railway YT videos again, and he mentioned current detection kits made by MERG (Model Electronic Railway Group). I looked into joining, but at $40 USD for the membership, plus the $10+ to buy the kit I need, I just don't see a justification. I have an NCE system, and their BD20 current detectors are roughly $20 a piece. 

I also came across DIY and Digital Railroad's own current detector, and while I like his design, I'd like to incorporate it into JMRI/CMRI and that wasn't really covered. I did however, come across these on eBay:

 

Now, these already couple into Arduino and it looks very much like a NCE BD20. I think I want to try these and see if they would work for what I want to do with detection.

Reply 0
Jim at BSME

Build your own

I have tried these in HO, but have not been successful, I believe they are not designed for the DCC frequency of 8KHz, the only youtube video (

) I have seen where they work is with standard 50/60Hz AC.

You can see Jimmy from DIY and Digital Railroad tried these here:

, and could not get it to work reliably. Jimmy did make a current sensor from scratch here:
, I believe it uses the same current transformer that is on the board you have pictured.

- Jim B.
Baltimore Society of Model Engineers, Estd. 1932
O & HO Scale model railroading
Check out BSME on: FacebookInstagram
Reply 0
Terry Chamberlain jterryc

Using the ZMCT103C Current Transformer

These Chinese current transformers operate at 1000:1 ratio compared to the more usual 300:1 ratio transformer used on the NCE BD20, for example. This means that they are less sensitive, particularly as regards the relatively low currents involved in DCC block detection.

However, they are widely available from many suppliers on AliExpress at an attractive price (especially since 300:1 current transformers are almost impossible to obtain at the moment from US or UK suppliers) and with the right circuitry they can be made to work very well.The circuit I developed is shown below - 

chematic.png 

 - and a version lashed up on a PCB I designed for a previous block detector I built (see the MRH post at  https://forum.mrhmag.com/post/simple-block-occupancy-detector-for-dcc-n-scale-12216144) is shown in the photo below - 

type-Rsz.jpg 

A set of new PCBs is currently being shipped to me (my brother needs 80+ units for his new N-scale layout) and, when I have some built, I will post further details here.

Terry Chamberlain

Back_320.png     A Free Windows application for NCE Systems

https://www.a-train-systems.co.uk/atrack.htm

Reply 0
greg ciurpita gregc

simple block detector

Simple block detector may help you understand the circuit

    ^^^^^^^^  corrected link

greg - LaVale, MD     --   MRH Blogs --  Rocky Hill Website  -- Google Site

Reply 0
Carolina Northern

The link doesn't work

@gregc interested, but the link doesn't work. Says page doesn't exist.

 

Don

I spend most of my money on model trains, the rest, I just waste.
Reply 0
jeffshultz

He had an extra letter in the URL

Try this:  https://forum.mrhmag.com/magazine-feedback-was-ezines-891776

orange70.jpg
Jeff Shultz - MRH Technical Assistant
DCC Features Matrix/My blog index
Modeling a fictional GWI shortline combining three separate areas into one freelance-ish railroad.

Reply 0
Carolina Northern

Thanks, Jeff

It works  fine now.

 

Don

I spend most of my money on model trains, the rest, I just waste.
Reply 0
CSXT1534

Interesting details, and I

Interesting details, and I like the much easier explained home built detector that I can input into DCC and the Arduino. Thanks!

Reply 0
Terry Chamberlain jterryc

Further details, as promised -

A DCC Block Detector using the ZMCT103C Current Transformer

This DCC block detector is designed around the ZMCT103C 1000:1 current transformer, which is readily available at low cost from a wide selection of Chinese suppliers, rather than the more expensive 300:1 transformer, such as used in the NCE BD20 unit, especially as these transformers have recently become more difficult to source.

The assembled module and its printed-circuit board (PCB) are shown below –

93433-1.jpeg 

The PCB is available from OSH Park, a small company located in Lake Oswego, Oregon, via this link – AT-DCCBlockDetect-4.  They will supply three PCBs for US$4.75 including free shipping to any destination worldwide.

If you then want to order a set of PCBs (in multiples of 3) click the button labelled Order Board, enter your e-mail address, name, and a password of your choice to establish an account with OSH Park, then follow their ordering process. You can pay either with a credit card or via PayPal. Your boards will be manufactured and delivered within two or three weeks depending on where you are in the world. If you prefer to use an alternative PCB supplier then, instead of clicking Order Board, just click on Download to download a copy of the  DCC Block Detect PCB file in Eagle board (.brd) format which you can then send off to your preferred supplier. Where the supplier cannot accept a file in Eagle .brd format, a copy of the PCB Gerber files can be downloaded from my own website at https://www.a-train-systems.co.uk/download_files/AT-DCCBlockDetect-4-Gerber.zip.

Please note that neither A-Train Systems nor myself have any connection with OSH Park other than as a very satisfied customer of their services.

The parts required to build one DCC Block Detect module are listed in the table below –

Part

Reference

Quantity

Value

Terminal Block, 2.54mm pitch, 3-Way

X1

1

Capacitor, Polyester, 63Volt

C1

1

10nF (0.01uF)

Capacitor, Polyester, 63Volt

C2

1

470nF (0.47uF)

Current Transformer (1000 turns)

CT1

1

ZMCT103C

Diode

D1 – D4

4

1N4148

Zener Diode

D5

1

BZX55-C5V6

Transistor, General Purpose NPN

Q1, Q2

2

2N3904

Resistor, Metal Film, 0.25Watt

R1

1

1M (1 Megohm)

Resistor, Metal Film, 0.25Watt

R2

1

470R (470 ohm)

Notes :

  1. The terminal block is an optional part. You can solder wires direct to the PCB instead of using screw terminals. Note that the centre connection (X1-2) is Ground, and that the Block Detect output can be taken from either of the two outer connections (X1-1 or X1-3).
  2. Suggested suppliers for the parts listed above are RS Components or Farnell for users in the UK, or Newark for users in the USA (part of the same company as Farnell). Mouser or Digikey are alternative sources in the USA, although their prices tend to be a little higher than Newark.
  3. The total cost of parts for a single DCC Block Detect module should be less than US$3.00, and even less if you omit the terminal block, plus the additional US$1.59 for the PCB.

For those interested, a brief technical description of the block detector design is given below.

Because the higher transformer ratio reduces the current coupled into the detector, more sensitive detection circuitry is required compared to that used in the NCE BD20, for example, (while still being kept as simple as possible), and the final operational design is shown below –

093433-2.png 

The small alternating input current, coupled from the DCC track feeder by current transformer CT1, is fed into a full-wave rectifier comprising diodes D1 – D4. The resultant direct current, smoothed by capacitor C1, then develops a voltage across resistor R1.

When the DCC current through the track feeder rises, due to the associated track block being occupied, the detector input current rises in proportion and develops a voltage across resistor R1. Zener diode D5 limits any voltage rise to a maximum of 5.6 volts to protect the other detector components.

As soon as the voltage across R1 reaches around 1.4 volts, any additional input current will flow through resistor R2 and switch on transistors Q1 and Q2. When the Block Detect output (terminals X1-1 and X1-3) is connected to a microprocessor input (such as those of an Arduino module or the PIC microcontroller on an NCE Auxiliary Input Unit) these transistors, connected in a high-gain (Darlington) configuration, will draw sufficient current to pull that input to ground (GND or 0 Volts), providing a signal that the track block is occupied. Capacitor C2 provides additional smoothing of the output signal and protects the attached microprocessor input from any damaging voltage spikes.

Note that the block detector cannot sink enough current to light an LED on its own – any such indication needs to be done separately by the attached microprocessor or additional circuitry.

Terry Chamberlain

Back_320.png     A Free Windows application for NCE Systems

https://www.a-train-systems.co.uk/atrack.htm

Reply 0
greg ciurpita gregc

circuit issues

the basic concept in such a circuit is that the change in track polarity thru the transformer causes it to generate a pulse that energizes the transistor causing it to drain the voltage on the output capacitor, C2.

maximizing sensitivity suggests minimizing the voltage needed to energize the transistor and maximizing the duration.   while two transistor in a darlington configuration would maximize current, it also increases the voltage needed to energize them.  2 diode drops are needed.

passing the transformer output thru a bridge also allows pulses in both directions, but now adds additional diode drop (4 with the 2 transistors)

as for the transformer ratio, i believe you want to maximize current, not voltage output.   a transistor is a current device.   so it may be better to have a much lower turns ratio  than a 1000:1 transformer

-720x225.png 

the Rob Paisely circuit below shows a much simpler front end, just a transistor and diode to suppress the reverse pulse.   he uses a 555 as a comparator and driver.   the MTC30101 has a turns ratio 50:1 

greg - LaVale, MD     --   MRH Blogs --  Rocky Hill Website  -- Google Site

Reply 0
Terry Chamberlain jterryc

@gregc

Thank you for your comments. However, while none of the points you mention are actually wrong, I think you are missing the point of the circuit configuration.

A current transformer reduces the current in its secondary (sole) winding by the stated ratio but potentially (!) increases the voltage in the same proportion, so having several diode and base-emitter voltage drops is not actually a problem - the transformer output voltage simply increases to the value required by the load (in fact, without an adequate load on the transformer, you can generate destructively-high output voltages - hence the incorporation of zener diode D5 as belt-and-braces protection).

The main point of the full-wave rectifier (D1-D4) is to maximise the charge pumped into capacitor C1, and raise the voltage developed across it, without it being bled away too quickly by the load resistor R1. The surplus current available when DCC current is being taken by the track block is then, as I stated, used to turn on the transistor pair. This will, as you say, drain the charge held by capacitor C2, but that is simply a consequence of the detector output being connected to an attached microprocessor input. Capacitor C2 is charged from the attached microprocessor's input pull-up resistor, not from the block detector. If the block detector output is not connected to anything then C2 holds no charge, and there will be zero volts across it.

While there are a lot of different ways to build block detectors, like Rob Paisley's, (and I have built a few myself), but the main point of the circuit I presented here is to make use of the ZMCT103C transformer which is available much more cheaply than current transformers available from domestic suppliers. It would be more convenient if it had a lower turns ratio, but we work with what we have - and offer a cost-effective solution to anyone who wants it.

 

Terry Chamberlain

Back_320.png     A Free Windows application for NCE Systems

https://www.a-train-systems.co.uk/atrack.htm

Reply 0
ACR_Forever

distant mounting of the tx- any concerns?

I'd like the PCB mounted at the front of my layout, but the tx should be near the back; do you forsee any noise/ signal problems?

Blair

Reply 0
greg ciurpita gregc

@jerryc

i believe maximizing the current from the transformer is most important.    i tested with a 300:1 Vitec transformer and a 50:1 transformer i wound myself and found the 50:1 to be more sensitive   (reducing the turns ratio reduces the voltage which concerns you while maximizing the transistor current).

normally, any source driving a transistor has more than sufficient current to drive the transistor.  but not in this case.   the transformer output a limited amount of power.   the BE voltage across the transistor is never more than a ~diode drop, while the collector current is some multiple of the BE current.   exceeded BE voltage with limited current does not increase the collector current.   dissipating power thru a 470 ohm resistor doesn't help.

the irony of maximizing the voltages from the transformer which i understand can overcome the various diode drops, is that excess current is lost thru the zener.  C1 voltage depends on the amount of charge is accumulates.  But any charge in C1 resulting in than 2 diode drops is insufficient to energize the transistors.

all current from every other pulse in the Paisley circuit goes thru the transistor.  the additional components in the circuit you posted limit the current thru the transistor and its collector current.    and the Paisley circuit demonstrates that the spikes do not damage the transistor.

the resistor used to charge C2 is not shown, but assumed to be relatively large, depending on the size of C2.   when pulses do occur, C2 is not necessarily discharged with the first pulse, it may take many.   but as long as the drain current thru the transistor is larger than the supply current thru the resistor not show, C2 becomes depleted indicating occupancy

greg - LaVale, MD     --   MRH Blogs --  Rocky Hill Website  -- Google Site

Reply 0
Terry Chamberlain jterryc

Re: Distant mounting, etc.

@ACR_Forever - I am not quite sure what you mean by "the tx".

For the block detector to work, you need to loop one of the feeder wires taking the DCC signal to the track block through the current transformer as shown (the yellow wire). This generally means locating the block detector near the track block - unless you are planning to feed all of your track blocks from a central DCC source near the front of the layout, rather than from a main DCC bus which follows the main tracks.

If the block detector and DCC feeder wire are located near the track block, then there should be no problem connecting the block detector output to whatever hardware you are using to handle block detection (such as an NCE Auxiliary Input Unit) with a pair of wires up to, say, 3 feet long (I haven't tried connections any longer than this). If you take this approach, I would recommend that the wires are twisted together to minimise any stray signal pickup.

@gregc - I don't understand what your problem is with my circuitry (other than you don't seem to understand how it works).

The voltage developed across R2, the 470ohm resistor, is of the order of millivolts - any dissipation is vanishingly small - and there is no current through D5, the zener diode, which does not conduct unless the applied voltage exceeds 5.6 volts - which will never occur in normal operation. Should a fault occur and the zener diode conducts, it will hold the voltage applied to the back end to 5.6 volts and R2 will limit the base current into Q1 and Q2 to below 10mA.

To date, I have built six of these block detectors (and need to build another seventy-odd) - they all work perfectly and consistently. End of story.

Terry Chamberlain

Back_320.png     A Free Windows application for NCE Systems

https://www.a-train-systems.co.uk/atrack.htm

Reply 0
ACR_Forever

Apologies for the tx abbreviation,

I was referring to the pulse transformer.  Is it feasible to mount it distant from the PCB, running a twisted pair back to the circuit board?  No matter, I guess, when it comes right down to it i can run the signals back to the node.

Thanks

Blair

Reply 0
Terry Chamberlain jterryc

Re: Distant mounting - again

Mounting the pulse transformer remotely from the rest of the circuitry is definitely not recommended - the current output from the transformer is in the microamp range, so that any long-wire connection would almost certainly pick up sufficient interference in a model railroad environment to completely mask the real signal, even with a twisted pair.

Keep the transformer on its little PCB, with a twisted pair connection from the detector output to your control hardware.

Terry Chamberlain

Back_320.png     A Free Windows application for NCE Systems

https://www.a-train-systems.co.uk/atrack.htm

Reply 0
greg ciurpita gregc

@jerryc

Quote:

the transformer is in the microamp range,

greg - LaVale, MD     --   MRH Blogs --  Rocky Hill Website  -- Google Site

Reply 0
Reply