https://web.archive.org/web/20220311020340/http://www.members.optusnet.com.au/nswmn/

https://web.archive.org/web/20220311020340/http://www.members.optusnet.com.au/nswmn/
Above photo is my Gosford complete with the Overhead. Click on the photo to see the Main North Album at Flickr

Sunday, June 14, 2020

Occupancy Detection for DCC.

Note: If using relays with Integrated Circuits (I.Cs.), see my warning at the bottom of this Blog entry
.
If you need to know where a loco/train/rolling stock is on the layout when using computers, signals or just for a LED on a Panel etc, you'll need an "Occupancy" Detector, sensing the train's position by infra red beams or current to a section of isolated track. Radio Frequency Identification (RFID) is not discussed here, if interested, click here.  

I installed a couple of infra red setups that were okay for sensing a train in a Siding but weren't suitable for sensing a train travelling in a "Block" of any length, so I installed an NCE BD20. "current" detector and they worked perfectly for my signalling operation, initially using Colour Lights but later upgraded to Semaphores. These were much easier to setup than using the infra red detectors. For more details on Block Detectors and the BD20 click here for Mark Gurries's page.

As always I need easy solutions, so nothing different for occupancy detection. 
I haven't installed any resistors to my rolling stock wheel sets, I ONLY sense the presence of the loco. Yes the train can still be in the block while the loco is not but the Operators can see the train when they enter a Yard/Loop. This saves me from adding resistors to to my wheel sets. There's only so much time left.

The only problem I experienced, that's common on all layouts, are power interruptions to the loco caused by dirty wheels/track, that'll cause the BD20s to "cycle", resulting in the Semaphore also cycling, while the loco continues on unaffected because all my locos have a Stay Alive unit. 
If the rolling stock had resistor wheel sets, this cycling could be all but eliminated as the the resistor wheel sets provide more "current" paths than just the loco. 
Installing a 100 uF 16V Electrolytic Capacitor across Pins 1 and 2 of the BD20 will delay for 3 seconds, the turning OFF the Detector thus eliminating the "cycling" of the Detector. 

The BD20 is capable of driving a Relay from Pins 3 and 4, if you supply 12 Volts to Pins Pin 1 and 4. Relays are used for my signalling to control the Tam Valley Octopus III for the Semaphore's Servo.

On my layout I use "occupancy" detection for:
  1. Signalling 40 metres of single line with 3 loops for automatic bi directional running.
  2. Signalling at other locations.
  3. Indicating which tracks are occupied in my "eye level" Armidale Staging.
  4. Turn off the track power to eliminate crashes in my Tickhole Tunnel.
  5. Operating Points and Signals to provide my desired route through Tamworth.
  6. Just lately, helping Cassino Craig with his Shelton the Photographer. 
For my signalling, see my previous Signalling Blog entries where I used BD20s. Needing more Detectors as I fit more Semaphores and other "occupancy" projects, at a mate's recommendation in the U.S., I purchased some cpODs

I enjoy tinkering around with electronics, so I looked at making my own Occupancy Detectors from Rob Paisley's web site. , I had already made a DCC Ammeter, see my Ammeter Blog entry 

I was hearing a lot about using Arduinos for model railways, so I asked Dave Lowe from Brisbane who was going to attend the MRNSW 2018 Convention, if he'd do an Arduino Presentation.
Great Presentation with lots of ideas and examples of how to use the Arduinos for our layouts. There’s even an application to make a DCC system. Dave's example to flash a LED/s with an Arduino, that can be easily done using a $2 "555", I thought it was an little bit of an overkill. I bought an Arduino to play around with it. 

I had just installed a 60' Turntable in Tamworth and when the AMRM Article explaining how to control a Turntable using an Arduino and a Jaycar Stepper Motor, I felt my prayers for motorizing the Turntable were answered. I raced out and bought the applicable Stepper Motor.
My mate Brian spent an inordinate amount of time using the exact same Turntable mentioned in the AMRM Article and had correspondence with the author but could not get it work successfully. More perseverance may have been necessary but you can only spend so much time pulling your hair out. Brian’s experience sealed the fate for my Arduino, yet to connect any power to it, let alone “make” a project.

Making Occupancy Detectors 

I decided I wanted to make "transformer" type Occupancy Detectors, similar to the BD20 using Rob Paisley's Transformer Occupancy Detectors. Rob Paisley's pages are not available anymore (April 2024), using the Wayback Machine, Click here for Rob's Index . The circuit using a LM393 I'm using is shown below.


My regular electronics parts suppliers, Jaycar and Element 14 did not stock the Transformer so I purchased them, along with other parts, from EBay. The 10 components were assembled on a piece Veroboard and they worked first time. 
Dave sent me some Circuit boards and his pdf to make a much tidier Detector. Changing the value of "C1" to 33 uF in Dave's circuit, provides the delay, I need. 

My home made Detectors cost me $3 each so I can save heaps and buy more Tam Valley Octopus IIIs to motorize my "static" Bracket Semaphores. Dave has used Arduinos to operate his Servos, maybe I should talk to him but for now the Octopus III, is good for me.  

Occupancy Indication for my Armidale Staging.

This staging area is at a height of 1680 mm, too high to manually set the Points and to see what’s in the 6 Sidings, I needed to add some Point Motors along with a Control Panel and some form of "occupancy" indication.

I made the Armidale Control Panel using my usual method of Toggle Switches and ONLY 3.0 mm Green LEDs, recessing the Panel into the fascia. Operating a Toggle Switch, illuminates the appropriate LEDs and operates the Peco Point Motor using it's own Capacitor Discharge circuit (see previous Signalling Blog entry).

The illuminated Green LEDs easily identifies which Siding is selected but requires extra wiring behind the Panel, well worth it.

Occupancy of the Sidings was to be simple, just a Red LED easily implemented by using Red/Green LED (Jaycar Part No ZD0248) for the LAST LED in each of the 6 Sidings, see photos.

An empty Siding the Bi-colour LED illuminates GREEN and an occupied Siding the LED is RED, see below.

The photo on the right has the last LED illuminated RED, indicating Siding 1 is occupied with the 4 Car Northern Tablelands Express at "home". 
Also shown is the Yard "Exit" Colour Light Signal is at green indicating it is safe to crossover into Tamworth.

I wanted a simple homemade solution, firstly trying infra red sensors but the difficulty of mounting the transmit and receive LEDs I made a simple homemade "current" type of detector I saw years ago on p89 in DCC book by Ames, Friberg and Loizeaux, years ago. I used a 4N25 and a 1 Amp Bridge Rectifier mounted on a Veroboard with a LED. Connected 12 Volts and DCC and it works.

For a circuit see Rob Paisley's Basic Detector but without the LM339 Comparitor etc. Pin 5 supplying an earth to the LED, with occupancy. This simple detector could be used if you want a LED on a panel, see photo.

I could not work out how to "changeover" the polarity to the Red/Green LED without using a Relay and my simple detector could not drive a relay without adding a LM393. Now it's not a simple detector. 

I went with one of my homemade Veroboard Transformer Occupancy Detectors, shown right.. 
Instead of adding a relay to control the Red/Green LED, with the help of my mate Andrew, I added 3 resistors (L/H side of Detector), that "swap" around the polarity to the Red/Green LED. Obviously RED indicates Occupancy of the Siding. 

You may have to adjust the turns through the Transformer to get the indication to changeover.

The photo right, shows 4 of the Detectors mounted under the layout behind the Armidale Control Panel 

The only problem with this above solution, if there’s no loco (only rolling stock), it will not show “occupancy” – solution, make it a train and not just rolling stock by placing a loco on the track. 
Everyone has spare locos, if not clip a 100 Ohm 1 Watt Resistor to the track.

I also re-modelled Armidale because I don't think I'll ever install the Return Loop, that I initially wanted all those years ago. I added a spare "island" station, some houses and a little bit of scenery. I know the station is not "correct" but it'll do for now until I maybe build the right station.  

Tickhole Tunnel “Isolation”.

In my last Blog entry I suggested if an Operator did not stop at the Colour Light Signal on the UP, if it was RED before entering Tickhole Tunnel, he'd probably crash into a train with catastrophic results. 
I'd have to spend half an hour during an Operation Session to remove scenery to access the wreckage. 

To safeguard this slack Operator, in this era of strict OHS procedures, I’ve removed the power to the track at the Signal by using the second set of contacts on the DPDT Relay on my Detector controlling the Colour Light Signal, an easy fix. 

The Occupancy Detector in this installation is one from the Model Railroad Control Systems in the U.S. mentioned above.



Tamworth entry/exit Points.

I could have used a different type of Auto Reverser for the Tamworth Return Loop with "contacts" to operate these Points. This would include of shunting in Tamworth.

I could have added a Frog Juicer and associated DCC stuff. 

I wanted  all trains from Werris Creek to be automatically routed to Tamworth's Platform, then they'd go to Armidale or take the Return Loop for continuous running (back to Werris Ck etc). 
If the Return Loop option was taken, the train appeared on the rear track of Tamworth, the second Occupancy Detector automatically switches the Points via the Capacitor Discharge seen on the left of the photo, getting the train back onto the mainline, to Werris Ck.

Casino Craig’s Shelton the Photographer.

After reading Craig's Blog entry he posted on 31 May 2020, I contacted Craig and with Andrew, we suggested alternatives to what Craig was trying to achieve with his Flasher Circuit that worked, well sort of. 
Craig purchased an Arduino and wrote the appropriate code, what a computer geek Craig is.

I did NOT want to venture into getting my Arduino to work so I used one of my $3 Detectors to operate the LED, but it remained illuminated dimly after the Flash even with changing resistor/capacitor combinations, I tried a Relay with a 100 uF Capacitor in series with the Coil that energies the coil for a  1/4 of a second providing a perfect Flash, irrespective of how long the Detector senses occupancy. 

A 100 uF for" C1" in the circuit, keeps the Detector "ON" for 15 seconds after there is NO sense current from 40 mm "block". This eliminates a second and subsequent flashes with dirty wheels/track and/or when the second bogie of a Diesel, contacts the 40 mm block. The values of both of these Capacitors may have to varied to provide a single flash. Maybe Craig's Arduino is looking as a  better option but not for me.  

To make value of the time I spent, I decided to add Shelton to my layout at Ardglen Tunnel, using a 0.8 mm Surface Mount Daylight White to glued to Shelton’s head. I cut the appropriate Gaps in one rail before the Tunnel and connected the DCC “sense” wire through the Detector’s Transformer to the isolated track and connected it to the 12 Volt D.C Bus for signalling, under the track..














Above is my "test" Transformer Detector, assembled on one of Dave's Circuit Boards, under the layout. 

The schematic on the right shows all of the the connections, including the 1/4 second Timer, C2 a 100uF Capacitor in series with the Relay's Coil. 

See Shelton “flashing” at Ardglen on the Main North, below.  


Craig's set-up on the 14 Jun 2020 entry, uses a Bridge Rectifier connected to a 4N25, "triggering" his “supercharged” Arduino as per the diagram below and it flashes. Craig has just got to get Shelton, onto his layout. 


The Voltage Drop across the Bridge Rectifier, reduces the voltage to to the track that can cause a "slowing down" of a loco using this method of Occupancy Detection. Circuits using this method of detecting the current without an Arduino, are also shown at the above Rob Paisley's pages.  

Bridge Rectifier Current Occupancy Detector using a LM555 Timer with a Delay.

I made another Occupancy Detector but instead of using the hard to source Transformer I use, I used a 1 Amp Bridge Rectifier and a 4N25 that triggers a LM555 Timer triggering a Relay. I used a 2.2 uF Electolytic that provides 3 seconds of delay. Inc/Dec capacitance, varies the delay.

The Output of the LM555 (Pin 3), can be used to operate LEDs for both "states" of the Detector as shown in the circuit.

Check Rob Paisley's site for more details.


 
If your Occupancy Detector needs to operate a Relay like the Jaycar 230 Ohm Relay, the LM555's 200mA capacity is fine operating these.   

To get the above Detector to FLASH to make a Shelton the Photographer, I added a 100 uF Capacitor in "series" with the Coil, see the above circuit below the photo of Shelton the Photographer. 

This makes an Occupancy Detector with easy to source parts from Jaycar etc and without using an Arduino that has to be "coded". Craig could this alternative circuit and save his Arduino for something a little more "difficult".

Without the Capacitor, the Relay is energized for as long as the Detector sees "occupancy". 

I haven't made another circuit schematic.



Warning when using Relays with Integrated Circuits (I.Cs.)

Energizing the 300 to 500 Ohm Coils of the “common” 12 Volt Relays from say Jaycar, is not a problem in most cases. The “circuitry” used to energize the Coil needs to be able to supply this necessary “coil” current.
The Output Capacity of the LM393 Integrated Circuit used in my Occupancy Detector is very low at 20 mAs. If you use the above “low” Ohm Relays, the LM393 could be damaged. Instead use the 1,000 Ohm Relays like Jaycar’s SY4032 or SY4036 versions.
Some years ago I purchased lots of 960 Ohm Relays shown in the above photos, so I’m okay.

Monday, June 1, 2020

The Workbench


Everybody spends lots of time using a computer at a place depending on various scenarios. Initially I connected to the Internet with a Desktop in a spare room upstairs. I soon bought a Laptop to be more “portable” then spent most of my time downstairs in the Trainroom on my workbench. I was away from the T.V. but close enough to hear the Boss, especially when she’d announce “lunch, afternoon tea or dinner”, was ready. How good was this!

Being an Electrician, I've always had an interest in things "electrical", I'm at home with most things electrical in the hobby. My workbench comprises of a spare standard door on top of some drawers I got from a previous employer. and setup with the appropriate equipment/tools etc, if not at an arm’s length, they're close by. I installed a Sliding Drawer under the bench using kitchen drawer slides from Bunnings, making for easy storage of commonly used tools like screwdrivers, cutters, pliers, rulers, scissors etc.

Present day "electronics", is getting really hi tech with Arduino etc, that's leaving me behind. My electronic questions are simply solved with resistors, capacitors, transistors, diodes, relays etc as shown in my Signalling Blog entries, most of the time.  

The 2014 photo below shows the normal mess, as I work on the workbench, I’m sure I’m not alone here. I’m getting tidier in my old age, most probably because I’m sick of looking for stuff for whatever I was working on.


Since I don’t do decoder installations and stuff for others anymore, I’m workin’ for me now, to finish what I started in 1990, indicating that progress around here was very slow. So much to do but it's not about finishing the layout, it’s the fun you're having on the journey. I’m certainly having fun making scenery and as of late, ballasting.

This above messy unsceniced “view”, is the most looked at part of the Main North, well by me that is, as I sit at the workbench, made “worse” when I turn on the workbench lighting to work on a model etc. It needs updating.

The “Rotten Row” shelf and the adjacent one to the right above the equipment, have been removed for more “vertical” space above the double mainline and the new mine, see below.

The electrical equipment on the R/H side shelf has been relocated onto the bench below, to reposition the shelf to the same level as the rear “brown” shelf, so as to add a Mine, coming off the “Down” Main (to Broadmeadow & north).

To eliminate a mess under the “brown” shelf, I fitted another Jaycar Cabinet, cut in 3, for more "tidy" storage.

Fitted a fascia then added a “3 piece” polystyrene Hill to the Corner where the double mainline exits Tickhole Tunnel, so it can be removed for access to the hidden track, if necessary. I planted plenty of trees. I did this scenery 2 years ago but it’s taken 2 years to clean up the mess.

My new “view” as I sit at the workbench without the mess.

 

Researching for "local" Mine, I wanted to model the Stockton Borehole Colliery with it's 2,000 ton “over the track” Bin. I couldn’t find the motivation to make it, instead I added some Mine structures I already had (spare Walthers New River Mine parts etc). It's amazing what you find you've collected over the years stored under the layout, so this'll do for now. I parked some of my “red” LCHs there. I may still make the Stockton Borehole mine, only time will tell.

I made the front track of the Mine, my new Program Track, appropriately isolated from the mainline, using the Main/Prog Switch, 3rd from the left on the row of switches to the right of the Power Cab, details below. See the below link for details of isolating so you don’t blow up a Program Track Booster at:




The Workbench Equipment (l to r).
Just out of view is the NCE 5 Amp Power Pro, with the track wiring going to the fascia Ammeter Circuit Board behind the Cabinet (see: http://mainnorth.blogspot.com/2017/07/dcc-ammeter-for-layout.html ), then in 4 directions to the EB1 Circuit Breakers, for the 9 Power Districts of the layout.

My home made 30 year old 5 - 25 Volt, 5 Amp Power Supply to power projects etc, with a recently added combined Volts/Amps display from EBay to replace numerous failed Ammeter displays. Included is a Timer and Constant Current circuitry to charge rechargeable batteries. 

A Jaycar 10 Amp Multimeter  (QM1535) is fixed to a sloping bracket to easily read the display, with the Leads extended and hanging from below the R/H side of the bench with suitable Clips, with 3 other “sets” of Leads (my Power Supply, extra Program Track Leads and Power Pro “test” Leads), providing enough length to test/make easy measurements/tests on the workbench, see the next photo.  

A wireless equipped Power Cab is clipped to a sloping bracket, providing an off the workbench, out of the way Procab, depending on which system I want to use.
Plugged into the R/H Panel or using it as a Wireless Procab, it is used with the Power Pro system.
Plugged in to the L/H socket (2 x Red LEDs), it is used a Power Cab. This allows the use of the Program Track without shutting down the layout or testing without turning the layout on, see below.
Connecting the laptop with either an NCE USB Interface (Power Cab) or a Serial Cable (Power Pro), allows the use of Decoder Pro for programming. 

The Switches (left to right) select numerous options for the layout, details below:
 

  • Layout ON/OFF: Left in the OFF position, isolating the layout during powering up the Power Pro and when programming/test locos on the Program Track. Obviously ON for playing trains.
  • Program Track:  Selects either the Power Pro or the Power Cab to power the Program Track. In the Power Cab position, it disconnects the layout from the Program Track. 
  • Main/Prog: Selects Operation or Service mode of programming for the Power Pro.
  • Ammeter: The Ammeter reduces the Track Voltage by approximately 1.0 Volts. Switch OFF, full voltage at the layout, if necessary.
  • P.Lamp: The "short indication" (12 V 10 Watt Lamp) for the Program Track can be switched out if necessary.
  • Dremel: Easy ON/OFF for the Dremel hanging from the Upper Deck shown in the bottom photo.
  • TAM O/C: 12 Volts for the Tamworth Points and Occupancy Detection.
  • Hawk Lts: 12 Volts for the Sydney Staging and Hawksburry River Station LED lighting.
  • 3 Spare holes for whatever new project needs an On/Off Switch.  
A Weller WES51 Adjustable Temperature Controlled Soldering Iron (green LED) with the Soldering Pencil located in a Holder on the Workbench, replacing a 30 year old Dick Smith unit, don't make them like that anymore.

I’m a dinosaur and still use a landline, the handpiece is at the end of the Program Track.

Above the yellow cabinet from the left is the Power Supply for the NCE Power Pro system also providing power for other stuff at the bench including the Fascia Ammeter, discussed on a previous Blog entry at:


Next is the Power Cab Jiffy Box, housing the USB Interface. In this configuration, it's the interface between Decoder Pro and the Power Cab. Disconnected from the associated wiring, I can take it with a Power Cab in my DCC Doctor Toolbox with the Laptop, plug the unit into 240 Volts then program/adjust locos on other modellers layouts. See my article at:


Jaycar’s very small tip Soldering Iron for repairs to Circuit Boards using SMD components, now done with my new Weller.

A 12.0 Volt Power Pack plugged into the power point, supplies the Power Cab, power to an External Hard Drive and for my ESU Lokprogrammer. 
 
The Soundtraxx PTB-100 Program Track Booster that's necessary to read CVs of most sound decoder is attached to the shelf. No need to remove the PTB-100 to program Soundtraxx Tsunami 2s. 

The last scenery job is adding ballast, but only after soldering rail joiners and adding more droppers, ballast glue plays havoc with rail joiners and Point "contacts" etc. 

The Colour Light signal (at Red) in the photo right, is located on the UP Main “protecting” trains ahead in Tickhole Tunnel especially when shunting the W44. but Operators still pass Red Signals. Those Operators are banished to make the Coffee. 

If the above "crash" happened, I'd have to remove the 3 piece Hill and the removable scenery at Fassifern/Newstan Mine, to clear the derailed train that'd take at least half an hour, a real inconvenience to an Operating Session. I should include removing the track power, with a Signal at Red. Sounds like it should be one of my next projects.

Occupancy Detectors control the Signal and will be the subject of my next Blog entry. I let you know if I did the above Signal "project".

Good “overhead” lighting is absolutely necessary for “close up” work, we're doing on locos and small projects etc, with two 18 W CFLs, and a long reflector from another light assy.

For magnification and some extra illumination when necessary on the workbench, I have a Jaycar Desktop Magnifier Light (LEDs) Part No QM3552, stored “out of the way”, under the bench that “doubles up” to illuminate the under-bench area. 
I modified the Light by replacing the base with an 8 mm bolt, that allows mounting the Light into a 8 mm hole, under the bench or at the edge of the workbench, see photos.

I need glasses for reading etc.I got a pair made up with a focal length of 200 mm, to work "inside" the models, all shown hanging up in their "correct" place. 


The latest addition to my Workbench is the WiFiTraxx Module that simply plugs into the NCE Cab Bus (no computer with JMRI needed for this), allowing the use of 4 Mobile phones with the applicable App, so when a Visitor comes to the layout, he can use his phone as a Wireless Throttle, see:


Thanks to Craig Mackie, he's written a very comprehensive "write up" in 2 Parts at his Blog. 



A variable height comfy office chair on wheels is necessary to move around the clean Main North "nerve" centre with almost everything at my fingertips. It's so much better sitting at the Bench, now that the scene has been upgraded, shown below, with my constant companion jumping onto the chair to obviously keep it warm for me.

Now to keep the mess, away – that’s the challenge.


For an easy exit when I'm done at the Workbench, pressing the circled "master" switch below, turns everything OFF including the Workbench lights, layout etc, except the one power point that feeds the master switch and the computer, to keep the battery charged. I can now sleep easy, knowing everything's off.