Download Electronics for Model Railways.pdf...
ectronics
by Davy Dick
Electronics for Model Railways Here are my thoughts on this book. I don't know if it is good but it is certainly big, with 22 chapters, around 450 pages and about 700 images and illustrations. Hopefully, it will act as a useful resource. To that end, all comments are welcome. You can reach me at
[email protected] Why do it? I believe that there is a need for a book that tries to encompass the broad electronic facets of our hobby. It is intended to help new members and those who might be drawn to our activities. There is not a lot of material out there, mainly old texts or books that solely cover DCC. I think that the contents will be widely welcomed. I have trialled the book to selected members covering a range of knowledge and experience, with favourable feedback. Who owns the book? This is not intended as a 'MERG publication'. I will retain ownership of the book. That is not to say that I think the book is perfect. I welcome suggestions for corrections, amendments, addenda, etc., so that the book can develop to meet the broadest needs and to keep up with technological changes. However, it is not a 'Wiki', where individuals can remove and change the contents to match their own personal preferences or hobby horses. The book will remain as one document – albeit in two volumes. Any conditions? The book is intended as a service to the model railway community. It is not a commercial product. It is strictly a non-profit production. It must not be used for monetary gain. It will be free to distribute and read. There will be no changes to book contents or its use without permission of the author. How will it be distributed? To keep the book free, and to allow for continuing improvements, there will be no printed version. It will be available in PDF format, with possible tweaking for Kindle users at some stage. It comprises two volumes so that they are small enough to be handled by most email systems. How can MERG use it? Apart from the benefit of access to the contents, MERG could use it as a recruiting tool. It could be added to the new members CD. [ It will be.] It could be added to the Download section of the website. [ It will be.] It could be used for publicity at MERG stands at exhibitions. [It will be.] It could be made available through other model railway magazines, thus achieving free advertising of MERG. I have added a section on MERG, explaining what we do, what we offer – including a membership application form that can be printed out. [ Davy’s book is being distributed to MERG members on a CD in the 2014 No.4 Journal mailing.]
Electronics for Model Railways Part A By Davy Dick
© 2014 by David Dick All rights reserved under the Attribution-Non-Commercial-NoDerivatives Licence. This book may be freely copied and distributed but may not be changed or added to without prior written permission of the author. This book is free and its material may not be used for commercial purposes. This book is issued as, without any warranty of any kind, either express or implied, respecting the contents of this book, including but not limited to implied warranties for the book's quality, performance, or fitness for any particular purpose. Neither the author or distributors shall be liable to the reader or any person or entity with respect to any liability, loss or damage caused or alleged to be caused directly or indirectly by this book. All trade names and product names are the property of their owners.
In memory of Margaret
Introduction Unless you are running an antique clockwork train set or have a large outdoor layout running steam trains, you are already using electrical and electronic equipment. For most railway modellers, power is supplied to the loco's motor through the track. With the help of electronics, our layouts can be further improved. How about control of points, signals, lights, turntables, crossing gates and barriers, uncouplers, sound effects – and much more. We can even detect where trains are on our layouts or automate activities, with or without computers. At first sight, this may seem complicated – but layout wiring and controls often consist of lots of little individual circuits, each carrying out its own function (e.g. switching a point or lighting an LED). The chapters try to look at each issue and show how they fit together. If you like, you can read through from start to finish. However, it is not meant to be read as a book. If you are new to electronics, this book covers a lot of ground. You are not meant to understand it all after just a quick read through. You will also find that you already know some parts – and are not currently interested in other parts. I would suggest that everyone have a read of the first chapter – even if you think you already know all the basics. Also, as you are working with a hot soldering iron, knives and cutters, drills and so on , be aware of safety at all times. In particular, please read the safety notes on page 50 of Part A and page 72 of Part B. Hopefully, there is something of interest in here for all railway modellers.
Davy Dick Model Electronic Railway Group member 1853
Contents Click on the page numbers to jump to chapters
Part A Chapter 1 – Basic electronics . . . . . . . .
6
Chapter 2 – Loco controllers . . . . . . . .
35
Chapter 3 – Layout wiring . . . . . . . . . .
49
Chapter 4 – Track wiring . . . . . . . . . . .
60
Chapter 5 – Voltage problems . . . . . . . .
78
Chapter 6 – Point wiring . . . . . . . . . . .
87
Chapter 7 - Point motors & servos . . . . .
99
Chapter 8 – Scenic lighting . . . . . . . . .
123
Chapter 9 – Coach lighting . . . . . . . . . . 142 Chapter 10 - Adding sound . . . . . . . . . . 157 Chapter 11 - Track occupancy detectors . 184 Chapter 12 – R F I D . . . . . . . . . . . . . . 202 Chapter 13 – Digital Command Control . . 212 Chapter 14 – CBUS . . . . . . . . . . . . . . .
Part B Chapter 15 – Transistors, ICs and PICs Chapter 16 - Interfacing techniques Chapter 17 - Computers and model railways Chapter 18 – Assembling a tool kit Chapter 19 – Soldering Chapter 20 – Using test equipment Chapter 21 – Pocket Money Projects Chapter 22 – Abbreviations & Acronyms Appendix – The Model Electronic Railway Group
240
Chapter 1 Basic electronics
Basic Electronics 6
Back to Contents Page 5
Basic electronic terms Units of measurement Before we start looking at volts, amps, etc., you should note that there are large variations in electrical and electronic units of measurement. For example, the steel pylon that brings power to your home might be carrying up to 400,000 Volts, while an LED (light emitting diode) in your layout might be working at around 3 Volts. Here is a chart that lists the most likely values that you will come across in model railway electronics. One millionth of a millionth
pico (10-12)
One thousandth of a
Tiny measurement, usually of capacitance
nano millionth (10-9)
Tiny measurement, usually of capacitance
micro One millionth (10-6)
1μF = one millionth of one Farad
milli
one thousandth (10-3)
1 amp = 1,000 milliamps
kilo
1,000 times (103)
1 kilohm = 1,000 ohms
mega 1 million times (106)
1 megohm = 1,000,000 ohms (or 1,000 kilohms)
If you have not come across terms such as 103 or 10-12 before, its not that difficult. 6 x 103 means 6 multiplied by ten three times, in other words 6 x 10 x 10 x 10 = 6,000 Put another way 103 means add three zeros to the end of the number. Similarly, 6 x 10-3 means 6 divided by ten three times, in other words 6 /10 /10 /10 = 0.006 Examples An N gauge loco motor might draw a current of 250 milliamps (written as 250mA); this is the same as a quarter of an Amp. An electric fire might be rated at 1 kilowatt (written as 1kW); this is the same as 1,000 Watts.
Note
Computers use a different definition of some terms, as they operate in binary (i.e. off and on) states. So, everything is in multiples of 2. Here, kilo is 1024 (210) and mega is 1,048,576 (220). These multiples are used to described memory size and disc drive and memory stick capacity.
Basic Electronics 7
Back to Contents Page 5
Current You cannot see electricity. However, you can see, and often feel, its effects. Electrical current drives motors, lamps, relays, electric heaters, etc. It produces light, heat, radiation and induction. So, what exactly is current? Current is simply the flow of electrons along a material that allows its passage. Electrical current always flow in a loop and a common analogy is to imagine marbles circulating inside a hula hoop. You will already have noticed that a battery has two terminals and the mains supply has a live and a neutral. Both have an out and a return. Of course, something has to push the electrons round the circuit. An often used comparison is made between the flow of water and the flow of electrons. This illustration shows a basic central heating system. The water drops flow round the system, passing through the boiler's pump, the pipes and the radiator. The water is heated before being pumped into the outgoing pipe. The water dissipates much of its energy in the form of heat in the load (the radiator). The cooler water returns to the boiler to be reheated and pumped back round again. Compare that system with how a lamp on a bicycle works. As the wheel turns, it spins a dynamo (an electrical 'pump'); the electricity is taken by wires to the load (the lamp bulb) and returned again to the dynamo. The energy created by the dynamo is dissipated in the lamp as light. In fact, the electricity in your home is also organised this way, except on a much larger scale, with huge power stations and the National Grid distribution network. Now look at this basic electrical diagram. It shows a battery as the electron 'pump', the wire that carries the current to the load and the return wire that conducts the electrons back to the battery. In this case, the load can be a lamp, a relay, a locomotive motor – or one of many other things that will convert the electrical energy for its own use. While the water flow is measured in gallons that are pumped round, the flow of electrons is measured in Amps (short for Amperes), or in milliamps. Just for the record (there is no need to remember this), one Amp is 6,250,000,000,000,000,000 electrons passing a particular point in one second!
Basic Electronics 8
Back to Contents Page 5
Note
Early pioneers of electricity thought that current flowed from positive to negative potentials. In fact, electrons move from negatively charged to positively charged areas. To 'save confusion', you will often find texts talking about 'conventional current' (the long-standing but wrong description) and 'electron flow' (which is what actually happens). So, all the arrow symbols that you see in diagrams (e.g. diodes, transistors) are showing conventional current flow, not actual electron flow. Just something we have to live with!
Voltage Let's continue with the central heating analogy for a moment. The pump is pushing out water at one end, thus creating a shortage of water at the other end. This difference in water pressure results in the flow of water round the house. As you would expect, increasing the pump pressure results in more water being pumped round. With electrical circuits, the power source creates an excess of electrons at one end and a shortage at the other. This is known as the 'potential difference' and this results in the electrons flowing round the circuit. This is true of any two points in a circuit; if one point is at a more negative potential than another point, electron current will attempt to flow towards the less negatively charged point. Water pressure is measured in 'psi' (pounds per square inch) or 'bars' (one bar is the force required to raise water to a height of 10 metres). The difference in potential of an electrical power source is measured in Volts (or kV or mV). The power source can be a battery (as used in your watch, mobile phone, laptop, car, etc.) or a mains supply (us used for your cooker, washing machine, house lights, etc.). For model railways, the mains supply is too high a voltage and has to be brought down to a lower level. Many loco controllers either use an external power unit, or an internal unit, to reduce the voltage from the 240 volt mains supply to the 12 volts commonly used for model railways. (more later).
Resistance The amount of water flowing through your central heating pipes depends on the water pressure, as already mentioned. But, it also depends on how easily the water is able to flow. So, for example, if we replaced old wide pipes with new narrow pipes, it would lower the flow. Similarly, if we screwed down the radiator valve, the flow would be lowered. The flow of electricity will similarly be affected by the material it has to pass through. Some materials, such as copper, offer only a very low resistance to the passage of electrons and such materials are known as 'conductors'. Other materials, such as plastic and glass, offer a very high resistance and these are known as 'insulators'. That is why wire is made from copper inside a PVC sheath. The copper conducts the electrons and the PVC prevents shorts to any other conductors. Different materials have different resistances and properties, and this is used to good effect Basic Electronics 9
Back to Contents Page 5
in model railway electronics. You can deliberately introduce extra resistance into a circuit to reduce the voltage on other components (e.g. to control loco speeds) or limit the current flowing through other components (e.g. when illuminating LEDs). On other occasions, the resistance is inherent in the materials you use. Your layout wiring, your loco motors, your point actuators, etc. all add their own resistance. The measurement of resistance is in Ohms (named after Georg Ohm, a German physicist). The symbol for Ohms is Ω, (the Greek letter Omega) but this is seen less often in diagrams and textbooks nowadays. Although resistances are measured in decimal amounts, the decimal point is not used in texts and diagrams as it is easy to miss. The letters R, k and M are used, where R represents the decimal point, k represents one thousand an M represent one million. Here are some example resistor values: 560R is 560 ohms R47 is 0.47 ohms 47R is 47 ohms 3R9 is 3.9 ohms 2k7 is 2,700 ohms 1M2 is 1.2 megohms
Resistors These are available in various shapes, sizes and performance.
The main characteristics of resistors are:
Value You can buy resistors with values as small as a fraction of an Ohm, up to resistors with millions of Ohms of resistance. Clearly, it is not possible to manufacture and stock every possible value in between. Basic Electronics 10
Back to Contents Page 5
Instead, resistors are manufactured in limited fixed ranges of values. These were the standards set up by the now defunct Electronic Industries Alliance, commonly known as 'preferred values' and these are shown in the table below. Preferred series
Values available in that range
E6
1.0, 1.5, 2.2, 3.3, 4.7, 6.8
E12
1.0, 1.2, 1.5, 1.8, 2.2, 2.7, 3.3, 3.9, 4.7, 5.6, 6.8, 8.2
E24
1.0, 1.1, 1.2, 1.3, 1.5, 1.6, 1.8, 2.0, 2.2, 2.4, 2.7, 3.0, 3.3, 3.6, 3.9, 4.3, 4.7, 5.1, 5.6, 6.2, 6.8, 7.5, 8.2, 9.1
Colour coding Larger-sized resistors have their values printed on them. In most cases, the values are deduced from the coloured marking round the resistor body. Most resistors use a numbering code that uses four coloured bands.
For example, the resistor shown in the illustration can have its value calculated thus: 1st band is brown = 1 2nd band is red = 2 3rd band is orange = multiply by 1,000 (simply add three zeros) So the value is 12000 ohms, commonly known as a 12k resistor. The fourth band is silver, which indicates that the resistor tolerance is + or – 10% (the actual resistor value can be greater or lower then 12k by as much as 10%). If you prefer, you can use one of the many free software calculators that you will find on the internet. This one can be found at www.hobby-hour.com/electronics/resistorcalculator.php
Basic Electronics 11
Back to Contents Page 5
Another calculator can be downloaded from www.merg.org.uk/merg_resources/resistors.php
Wattage The more current that flows through a resistor, the more it heats up (that's how your electric fire or soldering iron works). Of course, we don't use resistors as heating elements – its just a by-product of using them to reduce voltage or current in a circuit. In fact, excessive heat will eventually destroy a resistor. The wattage rating of a resistor tells you how much power it can dissipate over a long period of time without being damaged. Resistors fitted to electronic circuits where only tiny signals are being carried may use 1/8 th of a Watt, while heavy current usage requires higher wattage handling (e.g. a car lamp bulb or soldering iron may be 25W). Most electronic circuits probably use resistors with ¼W or ½W ratings.
Tolerance Resistors are manufactured in their millions. To keep their price down, they are not exactly precise, with their deviation between the actual resistance value and the stated value being known as its 'tolerance'. Of course, you can buy resistors with very low tolerances – at a higher price. It depends on what you want to use it for. Most resistors are produced with tolerances of either ± 2%, ± 5%, ± 10%, or ± 20%. Close tolerance resistors are used where precision is important, such as transmission equipment (to work at the correct frequency) or measuring equipment, such as your multimeter. In most situations, the cheaper wider tolerance resistors are commonly used. E6 series resistors have a 20% tolerance, while E12 series resistors have a 10% tolerance or occasionally 5%. E24 series resistors are mostly 5% but some are available in 2%.
Material Most model railway applications use carbon resistors. They are made up of a rod of carbon with wire connections at each end. If you broke one in two, the inside would look like a pencil lead. They are the most common and are cheap and readily available. Basic Electronics 12
Back to Contents Page 5
Other types are produced for specialist purposes. For example, resistors made from metal film ( nickel chromium) are used in audio amplifiers as they produce less noise than carbon resistors, and are less affected by heat and voltage changes Where very high currents are being passed through a resistor, wire wound types are used. They are constructed in a similar way to the element that winds round a bar of an electric fire. They are often used for high precision measuring or where high power ratings are required (some handle up to 300W). Early locomotive controllers used large wirewound resistors to control loco speeds. Surface mount resistors are now the standard for manufactured boards and are becoming more used for hobby kits. They are tiny, with no leads, and require practice to solder to boards.
Types Fixed
Most resistors are of the 'fixed' type. That means that they are manufactured to a specific value and that value cannot be varied by the user. It is just a component with two leads. The illustration shows a couple of fixed resistors (one is carbon and the other wirewound). The symbol for a fixed resistor that you see in electronic diagrams is either a zig-zag sawtooth-like shape or mostly commonly a simple rectangle. Single resistors are not polarised. That means that they work whichever way they are connected. The only exception is for commoned resistor arrays mentioned below. Arrays
Most circuits use a collection of individual resistors in their construction. Sometimes, however, there are occasions when a collection of the same value are used in close proximity, usually for a common purpose (e.g. connecting to a set of LEDs or to a group of switches). In these situations, it is neater and saves space to use resistor arrays (sometimes shortened to 'resnets') These illustrations show a type known as SIL resistor networks . SIL means single in line, a single row of pins. As you will notice, some resnets are 'isolated'.; each resistor has its one set of pins and has no connection to any other resistor. The other, known as 'commoned', has one end of all resistors taken to a single output pin. The dot on the resnet case indicates pin 1, which is the common pin for commoned resnets. Another array is the DIL (dual inline) with two rows of pins. All eight resistors in the network will have the same value of resistance and there is no internal connection between any resistor. Basic Electronics 13
Back to Contents Page 5
Variable You will already be familiar with variable resistors as they can be found as volume controls in many audio systems and as a speed control for a model railway controller. They are three-terminal devices and are often referred to as 'potentiometers' (sometime
shortened to 'pots') Some are altered by turning a knob while others use a slider to change value. In both cases, a wiper slides over the resistive material and the result is taken out to a third terminal. The symbol for a variable resistor is similar to a fixed resistor, with an arrowhead on the side to show that its value can be varied. Take this example of a 'linear potentiometer' with a value of 100k. That means that there will always be 100k across its outer terminals. Its the value seen at the wiper terminal that is changed when the knob or slider is varied. In our example, the outer terminals have 12V across them. As the inner material has a consistent coating, the voltage is spread evenly across the entire inner surface. So, the coating at the top terminal will be at 12V, while the coating at the bottom terminal will be at 0V. It follows that the middle of the coating should be at 6V. If we turn the knob (or move the slider) to mid position, the wiper should be at 6V. So, by moving the wiper, we can control the voltage that we use. Note There is another type of potentiometer known as the 'logarithmic' type. They are specially made for audio purposes, as our hearing levels are logarithmic. Make sure you always use a linear type for model railway projects.
This illustration shows a couple of examples of 'preset potentiometers'. These are much smaller than standard pots and have no external rod or slider to alter values. Instead, they have a small slot that allows the wiper's output to be set by a screwdriver. These are common on printed circuit boards where there is no need for constant adjustment. The wanted value is set and then left alone. The symbols used are slightly different from variable resistors.
Ohms Law Lets have one last analogy with central heating. The amount of water flowing round your system depends on the amount of pressure being provided by the pump, and the stifling of the flow from valves, narrow pipes and clogged pipes. The three are interrelated. If you increase the pump pressure, more water flows round. If you turn down radiator valves less water flows in that radiator, and so on. And so it is with electrical current. Basic Electronics 14
Back to Contents Page 5
The current flowing in a circuit is directly proportional to the voltage (greater voltage means more current) and inversely proportional to the circuit's resistance (greater resistance means less current). So, if you know any of two properties, you can calculate the third. The calculations use V to represent voltage, I to represent current and R to represent resistance. The illustration shows a simple way to remember the three formulae.
From the middle pyramid, we can deduce that I = V/R (i.e. that current flow increases with increased voltage but reduces with increased resistance). These calculations are known as 'Ohms Law' (remember Georg?).
Some examples
If you place a12V battery across a 6V bulb, you get double the current. The excessive heat burns out the bulb filament. If you have a short in a circuit, you get as much current as the supply can produce – until the fuse blows - or worse. If you have a bad connection or use wire that is too thin, you have introduced excessive resistance. The diminished current flow will probably result in the device working badly, or not at all.
Some calculations You have a 6V bulb but your supply is 12V. The bulb says it works on 200mA (0.2A). We know that if we add extra resistance, the current flow will be reduced. We also know that the current flowing through the resistor we added will now drop some of the voltage across it. So how do we calculate the value for the resistor? Well, the resistance of the bulb filament when hot must be R=V/I = 6/0.2 = 30 ohms. We want 6V to be dropped across the resistor, to leave just 6V across the bulb. So the value of the resistor can be calculated thus: R=V/I = 6/0.2 = 30 ohms. You could probably have guessed it would be the same value since we wanted to halve the voltage. How about when we have a 4.8V 300mA bulb? The calculations are only slightly more complicated. We want to drop 7.2V across the resistor (12V-4.8V). So, the resistance value must be R=V/I = 7.2/0.3 = 24 ohms.
Basic Electronics 15
Back to Contents Page 5
Note
In these examples, we deliberately introduced added resistance to achieve our needs. In model railways, the introduction of unintended resistance is a source of problems. When your loco runs slower in one section of track compared to another; when your solenoid doesn't quite move the point as snappily as it used to; when the lights dim unexpectedly – these are all symptoms of unwanted resistance. This is covered in detail in the chapter on layout wiring.
Series circuits When you have more than one resistance, they can be in series with each other, or be connected in parallel. The illustration shows a simple series circuit. You simply add the resistance values together to get the total resistance between the two ends. As the resistances are in series with each other; the same amount of current will pass through all the resistances – no matter what value of resistance they have. But, according to Ohm's Law, the same current flowing through different resistances results in different voltages across each resistance. This is used to good effect in many electronic circuits. The illustration shows two resistors in series across a 12 volt supply. The 12 volts is distributed across the resistors depending on their values, hence its name as a 'voltage divider'. The resulting voltage at their junction depends on the ratio between the two resistors. If both resistances were equal, there would be 6Vpotential between the junction of these two resistors and 0V potential. All voltages are relative to the 0V line. Other examples include: 10k on top, 1k on bottom results in 1.091V at the junction. 47k on top, 12k on bottom results in 2.441V. 47k on top, 33k on bottom results in 4.95V. As always, there is an online calculator to make life easier. Try: www.raltron.com/cust/tools/voltage_divider.asp The voltage divider effect was widely used in early loco speed controllers such as the H&M models. Like many others, it had a large wirewound variable resistor. As the rheostats's knob was turned, the wiper rubbed across the windings and varied the amount of resistance placed in series with the locomotive's electric motor. Turning the knob clockwise decreased the added resistance, increasing the voltage across the motor, thus increasing the current flow and the motor speed. Nowadays, we use more sophisticated ways of controlling loco speeds (see later).
Basic Electronics 16
Back to Contents Page 5
Tip : If you need a value that you don't have in your spares box, make one up from other resistors in series. For example, wiring a 820 ohm and a 180 resistor produces a 1k resistor.
Parallel circuits Not all circuits are wired in series. Your house lights, domestic appliances, PC, etc. are all wired in parallel with each other. They all receive the same 240V supply but each consume different amounts of current from the common supply. In model railways, we use parallel circuits when we operate locos, points, lights, etc. The illustration shows how to calculate the resulting resistance from two resistors wired in parallel. If there are only two resistors, the equation can be simplified to R1 x R2 R total = -----------------R1 + R2
To avoid awkward calculations, specially if you have many resistors, you can use on-line calculators such as: www.sengpielaudio.com/calculator-paralresist.htm Tip : If you want a value that you don't have in your spares box, you can make one up from other resistors in parallel. For example, wiring two 1000 ohm resistors in parallel will give you a 500 ohm resistor. Other examples include: 560ohms and 470ohms give 255 ohms. 100ohms and 150ohms give 60 ohms (or you could use 33ohms and 27ohms in series).
Wattage We mentioned wattage earlier but how do we calculate the power being used by any given device? You can calculate the amount of power if you know two of the three electrical values – voltage, current and resistance. See the formulae in the wheel (E, like V, is used to indicate voltage). So, using W = E x I, we can make some calculations like those below: If your loco uses 1Amp at 12 volts, then is consumes 12 watts. A 240V light bulb uses 0.417 amps (470millamps) to be a 100watt bulb. A 2 kilowatt kettle uses 8.333 amps (240 x 8.333 = 2000)
Basic Electronics 17
Back to Contents Page 5
What is DC DC stand for 'direct current'. A battery is a typical store of DC energy. It has two terminals, with a potential difference between them. One terminal (the -ve) has a surplus of electrons, compared to the other (+ve). Place it in a device, switch the device on and the electrons start to flow. All battery powered devices, such as your watch, mobile phone, iPod, etc. depend on a constant flow of direct current during their operation. The graph shows the voltage unchanging over time.
Electrons will always flow from the negative terminal to the positive terminal. Its true that you can reverse the wires from a battery pack to a loco and train will go in the opposite direction. However, although the current is flowing through the motor in the opposite direction, the current itself is still flowing in the same direction between the battery terminals. The voltage from a DC supply may vary and the current flow may vary (either intentionally or through a battery weakening) but its polarity never reverses. DC is used inside nearly all electronic apparatus, including industrial, domestic and hobby devices. DC is used extensively in model railways for loco motors, LED lights, most point motors, DCC decoders and more. Even devices that are connected to the mains use DC for their internal components (transistors, microchips, logic circuits, etc.). The incoming mains is converted from AC to DC as will be shown later.
What is AC With DC, the current flow is unidirectional; it always flows in one direction. Alternating current (AC) is completely different. If you could look at the two pins of an AC supply, you would see that the voltage is constantly changing, getting larger, then smaller then changing direction. The image shows a 'figure of 8' mains plug and below is a typical AC waveform, like the sine wave type you receive on your mains supply. The illustration shows three complete cycles of the waveform as time passes and the stages of supplying current to a circuit during a single time cycle are:
Basic Electronics 18
Back to Contents Page 5
At the beginning A, there is no voltage difference between the pins, therefore no current will flow. As time passes, see B, pin 1 has a higher voltage than pin 2, so current will flow out of pin 1, round the circuit and back to pin 2. Later, at point C, pin 1 is at its greatest compared to 2, with maximum current flowing round the circuit. At point D, the voltage difference has started to decrease, with reduced current flow. At point E, there is again no voltage difference between the pins and no current flows. At point F, the voltage difference is reversed. Pin 2 is now at a higher voltage than pin 1, Current will again flow in the circuit – but in the opposite direction. At point G, pin 2 is at its greatest compared to 1, with maximum current flowing in the circuit from pin 2 to pin 1 The AC mains supply then reduces again, see H. At point I, there is again no voltage difference between the pins and no current flow. The same cycle starts all over again... and again... and again...
You may wonder why such a complicated system is used instead of normal DC. AC is more efficient to generate and distribute and cheaper and more reliable. AC in the UK is supplied at 240 volts AC as the standard domestic mains supply. It is used directly, without any modification, to power your cooker, electric fire, incandescent light bulbs, etc.
Frequency The time taken to complete this cycle is measured in time as its 'period'. In the domestic supply for the UK, Australia, New Zealand, most of Europe, this cycle happens 50 times every second (60 times per second for the USA, Canada and parts of South America). The number of times the polarity reverses is known as the 'frequency' and is measured in 'cycles per second' (CPS) or 'Hertz' (Hz). So the UK mains frequency operates at 50Hz. That means that the mains goes through a complete cycle every 1/50th of a second – i.e. 20milliseconds. Consequently, the frequency = 1/ period.
Basic Electronics 19
Back to Contents Page 5
Voltage The total movement from zero volts to full voltage in any direction is known as the 'peak amplitude', with the 'peak-to-peak amplitude' measuring the total swing. You will have noticed that AC power does not supply a constant voltage and current; it is constantly varying. We need some way to measure the effectiveness of the power. This is done by measuring the heating effect of AC compared to DC. Obviously, 200 volts of AC would not produce the same heating effect as 200 volts DC. In fact, the equivalent heating effect of a sinusoidal waveform compared to DC is 0.707 of its peak value. This value is known as the 'root mean square' or effective value and just written as RMS. When you read that the UK household electricity supply is 240V, it is really saying that it is 240V RMS. It is providing the same heating value as if it was 240V DC. Note
If we measure the mains voltage with a multimeter set on the AC range, we will read 240V, as the meter reads RMS values. If we measure the same mains supply with an oscilloscope (which displays the actual waveform), we will see that the UK mains has a peak amplitude of 340V and a peak-to-peak amplitude of 680V. The RMS voltage is 120V in the USA and Canada and 230V for most of Europe, Australia and New Zealand. The UK voltage is also meant to 'harmonise' with EU standards but still supplies at 240 (being within the 230V ±10% rule). As a quick method, multiply the RMS value by 1.414 to get the peak value, or multiply the peak value by 0.707 to get the RMS value. So, for example, a 15V AC socket on the rear of your loco controller has a peak voltage of 21.21V. The difference between RMS (the value printed on the label of a supply) and the peak value becomes important when we start to look at building a regulated power supply later in this chapter.
Basic Electronics 20
Back to Contents Page 5
Analogue and digital Electronic circuits operate with either analogue or digital signals and both can be found in use in model railways.
Analogue Also known as 'analog' in the US A useful definition of an analogue signal is: “A nominally continuous electrical signal that varies in amplitude or frequency” Consider, for example, a simple loco controller with a potentiometer to control the output voltage. Turning the knob will result in an output between 0V and 12V – and every possible value in between. Depending on the pot's physical construction, and the steadiness of your hand, you could have an infinite number of outputs values. The 'nominally continuous' part means that after you set the loco speed, the output voltage will stay at that same level forever – or at least until you change the speed again. Analogue technology is also widely used in audio devices such as a microphone, a tape recorder, a DJ's turntable, loudspeakers and headphones.
Digital Digital technology takes a signal and converts it into a series of high and low voltages. It has been around for a long time (Samuel Morse invented the Morse Code back in 1837) but has really taken off in recent decades. The supreme example must be computers, where every word, every picture, every sound or video clip is reduced to a long set of zeros and ones (i.e. OFFs and ONs). Other domestic examples include digital radio, digital TV, CD players, etc. Sometimes, we even have both at the same time. If you have broadband internet in your home, you probably are using ADSL technology (digital) on the same incoming telephone as your normal telephone calls (analogue as far as the exchange). In model railways, digital signals are increasingly being used to enhance layouts. Some examples are:
Operating points using servos. Pulse width modulation (PWM) controllers to run locos. DCC controllers and locos fitted with digital decoders. The CBUS system to control accessories and traction.
The image below is the actual digital waveform from a DCC controller.
As you can see, the commands sent to the loco use a series of pulses and it is the pattern and length of the pulses that contain the information.
Basic Electronics 21
Back to Contents Page 5
Electro-magnetism If you pass current through a wire, magnetic field lines are formed around it. If the wire is formed into a coil, this effect is magnified and concentrated; you have created an electro-magnet with similar properties to a permanent magnet. This is put to use in a huge number of appliances including shavers, doorbells, buzzers, etc. In model railways, it was the basis of the majority of 'solenoid' type electrically-operated points and for magnetic uncouplers. Let's look at some examples of electro-magnetism in action.
How a solenoid works When the voltage is applied to the ends of the coil, the current flowing through the coil creates a magnetic field that pulls the metal rod into the coil. When the voltage is removed, the magnetic field dissipates and the spring pulls the rod back out of the coil. Although a very simple mechanism, it can be found in many everyday appliances such as washing machines, dishwashers, car starters, door locks, electric typewriters, circuit breakers, chime type doorbells, vending machines, automatic tellers, etc. A variation is to have two coils – one that pulls the rod in one direction and another coil that pulls the rod in the opposite direction. For model railways, it is the basic technique used in Seep and Hornby point motors (see later).
How a relay works If the wire is wound round a metal core, the magnetic field is strengthened and this is the most effective way to create electromagnets. A relay is just a switch that is operated by an electromagnet instead of your finger. As the image shows, they are available in a range of different shapes and sizes, with different specifications for voltage and current handling and the number of switch contacts. The illustration shows the principle of operation. A voltage is applied to the ends of the coil and the current through the coil creates a magnetic field that attracts the small block of metal (called the 'armature') towards the coil. The armature is attached to the moving part of the switch and results in an electrical connection between switch contacts A and C. Removing the voltage collapses the magnetic field and the moving contact is pulled back to its original position by the spring. If the relay is of a changeover type, there will be another contact (B in the illustration). In that case, contacts A and B are made when the relay is not energised.
Basic Electronics 22
Back to Contents Page 5
This image shows a close-up of one of the relays. The moving part is L-shaped, with the longer section being used to move the switch contacts. The short section is close to the coil (shaded red just for the sake of clarity). When the coil is powered, the shorter (red) section is attracted towards the coil and this forces the longer section to pivot upwards. This movement breaks the connection between the middle and lower contacts and the middle contacts now touch the upper contacts. While some relays use a spring to return the armature when power is removed, this relay has its spring built in to the contact blades. A main feature of relays is that there is complete electrical separation of input and output. This provides a number of advantages: A small current to energise the coil can result in large currents (say 5A) being switched. A small voltage across the coil (e.g. 5V) can result in higher voltages of 12V or even 240V being switched A relay can switch AC or DC. A relay can switch audio or data. A relay can have multiple contacts that switch at the same time. The main disadvantages of relays are: Being mechanical, they can be quite large compared to other electronic components. Like all moving parts, they could be affected by dirt, rust, moisture, etc. They are slower to operate than electronic components. Some need more current than can be supplied directly be a module. This often means that they need extra components to interface relays to electronic circuits. Relays are relatively cheap and are easily understood. Although they don't need any special handling precautions (they are not prone to damage from static for example), they should always be used within their specifications. The relay with the blue case shown in the earlier image is designed to be operated at 4.5V. While it will still operate happily at 5V, it should not be operated at a greatly higher voltage; the coil will overheat and burn out. On the other hand, the relay in the black cube is designed to operate at 12V. While it may still operate at a slightly lower voltage, too low a voltage will lead to unreliable operation. It is also best to avoid switching higher voltages or currents than the relay is rated for. This can easily lead to pitting of the contacts or even welding the contacts together. Operating relays within their ratings usually provides many years of trouble-free operation. In model railways, relays are used to great effect for section switching and frog switching (more later).
Basic Electronics 23
Back to Contents Page 5
How a motor works The most common type of motor used in model railways is the 'Brushed DC motor'. Although AC motors exist, they are mostly run at mains voltage for use in domestic and industrial appliances. A huge amount of research has gone into motor design but we can see how a simple DC motor works without delving too deeply into the physics of it all. These illustrations take us through the stages of creating a DC electric motor. Everyone knows that if you try to place two magnets together with their North poles facing each other, the magnets will repel each. Similarly, if two South pole faces are placed close to each other. Opposites attract and likes repel. In the first illustration, a magnet is fitted on a rotatable shaft and positioned between a pair of magnets. Since the two magnet's faces have opposing poles, the middle magnet will be repelled and make a half rotation to align opposite poles. The second illustration shows the middle magnet being replaced with an electromagnet (a coil wound round a piece of metal), usually called the 'rotor' When power is applied to the coil, it creates an electromagnet whose magnetic poles are identical to the magnet in the first illustration (i.e. N pole on the left, S pole on the right). This magnetic field results in the same 180° rotation (the N pole now has moved to the right-hand magnet). If the polarity on the coil is now reversed, the electromagnetic magnetic field would produce a magnetic field identical to the first field, the N pole is once again on the left-side – and the rotor will again spin 180°. Since the rotor is continually turning, the power to the coil is fed as shown in the third illustration. The coil is wired to separate sections of a 'commutator' which rotates along with the rotor. It has conductive sides, usually copper, and a bar of carbon is held in touch with each of the copper areas. These brushes are connected to the DC supply. So, as the rotor spins, the voltage being fed out of the commutator into the coil is reversing regularly. This ensures continual rotation while the power is switched on. The image shows an actual DC motor. A motor may have multiple windings (3-pole, 5-pole or 7-pole) and multiple segments on the commutator, to ensure the smoothest rotation with maximum torque.
Basic Electronics 24
Back to Contents Page 5
How a dynamo works The dynamo is basically a motor being operated in reverse. With the motor, movement was created by passing current through a coil. With a dynamo in a circuit, current is created by passing a coil through a magnetic field. So, if you take a DC motor and manually rotate its shaft, a DC output can be taken from its brushes. Current is only generated by the movement of the coil through the magnetic field; stop rotating the shaft and the current will stop; turn the shaft faster and a greater current will be generated.
How a transformer works A transformer takes an AC voltage input and produces an AC voltage output. Sometimes the transformer is wired to produce an output voltage that is the same as the input voltage. This is called an 'isolation transformer' as the device connected to the output has no direct connection to the mains supply. This helps minimise electric shocks and unwanted electrical interference. Many domestic devices, including model railways, run on much smaller voltages than the 240V mains supply. In these cases, the input is still at 240 volts but the output has to be wired to produce a much lower voltage (typically 6V, 12V, or 15V). The illustration shows the basics of a transformer. There are two coils of wire wrapped round an iron core. The input voltage is fed to the 'primary' winding and the constantly varying voltage (in both amplitude and direction) results in a constantly varying magnetic flux around the core. The varying magnetic field then produces an AC voltage on the output coil, the 'secondary'. Its like an electromagnet (on the primary) and an alternator (on the secondary) sharing the same iron core. The actual output voltage depends upon the 'turns ratio' of the coil on the secondary compared to the primary. If the two coils had the same number of turns, the output voltage would equal the input voltage (ignoring any losses). Transformers can be 'step-up' or 'step-down' types. Step-up transformers have more turns on the secondary and are used to produce the high voltages used in the old cathode-ray-tube TV sets, and in car ignition systems. For model railways, we use step-down transformers. So for example, if we wanted a 12 AC output, the transformer secondary would only have a single turn for every 20 on the primary. The 1:20 ratio would result in a 240V input producing a 12V output. Since a transformer has an AC output, it has to be converted to DC for use by most devices. Basic Electronics 25
Back to Contents Page 5
Reading circuit diagrams When a project is being designed, it is all about what components to use and how they should be connected together. This might be done by scribbling on a piece of paper or might be achieved through sophisticated software. Either way, the result is a 'circuit' diagram' or 'schematic'. This does not try to show how the project would look when built – just a guide to what connects to what. This allows someone to see how the stages of a circuit work and trace inputs and outputs. The working project is then developed, showing the printed circuit board tracks and where components sit on the board. This layout is used when constructing a kit. Circuit diagrams can often be overwhelming at first sight, with lines darting all over the page. Here is an example of a module that is used to control four servo motors.
Before looking at individual components and their symbols, it is useful to know that there are different ways of indicating the same thing. Although we will look at various options, it soon becomes clear which symbols are being used on a particular diagram, as they are not mixed on any one diagram. Wiring symbols The illustration show four devices that are wired together. Some wires are connected to each other, while others cross each other without connecting. The red circles show two ways of connecting wires together (you will see both being used in magazines). In the top example, a blob is used to show that they connect to each other, while the other example shows wires connecting at a 'T' junction to indicate that they connect. The blue circles show two ways of wires crossing each other. In the lower example, one wire 'humps' over the other, while the other two simply cross over. Just below the upper red circle, the wire seems to 'break' and this is just another way of showing that the wires cross each other without connecting.
Basic Electronics 26
Back to Contents Page 5
Ground symbols This illustration shows different ways of showing the common 0V point in a circuit, as many components often have one leg wired to 0V. This is used as a common reference point for taking voltage readings (e.g. a pin on a chip may be 3V positive with respect to ground). Most diagrams show the 0V line along the bottom of the diagram, with the +ve line along the top. The diagram on the previous page just used the inscription “0V” to indicate the 0V line. The other symbols may also be found in diagrams, depending on how old the diagram is or whether it a UK or US circuit. Some circuits simply use the inscription “Gnd” to indicate the 0V line. The symbol on the far right is the 'Earth' symbol which is sometimes used, although it dates back to a time when the connection was physically taken to real earth by burying a metal rod in the ground. If you look at component C3 on the top left-hand side of the diagram on the previous page, you will see that one end goes to the positive supply (see the +5V) and the other goes to the first symbol in the illustration (the 'Circuit Ground'). This just means that one end of the resistor is connected to the 0V line. It saves having to draw the line all the way down to the horizontal 0V line and thus makes the diagram look less cluttered. The second symbol from the left is that of the 'Signal Ground'. This is the common return line for any signals travelling along the circuit. Often, this is used in the same way as the first symbol. The third symbol from the left is that of the 'Chassis Ground'. This is a common point for components using the metal chassis of a device. It is often at 0V but not necessarily so.
Power symbols In the same way as you can simplify the drawing of a diagram by using symbols for ground, there are various symbols that indicate the supply voltage, whatever level that may be. The diagram on the previous page used +5V to indicate the positive 5V supply line. The three symbols shown are also used to indicate that the connection should be taken to the positive supply line. This snippet from a circuit shows both the supply and ground symbols being used.
Switches The symbols shown are for three varieties of lever switch and two push buttons. SPST stands for 'single pole single throw'. It has two terminals that are connected together when the switch is operated. The 'pole' indicates how many moving wipers are in the switch, while 'throw' indicates how many contacts the wipe can connect to. In this case, it is a single wiper that can either be connected to the other terminal or not – a simple ON-OFF switch. Basic Electronics 27
Back to Contents Page 5
The SPDT switch stands for 'single pole double throw', so the one wiper can touch two possible terminals depending on which direction the switch lever is operated – a changeover switch. A variation on the SPDT switch is the SPCO variety. It stands for 'single pole centre off' and this switch can be moved to one of three positions. In the middle position, the wiper touches neither of the terminals. The DPDT switch stands for 'double pole double throw' and is really two SPDT switches in the one switch body. It has two input terminals and four output terminals. The dotted line indicates that both wipers move at the same time. The NO pushbutton stands for 'normally off'. The two terminals are only connected to each other when the button is pressed. The opposite type is the NC pushbutton. It stands for 'normally connected' so the connection is broken when the button is pressed,
Electronic components Most of these components are covered later. In the meantime, here are their symbols.
Basic Electronics 28
Back to Contents Page 5
Power supplies Now that we have covered some basic principles, let's look at how they can be applied to model railways. Most layouts need at least two sources of power: A variable voltage to run the locos. A fixed voltage to run lights, points, etc. Sometimes, both power needs are built in to the one controller, with the controller providing a separate power socket for accessories. Other controllers need a separate power supply. The remainder of this chapter shows how a power supply is constructed.
Building a DC supply Most electronic devices use low-voltage DC to operate their components. However, the mains supply is at 240V AC. We already covered how a transformer can reduce the 240V AC mains supply to a more manageable low voltage AC. So, the next stage is to convert the AC into DC. This is achieved using diodes.
Diodes A diode, also known as a 'rectifier', is a semiconductor device that allows current to pass in one direction only. The illustration shows the shape of a common diode and its symbol. Diodes are available in a range of sizes and shapes, depending on the maximum current they are able to handle. Other factors are operating speed and maximum operating voltages.
Diodes and DC Consider this simple circuit of a power supply (battery or power unit) wired to a bulb via a diode. If the diode's anode is connected to the positive side of the supply, it is said to be 'forward biased' and it allows current to flow. Note that the electron flow is against the direction of the arrow.
If the diode is reversed, with its cathode towards the positive supply, it is said to be 'reverse biased' and no current will flow. Incidentally, the bulb will not glow quite as bright as would without the diode, as 0.65V is dropped across the diode.
DC uses for a diode Hobbyists sometimes connect power to a module the wrong way round, which can have grave consequences for the module. If a diode is wired in series with the power input, the module will only draw current when the power is connected the right way round and no current when reversed. Basic Electronics 29
Back to Contents Page 5
It is also common to see a diode placed across a relay's coil terminals, as in this portion of a diagram. We know from earlier in this chapter that passing current through the coil results in a magnetic field being developed around it. When the voltage is removed from the coil, that magnetic field collapses and this produces what is known as a 'back EMF' – a high voltage in the opposite direction to the original voltage across the coil. This, if left untackled, could lead to destructive voltages being fed back into the rest of the circuit. The solution lies in fitting a diode across the relay. While the relay is held in, the diode is reverse biased and acts as if was not there. However, when the relay is released, it is forward biased to the back EMF, the diode conducts and the current circulates round the diode and the relay coil until dissipated.
Diodes and AC This diagram shows an AC supply being connected across a diode and a resistor. During the first half cycle, the diode is forward biased, current flows and a voltage is developed across the resistor. During the next half cycle, the diode is reverse biased and there is no current flow, therefore no voltage across the resistor. This process is repeated for every cycle of the AC waveform. This is known as 'half wave rectification', as only half of the input waveform reaches the output.
The result is that the voltage across the resistor is a series of 'bumps'. It is not AC but is not a smooth DC either – it is a rippled DC. This is sufficient for some basic purposes but is very inefficient. The shaded areas show that only half the available power is available after rectification. A much improved supply uses a 'bridge rectifier' circuit as shown below.
This results in 'full wave rectification' as both half cycles are now used in the final output. This has greatly reduced the ripple effect and doubled the output power. A bridge rectifier is available as a component with four connections, two for the AC input and two for the DC output. Alternatively, a bridge circuit can be made up from four separate diodes. Like diodes, bridge rectifiers are available in a range of sizes and shapes, depending upon the current and voltage they need to handle. Basic Electronics 30
Back to Contents Page 5
Smoothing out the ripple The power supplies so far have very large voltage ripples on them, making them unsuitable for many circuits. The voltage level consistency can be improved with the use of 'smoothing capacitors'. These are large energy stores that are explained later. The capacitor is fitted across the DC output and is charged (like a battery) while the voltage is high. When the voltage starts to drop, the circuit gets its current out of the capacitor. This causes the capacitor to discharge but it is then recharged during the next voltage surge. The diagrams show the effect of the capacitors in half-wave and full-wave situations. The darkly shaded areas are the voltage to be expected without smoothing and the lightly shaded areas show the additional voltage lift from using capacitors. The rate at which the capacitors discharge depends on the storage ability of the capacitors and how much current is drawn from them by the circuit. Note The stated AC voltage from of any transformer's secondary is an RMS value. However, after rectification and smoothing, the DC level is quite different from the secondary's AC level. Remember, the AC peak level is 1.414 times the RMS level. For example, a 14V AC secondary output is really 19.796V peak. Since, after rectification, the smoothing capacitor maintains this level, the DC voltage across the capacitor might be thought to be 19.796V. Unfortunately, current passes through two of the bridge diodes during any one half cycle and each diode drops 0.65V across it. Subtracting these two voltage losses (a total of 1.3V) from the 19.797V , the final voltage across the capacitor is 18.5V – higher than the expected voltage.
Capacitors Capacitors are two wire components that are used in almost all electronic circuits, industrial, domestic including model railways. They are available in a range of sizes, types and specifications. Some are built for highfrequency equipment, some are designed for high stability, some for close tolerance, some for high-voltage working and some for high storage capacity. They are all, however, doing the same job; they store electrons for later use. Their storage ability is measured in Farads and values range from picofarads (10-12) through nanofarads (10-9) and microfarads (10-6) up to Farads. In audio and radio frequency systems, coupling capacitors are used to connect stages in the system; it passes the audio but blocks any DC component. In radio systems, they are used for tuning and filtering. In model railways they can be found in:
Capacitive discharge systems to move point solenoids. Power supply smoothing. Stay-alive capacitors for DCC decoders (e.g. for the Lenz Gold Mini decoder). Wave shaping DCC and CBUS signals. Timing for PWM controllers, flasher circuits, and other timers.
Basic Electronics 31
Back to Contents Page 5
Capacitors are made up from two metal plates that are separated by a conductive material, known as the 'dielectric'. Like a battery it can store electrons; unlike a battery, it cannot create electrons. A capacitor builds up a potential difference across its plates when a voltage is placed across it. One plate accepts electrons from the circuit, while the other plate loses electrons to the circuit. Depending on their use, capacitor dielectrics can be made from polystyrene, polyester polycarbonate and more, but the most used capacitors have ceramic or electrolytic dielectrics. Ceramic capacitors have low storage capacity and are used in timing and decoupling roles. Electrolytic capacitors have much greater storage capabilities and are used for supply smoothing and capacitor discharge systems. The upper picture shows a ceramic capacitor. These are 'non-polarised' which means they can be fitted either way round. The symbol next to it is for any non-polarised capacitor. The lower picture is of an electrolytic capacitor, which has a chemical dielectric. It is polarised and has to be fitted the right way round or it will be destroyed. They have a strip down the side with minus signs printed on them so that you can identify the positive and negative leads. Its symbol has a white rectangle on top (the positive lead) and a filled rectangle below (the negative lead). Some diagrams will also show a positive sign next to the positive end, but not always.
Identifying values The letter 'p' is used to represent values measured in picofarads, while 'n' represents values measured in nanofarads. Microfarads use the Greek letter mu 'μ' to represent microfarads as shown in this image. However, it is commonly replaced by the letter 'u'. So, 2μ2 and 2u2 both represent 2.2 microfarads. Sometimes, a value is shown without the 'F'. So 50μF, 50uF, 50μ and 50u are all the same. Similarly, a 10 nanofarad capacitor could be found in a magazine or on a diagram as 10n or 10nF. Equally, a 15 picofarad capacitor could be identified as 15pF or just 15p. As with resistors, the letter is used as a decimal point. So, a 6.8pF capacitor might be marked as 6p8. If a capacitors marking has exactly three numbers, without any letters, then the value is measured in picofarads. If you look at the blue ceramic capacitor above, you will see that its value is 472 (i.e. 472pF). The capacitor on the right is marked as .01, which means that it is .01 (one hundredth) of a microfarad. Where decimal places are displayed, it describes the capacitor's value in microfarads. Lastly, diagrams might use different ranges to describe the same capacitor value. For example, this capacitor, although marked as .01, could equally be described as 10nF. A .001 capacitor is the same as a 1nF or 1000pF capacitor. Basic Electronics 32
Back to Contents Page 5
Regulation So far, we have been able to convert a 240V AC mains supply to a lower voltage AC, rectify it to obtain a rippled DC voltage, and smooth out the worst variations with a large value capacitor. While this is sufficient for some basic uses, a much more smooth and consistent supply is preferable. Note You cannot always rely on the stated voltage outputs of 'wall warts', the units with an integral mains plug, that are inserted straight into a mains socket. The cheaper ones do not match up to their performance description. For example, a unit rated as 12V may produce 18V, dropping to only 9V when handling a load. Check before connecting to your equipment.
So, a supply unit may state that it supplies 5V, but is it really at 5V and does it always maintain a 5V output? These doubts can be eliminated using a 'voltage regulator' A voltage regulator is a semiconductor device that offers these benefits:
It provides a guaranteed specific output voltage It provides a constant voltage, over varying current demands. It eliminates all ripple.
It is a three-pin device:
A pin for the unregulated input voltage A pin that is connected to 0V A pin that outputs the regulated voltage
It has a very simple symbol and the output voltage can usually be understood from its markings. The most commonly used series start with a 78 or 79, followed by two other number that indicate the output voltage. 78 indicates that it produces a positive output voltage (the most commonly used type) while 79 indicates that it produces a negative output voltage (this one needs to be fed with a negative input, of course). The voltage regulator shown in the symbol illustration is a +12V regulator. If the first two numbers are followed by the letter 'L' it means that it is the smaller 100mA type. Some examples of regulator markings are: 7805 7806 78L05 7912
+5V 1A regulator +6V 1A regulator +5V 100mA regulator -12V 1A regulator
Some typical voltage regulators are shown in these images. They are not to scale; the one on the left is a surface mount component which is smaller than a grain of rice. The one on the right looks like a transistor and is used for low current circuits as it has maximum current handling rating of 100mA. The middle image is of a type that can handle larger currents and is intended to have a heat sink (a chunk of metal with fins to dissipate unwanted heat) attached to it, or to be bolted on to the metal case of a module.
Basic Electronics 33
Back to Contents Page 5
The unregulated DC input is connected across the regulator's input and ground pins, with positive lead from the supply connecting to the regulator's input pin. The input voltage should be at least 2V or 3V higher than the required output voltage. So, a 5V regulator should be fed by at least 7V and a 12V regulator should have at least 14V or 15V. Any less and the regulator cannot be guaranteed to work consistently. Although the 78xx and 79xx range of regulators have a maximum input voltage of 35V, there should not be too high a difference between the input and output voltage. This is because any unwanted power is dissipated as heat in the regulator and if the heatsink cannot conduct it all away, the regulator will shut down. It all depends on the current you expect the regulator to handle. Remember, power is voltage times current. A high input voltage with a small output current will produce less heat than a lower input voltage with a large output current. If in doubt, use an input voltage that is not excessive compared to the regulator's output voltage. This portion of a circuit shows the voltage regulator in use, with a 100nF (0.1uF) capacitor across the output. This would be in addition to the smoothing capacitors that would be fitted. It is fitted to shunt away any unwanted high-frequency voltage component that may have got through the regulator. The benefits of regulators explains why MERG kits use a +12V input and convert inside the module down to 5V. Any temporary drop in the 12V supply, such as might be caused by a sudden high current (e.g. operating a solenoid or servo) would have to be very dramatic before it would affect the 5V inside the module. This ensures that the internal components of the module (e.g. logic circuits or PIC chips) are always supplied at the required operational voltage.
Our final supply circuit Bringing all this together, we get this circuit.
To recap, the circuit functions are: The 240V AC mains supply is connected to the transformer's primary winding. The transformer's secondary winding connects 15V AC to the bridge rectifier. The rectified output from the diode bridge has a ripple that is partially smoothed by the 100uF capacitor. This is fed to the voltage regulator, which produces a consistent +12V DC output. The 100nF capacitor takes care of any unwanted high-frequency components. The 4.7uF capacitor carries out some final smoothing. Basic Electronics 34
Back to Contents Page 5
Chapter 2 Loco controllers
Loco Controllers 35
Back to Contents Page 5
Loco controllers As you have probably found out, loco controllers are available in all shapes, sizes, prices, with different facilities, accessories and so on. But let's start at the beginning.
The simplest controller Here is the simplest DC speed controller – one that was used extensively in early model railway controllers. It uses a 'rheostat' (a large wirewound variable resistor capable of handling large currents). As the knob is turned, the wiper rubs across the windings, varying the resistance placed in series with the locomotive's electric motor. Turning the knob clockwise decreased the added resistance, increasing the voltage across the motor, thus increasing the current flow and the motor speed.
This works well on a basic level but it only allows the loco to travel in one direction – there is no facility to change loco direction. Reversals are achieved by adding a DPDT (double-pole, double-throw) switch to the circuit.
Overload protection No matter how well you build and run a layout, there are always unexpected derailments with wheels shorting across points or the track. Our circuit above would not be able to cope with short circuits. If the rheostat was turned to minimum or no resistance, then there is almost no resistance across the power supply. Unless the power supply had its own protection, there would a huge amount of current (limited only by the current rating of the transformer). The wire windings of the rheostat would then act more like the bar of an electric fire – unless the diodes blew in the supply. You could fit a simple fuse between the power supply and the rheostat but that would be a bad idea, as it would need to be replaced regularly. It is best to fit a circuit breaker. The one on the left is a thermal breaker (it breaks and resets itself when the short is gone). The one on the right needs to be manually reset, like in your domestic fusebox. Loco Controllers 36
Back to Contents Page 5
If you want, go to eBay or an electronic supplier, buy a rheostat, a DPDT switch and a circuit breaker – and you can build your own basic DC loco controller! Rhesostats are expensive so many circuits replace them with power transistors which are cheaper and smaller. Apart from that, they function in the same way – reducing or increasing the resistance between the supply voltage and the loco's motor. Of course, you will not have the most refined controller like those that are now available. What are problems with a basic controller?
Jerky starts This is an all too familiar problem. The loco is stationary and you increasingly turn up the speed knob to find nothing happens – until the loco suddenly speeds away (a condition sometimes called 'jump starting'). The effect is unrealistic and unsatisfactory. The sources of the problem can be both mechanical and electrical.
Static friction The motor and its gears have their maximum friction when they are stationary, a phenomenon unsurprisingly called 'static friction' or 'stiction' As the loco's speed control is turned up, the increasing current through the motor has no effect – until it is sufficient to overcome the static friction. By this time, the speed setting is well advanced and the loco flies off.
Cogging The metal of an iron cored motor is not uniformly present round the armature. There is a gap between each pole on the rotor, as shown in the illustration ( and look again at the picture of a motor in chapter 1). This results in parts of the rotor being attracted to the nearest permanent magnet and being reluctant to be pulled away. It is the same effect you will have noticed when pulling a magnet off a sheet of metal; its stays put despite increasing pulling, before suddenly being jerked off the material. Better quality motors use 'skew wound' construction. The illustrations show the standard motor on the left and the skew wound motor on the right. The non-metal gaps run the length of the standard rotor, while the gaps run at an angle with skew wound. Skew wound rotors have less pronounced gaps, when viewed on the horizontal axis, and this minimises cogging.
Motor resistance This is the main cause of jerky starts. First, a quick look at the phenomenon called 'back EMF'. We described earlier how a motor can act like a generator as well as a motor. Well, when a motor is being turned by an external voltage, it is also generating a counter voltage (the back EMF) which opposes the supply voltage. It is the resultant voltage that determines the speed of the motor. The faster the motor spins, the greater the back EMF; a stationary motor produces no back EMF. You will recall that there are two resistances in series across the power supply – that of the controller and that of the loco's motor. The motor has a much lower resistance and a higher current when stationary than when it is turning, due to the lack of any back EMF.
Loco Controllers 37
Back to Contents Page 5
The increased current means more voltage being dropped across the rheostat and less across the motor. However, once the motor starts turning, back EMF occurs, the current drops, less voltage is developed across the rheostat and more across the motor. The sudden voltage increase makes the loco surge forward. Although this problem is worse when using rheostats, it occurs with most DC controllers.
Loco slows or stalls When an electric motor is presented with a greater load, its speed will slow. This reduces the back emf and results in it drawing a higher current and effectively lowering its resistance. Since this current flows through the controller as well as the motor, the voltage available to the motor is actually reduced, as the controller takes a greater proportion of the available voltage. This explains why your loco slows on gradients, with heavy loads, or the friction of going round tight bends in the track. In the worst case, the motor voltage will drop to a level that prevents it from turning – a stall situation.
Jerky slow running Some of the problems might simply be caused by dirt on the track, or the wheels or the power pickups. It might also be caused by poor mechanical transmission (motor gears, valve gear, coupling rods, etc.). Otherwise, it is similar to the above problem. At slow speeds, most of the circuit resistance is in the controller and current changes affect the motor voltage less than the controller's resistance. There is insufficient torque (i.e. turning force) being created to maintain a smooth smooth rotation of the rotor.
Racing downhill This is the opposite effect to slowing on inclines. When going down a gradient, the motor draws less current due to increased back EMF. The voltage across the motor increases and the loco speeds up.
Unrealistic performance Unless you are very careful, it is difficult to achieve the realistic simulation of train inertia and momentum. It would be much better if the controller could simulate acceleration and deceleration effects. So, if you suddenly turn the speed knob fully up you don't jerk away; you gradually build to maximum speed. Similarly, a quick turn of the knob fully down gradually slows the loco to a stop. In fact any speed changes should reflect the authentic performance of the loco.
Approaches to solving these problems We can easily tackle mechanical issues with some cleaning, adjustments and lubricant. The electronic problems mostly concern achieving and maintaining sufficient torque (i.e. turning force) in the motor. If we can achieve sufficient instantaneous torque from the motor, we can overcome the retarding effects of friction and cogging – achieving smoother starts. If we can maintain torque levels throughout the twists, turns, gradients and declines in the track, we minimize stalling and jerky slow running. The two main ways that controllers tackle this is by:
PWM – Pulse Width Modulation Back-EMF Feedback
Loco Controllers 38
Back to Contents Page 5
PWM In most of the above situations, we wish we could just give the motor a bit of a 'kick' to get it started or to avoid jerking or stalling – and that's just what PWM aims to do. In fact, Pulse Width Modulation (PWM) is nothing other than giving the motor continual 'kicks'. With normal DC, we change the voltage from 0V (stop) to maybe 12V (full speed), with every voltage in between. At high voltages, we avoid some of the problems of stiction and cogging, due to the momentum of a high spinning motor. It is at low motor voltages that the problems are mostly evident. If you could look at the voltage across a motor when using ordinary DC, it would like these three charts which show the voltage at different speeds.
You can see how difficult it is to maintain torque at the slower speeds, with such small voltage levels. A PWM signal, on the other hand, looks like this for the same three speeds.
At the faster speeds, the output looks similar to a normal DC voltage. In fact, at the very fastest speed, it would be a continual 12V just like normal DC. It is the slow speed on that chart that is of the greatest interest. Instead of sending a small voltage (say 2V) to the motor, a succession of 12V pulses are sent to the motor. Over a period of time, its effective voltage is the same as the small DC voltage. If you tried to measure the signal with a meter, it would look like a low voltage, as the meter would average out the pulses. However – and this is the big advantage – the 12V kicks provide the instantaneous torque that tackles stiction and cogging. Its increased torque also minimises problems with stalling and jerky slow running.
Loco Controllers 39
Back to Contents Page 5
The PWM signal has two factors:
How often the 'kick' happen – known as the 'clock cycle'. How long the pulse lasts – known as the 'duty cycle'.
The clock cycle is measured in Hz and the duty cycle is measured as a percentage of the available time. In the example, the duty cycle's slow speed is running at 10%, the mid speed at about 40% and the fast speed at around 90%.
Clock cycle The clock cycle cannot be too long, as the pulses would appear too infrequently to be effective. If the clock cycle is too short, the pulses would be arriving at a much faster rate. At excessively high frequencies, the coil in the motor behaves more like an inductor and its impedance (resistance to current changes) inhibits the passage of high frequency pulses and reduces the current flow through the motor. There is no one frequency that can be applied to all motors. ZTC Controls produces a useful chart that shows the best PWM frequencies to use for different motor types; it varies from 31Hz to 32kHz.
Loco Controllers 40
Back to Contents Page 5
As a general rule, the older 3-pole open frame motors, with straight slotted poles, benefit most from running at lower frequencies. Modern, 5 or 7-pole can motors, with skew wound poles, use mid frequencies. Coreless motors can be run happily at higher frequencies, although slow speed running might not be enhanced.
Buzzing The average human ear, depending on your age, can hear frequencies between 20Hz and 20kHz, with maximum sensitivity between 1Khz and 4kHz (your landline telephone only uses a band from 300Hz to around 3kHz). With exception of the very highest frequencies in the ZTC list, all are within the human hearing range. Feeding a motor with pulses in the audible range usually results in an distinct buzzing or humming sound from the motor. This is not normally harmful to the motor but some find it annoying. To counteract buzzing, a loco controller can increase the frequency of its clock cycle, to take it beyond the range of human hearing. 16kHz usually is beyond the hearing of a middleaged male, with frequencies up to 32kHz being beyond everyone's hearing ability. The downside to a higher frequency is often poorer performance at slower speeds. Note If you are already using DCC, then your decoders are using PWM to control motor speed, set by the values in CV9 to match your individual loco's motors (see the chapter on DCC). This CV is sometimes referred to as the 'repeat rate'. The value entered into CV9 is the period (the reciprocal of the frequency). So, higher values result in lower frequencies and vice versa. Decoder manufacturers like to promote their decoders' by describing their abilities to produce high frequency PWM. So, we have Silent Running(from NCE and Zimo), Supersonic (from Digitrax) and Quiet Drive (from TCS).
Duty cycle The duty cycle decides the effective running speed of the motor. It is a ratio of the voltage's 'on' time to its 'off' time. A 0% ratio means the pulse has no width, hence zero volts, while 100% means the pulse has no 'off' time, resulting in the full supply voltage across the motor. While the clock cycle is a fixed value, the duty cycle will vary as the operator speeds and slows the loco. If you go back a page and look again at the PWM waveforms, you can make the following observations. In the first chart, the 'on' time was 10% leaving an 'off' time of 90%. This would be known as 1:9 mark-space ratio and would be the equivalent of 1.2V DC for a 12V supply. The second chart would equate to 4.8V DC and the bottom chart would equate to 10.8V DC. If the operator tuned the control to full speed, there would be no 'off' period and the voltage on the motor would a continuous 12VDC (just like a straight DC controller). While high mark-space ratios are broadly similar to normal DC working, the real benefits come at lower ratios. While a constant 1.2V DC supply exposes the motor to stalling, etc., the short bursts of full power produce greater torque and are much more likely to keep the motor turning.
Loco Controllers 41
Back to Contents Page 5
Heat dissipation In our earlier example rheostat controller, if we wanted to reduce a 12V supply to only 3V for the motor, we would have to drop the other 9V across the rheostat. If the loco consumed 1A, then the power developed in the rheostat would be a full 9W. The same power would be developed if we had instead used power transistors as the drive electronics. In both cases, the power would be dissipated as unwanted heat. PWM working reduces the harmful overheating effects. With PWM, power is totally switched off during the 'off' times and the power developed during the 'on' times is nearly all used by the motor. There is very little wasted power in a PWM controller. PWM is also very handy for the controllers built into DCC decoders, otherwise the excessive heat would melt the plastic bodies of the locos! Lower clock cycles however, can have an effect on increasing the heating of the motor coil; this is usually worse for small motors with little metal to absorb the heat.
Conclusions on PWM Despite the noise and heat problems, PWM offers a great step forward in obtaining much smoother running of locos, particularly at slow speeds. Most DC controllers use PWM for that reason, and it is almost universally used as the motor control system built into DCC decoders. For best results, the PWM clock cycle should be matched to the motors in use.
Back-EMF We looked at back-EMF (often shortened to 'bemf') a little earlier and described it as the voltage that is generated as a motor spins, its voltage being in opposition to the supply voltage to the motor. This diagram shows a battery supplying a motor. The smaller battery, marked as 'Back EMF' represents the voltage which is effectively in series with the main supply, but with a reverse voltage. The motor, therefore, is being run from the difference between the two voltages. Back-EMF is the voltage generated by the motor windings moving in the magnetic field of the motor's magnets. Consequently, the faster the motor spins, the greater the amount of back-EMF, and vice-versa. Put another way, the back-EMF is directly proportional to the loco speed at any one time. When a loco comes to an incline, its speeds slows and its back-EMF reduces. When a loco hurtles down an gradient, its back-EMF increases. You could think of the back-EMF as a variable resistance with a value that changes with loco speed. In both cases, the current being drawn from the supply alters with the loco's speed – even though the operator has not touched the throttle control.
Feedback If we could detect these changes, we would know if our loco was running slower or faster than the speed set by the operator. The controller's circuitry could then take steps to automatically adjust the loco's speed back to where it should be. Loco Controllers 42
Back to Contents Page 5
This approach is known as 'feedback', as the changes inside the motor are fed back to the circuit in the controller. Of course, it is not possible to read this feedback at the same time as powering the loco. So, the steps are: Power the loco. For a very short time, cut off the power. Read the feedback (the unpowered motor is still spinning due to momentum). Restore the traction power. The illustration shows the principle of how it works. The voltage from the controller is taken to the motor via the tracks. When the feedback is to be measured, this voltage is cut off. The back-EMF generated by the freewheeling motor is now on the tracks and fed back to the controller, but in the opposite polarity. The detector circuitry measures the amount of back-EMF and compares it with previous readings. If the readings are identical, no adjustments are made. If the back-EMF reading has altered, either greater or smaller, this difference is used to alter the speed control's output (see the red dotted link) to compensate. Three different control systems use feedback techniques. In a normal DC feedback controller, the circuit has to make periodic power breaks to allow the bemf to be measured. These breaks may only last less than a millisecond and need only occur infrequently (maybe every second or less). In a PWM-based controller, the power is being switched on and off continuously anyway, so it is easy to read the feedback during some of the 'off' periods of the duty cycle. In a DCC system, the bemf is read within the decoders, with no involvement on the part of the controller. Controllers which combine PWM and back-EMF feedback, and also DCC decoders, provide much more consistent running than normal DC controllers. You can expect: Elimination, or a huge reduction, of jerky starting. Improved slow running. Reduction in stalling. Consistent speeds up and down gradients and on track curves. Speed calibration on DCC, so that all locos run at the same speed on the same controller setting. However, a balance has to be struck between improved running and having a train that runs at the same speed under all conditions (like a car's cruise control). After all, you would expect a train to slow somewhat on an incline.
Loco Controllers 43
Back to Contents Page 5
Other features Other useful features for a loco controller are the ability to introduce acceleration and deceleration. The controller converts an operator's sudden large speed change into a gradual increase or decrease in speed. No more jerking away from a standstill, or screeching to a sudden halt, or lurches as the speed is altered by substantial amounts. The controller's circuitry ensures gradual pulling away and slowing to a halt. In DCC systems, this facility is saved as user-defined values inside in the DCC decoders.
DCC - Digital Command Control For many years, model railway systems ran on DC. You varied the DC voltage to the track and the loco slowed down or speeded up. Modellers observed that things worked differently in the real world. The voltage supplied to electrified railway systems or underground systems did not vary their voltage. The overhead lines or rail tracks were supplied at a constant rate; the varying of the voltage to the electric motors took place within individual locos. That observation started the development of DCC, notably byBernd Lenz, which has now become widespread in model railways. Some find DCC a little complicated but we are discussing it here because the choice of loco controllers, and probably some layout wiring, will depend on which system (DC or DCC) you decide to use. If you are not using DCC, you could skip to the next chapter. If you are thinking of looking at DCC, then this is good place to start. If you already have a DCC system, it is best to know how it works before considering how it should be wired. With DCC, the loco is always provided with full track voltage and it is up to the operator to control how much of it is provided to the motor. This is explained in more detail later but the main thing to recognise is that: All sections of track are live at all times. The electronic devices (known as 'DCC decoders') that can be connected to the track provide great flexibility. These provide a great many benefits to model railway enthusiasts, such as:
Simplified wiring
DCC does not require any complex wiring systems for normal operation. A single power bus can feed the entire layout, connecting to every piece of track. A DCC layout does not need block/section switches or relays. A DCC layout, with less complicated wiring, results in fewer wiring problems. A DCC control panel has a cleaner look, with far fewer switches. A DCC layout need have no control panel at all, running everything from a handset. Wiring reversing loops, wyes and turntables are simplified.
Loco Controllers 44
Back to Contents Page 5
Simplified working
With all sections live at all times, there is no need to remember what sections are live or dead. You can run multiple locos on the same section of track, at the same time. You can run consists (one or more locos pulling a train).
Improved running
Non-polarised rails attract less dirt. DCC locos use PWM, with its benefits of improved slow running and less stalling (see earlier). Given its constant high voltage track supply, it is less troubled by voltage drops in cables. Each loco can be set to have a constant stopping distance.
Motor tuning
You can set the loco's minimum working voltage, so that the motor is fed with this voltage as soon as the operator advances the speed control to the very first notch. You can set the loco's maximum voltage. So, for example, a shunter will be prevented from racing round the yard. You can set the rate of acceleration for an individual loco. You can set the rate of deceleration for an individual loco. You can set bemf (see earlier) for maximum performance. You can tweak the reverse running to be identical to forward running. You can match the performance of multiple locos, to allow smooth-running consists. Each loco's electronics has its own individual settings that you set up and it remembers.
More than loco motors DCC offers more than running motors. It is designed to handle a range of accessories, both in the train and at the trackside. Loco features
Since there is power available to all locos on any section of track, at any time, even when they are stationary, the loco decoder can be configured to switch off and on various loco features such as: Sound (horns, whistles, bells, diesel engine and steam engine effects, brakes, etc.). Lights (headlights, beacons, Mars lights, firebox flicker, ditch lights, etc.) Uncouplers Cranes Lineside features
There are two types of DCC decoders- those intended for handling loco motors and those intended for handling accessories. Accessory decoders obtain their power (and their instructions) from the track and are used for: Points. Signals. Crossing and barrier gates. Uncouplers
Loco Controllers 45
Back to Contents Page 5
Simplified computer control Computer control of DC layouts is perfectly possible, with the computer turning relays on and off to switch the power to various track sections on and off. This is in addition to controlling the track voltage levels for speed control. Computer control is made easier with DCC, as the computer only has to tell a loco's DCC decoder to start or stop the motor, or change the motor's speed. There is no elaborate and complicated track power switching to worry about. Each loco has to have its own electronics board fitted – called a DCC loco decoder. The trackside decoders are known as 'Accessory Decoders'. They don't have the electronics for controlling the loco's motor, but provide switchable outputs for signals, lights, etc. Most of these provide 4 or 8 switchable outputs on the one decoder. Other decoders are designed to drive servos for point operations; others handle stall point motors or capacitive discharge point motors.
Downsides As usual, benefits come with downsides namely: Cost
The cheapest decoder costs around £12 and can be as much as £70 for large gauge locos that require higher current. To equip a sizeable fleet of locos would be an expensive undertaking. While a bottom of the range DCC command station costs little more than a good DC controller, the top of the range command station could cost over £500. A DCC sound decoder costs around £100. Railroad & Co Train Controller Gold is at the top end of computer automation software and sells at 499 Euros. (fortunately, there are cheaper versions – including free programs).
Complexity
You can only run one loco straight out of the box. Each loco decoder has to be allocated a unique identification number. So, if you bought two locos with prefitted decoders, they would both be supplied with the same default address. You would have to change one decoder's address to get both working on the same layout. Similarly, if you bought decoders to fit to locos, you have to ensure that they have different address numbers before trying to run them both at the same time. Decoders can be awkward to fit, specially in smaller gauges. All decoders require some initial tweaking to get the best from them. This is covered in a later chapter. DCC decoders don't make poorly running loco run much better. If your motor and mechanism is dirty, sticky, or badly adjusted, the electronics inside the decoder cannot compensate for the lack of basic maintenance.
Loco Controllers 46
Back to Contents Page 5
DCC shopping list If you are considering starting a DCC layout, here are the items to look for. Minimum
A DCC command station. The image shows a budget model – the Bachmann E-Z Command. A separate power supply, if one is not built into or supplied with the command station. A decoder for each loco.
Additions A booster unit, if you need to run more locos than your
command station can cope with at any one time. DCC function decoders, if you want to operate points and accessories via DCC. The image shows the Lenz LS150 accessory decoder which can switch six separate outputs. A hand held cab controller, if you want to walk around the layout while operating locos, etc. These can be wired to the layout via a plug and socket, or can use a wireless system.
How DCC works This is a simplified explanation of DCC working, as there is a full chapter on this later on. A DCC controller is called a 'Command Station' because it send out commands to the various decoders that are connected to the track – either in the locos or at the trackside. These commands are sent on to the track as part of the power supply to the track (this is explained in the later chapter on DCC).
The illustration shows three locos on the same section of track, being operated from a single command station. Although they are shown next to each other, they can, of course, be anywhere on the layout. Each loco is fitted with its own decoder. In the example, the decoders have been given the Loco Controllers 47
Back to Contents Page 5
unique addresses of 1, 2 and 3. There can be no two locos with the same decoder address on the layout at the same time. Each decoder is constantly looking for any incoming messages for itself. Messages for other addresses are ignored. When a message is received that matches its address, the instruction from the command station is acted upon. The message could be to go faster, go slower, stop, reverse, etc. In the example, the operator wants loco 3 to drive forward at half speed, so he/she selects loco 3 on the command station and turns the speed control to half way forward. The command station converts this setting of the speed control into an electronic message that is sent out along the track. Although the message is received by all the loco decoders, only the decoder with address 3 will respond to the message. A similar process takes place when the operator wants to move a point. The accessory decoder for that point will also have its own unique address. In this case, the message is not picked up from the loco's wheels and pickups. The decoder is permanently wired across the track near where it is to be used. Although the decoder will be receiving messages via the track, it will require additional power for running the accessories it is attached to.
Loco Controllers 48
Back to Contents Page 5
Chapter 3 Layout wiring
Layout Wiring 49
Back to Contents Page 5
Layout wiring Some layouts are planned and some layouts just 'develop' with time. While a lot of thought often goes into designing the tracks, the wiring of the layout is often looked at afterwards. This can easily lead to ad-hoc wiring schemes involving duplication of work, greater fault liability and even ripping out some parts to start again. This is all avoidable if the layout wiring is considered along with the rest of planning of the layout. Don't lay the track then think about the wiring; plan your wiring requirements before laying the track. This, in turn, means that you should give some thought about what type of layout you are aiming to produce - from an electrical standpoint. As we will see later, there are a variety of ways to operate and control a layout, with each requiring different wiring systems (e.g. DC, DCC, CBUS, etc.). You may even decide to buy particular brands of track and points that best match your final layout configuration (e.g. do you need insulfrog or electrofrog points).
Layout Wiring Goals The wiring of a model railway should have as its main aims:
Reliability (not prone to breakdowns, overheating, fire or shock risks) Maintainability (easily looked after and corrected when things go wrong) Alterability (the existing layout can be easily altered or added to)
These goals can be established by implementing some 'standards' with respect to the wiring. Reliability complications include
Long wiring runs (voltage drop, induction, interference) Multiple baseboards / connections Multiple operators Mixing DC and DCC Signalling Feedback / automation
Maintainability / alterability complications include
No / incorrect documentation No wiring scheme No diagrams No fault history Inaccessible mountings
Safety A short, but important, word before we begin. All the wiring that runs above and below your baseboard should be at low voltage. Mains voltages should never be allowed on the baseboard. There are a number of circuit diagrams available on the Internet for constructing home made loco controllers. Most use mains transformers to feed the rest of the circuit. Please don't attempt this unless you really know what you are doing. An alternative is to use 'wall warts' or 'power bricks' – power supplies that are sold for use with consumer goods or computers. These are double insulated and safe to use. Layout Wiring 50
Back to Contents Page 5
Different operating approaches Model railways are a hobby. That means that there is no 'correct' way to design a layout. It's about what you want to achieve. Some may aim to run an exact timetable for a particular railway line in a particular era. Others may prefer a more eccentric and chaotic narrow-gauge layout based on imagination. Yet others may enjoy the challenge of constructing a fully-automated, computer-controlled layout. Last, and not least, some may be content with a simple 'Thomas the Tank' layout running round a loop. All these, and others, are legitimate layouts. They only differ in the complexity of the layout wiring. A simple loop of track, with a point or two, is easily wired by even the newest beginner, only requiring two wires from the controller to the track. Moving beyond a simple loop, to the medium and large sized layouts, there are different attitudes to how a layout should be run. These differences lead to different wiring requirements. Firstly, there is the ongoing discussion as to whether the train is controlled by the driver or by the signalman. In most layouts, the trains are controlled by the operator (driver) with the signals being purely ornamental (doing nothing) , or an optional extra (manually operated) or simply tied to the trackside detectors. The other view is that to emulate the real world, train movements are controlled by the setting of the signals and therefore the hobbyist should have the primary role of signalman. The train movements are then dictated to by the signals, either manually or automatically. That leads to different wiring approaches. Purely manual Everything is left to the operator. There is no interlocking. Trains can run into the back of each other. Its up to you to control everything. Everything is wired back to the control panel. Manual with train detectors for signals Train detectors are used – but only to operate the signals. They have no effect on the trains. Trains are still controlled by the operator. It is still up to the operator to ensure trains don't run into each other. Manual with some interlocking Train detectors are used to operate the signals. They also operate relays that ensure power is switched off in the preceding section. The operator runs the trains but is prevented from running trains into each other. Manual with computer assistance The operator still runs the trains by hand. The train detector information is fed back to the computer. The computer controls the power to the sections. The signals can be operated directly by the train detectors or by the computer. Useful for 'glass panel' operators - those using mouse controls on a monitor screen. Fully automatic. The train detector information is fed back to the computer.
The computer controls train movements based on this information. Layout Wiring 51
Back to Contents Page 5
Layout options The 'train set' of our youth was simple. A pair of wires from the controller was attached to the track of the oval and the train ran in circles. One operator, one controller and one loco on the track at a time – layout control at its simplest. When a more complicated layout is planned, that involves having several locos on the track, or several operators, a number of different wiring methods are available. There are two main approaches to layout wiring: Block or cab control Bus-based layouts
Block control Real-world railways divided up mainline track into long blocks, with entry to each block controlled by signals. This prevented trains from running into the back of each other. This concept can be adopted for model railways in various options. We can carry out all operations manually, through electronic modules, or through computer control. For us, block control is a common means of controlling multiple DC locos on a layout. If you divide your layout into sections of track that are electrically isolated from each other, you can place multiple DC locos on the layout, each in a separate track section. If you are installing track, you can use plastic rail joiners to isolate adjoining rails. If the track is already laid, the rails can be cut with a fine-toothed saw or with a cutoff disc in a Dremel drill (don't forget to wear protective glasses). Since each loco sits on an isolated section of track, it can be operated in that section, independently from any other locos on other sections. You would create a block for each section of track on which you are likely to run, or park, trains. Some sections will be long (e.g. a stretch of main line) and others short (e.g. a siding or a passing loop). The more blocks you create, the more flexible the layout becomes – but the complexity of the wiring and switching also increases. Since each block requires to be powered independently, they need their own separate power wiring back to the loco controller. This illustration shows a basic block system (sometime referred to as a 'Star' or 'Point to Point' system).
Layout Wiring 52
Back to Contents Page 5
All the track sections shown are isolated from each other but are all connected to a central point (the controller), usually via switches or relays. The operator decides which locos to run by powering up that particular section by throwing its power switch. In the example, sections B, E and F are permanently wired to the controller so these track sections are always powered. Because switches S1 and S2 are thrown, sections A and D are also powered but section C is unpowered as switch S3 has not been thrown. So, throwing these two switches allows the operator to drive the train from block A, through block B, to block D. If switch S2 is now turned off, block D has no power and the train sits stationary in the block. Now, if switch S3 is thrown, a train in block C is powered and could be driven from block C, though block B to block A. Pros:
Each section is independent, so a failure in one section need not prevent the rest of the layout from working. Each section only draws a proportion of the total layout current. You can concentrate the entire layout's device controls (circuit breakers, block detectors, light switches, point control modules, etc.) in one accessible location.
Cons:
The huge amount of wiring that is involved produces cable management problems, unless meticulous records are kept. The long runs to the remotest parts of the layout may cause voltage drops in the cable and connectors, reducing the efficiency of the devices at the far end (e.g. locos running more slowly, LEDs dimmer, CDU's being less punchy).
Multiple operators The simple illustration above shows three tracks sections that can be switched between being powered and unpowered. It is designed for one operator, running one train at a time, using a single controller. That is enough for many home layouts, with the switches to power the blocks mounted in a central control panel. For larger home layouts and club layouts, there is a need to have multiple operators, each running their own locos – while still maintaining electrical and physical separation. For every loco running on the layout, there is an operator with a separate controller and two controllers should not be connected to the same block at the same time. In some cases, the operation is simple: one operator can be handling the main station while another handles the mainline, another the marshalling yard, and so on. To maintain movement, there would have to be a common handover point for each operator's domain. So, for example, the operator of the main station and the operator of the main line would require control over a common block (e.g. entry to the station throat). Layout Wiring 53
Back to Contents Page 5
The illustration shows a DPDT (double-pole double-throw) switch. When set one way, it connects controller 1 to the block; when set in the other direction, controller 2 is connected to that block. You might prefer to have a 'centre-off' version of this switch so that, in midposition, the block is left unpowered. This approach suits layouts where operators have defined layout districts to control and eventually have to hand over the loco to another operator. It is less suitable if you want to control a train as it goes all round a layout.
Cab Control The most flexible approach is to allow all operators and all controllers access to all blocks. This is known as 'cab control'. It gives any one operator the ability to control his/her train anywhere on the layout. Naturally, this raises problems of 'interlocking' – making sure that no two controller access the same block at the same time. This can be achieved through lots of switches, or through more complex arrangements using electronics and relays. We could have a separate switch for each controller to every block, but this quickly creates problems. Imagine a control panel that allowed 6 controllers access to 80 blocks – a total of 480 switches! However, there is an even bigger problem. To ensure that one controller had sole access to a block, we would have to ensure that the other five controller's switches were switched off – accidents waiting to happen! Luckily, there is an improved switching system that drastically cuts down the needs to a single switch for each block. Let's consider a single block for the moment. If there were four operators, for example, we could have an switch arrangement like that shown in the illustration. It uses a 1-pole, 4-way rotary switch. If controller 2 wants access to the block, the knob is turned to position 2. This prevents the other three controllers from connecting. The on/off switch can be left in the 'off' position when the block is not being used, preventing unintended train movements. This works well for a single block and can be replicated again and again for other blocks, with a rotary switch and on/off switch for each extra block added. Switch panels With a small layout, cab control is usually achieved by fitting all the switches to a central control panel. It is still possible to have a central switching panel in a larger layout, as long as the operators are happy to have a main co-ordinator in charge of all layout block switching. The main co-ordinator decides which operator can take over a block and provides access to the block to the chosen controller. The co-ordinator informs the chosen operator that he/she is ready to go – verbally, through lights, or through switching track signals. This method may be thought useful for running timetables, with the co-ordinator as the signalman, dispatcher, or 'Fat Controller'. It still allows some degree of flexibility. So, if block 12 should never be available to controller 3, then controller 3 will not be wired to block 12's rotary switch.
Layout Wiring 54
Back to Contents Page 5
Central control might be considered too restrictive and a common alternative is to wire smaller local control panels throughout a large layout. The blocks of a goods yard may be given their own control panel, as may a station or a fiddle yard. This system is usually accompanied by portable handheld throttles that plug into the layout close to the control panel. This way, any operator can walk up to a control panel, plug in a handheld throttle, dial his controller number on a block switch, and start running the train in that block. If required, a number of block switches can be similarly set, allowing the operator to run the train across multiple blocks. Moving from control panel to control panel, an operator can run a train anywhere on the layout. Another advantage of using local panels, is the shorter wire runs between the track and the panels.
Electronic switching While switches are the simplest way to ensure cab control, power to blocks can be controlled electronically. When a relay switches one controller's power to a block, it prevents other relays from switching until the block is released by that operator. Many home-brew designs have appeared to meet the needs of particular layouts. Ready-made modules are available for automatic block control. Heathcote Electronics have a range of modules that implement interlocking and also include acceleration and deceleration of the loco. MERG's SuperBloc system produces electronic kits that ensure there is never more than one train in each section at any one time. Trains can be controlled manually by setting signals in each area, or run automatically via interconnected block controllers. It is designed for DC motors. Finally, control of blocks could be achieved by linking electronic boards to a personal computer. CTI Electronics market a range of boards, under the 'Train Brain' range for controlling DC locos, via a PC and MERG produce a range of kits for DCC in its CBUS range for standalone or PC working.
Bus control This approach dispenses with lots of block switches This illustration shows that a single pair of wires is taken from the controller and routed round the layout.
Layout Wiring 55
Back to Contents Page 5
Wires are then run from each piece of track to connect to this 'bus'. So, all sections of the track have power at all times. Control of individual locos have to be controlled by other means – this is the basis of DCC-based layouts. In some cases, a bus could be wired as a loop, although not for DCC. Pros:
The huge potential reduction in layout wiring. Fewer wires means the wiring is cheaper/quicker to install. Fewer wires means reduced maintenance problems (fewer wires to break, fewer connections to corrode, fewer wires to have to trace/colour code/document. Fewer wires means less interference between longs runs of parallel wires (noise, crosstalk, induction). Easy to extend. Adding an extra baseboard, or adding a terminus, does not require lots of extra wires to be run back to the central point. The devices are simply tapped on to the existing bus which is extended to the new work area.
Cons:
Vulnerability to breakdowns. Since the entire layout relies on a single pair of wires, any breakdown in the bus could stop the entire layout from working. A system of cutouts to various sections is necessary to restrict the breakdown to the section that is causing the problem. Without using additional boosters (see below), the bus has to handle the entire current demands of all attached devices.
DCC (Digital Command Control) DCC is becoming ever more popular due to its many extra facilities, including track wiring simplification. At the level used by most small layouts, a single controller is wired to all sections of track. The entire track system is powered at all times and special decoders are fitted to each loco. That allows the controller to send messages to specific locos on the layout, instructing them to move, change speed, change direction, switch on loco lights, make sounds, etc. Locos are free to move around the entire track system without the need for track breaks, isolated sections, section switches or relays. Movement between stretches of track is seamless. Pros: No block/section switches or relays. Less wiring / fewer connection problems. Can run multiple locos – even on same stretch of track. Automation software, commercial and public domain, is easily integrated. Stay-alive capacitors can be fitted to locos. This minimises problems with insulated frogs and dirty track (particularly welcome for smaller gauges with short wheelbases). Points and accessories can be controlled via trackside decoders. These attach to the DCC bus and get their power and instructions via this single bus. No need for a separate accessories bus. Cons: Expensive. Savings on wiring costs are wiped out by high cost of decoders. Requires initial tweaking of decoders (setting the CV, motor tuning).
Layout Wiring 56
Back to Contents Page 5
Large scale DCC Large DCC-based layouts create additional problems that need extra wiring. If many locos, or locos that consume heavy current, are used then the total current demand may be greater than that available from a DCC controller. Up to a point, that can be satisfied by adding a booster to the controller. Beyond that, the layout would have to be divided into separate isolated sections with each section having its own power booster. Also. large club layouts usually have multiple operators, each controlling their own work area on the layout. The wiring system has to take that into account. These problems are overcome at the expense of more complex wiring. This illustration shows a large DCC-based layout that has locos with high current demands and multiple operators.
A single DCC command station still controls the entire layout and locos can move freely throughout the layout without any block switches. The layout is separated into a number of isolated sections that connect to the command station through separate boosters. The boosters have their own power supply and that means that the command station and its wiring does not have to carry the total current of the entire layout. Each booster powers its own district. The commands to control locos and DCC accessories come from the command station and are sent to each booster via its own bus – the Control Bus. Another requirement for multiple operators is a connection between their hand-held controllers and the command station. This wiring connection is known as a 'Cab Bus' and may be specific to a particular commercial DCC system, as there is no NMRA standard for CAB buses. The Cab Bus (or Throttle Bus), as shown, also allows computers and/or control panels to communicate with the command station.
Other buses Star and Bus wiring is not restricted to loco traction. It is also applicable to point control, signalling, lighting, etc. For example, if a factory used 20 LEDs for internal illumination, it would be very messy to have 40 wires routed back to the power supply. A single 'accessory bus' could take the power to the building, where is would fan out to individual LEDs. In other words, a bus to the building and a star formation inside the building. Where heavy current peaks are expected, it is best to have a separate loco traction bus and an accessories bus. That way, if a loco suddenly pulls away, the lights don't dim in the Layout Wiring 57
Back to Contents Page 5
station; or if a group of solenoids are operated for setting a route, the loco does not suddenly jerk down to a slower speed. In fact, for larger layouts, it is usually advantageous to have a separate power supply for the accessories.
CBUS MERG's own 2-wire layout control system has huge implications for layout wiring. It is based on the distributed bus method and is extensively covered in MERG's Technical Bulletins (there are 10 different TBs in the G32 list). There are also many articles in back copies of the MERG Journal.
This diagram, slightly adapted from previous MERG material, shows the versatility of the system. Apart from power, all the devices that are shown interface with each other over a single pair of wires – the CBUS. The devices include switches, LEDs, various point motor controllers, track occupancy indicators, relays, etc. To that can be added the CAN_CMD, which is a DCC command station that be controlled by MERG hand controllers (the CAN_CAB) or by computer.
Layout Wiring 58
Back to Contents Page 5
This 2-wire bus can replace much of the traditional layout wiring. For those beginning to plan a new layout, the CBUS system should be given consideration. Even for existing layouts, CBUS can be used to implement new additions such as signal and point operations, or track occupancy feedback to a mimic/control panel. This can be achieved without altering the existing track power arrangements.
Summary of buses This chart looks at the wiring demands of the most popular layout control systems. The simplest DC system only needs track power – a single bus. If you need to control points or accessories from a control panel, you need to run wires directly from the panel to each device. This includes the signal to operate the device and the power for that device. Similarly, if you want to have panel lights indicating track occupancy, you have to run signal wires back from every detector to the panel (plus the power for the detectors). In total, you would need a track bus, a power bus to take the 12V power round the layout, an accessory bus and a feedback bus – a total of four buses.
DC
Simple DCC
Large DCC
CBUS
Track Bus
Direct from controller to track (maybe via switches or relays)
Directly from controller to track or via a booster
Via track boosters Use CBUS with and power CAN_CMD and districts CAN_CAB
Accessory Bus commands
Direct from switches etc. to devices
Carried by the DCC track bus
Carried by the DCC track bus
Uses CBUS with CANACC8, etc.
Occupancy and other feedback
Separate bus needed
Separate bus needed
Separate bus needed
Uses CBUS with CANACE8C
Accessory power
Needs 12V feed
Via track bus
Via accessory bus Needs 12V feed booster
Control Bus
Not required
Direct from controller to booster (only if booster is used)
From controller to Not required multiple boosters
Cab bus
Not required
Not required
From all controllers to command station
From all controllers to CBUS
Note that the CBUS system can control traction and accessories and feedback from the one bus, with an additional power bus for the accessories and points. For an average layout, two buses are sufficient; an extra CAB bus would be needed if a larger layout had multiple operators.
Layout Wiring 59
Back to Contents Page 5
Chapter 4 Track Wiring
Track Wiring 60
Back to Contents Page 5
Track wiring The previous chapter looked at running a single train on a simple loop of track with a single power feed. A place where most of us started. Later, however, you add points and extra track, to allow for more varied running. So that chapter discussed methods of laying the track as a collection of separate isolated sections, making possible more complicated running operations. These included Cab Control systems and large DCC systems using multiple boosters to feed many power districts. Another reason for having isolated sections, both with DC and DCC, is to allow for track detectors to detect and act upon track occupancy (knowing that a loco is sitting on that section of track, whether moving or stationary). For example, the MERG TOTI-4 and TOTI-12 kits detect tiny currents when a loco is sitting in an isolated section. How the feedback from these detectors can be used is covered in a later chapter. There are two approaches to wiring isolated track sections: Common return Two wire feed If you have not yet laid your track, you may want to look at these two options and decide what is best for you.
Common returns One wire from the controller is fed to one rail as shown in the illustration. The other rail is cut into sections and the pieces are joined with insulated rail joiners. section is connected back to the controller through a device shown here as a blank box. For a cab control system, these boxes represent switches. This means that individual sections are only powered when their corresponding switches are thrown. Alternatively, the boxes might represent track occupancy detectors, such that the only detector triggered is the one that is passing current (through the loco's motor). Pros:
Each
Simplifies wiring. Half the wiring of the twin feed approach. Simplifies fault-finding. If one section stops working, there is only a single wire to trace for a fault.
Cons:
If using multiple boosters, the common return must have a very high amperage rating, as it has to carry the sum of all the boosters' currents. For example, if six of the sections were consuming 1A of current, the return wire has to carry 6A.
Track Wiring 61
Back to Contents Page 5
If a single common wire is used to connect the return wire from the track, solenoids, detectors, etc., there is an increased risk of interference (e.g. a pulse from the solenoids affects the detectors resulting in false triggering). Reverse loops still need to have isolated sections, to avoid shorts.
An improvement could be using separate returns for different high and low current devices. So, for example, the power bus, traction bus and solenoids could share a common return. These are all high current wires but are relatively immune to interference. Low level signal wires, such as track occupancy detectors and logic signals for motorised points could then share a common return that is unaffected by the large current pules on the other return wire. Note that although the diagram shows a single feed to the common return rail, multiple feeds to different parts of the common rail are used to minimise voltage drop.
Twin feeds To isolate a piece of track, both rails are cut, instead of one. Every piece of track has both rails isolated from adjacent track sections and each section is is fed with two wires, one for each rail. For block control, this means use a double-pole double throw (DPDT) switch, so that both rails are connected when the switch is thrown. Pros: Reduces unwanted interactions. Since no sections share a common return wire, the chance of changes in one section affecting another section is greatly reduced. Easier to make future alterations, as all rails sections are already wired under the baseboard. There is no need to cut track and insert insulated joiners. You simply rewire your under board connections to what your new needs are, without touching anything above the baseboard. Cons: Many more wire runs. Twice as many wires to connect. More scope for faults. Twice as many connections to go faulty.
Positioning track breaks As we have seen, there are a number of circumstances when we want to introduce isolated blocks and sections: These include: For DC Cab Control. For DCC power districts. For DC/DCC track occupancy detection. For programming the CVs of DCC decoders.
Track Wiring 62
Back to Contents Page 5
DC Cab Control The layout's track is cut into isolated sections that meet the operational needs of the user. Sometimes a long stretch of track will be considered as a single block. If, however, you want to run several locos on that stretch at the same time, the track has to be further sub-divided. On most occasions, a single siding has to be isolated (or at both ends for a passing loop. The plan has to cover all track sections where a loco might be reasonably expected to stop, and also take into account the likely maximum length of the train on each particular isolated section. Power to the track sections is routed through switches/relays. DCC power districts Power districts are introduced to spread the heavy current demand in the layout. This is usually caused by concentrated activities in distinct 'work areas' such as main line stations, goods depots, marshalling yards, fiddle yards, etc. These work areas can be isolated from each other and be fed from separate boosters, each booster taking a share of the overall current demand. Power to the track sections is routed through DCC power boosters. Track occupancy detectors The isolated sections should be chosen according to the function they are to fulfil. For example, you may only want a single occupancy detector, to operate crossing gates. Another option is allocate a detector to each of a layout's hidden sidings, to indicate which are currently occupied. You might even consider having many occupancy detector sections all round a layout, to provide feedback for mimic panel updates or computer automation. Power to the track sections is routed through the current detectors. Programming track DCC-equipped locos have their decoders programmed using a SPROG programmer, or the programming output from a DCC command station. The loco has to sit on a stretch of track that is dedicated for programming locos and is isolated from the rest of the layout, to prevent accidental re-programming of other locos. Some users prefer using a small piece of track on their workbench, to avoid any possible mistakes. Power to the track comes from the SPROG programmer or a DCC command station's programming output.
Feeds and droppers Track buses carry power all round the layout but they don't connect directly to the track rails. The track bus has to carry all the current needs of an entire layout, or an entire block or section. To minimise track resistance and connection problems, the track bus is best wired as a pair of continuous heavy current conductors that makes its way along the layout under the baseboard. Short wires are then taken from the track bus and fed through holes in the baseboard to connect to the track rails above. These wires can be of lower current capacity, since they don't carry the total layout current. These short wires are known as droppers (because they drop through holes drilled in the baseboard) or feeders (because they feed the power from the track bus to the rails). There are conflicting opinions on how many droppers should be used for any one section of track, with advice varying from 18” to 12'. Track Wiring 63
Back to Contents Page 5
However, there is general agreement on:
If a section is made up of two pieces of track, take a dropper to each piece – do not rely on getting a good contact from the rail joiners. Alternatively,some solder both rail ends to the rail joiners, although this can lead to problems when the track expands/contracts under changing temperatures. Droppers should be soldered to track rails, not to joiners. For long stretches of isolated track, use more than one dropper. This ensures continuity should one dropper fail. It also improves performance (less voltage drop, since track buses have lower resistance than most track rails). Use the thickest dropper wire you can manage, taking into account aesthetics and any soldering difficulties that may occur with smaller gauges. Droppers should be as short as possible. This prevents the introduction of a high resistance section into the current loop, which might prevent the short circuit protection system of a controller or booster from operating (the current may be sufficient to cause damage while not being high enough to trip the protection). Smaller gauges have track rails with much smaller mass and therefore higher resistance. It follows that a long run of z gauge track would need more droppers than the same length of O or G gauge track.
DCC bus terminators DCC systems generally run perfectly happily, with small distortions of the DCC waveform being handled by the decoders. However, where the bus is over 10m, or where you are experiencing decoder efficiency problems, terminators can be fitted to each end of the bus. These devices are simple filters that prevent voltage spikes appearing on the bus and upsetting (or damaging) decoders. It is intended to improve the DCC waveform and thereby improve DCC reliability. Terminators can be bought or can be made from two components as shown. The resistor can be around 100 to 150 ohms 1W or 2W, and the capacitor is 100nF (0.1uF) ceramic at 50V working. The two are wired in series then wired across the ends of each bus.
Wiring suggestions These are drawn from the experiences of others and should be given due consideration.
Routing wires The track bus should be as short as possible (to minimise voltage drop), while following the main track as closely as possible (to keep droppers as short as possible). Sometimes, you may have to run spurs off the main bus to avoid long snaking runs for the main bus. Of course, the track bus (or buses) are not the only wires on the layout. Under the baseboard, you may have buses for accessories, lighting, point operation, track occupancy feedback, etc. Since every piece of electrical equipment has the potential to generate magnetic fields and also to pick up these unwanted radiations, consideration has to be given to preventing mutual interference.
Track Wiring 64
Back to Contents Page 5
This means that wires from feedback devices (e.g. track occupancy detectors) should not be routed close to DCC buses or, even worse, point solenoid wires or decoupling magnets. Similarly, wires to heavy current motors should not be run close to DCC buses, to minimise motor commutation spikes from upsetting DCC signals. Where there are multiple DCC buses (from boosters), they should be spaced apart to prevent 'crosstalk' – the signals from one booster being picked up on the neighbouring bus. All this suggests that you should avoid running all the cable together in trunking, or bunching to pass through the same hole drilled in the baseboard frame.
Twisting wires DCC system rely on having clean signals that the decoders can understand. Any external interference (from loco motors, point solenoids, radio transmitters, etc.) can modify the signal and prevent reliable operations. The longer the track bus wires, the greater is the danger of interference. While this may pose few problems for small layouts, precautions are recommended for large layouts. A bus wire acts like an aerial, picking up external interference and converting it into unwanted voltages on the wire. So, if the two bus wires are twisted together, the unwanted voltage on one wire is cancelled out by the voltage being induced in the opposite polarity in the other wire. There is no need to buy special twisted pair wire. Just twist the two wires loosely round each other, approximately two to four twists per foot.
Connecting wires Good, low resistance connections are essential for trouble-free operations, with reliable metal-to-metal contact. This requires making 'gas tight' connections to prevent the build up of oxides (poor conductors) between the wires and the terminals. Soldering is the best way to ensure an air-tight connection. Screwed connections can be successful as long as precautions are taken to ensure that the wire ends and the screw surfaces are clean, shiny and free from dirt, corrosion, rust, oils, etc. If the wire end or terminal needs cleaning, the connection should be completed as soon as possible, before surface oxidisation starts.
Fitting droppers The illustration shows two methods of soldering droppers to the track rail. On the left, the dropper comes up through a hole in the baseboard and is bent as shown before being soldered (don't forget about cleaning the track area, tinning that area and the wire end before soldering). This method is the only option if the track is already laid. On the right, the dropper is soldered to the underside of the rail before the track is laid. The other end of the wire is then inserted through the hole and soldered to the track bus. This method is used where some thought has been given to the locations of track blocks/sections prior to laying a section of track.
Track Wiring 65
Back to Contents Page 5
What current does a layout need? The table shows typical current demands for one of each device. These values will vary depending on different manufacturers of the same product. The current demand can vary from as little as a few milliamps (e.g. LEDs) to 5A for a point solenoid. For locos, it can be under 100mA for a Z gauge loco and as as high as 20A for a long consist of O gauge locos.
Typical current demands Locomotive motor: Z scale and N scale TT, 00/H0 scale O scale
100-300mA 250-500mA 400mA-1A
Twin-coil turnout (point) motor e.g. Peco, SEEP
5A pulse
Motor-actuated turnout motor e.g. Tortoise, Conrad
15-20mA
R/C servo turnout motor
100mA
Memory wire actuator (turnouts and signals)
200mA
Light Emitting Diode (LED) (signals, train headlights / taillights)
5-20mA
Incandescent lamps (signals, train headlights / taillights)
40-80mA
Relay coils
20-50mA
CBUS modules
20-70mA
Track occupancy detectors
2-70mA
Signal wires (from TOTIs, to Servos, to/from CBUS modules)
2mA
We have to ensure that the layout's wiring can meet the demands of all the locos and other devices that may need to run/operate at the same time. Let's see what wire types are available and then decide what's best for a layout.
Wire standards As usual, why have one standard when you can have several? Why learn about them ? Because you will often find them referred to in model railway magazines and on the internet. More importantly, they are used as descriptions of wire being sold by Rapid, etc. The American Wire Gauge (AWG) is a U.S. standard for wire gauges. Higher gauge number indicate smaller wire diameters, with thicker wires having lower gauge numbers. Although an American standard, it is often quoted in UK and European descriptions. There is also an Imperial Standard Wire Gauge (SWG) and its values are not directly equivalent to AWG values. SWG is not often used. Probably the most understandable is the metric measure, which describes the wire in terms of its diameter or its cross-sectional area (CSA) measured in square millimetres. Unlike AWG, higher metric
Track Wiring 66
Back to Contents Page 5
measurements indicate thicker wires. Wires are sold either as a single solid conductor, or as a multi-stranded cable. Multi-strand cables are described in the metric system by giving the number of strands, followed by the diameter of each strand. So, for example, a wire described as 7/0.2 is made up of seven strands of wire where each strand has a diameter of 0.2mm. AWG, on the other hand, does not make a distinction between solid and multi-strand. So for example, an AWG value of 24 could be a single strand of 24 AWG, or it could be made up of seven strands of thinner 32 AWG wire (which together result in the same current-passing capacity as a solid 24 AWG conductor).
Current ratings of different wires As expected, thicker wires can carry greater current than thinner wires of the same material. This tables describes some the wires that are available from Rapid Electronics and other suppliers. Number of wires/ diameter of each wire
Current capability
Available colours
10/0.1
0.5A
11
Ribbon cable – 7/0.127
1A
11
7/0.2
1.4A
11 (also 16 bi-colour)
Security alarm cable (7/0.2)
1.4A
4,6 and 8 core
1/0.6
1.8A
11
16/0.2
3A
11
32/0.2
6A
11
Twin and earth 1mm2 (lighting)
10A
2
Twin and earth 1.5mm2 (lighting)
15A
2
20A
2
2
Twin and earth 2.5mm (power)
Notes: The current ratings shown are a good indication of what can be expected under normal conditions. Some manufacturers are reluctant to stipulate an exact value, as the current handling can be affected by external conditions such as the ambient temperature and problems with heat dissipation. The picture shows a piece of 'twin and earth' cable. It has three solid conductors, two being insulated and one being bare. Normally used for house wiring, it is often stripped of its outer plastic sheath and used for carrying heavy currents round a layout. Although often specified for higher currents, the table shows a more conservative estimate to allow for the inevitable voltage drop at such high currents. Some cheaper wires (e.g. bell wire) may not be made from copper, instead being iron with copper plating. This increases the wire's resistance significantly (perhaps a factor of 5 times) and lowers its current carrying capacity.
Track Wiring 67
Back to Contents Page 5
Selecting wires for layouts The earlier chart showed the current demands of various elements of a layout. The wire chosen for a particular job should be able to supply the current needs of the maximum amount of devices that could be operating at the same time – plus an extra margin.
Track bus This is likely to have the heaviest current and the one most likely to suffer from shorts (e.g. locos derailing). So, the wire should not be chosen for the maximum loco currents, but for the maximum current in the event of a short. You cannot always rely on a controller's cutout. Consider a 12V, 5A controller, where the bus wire's resistance is such that the circuit current can never reach 5A. In a situation where the supply can provide 5A but the short only results in 3A , the controller cutout won't trip. However, since power is calculated as I x V, the circuit (the track bus and probably part of the track) will dissipate 3 x 12 = 36W! Clearly it is necessary to ensure the lowest possible resistance in a track bus, particularly in the larger gauges where loco currents can be many amps. Since the track bus runs the length of the layout and is hidden under the baseboard, it pays to use the thickest twin and earth wires that you can afford. One solution lies in sub-dividing the layout into blocks (DC) or power districts (DCC), where the current in any one section is reduced.
Droppers The track bus carries the controller's power across the entire layout. It does not normally appear above baseboard level. To connect the track sections to the track bus, small connecting wires are soldered to the track, poked through holes in the baseboard and then connect to the track bus. To prevent unsightly connections between the droppers and the track in smaller gauges, it is common to use thinner wire than that used for the track power. This is not a problem, as long as the dropper lengths are short. Although these wires are thinner and therefore have a higher resistance, the fact that they are short means that they do not much alter the overall resistance of the circuit. The picture shows part of the insulation on the track bus being bared back to allow droppers to be soldered to them.
Points Solenoid-operated points are designed to pass a large current for a short time and are usually used in conjunction with CDU (capacitive discharge units) modules such as MERG's PD3 kit. I measured the coil resistance of a Peco solenoid coil at just over 5 ohms and an old H&M coil at just 2 ohms. In theory, a CDU's pulse of 20V should result in a pulse of around 4A through a Peco solenoid and a whopping 10A through an H&M solenoid. Where such small
Track Wiring 68
Back to Contents Page 5
coil resistances and such large currents are in play, the presence of even a small unwanted resistance can have a major impact on performance. Wiring for solenoid power, therefore, should use either 1.5mm or 2mm wire. The same considerations apply to electromagnets used for uncouplers. For these reasons, it is best to locate CDUs as close to the points as possible, to minimise long runs carrying high currents. After all, the signal that controls the CDUs only requires small switching currents. Motorised switch machines, such as the Tortoise, operate with much less current (from 4mA to around 20mA) and will happily work with 7/0.2 wire or even ribbon cable – unless you have particularly long runs to the point motors. Servo operated points are becoming more popular for a variety of reasons (cost, speed, controlability). An individual servo may only demand a few hundred milliamps while operating. On the other hand,, moving multiple points (as in route switching) increases the current demand substantially during movement and that has to be taken into account when running power wires to servos.
Accessories The connecting wires to each accessory depends on the current draw of that accessory. In most cases, 7/0.2, alarm wire or ribbon cable is more than adequate. If you have a large motorised accessory, you would use 16/0.2 or higher.
Lighting Grain of wheat bulbs use around 80mA at 12V. Lighting a row of buildings or a chain of street lamps soon totals a substantial current draw. To reduce wire thickness and reduce power requirements, most modellers are turning to LED lamps for illumination The picture shows a commercial OO lamp using a grain of wheat bulb that uses 60mA. On its left is a home-built equivalent using an LED that uses just 5mA. Even the thinnest of wires can handle the current requirements of a chain of LEDs, particularly if they are wired as groups (where a group may consist of 3 LEDs in series).
Signal wires Layouts may use a range of different signal wires such as feedback from occupancy detectors, signals to drive servo boards and the inputs and outputs of CANBUS modules. This diagram shows the input signals to a MERG Servo4 board. Each input has a 2k2 resistor in series. Since the voltage to any input is either +5V or 0V, the maximum current that can be drawn is 5/2k2 ( a couple of milliamps). Similarly, the outputs of a CANACC8 have 10k resistors in series, limiting their current draw to half a milliamp. Consequently, 10/0.1, 7/0.2, alarm cable or ribbon cable can be used for signal wires.
Track Wiring 69
Back to Contents Page 5
Suggested wire usage 10/0.1 or ribbon
0.5A
Colour-light signalling, individual motor-actuated switch machines (Tortoise Conrad, etc.), LED lighting, signal wires to Servo4s, from track occupancy detectors and to/from CBUS modules.
7/0.2
1A
Track feed droppers.
16/0.2
3A
DC traction feeder, DCC power Bus (booster output up to 3A), twin-coil solenoid point motors
32/0.2
6A
DCC power Bus (booster output up to 5A), DC Bus, twin-coil solenoid point motors
Twin and earth
10A , 15A, 20A
DCC power Bus (booster output up to 10A), DC Bus
Stranded v solid wire Copper wire is available as a single solid conductor or as a set of thinner strands twisted together. To some extent, it is a matter of personal preference, although some factors have to be considered. Stranded wire, by its construction, is much more flexible and is really essential in situations where the cable will be flexed (e.g. hand-held controls, or trailing plugs and sockets for joining multiple baseboards) or subject to excessive vibration. In these situations, solid conductors would suffer from stress fatigue and probable eventual failure. The thinner the strands used in the cable, the more flexible it is. That is not to say that stranded wire may not eventually suffer from stress fatigue (I have replaced my multimeter leads three times due to broken wires inside the insulation or where the wire meets the plug). Solid wire, specially twin and earth wire, is often used for power buses under the baseboard where it is a permanent installation. Stranded wire can be used here too, although many prefer the rigid, non sagging, nature of solid conductors. Solid wires take longer to corrode than stranded wires (less surface area) and can be useful for garden railways.
Skin effect? DC current travels along the wire using the total cross sectional area of the copper. When high frequencies travel along a conductor, they tend to travel close to the outer surface of the conductor – known as 'skin effect'. The higher the frequency, the thinner the skin depth (how far into the conductor is capable of carrying the current). This has led some to advocate the sole use of stranded cable for DCC signals, since they have multiple surface areas. Of course, since multi-stranded wire do not insulate the individual strands, this benefit is hard to realise. Although DCC is not an AC waveform, it changes its logic state at the approximate equivalent of 7KHz. According to the online calculator at http://chemandy.com/calculators/skin-effect-calculator.htm the skin effect depth for DCC signals is 0.779mm. This is over 1.5mm across the conductor, so the only wires directly affected should be those with a smaller diameter. On the other hand, as the DCC power bus is required to pass many amps, it will not be using any wires as thin as that in the first place. The skin effect for CBUS messages, which operate at 125KHz is given as 0.184mm (or a diameter of 0.368mm. Again, this is greater than our most likely wires in use. Track Wiring 70
Back to Contents Page 5
It can be argued, however, that the DCC and CBUS signals are square waves that generate multiple harmonics of its basic frequency, hence making the problem worse than first expected. However, over 98% of the current is able to flow within a layer that is four times the skin depth, counteracting any potential problems. Skin effect, therefore, is really only a problem when working at much higher frequencies than those used in model railways.
Types of connection The layout will have many connections between wires, between wires and devices and between wires and various connectors. Users have employed and advocated a large range of connection types, with some controversy being generated as a result. The descriptions that follow explain what connection components are available. Users can decide which of the following methods most suits their needs.
Soldered For many places, this is the most secure, most permanent, most trouble-free connection, if done correctly. You can expect many years of problem-free use from soldered joints, assuming there was a good clean mechanical joint and soldering was carried out efficiently. The picture shows a dropper wire being wrapped round a power bus before being soldered. WAGO 222 These terminal blocks are designed for handling 240v domestic lighting at 32A. They are intended for permanent installation in homes, where a robust and reliable connection is essential. They are not straight through connectors. They are available in strips of 2, 3 or 5 lever connections, with all the sockets joined internally. They are useful for power fanouts, with the main feed and the auxiliary feeds sharing the block. Their use requires no special tools, just strip the wires and insert their bare ends into the holes before closing the levers. It is a very quick assembly process which is helpful when used in awkward and hard to reach locations. Wago terminal blocks can accommodate up to 2.5mm solid wires, although it also works with stranded wires. Of course, not all connections lend themselves to these two methods, since they may have to allow for devices to be plugged/unplugged or baseboards to be attached/detached on a regular basis. There, a more flexible approach is required.
Wire nuts These are also known as cone connectors, thimble connectors or Marrette connectors and are sometimes used as an alternative to terminal blocks. They are plastic cones with a coiled metal insert. They are specially effective for connecting stranded wires. They are available in five sizes and are colour coded to indicate the
Track Wiring 71
Back to Contents Page 5
gauge of wire they are intended for. To install, just bare the wires, insert them into the cone and twist the cone. The wire-towire and the wire-to-insert contact make a reliable connection that can be readily undone by untwisting the cone.
Screwed The most common non-soldered connections make use of terminal blocks (also known as 'chocolate blocks'). These are straight thorough connectors, with screws on either side of each connection. They are often sold as strips of ten and can be easily cut into smaller blocks with a knife. There are holes between each connector, allowing easy screw mounting to a baseboard. They are cheap and come in different sizes, to provide 3A, 6A, 10A, 15A, 16A and 30A versions. There are a couple of things to watch out for when using these blocks. As Howard Watkins, MERG Publicity Manager, recently pointed out: “Some people prefer to solder the wire, especially if several wires are to go in the same terminal block position. This should be avoided because solder is a soft metal and tends to squeeze out from between the strands. As time progresses the joint can become loose and the connection can become unreliable.”
Another danger is not having every strand of wire securely held under the screw. If, for example, three strands of a 16-strand wire ended up as stray unconnected wisps, you have lost almost 20% of the connections current carrying capacity. One way to prevent this is to use crimp ferrules.
Crimp ferrules Where multi-strand wire is used with terminal blocks, consideration should be given to the use of crimp ferrules. These are simply metal tubes into which the bared end of a wire is inserted. The tube is then crimped to tightly grip the wire, as shown in the bottom example. The ferrule can then be inserted into the terminal block and screwed down tightly. This provides a stronger, more resilient termination than using bare wire alone. The illustration shows both bare and insulated versions (the bare version is also useful for chimneys on buildings or locos). The insulated version provides additional protection against stray strands of wire causing shorts or increased resistance.
Terminal blocks These chunky connecting blocks were developed for high current connections in a range of industrial devices and power supplies. They comprise two rows of screws and are produced in block from 3-way to 12-way. Often referred to as 'barrier blocks' because of the protective wall between each pair of screws. They are available in ratings from 15A up to 45A and some have a protective cover to prevent accidental shorting, spillages, etc.
Track Wiring 72
Back to Contents Page 5
They are popular among some hobbyists due to their ease of use and their large contact surfaces. Wires can be connected by baring the ends, curling the bare ends into hooks and inserting under the screws. An alternative method, shown in the picture, is to terminate the bare wire end in a crimped spade connector. One way to help ensure a gas tight connection is to place a star washer between the wire/spade and the head of the screw. As the screw is tightened, the star serrations bite into both the wire/spade and the screw head. This cuts through any existing layer of oxide and ensures a good contact. This is particularly useful where the connections may be disturbed or altered, as the washer ensures a good connection each time. PCB terminal block These blocks provide a simple way to connect wires to a printed circuit board module and are commonly found on MERG kits and other PCBs. Each connection uses a pin to solder to the printed circuit board and a screw terminal for connecting a wire. The bared end of a wire is inserted into the hole and the top screw is tightened. Despite their small size, they have large current carrying capacity, with some handling as much as 57A. Even the smallest in the range can handle 6A. They are available in different pitch widths (the distance between the pins) as the larger current carrying versions uses wider pitch widths. Pitch widths range from the commonlyused 3.5mm and 5mm up to 10.16mm. Stripboard has a 2.5mm pitch and can accommodate a 5mm pitch, although not on adjacent tracks. The blocks are available in a range of sizes, from 2 way to 7 way and many types can be interlocked to create custom widths. PCB terminal blocks provide for the quick and easy removal or replacement of a module, requiring only a screwdriver. Many of these blocks use a 'rising clamp' method of securing the wire. As the screw is tightened, the wire is gripped between two plates – one fixed to the top of the insertion hole and the other which rises as the screw is tightened. The two flat plates provide an even contact over all of the wire's strands. This results in better contact with the wire and less chance of stray wires causing problems. Note, however, that with some blocks, there is no physical contact between the top and bottom plates until the screw is tightened. This can sometimes lead to mistakes when taking meter readings, when the meter prod is touched the electrically unconnected screw.
Crimp connectors The pictures shows a male and a female connector. They have a large surface area and make a tight fit when connected. This ensures a reliable connection and they can be found in domestic (boilers, hot tubs), car audio wiring (resistant to vibration) and industrial machinery. The bared end of a wire is inserted into the connector tube and the tube is then crimped to tightly grip the bare wire. Although pliers and wire cutters are often used, crimping is best done with a proper crimping tool. These connectors handle solid conductors and work at up to 10A. Track Wiring 73
Back to Contents Page 5
PCB interconnect As the picture shows, these are produced as header plugs and matching PCB sockets. They are used on MERG kits, as jumpers on Servo4 modules and as ICSP connectors on CBUS kits, etc. The sockets are available in a range of sizes from 2 way to 25 way, and in single or double rows. They can be cut or sawn to create any length of strip. They have a 2.5mm pitch, making them ideal for use with homegrown projects built on stripboard. The picture shows both types with ribbon cable soldered to them and protected by heatshrink tubing. This provides a very neat way to achieve cable runs of multiple wires. When only three pins/sockets are used this way, it also makes a cheap alternative to commercial servo extension leads. These connectors were designed for light duty and are only suitable for running signal wires and low current devices. Another PCB connection is the Molex plug and socket system. As you can see, it designed such that the plug can only be inserted into the socket one way. This polarisation prevents the accidental insertion of power leads or output leads in the wrong polarity and is commonly used for connecting power to PCBs.
DIN DIN plugs and sockets have been around for a very long time and have been used for audio connections, MIDI connections and the old AT computer keyboard cable. They are available in 3-way, 5-way, 7-way and 8-way versions and are keyed so that the plug can only be inserted one way (no accidental polarity reversals). They are also available as mini-DIN versions as used on the mouse and keyboard cables of older computers (known as PS/2). Standard DIN connectors are cheap but only have a maximum rating of 2A. The socket can be mounted to the baseboard and the plugs can be wired to flying leads. An old keyboard can have its cable cut off and then you have a ready wired DIN plug and cable.
D-type D-type plugs and sockets were designed for use with computers and data communication equipment. The various versions include the 9-pin and 25-pin (RS-232 serial ports), the 15pin (monitor VGA ports) and the 37-pin (RS-449 high speed serial interfaces). They are rated as either 3A or 5A. They can be found interconnecting model railway baseboards, due to their large number of contacts. Indeed, the larger versions can wire together two or more pins for a single connection – increasing the current carrying capacity and providing redundancy (if one connection fails, there is still one or more others to carry the current). However, the rear pins of the plugs and sockets can be difficult to solder wires to, particularly if the wires are thick (7/0.2 seems to be about the thickest that's usable). Track Wiring 74
Back to Contents Page 5
The pins are bunched very close together, requiring skill/patience to avoid shorting adjacent pins (with solder blobs or stray strands of wire posing the greatest problems) Alternatively, eBay sell a 2 metre female to female 9-pin serial cable for a couple of pounds. Simply cut it in half and you have two ready made cables. For around the same cost, buy a 25-pin male to female cable, cut it in half, and you have two trailing leads for connecting two baseboards. Make sure all the pins are wired and check for any wires crossing over.
SCART Before HDMI emerged, most connections between DVD players, satellite boxes, TVs, etc. used SCART cables and many are still in use. SCART connectors offer 21 pin connections, although not all pins wired through in some cables. They are low voltage low current connections and are not suitable for carrying high currents. The large pin count makes them a possibility for carrying multiple signal wires to and between baseboards (for LEDs, servos, etc.). Like the D-type cables, a SCART cable can be hand wired or you can buy a ready-made cable and cut it in two.
Circular locking If you want to ensure that you have a high-current connection that won't shake loose or drop out, a screwed connection is available. As the picture shows, the socket is designed for panel mounting, although it could be mounted in a small case with a trailing lead if required. The ends of the plug and the socket are threaded and can be screwed together for a sound mechanical joint. The picture shows a 3-pin 5A version, which might be considered for taking power from power supply or controller to a layout. Bulgin market 32A versions, varying from 2-pin to 10 pin. These connectors are bulky but merit consideration for 'must work' connections.
Durability An important issue when choosing connectors is their durability- measured in 'mating cycles' (how many times you can plug and unplug the connection before good performance is no longer guaranteed). If you have a home layout made up from several interconnected boards, this may not be an issue, as you will only occasionally disconnect a board for maintenance/upgrading. For a club that carries out a lot of exhibiting, it can be an important consideration. It pays to check a particular dealer's product specification, as quality varies. D-sub connectors can have mating cycles from as low as 50 to hundreds, DIN connectors vary from 1,000 to 5,000 cycles, SCART connectors from 750 to 3,000 and Molex from 1,500 to 10,000.
CBUS Some of the connectors described above allow for huge amounts of wires to be connected together. With even the best of care, there is much scope for faults to develop. If you find you need such large numbers of connections, you might wish to consider the merits of the 2-wire CBUS interface.
Track Wiring 75
Back to Contents Page 5
Maintenance aids The greatest aid to maintaining a model railway layout is not a multimeter – it is knowledge. To be able to test a layouts' wiring, you have to know where wires are supposed to go and what conditions should be expected on them. As you build a layout, more and more wires are run, more components are added and configured. Unless this is approached in a methodical manner, faultfinding will be much more troublesome. Problems will start to occur long after you have forgotten what you laid where and for what purpose. The time spent in developing and sticking to a plan for rolling out a layout is more than repaid when the layout has to be maintained. MERG's Technical Bulletin LC01 provides details.
Colour coding Imagine a single wire running through a rat's nest of cabling. Consider the problem of tracing it along the length of a layout. Life is much easier if you settle on a colouring scheme for wires For example, every time you see a red wire, you know it carries +12v, an orange wire carries +5v, a yellow wire carries the output from a track occupancy detector, and so on. There is no universally recognised 'standard' colour coding scheme, although red and black are widely used for main +ve and -ve wires. Digitrax have their own suggested wiring scheme, see: http://www.dccwiki.com/Wiring_color_code For a home layout. The colour scheme is entirely up to you, as long as you record it and stick to it. For a club layout, where many different people will be working on a layout and developing and maintaining it over a considerable period, an agreed colour code needs to be developed and recognised by all members. Fortunately, wires are available in a range of colours.
Labelling Unfortunately, there is not an inexhaustible range of coloured wires available, so you are liable to find many wires of the same colour running under a baseboard. Although it is useful to know what it is used for (e.g. wires to Servo4 boards), it does not tell you where the wire originated from and where it is heading. Attaching small labels to wires during installation can provide very valuable information at a later date. For example, a label that says 'ACC84/3-Ser3/2' would let you know that the wire ran from your fourth CANACC8, pin 3 to your third Sevo4 module, pin 2. Some people prefer to use a numbering scheme for their labels, with a printed table explaining what a particular wire number is used for. Others use a lettering system for labels while some prefer adding coloured tape or short lengths of coloured shrink wrap to wires. There is no standard for labelling; just use what makes sense to you.
Schematics Consider a layout that has many electronic modules, connectors, etc. By the time a fault occurs, you will have long forgotten that output 7 of this module is connected to input 5 of that other module. The only way is to manually trace it. Every time you have a fault, you have to work out what goes where all over again. Much better to spend a little time making up a simple diagram or chart that shows how modules,
Track Wiring 76
Back to Contents Page 5
connectors, etc. are interconnected. That way, when you have a fault, you know exactly where to go to make your tests. Consider documenting a station throat as being served by number 5 Servo4 board, with points being noted as 1,2,3,4. If point 2 fails to operate due to no input signal, your chart tells you what drives that particular board input. So, for example, you can put your meter across pin 5 of a CANACC8 or across switch 7 on your control panel – or whatever. There is no need to even trace the wire initially. You can check whether the control output signal is being produced. A quick check of your schematic tells you exactly what connects to what, no matter how far apart they may be. The schematic can be further refined if the wire passes through several connecting blocks or plugs and sockets.
Documentation Clearly, documenting your layout pays dividends in the longer term. To be useful, the documentation must always be readily accessible - in a folder and/or wall chart. A typical folder might contain: Tables, showing the colour coding and labelling of wires used on the layout. Schematics showing the interconnection between modules and connectors. Development history, detailing who added what when. Fault history, so that recurring faults can be identified and dealt with. CBUS details, listing the node numbers of each module, what events do what, etc. DCC details, listing the CVs of locos, accessory decoders, etc.
Important note Documentation is a chore and most people are reluctant to keep updating it. However, it is important to recognise that documentation that has not been updated can sometimes make things worse. The key is to make the documentation easily alterable. For example, you don't want to have to redraw a diagram every time a change is made. Those with computers have an obvious advantage, as lists, tables, etc. are more easily updated and reprinted.
Track Wiring 77
Back to Contents Page 5
Chapter 5 Voltage problems
Voltage Problems 78
Back to Contents Page 5
Voltage problems In an ideal world, the only loads across your controller would be ones that you wanted, such as locos, lighting, point motors and so on. In practice, the layout wiring, connections, plugs and sockets, switches, etc. all add unwanted additional resistance into the circuit. Some of the power is lost in the bad connections, long wire runs, etc. This chapter looks at what causes voltage drop problems. This illustration shows just some likely causes of unwanted resistance in loco/track wiring.
These examples all happen and you may suffer from one or more of these problems. Some are the result of poor installation (poor soldering, using wires that are too thin). Some are the result of poor maintenance (dirty track, dirty loco pickups). Some just happen over time (breaks in cables, corroded or loose connections, power supplies that get overloaded with ever increasing numbers of locos being run).
If the unwanted resistance is very small compared to the wanted resistance, this causes little change to the layout performance. All layouts have some voltage loss, although mostly too small to be noticed. However, if the unwanted resistance becomes excessive, too much of the supply voltage appears across this resistance and reduces the voltage to loco, relay, point motor or whatever. These effects are predictable and can be calculated using Ohm's Law.
Its Ohms Law time If you don't know Ohm's Law, you really ought to get familiar with it, as it is the cornerstone of many voltage, current and resistance calculations that we will come across. Put briefly, electric current is the flow of electrons round a circuit. The electron flow is measured in Amps (or mA – thousands of an Amp). The force that moves the electrons round the circuit is known as the voltage and is measured in Volts (or mV – thousands of a Volt). The physical properties of different materials act to resist the flow of current. This is called Resistance and is measured in Ohms (or kohms – thousands of ohms or Mohms – millions of ohms).
Voltage Problems 79
Back to Contents Page 5
There is a direct relationship between the voltage, the resistance and the resulting current flow. This is expressed in Ohms Law as three simple formulae: I=V/R V=IxR
R=I/V
- increased voltage results in increased current. - increased resistance results in reduced current. - increasing current through a fixed resistance results in an increased voltage across that resistance. - increasing the value of resistance, while maintaining the same value of current through it, results in an increased voltage across that resistance. - resistance is proportional to the current (i.e. increases) and inversely proportional to the voltage (i.e. decreases).
On our model railway, therefore, voltage drop occurs when current flows through our wires, our loads and any unwanted resistances. It obeys Ohm's Law, where the amount of voltage drop is equal to the resistance times the current.
Some worked examples Consider this illustration. It shows an accumulation of 3 ohms of unwanted resistance from all the possible sources shown above. From this, we can calculate the expected voltage losses for different locos.
The best case Let's assume we have an 'N' gauge motor which runs at 250ma (0.25A) when supplied by 12V. In an ideal world, free from unwanted resistance and other effects, the resistance of the motor must be: R=V/I = 12/ 0.25 = 48 ohms Working backwards, to check our formula: V = I x R = 0.25 x 48 = 12V Now, if there is 3 ohms of additional resistance, the total resistance has risen to 51 ohms, while the supplied voltage is still 12V. The increased resistance results in less current: I = V / R = 12 / 51 = 235mA (instead of 250mA) The Voltage drop across the motor is now V = I x R = 0.235 x 48 = 11.3V The other 0.7V is lost across the unwanted 3 ohms of resistance. Worse cases The same calculations for an 'OO' gauge loco using 0.5A at 12V shows that the current drops to 440mA, the voltage across the motor is reduced to 10.7V For an 'O' gauge loco drawing 1A, the current is reduced to 800mA and the motor voltage is reduced to only 9.6V
Voltage Problems 80
Back to Contents Page 5
The worst, worst case Now, consider a US-style consist of ten 'O' gauge locos, with a total current draw of 10A. The unwanted resistance is large in relation to the resistance of all the motors running in parallel. The current in the circuit is reduced to a mere 2.8A and the loco motor has only 3.4V across it. The other 8.6V is dropped across the unwanted resistance. Notes You won't get these exact results in practice as Ohms Law calculations are for DC and doesn't take into account effects of inductance, back emf, etc. from motors. However, it does give a fair representation of the dramatic effect of voltage drops in some circumstances. Voltage drop is not just an issue for loco motors. Solenoid point motors can be an even bigger problem as they have very little resistance, even lower than loco motors. The Peco solenoid measured at just over 5 ohms, while the old H & M solenoid measured just over 2 ohms. With the MERG PD3 CDU kit supplying a 20V kick, that results in current surges of 4A and 9A respectively. With such low resistances, point motor coils are even more vulnerable to unwanted resistances. Power and heat
Power is measured in Watts and can be calculated by multiplying voltage by current. So, for example, if the N gauge loco took 0.25A when supplied by 12V, its wattage is 0.25 x 12 = 3W. As we go up in gauge, with larger motors drawing more current, the wattage is also increased. With motors, most of the power is used in turning the motor. With an unwanted resistance, the power will be dissipated as heat. In the above example for an 'O' gauge loco, the voltage across the unwanted resistance was 2.4V and the current through it was 0.8A. That represents a power dissipation of 0.8 x 2.4 = 1.9W. In the worst case example, the consist of 10 locos, the voltage across the unwanted resistance was 8.6V and the current through it was 2.8A. That represents a power dissipation of 8.6 x 2.8 = 24W, generating more heat than many soldering irons! Wire resistance The current carrying capacity table shown earlier does not fully tell the whole story. Even the best conductors have some resistance and the resulting voltage drop in the cable can be calculated from its CSA (cross sectional area). The CSA can be expressed in mm 2. The internet provides a number of calculators that let you see what voltage drop to expect from different gauges over different lengths of wire runs. Many of these the AWG sizes but you can get some conversion information at http://www.calculator.net/voltage-drop-calculator.html For example, 7/0.2 means 7 strands of wire each 0.2mm diameter, This results in CSA of 7x(πx0.2x0.2)/4 = 0.22mm2. Voltage Problems 81
Back to Contents Page 5
The image shows a calculation for 24AWG, the nearest equivalent to 7/0.2 stranded wire.
Remember that a circuit uses two wires, one feed and one return. So, a 10ft layout would have a 20ft run. Some calculated results
A 10ft layout using 7/0.2 for N gauge (250mA) locos would suffer a drop of just 0.13V. The same 10ft layout for OO, using 0.5A locos would suffer a 0.26V drop. If that layout was 20ft long, a drop of around half a volt would result. When an 'O' gauge loco at 1A is run on a 20ft layout, the voltage loss is just over 1V. However, if a 5 ohm solenoid coil was operated by 20V over a 10ft cable, the drop would be 4.11V. This could be reduced to 1.62V or 0.81V by using 16/02 stranded wire or 1mm solid conductors respectively. Our earlier example of a 10A consist running over a large 60ft layout would drop a whopping 6V using 1mm twin and earth and even 2.5mm twin and earth would result in a 2.4V loss.
Clearly, voltage drop in the layout wiring is less of an issue with smaller gauge locos, although it still pays to use as thick a wire as you can afford (specially for solenoids and other heavy current devices). As the layouts get larger and the loco currents get larger, the problems of voltage drop become an issue that needs attention. Note: The calculations for stranded wire assume that all strands are intact and correctly connected. It is not uncommon for stray strands of wire to fan out as wisps and fail to be connected or soldered. It is also common for wrongly-adjusted wire strippers to cut or nick some strands. If, for example, a 7/0.2 wire had only two unconnected strands, the final resistance of the wire has increased by a significant margin, having lost two-sevenths of its current carrying capacity. Even a nick in a strand can lead to an eventual break in that strand, if placed under stress or vibration.
Voltage Problems 82
Back to Contents Page 5
Finally, note that these calculations are for voltage drop in the wire alone, while other resistances such as the bad connections, etc. mentioned earlier may have to be added to the calculations.
Rail resistance A track bus with multiple droppers may seem excessive when we might simply rely on the nickel silver rails to carry the current. However, nickel silver is an alloy made from copper (60%), nickel and zinc. The difficulty is that the resistance of nickel silver is nineteen times greater than that of copper. Since not all nickel silver alloys use the exact same proportions and not all rail sections have the same cross sectional area, the final resistance is not precise – although it is very significant. That is why a length of track has a corresponding length of copper wire running underneath, with frequent connections between them. The poorer conductor (the rail) only carries current over a small section of track to the loco, while the current is mainly carried by the better-conducting copper track bus. The effect is to greatly reduce the voltage drop. Track is sold as code 70 or code 100, etc.. The code number is the height of the rail expressed in thousands of an inch. So, code 75 rail is 0.075” in height while code 100 is 0.1” in height. Here are some rail types: Code 40 – Micro Engineering N and HOn3 Code 55 - Peco N, Micro Engineering N and HO Code 60 – Peco OO9 Code 70 - Micro Engineering N and HO, Shinohara N and HO and HOn3 Code 75 - Peco OO Finescale Code 83 – Peco HO, Atlas, Walthers/Shinohara HO, Micro Engineering HO Code 100 - Peco OO, Atlas, Walthers/Shinohara HO, Micro Engineering HO Code 148 - Micro Engineering O
The rails with the smallest height and the small cross sectional area present the greatest resistance. The DCCWiki displays a chart of measured resistance of various brands of track. Code
Rail Resistance, Ohms/foot
Equivalent Wire (AWG)
Atlas / Shinohara
100
0.038
26
Walthers / Shinohara
83
0.052
27
Atlas / Micro Engineering
83
0.078
28
Shinohara
70
0.077
28
Micro Engineering
70
0.116
30
Brand
And adds this note: Note the difference between two brands of Code 83 rail. One has about 50% more resistance. That can be explained by the rail profile, which has an effect on the cross sectional area of the rail. The cross section of 27AWG wire is 0.102 mm2, 28AWG is 0.08 mm2.
Voltage Problems 83
Back to Contents Page 5
From this table, we could calculate that an N gauge layout with a 20ft track run would have a resistance of 40 x 0.116 = 4.64 ohms, resulting in just over 1V of voltage drop in the track. A track bus using 1mm wire, on the other hand, would only drop 0.05V. Now you know why lots of droppers are recommended! You can never eliminate voltage drop entirely; you have to decide what amount of drop you can live with. You may simply prefer to increase the supply voltage to compensate, after considering whether there are any unacceptable overheating risks as a consequence.
Overload and short circuit protection There are two dangers that need guarding against: with special protection circuitry. short circuit protection
Imagine buying a controller with a 10A capability. You only run a single 1A loco at the moment but are looking to the future. Now, if there is a short on the cable, there is almost zero resistance and the maximum current possible will flow. In the example, the current is not 1A but 10A. This produces 120W which will manifest itself in heat that will destroy electronic components, melt plastic and potentially causes fires. Speed controllers and power boosters have systems that detect the surge in current and switch off the supply. current overload protection
Short circuits produce a sudden surge in current and this is easily detected. Not all current increases need be that dramatic. Running more and more locos on a layout, switching on lighting and other devices, may incrementally increase the current demand to a level greater than that for which the supply was designed. A good controller/booster will allow the user to set the current at which the circuit will cut off the power. In the above example, a user may decide to set the 10A supply to trip at just 3A, as that is his/her current maximum usage.
Protection devices Fuse
A fuse is simply a short length of wire that melts if too much current flows through it, thus breaking the circuit. The fuse is disposable and needs replacing after it blows. Circuit breaker Like a fuse, a circuit breaker stops the flow of current when it exceeds its set rating. They are thermal breakers, which means that the heating effect of the current passing through it eventually bends an internal element that switches off the power. Some, like the one shown in the picture are automatically reset once the element cools down again. These are available with trip ratings of between 1A and 5A.
Voltage Problems 84
Back to Contents Page 5
An alternative is a thermal circuit breaker that needs to be manually reset after it trips (like the ones in your house mains box). The picture shows a panel mounting circuit breaker, with trip ratings from 3A to 20A . Many push to reset breakers can only be reset after a minimum time has passed (e.g. one minute). This can be a good things, as it forces you to look at the source of the problem. Car bulb
Perhaps one of the oldest, and most controversial, protection methods is the use of a 12V 25W car tail light bulb. A car bulbs is wired in series with the supply to a track section and provides almost no resistance when unlit. The locos run happily with their full voltage. When a short occurs, the current increases rapidly, causing the bulb to light. A lit bulb has a much greater resistance than when unlit. This increased resistance then limits the amount of current flowing in the circuit, This increase occurs very rapidly, around 4mS. When the short is removed, the bulb cools down and its resistance lowers again. Car bulbs are cheap and you may like the idea of an immediate visual indication when a short occurs. However, it is important to remember that they are not cutouts, only current limiters. If a short occurs the current round the wire and the track is limited to a maximum of 2A, which still has potential for causing overheating damage. If using car bulbs, choose their position carefully, as they are very hot when lit.
DCC protection A DCC controller or booster has its own cutout circuitry which will cut off the power and most check periodically to see whether the short is removed before restoring the power. If the whole layout is fed from a single controller/booster, then a short will disable the entire layout. Troubleshooting is then a problem, as the fault could be anywhere on the layout. This is usually prevented by dividing the layout into power districts, as previously discussed. Of course, that means that each power district would have to use a separate circuit breaker. Now, when a short occurs, only the section affected will be cut off, with the rest of the layout working normally. Circuit breaker modules are available as standalone devices that are wired in series with the wire from the bus to the section track. These include:
The PSX from DCC Supplies.. Handles up to 20A per block, with 1 to 4 blocks on a board. The OnGuard! OG-CB, from DCC Specialties, rated at 4A . The NCE EB1 single circuit breaker. The MERG DC05 block cutout. The MERG DCC District Cutout Kit 57
The MERG NB1B DCC booster has own internal cutout with 3.3A and 5A options as standard.
Voltage Problems 85
Back to Contents Page 5
Wiring cutouts For DC, one controller is allocated to every running loco. If a layout has many blocks, there is still only one controller powering one loco in any one block. Given that controllers have cutouts, a DC layout is already reasonably protected. If a short develops in a block, that controller's cutout will remove the power from the offending block; the rest of the blocks carry on normally, as all the block are electrically isolated from each other. If a block is large, it may be sub-divided, with all sub-blocks still being wired to the one controller. If each sub-block was fed via a circuit breaker or car bulb, the whole block still stops working, but you can quickly identify the problem sub-block. This is an aid to troubleshooting. For DCC, with a single command station powering the entire layout, a short anywhere on the layout cuts the power off from the entire layout. All locos stop running. This can also be overcome by sub-dividing the layout into independent power districts, each with their own booster. A short in one power district only stops running in that power district. Alternatively, for smaller layouts, a single command station, with or without an added booster, can feed power to power districts through a collection of DCC circuit breaker modules or other protection devices. While circuit breaker modules are more efficient, they are also much more expensive compared to car bulbs. Since most shorts are caused by derailments at points and crossing, it makes sense to cover the blocks that contain many points with circuit breakers. Other less-frequently used blocks could be more cheaply covered with car bulbs. In the illustration above, three power districts are fed from a single command station/ booster combination. One is protected by a commercial cutout, one from a MERG district cutout, and one from a car bulb. It is important to note that the bulb may limit the current below the level where the booster would be expected to cut out. Most modern boosters may activate before the car bulb illuminates. In an ideal world, a DCC layout would be divided into many power districts, each supplied via its own circuit breaker module. This approach may be unsuitable for financial reasons. However, since car bulbs are substantially cheaper, they allow more sub-districts to be individually protected. A combination of circuit breakers for point-intensive districts and bulbs for more sparse districts may be considered. Sometimes dogma has to be replaced by pragmatism. If we can't have all that we want, we can at least get what we need. Prudent operators may wish to test that all the protection features work,before an operating session (particularly at exhibitions). This is usually achieved by placing a coin across one section of track at a time.
Voltage Problems 86
Back to Contents Page 5
Chapter 6 Wiring points
Wiring Points 87
Back to Contents Page 5
Wiring points Before looking at optimising the performance of points, eliminating possible sources of poor performance or shorts, it is best to remind ourselves of the names of the various parts that make up a point (according to www.britishrailways.info). Other countries may give parts different names (e.g. even calling it a turnout instead of a point) but using this illustration ensures that the rest of the material is understood.
In most points, all or part of the closure rails remain fixed and stationary, while the point blades (switch rails) are the moving parts that guide the loco and wagon wheels to the required track. Most magazines talk about 'frogs' and points are described as 'insulfrog' or 'electrofrog'. Sometimes, they refer to the area shown in the illustration as the 'crossing V', while other times it refers to the area that encompasses both the crossing V and the wing rails.
Point varieties Commercial manufacturers offer points with many different constructions and wiring differences. It is common to find 'power routing' points. These are constructed so that power is always connected to the direction set by the point. For example, a train in a siding would be disconnected if the point was set to the main line – and automatically reconnected when the point is set back to the siding. In many cases, all the point blades, closure rails and wing rails are bonded together by wires under the trackwork (even the crossing V might be similarly bonded). Also, some points have both point blades bonded together, while some have each point blade bonded to its nearest stock rail. Some points have the points blades bonded to the closure rails with wire, while others use rail joiners. In most cases, commercially-produced points have plastic check rails. Notes
If your pointwork runs happily for you, that's fine. If you are experiencing electrical problems with your points, then you might wish to consider the following alterations to your point wiring. If you want to achieve the best future problem-free running with your points, you might wish to implement some, or all, of the alterations that are outlined. If you are planning a layout, you might want to consider the following pages before Wiring Points 88
Back to Contents Page 5
selecting your points. Not all the following may apply to your points. If in doubt about how your points are wired, use a multimeter to check your point setup. A multimeter will soon tell you whether you need to consider making any alterations.
Point problems The biggest problem experienced with points is shorting of the track power as the loco runs through the point trackwork. If you are using DC, this may not even be noticed, apart from an occasional hiccup of the loco on the way through. That is because the loco's controller can handle the temporarily increased current for a sufficient time for the loco's momentum to take it past the point of the short. While this may seem to be acceptable, bear in mind that every time the short occurs, the spark is pitting the surface of the trackwork. So, even if your loco does not come to a complete halt on points, it may still be worth looking at improving the point's wiring. With DCC, shorts are a bigger problem because the command station will close down when it detects an unexpected current surge. Not only will the loco come to a stop – the whole layout may come to a stop, if it is controlled by a single command station.
Shorts at point blades Consider the case shown in the illustration. The point is set to straight-ahead, with the upper point blade touching the upper stock rail. Both closure rails are bonded together which results in the lower point blade sitting only a small distance from the lower stock rail – but at the opposite potential. In an ideal world of fine tolerances, this might not pose any threat. However, with many locos having coarse scale wheels with wide wheel treads, there is a possibility that the metal wheel will touch both the lower point blade and the lower stock rail. This produces a short across the track bus. This effect can also be caused where a wheel is out of gauge or has slack bearings. Another cause may be taking a loco round a small radius curve, such that the back of a wheel flange touches the open point rail. The solution is to cut the link that bonds the two point blades together. Left this way, a point blade/closure rail combination will only be 'live' when it is touching its own corresponding stock rail.
Dirt at point blade It is commonly accepted that it is best not to solely rely on a good contact between the point blade and the stock rail to provide electrical connectivity. While a new, out-of-the-box point may work happily for a while, the eventual build up of oxidisation and grime on these points of contact could lead to high resistance joints, or complete loss of contact. The solution is to have a permanent link between each point rail and its Wiring Points 89
Back to Contents Page 5
neighbouring stock rail. Both point rails, and possibly their closure rails and wing rails, are permanently powered similarly to their stock rails. A couple of links of Kynar wire or similar fine wire should be soldered between the point rails and their neighbouring stock rails. As always, it is much easier to do this before a point is laid. This modification ensures the best long-term running for both DC and DCC. Since the point rails are always at the same polarity as their nearest stock rail, DCC shorts are minimised and track pitting due to DC arcing across them is eliminated.
Shorts at frog If you look at the previous illustration, you will see that there may now be a problem at the 'frog' area, depending on how a point's closure rails, wing rails and crossing V are currently connected. As shown, there is little space between these track components, which again provides the possibility for shorts. One solution from manufacturers is to manufacture that problem area from plastic, preventing possible shorts. These are often referred to as 'insulfrog' points and an example is shown in this picture. This avoids any wiring modifications and is a suitable solution for long wheelbase locos that have pickup wheels that can span the dead gap, so that at least one set of pickups is on live track at any one time. It is more of a problem for short wheelbase locos, or longer locos where one set of pickups is not functioning. That is why many user prefer 'electrofrog' points, where the wing rails and the crossing V are conductive. Also, plastic frogs are more prone to wear than their metal equivalents, causing an eventual increase in derailments.
Wing rail shorts Live frog components provide the most reliable point operation, but using electrofrog points is not without its own problems. The picture shows just how close the wing rails and the crossing V are to each other and – more importantly – at different polarities. Also, the junction between a wing rail and a closure rail is close to the other wing rail/closure junction. Potential shorting can be overcome by breaking the electrical connection between the closure rails and the wing rails. This may require cutting the junction with a cut-off disc in a Dremel drill, or something similar. This picture shows a point that has gaps between the closure rails and the wing rails. Other prefer to cut further back down the closure rail, to further reduce any risk of shorts during derailments. In some Peco points, these gaps may already be provided, with just wire links under the trackwork between the wing rail and its closure rail., In that case, the links should be cut. Left this way, this would be a 'dead frog' point, which is little better than an insulfrog point. Being metal, it allows the frog area to have its polarity switched as the point is switched (see later). Wiring Points 90
Back to Contents Page 5
Shorts at crossing V Another source of shorts is the tiny gap between the two halves of the crossing V on most points. As the above pictures show, the two rails are chamfered down to create a fine point, with almost no gap between them at the tip of the V. The wide tread on some metal wheels are able to bridge the gap, causing shorts if both rails of the V are powered (if they are powered then they will be at opposing polarities). A number of solutions have been offered for this. Applying a small touch of paint on one of the rails, at the tip of the V. Most report that this wears away and is not a permanent solution. Applying a small touch of glue, such as SuperGlue, to the same area. This wears better than paint. Both of the above are only semi-permanent remedies and both cover up a part of the conductive surface of the rail. An alternative approach is to widen the gap in between the two rails of the V. A cut-off disc fitted to a Dremel drill, or similar, can be used to grind a small section off the inner edge of each rail of the V. It need not be too wide or even too deep; simply enough to prevent wheel to rail contact. The same effect can be had using a small round jewellers file to gradually widen the gap. If required, the gap could be filled with epoxy then trimmed. Users have success without modifying the V at all. If the flangeway of the points (the gap between the check rail and the stock rail) is too wide, it may allow a loco's wheels to drift over the gap in the V. Gluing a thin plastic strip to the check rail narrows the gap and prevents excessive loco sideways movement. This solution is dependent on the points and locos in use. An alternative approach does not modify the point's rails. As shown in the illustration below, it treats all the frog components as a single condutive unit. In other words, the crossing V rails, wing rails, and maybe even part of the closure rails, are wired together. In some points, this may be how they are supplied as standard; if not, they can be wired together with Kynar wire or other fine connecting wire. This requires additional electrical switching as below.
Frog switching The first step is to ensure that the V is isolated from the rails that feed out from it, using insulated joiners. Similarly, the wing rails need to be isolated from the closure rails. The illustration shows the crossing V, the wings rails, and a small part of the closure rails are wired together. Left that way it would be a 'dead frog' point which is little better than an insulfrog point, apart from the fact that the metal frog will wear less. Clearly, the frog area needs to be powered and, since all parts of the frog area are at the same polarity at any one time, its polarity must always corresponds to the direction to which the point rails are switched. So, the frog area needs its own electrical feed whose polarity changes dependent on whether the point is set or unset. Wiring Points 91
Back to Contents Page 5
Point switching can be achieved in a number of ways: Using the changeover switches available on some point motors (Tortoise, Hoffman, Cobalt, Fulgurex, Seep) , or purchased as point add-ons (Peco). These are often regarded as not fully reliable in the longer term. Using the Tam Valley Frog Joicer. This module works by detecting a short if a loco enters when the frog is at the wrong polairty to match the direction of travel. The surge in current is detected and the frog polarity is reversed. These have a number of qualifications. They are expensive (currently £57 for a module to handle 6 frogs); they cannot be located close to all 6 frogs simultaneously, requiring wires to be run from the module to distant frogs; they rely on a current spike to function (i.e. arcing and pitting have ocurred before the frog is switched). Using a changeover microswitch that is mechanically operated by the movement of the point's tie bar. This keeps the switch close to the point and independent of any other point wiring. Could be a little tricky to adjust for the correct switching point. Also, a low operating force microswitch is preferable, to prevent the back pressure from the microswitch moving the point blades away from the stock rails. Using a non-mechanical detection system such as attaching a small magnet to a location on the point operating mechanism, such that it activates a Hall Effect switch that controls a relay. An alternative might be a small shutter that breaks an infrared beam detector. These are more finicky to set up but have the advantage of placing no backlash effect on the point blades. Using a relay with SPDT (single pole double throw) contacts. The relay could be operated by a simple trackside or conrol panel switch, or by the output from a CBUS module such as the CANACC8. For example, the signal that operates a servo in a Servo4 board could also be wired to a relay to simultaneously changes the polarity of the frog. There are plenty of options and their relative merits are a matter of debate. It all depends on what you already have, how efficiently you expect it to work (now and in the future) and the lengths you are prepared to go to ensure trouble-free point operation.
Point feedback Throwing a switch on your control panel, or clicking a button on a screen display, does not ensure that your point has operated correctly. Any number of problems could prevent a point from moving. There may have been a cable break, bad connections, a mechanical failure, a motor coil burned out, or a chunk of ballast or other dirt stuck between the stock rail and the point blade. Ideally, the operator should be informed that a point movement has been successful, by lighting a lamp on the control panel, or illuminating a part of a screen display. That involves taking feedback from the point back to the operator. This could be via a length of wire, or via a CBUS CANACE8C module. If a point is fitted as supplied (with none of the above modifications), it can add a microswitch that is operated by the movement of the point's tie bar; the output from the microswitch is switched either high or low depending on the tie bar's position. If a point has wiring for frog switching, then the most of the above wiring methods used for frog switching could also be used as the feedback.
Wiring Points 92
Back to Contents Page 5
These methods are suitable for DC or DCC, conventional wiring or CBU S. Most of the time, your points work dependably. For more critical situations, such as at exhibitions or for automated layouts, feedback is much more useful if not essential. In most situations feedback from a single source (e.g. point motor switch, microswitch, Hall Effect switch, infrared detector) will be perfectly adequate. However, it has limitations. If the frog polarity has been successfully switched, without the point blades moving, you will soon know about it as there will be a short when the loco reaches the frog. The 'feedback' will take the form of the power being cut off from that section/power district. If the blades partially move, as with dirt blocking full movement, there is likely to be a derailment with possible shorting once again. In both cases, this can be prevented by having a system that detects the tie bar has moved the point blades fully in either direction. At its simplest, this might mean having a detector at either end of the tie bar – one to ensure a fully open point and one to ensure a fully closed point. Circuits can also be devised that will only power the frog when a tie bar is fully in one direction. This results in a dead frog but prevents overall shutdown, and the operator is notified of the problem.
Reverse Loops Although not common on actual railways, reversing loops are popular on many model railways. As the illustration shows, if your track reverses back on itself, you will have a short. Solutions require that a 'dead' section be created in the loop, using insulated joiners at both ends. This unpowered section is often called the reversing section. The only connection to the reversing section of track is through some switching system, either manual or automatic. The switching system (see below) is fed from the track bus and feeds out to the reversing section – usually two wires in and two wires out. Before looking at different switching approaches, it is important to ensure that the length of the dead reversing section is longer than the longest train that will be on the loop. Anything that has track pickups must be included in the train length. Apart from the loco, take into account carriages with lighting, with sound, or with extra power pickups, or a train that has a loco at each end. All of the trains pickups must be sitting in the reversing section, otherwise there will still be a short. If a train has only a single loco, and no other pickups, it is possible to have a short reversing section. However, that is only possible if you know that a loco will always be pulling the train and never pushing it. Otherwise, where do you position the short dead section – near the entrance to the loop or near the exit. To play safe, and to allow for a range of different train lengths, it is best to have a long reversing section. Different switching approaches are adopted, depending on whether you are using DC or DCC. Wiring Points 93
Back to Contents Page 5
DC The usual way of handling reversing loops in DC is manual and uses these steps: Make sure that the reversing section is powered to match the direction of the point blades (otherwise you have a short). Drive the train into the reversing section. Stop the loco. Change the point. Reverse the mainline track power. Start the loco again. As you can see, this involves the operator to be in attendance and to carry out a sequence of tasks in the correct order. There are a number of methods of handling DC reversing loops.
Switch This is the most common method of manually switching the section polarity. The picture shows the use of a DPDT (double-pole double-throw) switch to reverse the polarity of the reversing section. When the switch is thrown to the left, the two middle tags are connected to the two leftmost tags. When the switch is thrown to the right, the middle tags connect to the rightmost tags. By cross-wiring the outer tags, the polarity of the output on the middle tags depends on the direction that the switch is thrown. The illustration shows the schematic representation of a DPDT switch; this is how it will look in a circuit diagram. The dotted line indicates that the two switches are always operated at the same time, Consider the case of a train entering the loop via the 'branching' track of the point and leaving the loop via the 'main' track of the point. This illustration shows the point being set to branch. The switch is thrown such that the polarity of the reversing section matches that of the branching track. The train can safely enter the reversing section, since the rail polarities match. The track where it exits the loop has a polarity that does not match its adjacent rails; this does not matter since they are isolated from each other. The train is run into the reversing section and stopped.
Wiring Points 94
Back to Contents Page 5
This illustration shows the point being set to main. The switch is thrown in the opposite direction from that above, making the polarity of the reversing section now match the main track of the point. At this point, the mainline track polarity is reversed, as the loco is entering the mainline in a different direction from before. The train can now be safely run out of the reversing loop into the main line. The track where it originally entered the loop has a polarity that does not match its adjacent rails; this does not matter since they are isolated from each other. Manual operation is very simple to wire but relies on the operator carrying out the sequence correctly.
Relay This can be improved on with the use of a DPDT relay to switch the reversing section, instead of a switch. When the point is switched, the relay is also switched, eliminating some manual operations and ensuring that the polarity of the reversing section always matches that required. This eliminates the possibility of shorts caused by the operator carrying out the sequence incorrectly. The relay can be operated by the switch on the control panel, or by contacts on the point motor. You must use a latching relay with solenoid points, as there is nothing to keep the relay switched after voltage pulse is gone.
Automatic methods Automating DC loops is possible, although complicated. The electronics has to detect when the train is fully in the loop, possibly slowing the train to a halt before reversing the track power to the reversing section. These are not commonly used but an example is the MREV Track Polarity Controller by Azatrax. This method uses track detectors to know when the train has sufficiently entered the reversing section.
Bridge rectifier This method simplifies even further – provided you are happy to have the train always run round the loop in the same direction (always clockwise or always anti-clockwise). Many reversing loops are hidden, so is often OK if loco only every goes round one way. A bridge rectifier is just a single component that houses four diodes in a special formation (the MERG Kit Locker sells a WOO5 bridge rectifier rated at 1.5A) If you prefer, you can use use four separate diodes instead (the MERG Kit Locker sells a single 1N4001 diodes and 1N5401 diodes, rated at 1A and 3A respectively) Wiring Points 95
Back to Contents Page 5
The picture shows a typical bridge rectifier and its equivalent seen as a schematic symbol in a circuit diagram. Bridge rectifiers come in all shapes and sizes, depending on their voltage handling and current ratings. The chief purpose of a bridge rectifier is to convert AC into DC. It has four leads. The two marked with a ~ symbol are the input connections and the other two are the positive and negative outputs. However, a bridge rectifier can also accept a DC input. Because of the way the diodes are wired, the + and – wire will always provide a positive and negative polarity respectively – regardless of the polarity of the DC input. This allows us to connect the reversing loop section such that it always has the same polarity on its inner and outer tracks, regardless of the polarity of the incoming track and point. This example assumes that the loco always enters from the 'main' track and exits from the 'branch' track after going round the loop. The operator moves the point to 'main' (i.e. straight ahead), The illustration shows the conditions when entering the loop. The feed track has its inner rail is at negative and the outer rail is at positive. This is also the conditions fed to the reversing section.
The train will run from the main line into the reversing section and carry on round the section, even when the operator reverses the controller's output. When the point is changed, the inner and outer rails of the feed track now match that of the reversing track, so the the loco can carry on out of the section into the main line. This allows three options; The operator still stops the train in the reversing section, either for timetabling reasons or to allow time to change the feed polarity and move the point. The changing of the feed track polarity is wired to automatically change the point. Instead of six steps, the operator only has to change the track polarity at the correct time (when the train is fully in the reversing section). Using automation modules that do the job for you. Automatic methods involve electronic modules to control the points and the main line polarity, normally through computer interfacing and track detectors (such as the one marked as X in the illustration). Wiring Points 96
Back to Contents Page 5
DCC With DCC, there is still a need to have the reversing section isolated and connected to power in accordance with the direction of the point. The problem with shorts is still prevented by having an isolated section but there are operational differences. With DC, locos are dependent on the polarity of the rails. Reversing a track's polarity results in the loco changing direction. This is not the case with DCC. The loco direction is controlled by sending commands to go forward or in reverse. Once given that command, the loco keeps going in that direction, even when the track polarity is reversed. This is handy for reverse loops. The loco drives forward into the loop, drives round the loop and is still going forward as it exits the loop – all without any change of the incoming track's polarity. Of course, you still need to change the polarity of the reversing section track once the train is fully in, to prevent shorts. Stopping the train in the reversing section is optional. You may want to stop the train for timetabling reasons, or to give you time to change the polarity of the reversing section and to move the point. However, if you want, you can allow the train to keep driving through the loop as long as you change the section polarity and point direction before the loco exits the loop. As before, the polarity changeover can be achieved by a variety of means;
By manually throwing a DPDT switch. By linking a DPDT switch to the point's tiebar. By having a relay change the section polarity; the electronic signal that moves the point also operates the relay.
The last two options simplify the activities of the operator.
Automatic methods Like DC, special modules are available in DCC to automate the process. Indeed, there is a greater variety of electronic modules available in DCC. These circuits do not need track occupancy detectors. Instead, they work by detecting a short when the loco bridges the gap between the reversing section and the point track, as the loco leaves the section. Instead of closing down the track power, these circuits quickly reverse the section polarity to remove the short. At the worst, there may be a slight jerk in the loco movement. These circuits may be built into a booster, such as the SPROG SBOOST DCC Booster, or are available as stand-alone modules. Standalone auto reversing units include
Digitrax AR1 DCC40 Auto Reversing Module (see picture) Gaugemaster DCC40 Auto Reverse Module Lenz LK200 Auto Reverse Loop Unit Hornby R8238 DCC Reverse Loop Module Bachmann E-Z Command Reversing Loop Module
All of these modules save you the job of switching the polarity of the reversing section polarity. You still have to switch the point – unless you use track occupancy detectors to switch the points. So, with a combination of an auto reversing unit and a track occupancy detectors operating the point, the whole process can be automatic. The operator simply has to control the loco speed. Wiring Points 97
Back to Contents Page 5
Wyes This formation is much more common on USA rail systems and is rarely found in Europe. Like the reversing loop, it allows a train to enter a track configuration facing one direction and exit facing the opposite direction. The wye uses three points and a single isolated section (the 'stub end'). The train comes in to the isolated section from one mainline point and reverses out through the other mainline point. It is now back on the main line but facing a different direction. The wye uses more points than a reversing loop and is less popular, although it may better match the physical locations of some layouts. Like the reversing loop, the stub end of the wye must be long enough to accommodate your longest train.
DC The operator's sequence might be:
If necessary, switch point A and point B to allow the train to enter the stub track. Move the train into the stub track through point A and point B. Stop the loco. Change the direction of point B and point C. Reverse the polarity of the reversing section. Move the loco out of the stub track into the main line through point B and point C. Stop the loco. Switch point A and point C. Reverse the polarity of the track power. Drive the loco along the main line through point C and point A.
The train is now travelling forwards, in the opposite direction to that when it approached the wye. It is possible to have the power to the isolated section reversed by a DPDT switch or relay linked to the point operation. Nevertheless, operating a wye is a detailed process that needs to be carried out in the correct order – which is maybe another reason why it is less popular then reversing loops.
DCC Once again, operations are somewhat simplified when using DCC. The illustration shows an auto reversing module ensuring that the stub track is always kept at the correct polarity to prevent continuous shorts. You still have to switch points, unless automated with track occupancy detectors, etc. Important note The illustrations for reversing loops and wyes ignore any consideration on frog or point rail wiring or switching. This is to make the diagrams more clear. Consideration has still to given to how you wire the points themselves, as discussed earlier. Wiring Points 98
Back to Contents Page 5
Chapter 7 Point motors and servos
Wiring Points 99
Back to Contents Page 5
Point motors and servos All layouts have points; some have a few points while others have scores of points. Over the years, many different approaches to operating points have been used. They all have one thing in common, the need to move the point's sliding tie bar back and forth to change the point's routing. Some operators are happy to just lean over the layout and flick the point by hand, although this becomes more troublesome on larger layouts with points dispersed across greater distances. The need to move distant points led to a range of mechanical solutions, ranging from simple push/pull dowel rods to wire in cable systems, often connecting to lever frames. However, since this book is about model railway electronics, we will concentrate on their contribution to point operations. The available options are:
Memory wire Solenoids Stall motors Servos
Memory wire Memory wire has an interesting property – it shrinks when heated and restores to its original length as it cools again. It is heated by passing current through it (around 200mA depending on the wire gauge used) and shortens by about 5%. So, for a 4mm movement, we would need a length of 80mm (a 1/2” movement would need 10”). We could use levers to get greater movement, at the expense of pulling power. This illustration, taken from the MERG Technical Bulletin G19/1, shows how memory wire can be used to operate a point.
Power connections are made to each end of the memory wire, normally using bolts with washers, crimps or terminal blocks. You can't solder directly to memory wire, as the excessive heat will result in the wire losing its special properties. When sufficient current passes through the memory wire, it shrinks and pulls the lever rightwards. In so doing, it moves the point's tie bar. When the current is withdrawn, the wire slowly restores to its original length and the spring ensures that the lever moves back to the right. The shrink time takes around 1 sec and the restore time is around 1-3 secs. The wire's power is generally fed from a constant current source (e.g. an LM317), as excessive current leads to overheating and shortens the life of the wire. Power to the wire can be fed through switches, power transistors or Darlington arrays (e.g. the 2003A). It is not a very popular method, as it needs constant current to keep a point set in the operated mode, and it takes up a lot of space under the baseboard. See MERG Technical Bulletins G19/1 and G19/2 for further reading on memory wire.
Wiring Points 100
Back to Contents Page 5
Solenoids Solenoid-operated points was by far the most common system in use for many years, and is still popular today due to its simplicity. A solenoid was described in the first chapter as a wire coil that acted as an electromagnet to exert a pull on a metal rod. We can use two such coils, slightly spaced apart, with a common moveable metal rod. If coil A is supplied with current, it pulls the rod deeper leftwards into its coil. Supplying current to coil B produces a pull in the opposite direction. In this example, an operating pin is attached to the rod and it too slides left or right. As it does so, it moves the point's tie bar. The illustration shows the simplest possible method of operating a couple of point motors. Each point motor has two coils and each coil is connected across the power supply when its push button is pressed. It is common practice to join two ends of the coils together, requiring only three wires to to be connected to each point motor. Push-buttons are used instead of switches, as the coils would overheat and burn out if power was applied for too long. Although this systems works, solenoid point motors are more commonly used with capacitive discharge (CDU) systems. They avoid burnouts and provide a more reliable performance.
This basic CDU circuit rectifies a 15V AC supply and uses it to charge up a high value capacitor. The connections from the point motors (apart from those that are commoned) are wired to studs on a control panel. The positive end of the capacitor is wired to a floating lead with a probe on the end (an 'electric pencil'). When the probe is touched to a stud, the capacitor provides a short duration burst of high current into that particular coil. This ensures that the solenoid snaps over successfully. The capacitor's charge is soon exhausted and so cannot provide a damaging continuous current. The resistor limits the current coming from the supply, if the probe is kept on the stud for too long. The capacitor then needs to be recharged and this is done through the resistor, ready for the next operation. The charging delay is usually between 0.5 sec and 1 sec. This delay slows up setting up routes of multiple points. You only need one CDU circuit, no matter how many points you have on your layout. Wiring Points 101
Back to Contents Page 5
While operation by push buttons produces a neat control panel, the sparking across the switch contacts and the high current surges they handle can lead to short life and unreliable operation. For this reason, manufacturers have produced 'passing contact switches'. The switch has a lever that can rest in three positions – in the middle and at each end of the travel. The lever is connected to the power supply. As it is moved between the middle position and any of the outer positions, it rubs against a contact that is connected to one of the solenoid coils. As long as the operator pushed the lever all the way, the contact is only momentary and enough to discharge the capacitor through the coil. Passing contact switches are useful in replicating a signal box lever frames, but are not suitable for operator's control panels. Over the years, this basic system was improved upon by using power transistors (highpower devices acting like switches) to direct current through solenoid coils. This allowed ordinary pushbuttons and switches on control panels to be used, letting the transistor do all the heavy switching. It also allowed other devices to switch the points (any electronic device such as train detectors, logic circuits and computers). A further improvement is using more sophisticated electronics to recharge the capacitor more quickly.
Solenoid point motors Firstly, get used to the fact that solenoids are described as point 'motors' when they don't actually contain any motors. Later, as we shall see, there are point-operating devices that do use motors – but all the main brands of solenoids are described as motors (or sometimes as 'point machines'). Solenoid motors are all pretty much alike in the way they provide linear motion. The main differences, apart from price, are:
Some also include changeover switches, so that when the point is moved the switch can set the point's frog polarity (more on this later), light panel LEDs, etc. Some are designed to clip onto the underneath of the point, making installation easier, assuming you buy the same brand of point and solenoid.
Hornby The images show two Hornby solenoids that have different styles for mounting. They operate on 12V DC or 15V AC and are recommended to be switched with Hornby passing contact switches. The first is the R8014 standard point motor. You can clearly see the two coils. The four metal lugs are designed to be plugged into the underside of their points; a rectangular slot is cut in the baseboard to allow the point motor to fit. Alternatively, they can be mounted above the baseboard and hidden in a Hornby trackside hut that includes an extension arm to move the point. If fitted below the baseboard, an extending rod transmits the mechanical movement from the solenoid to the point's tie bar. The second image shows their R8243 surface mounted point motor. This is designed to connect directly to a Hornby point. Neither model includes a changeover switch. Wiring Points 102
Back to Contents Page 5
Seep This solenoid operates from 12V to 25V, AC or DC. They make two models; the basic PM-2 and the PM-1 which is physically identical but has a built-in switch. However, the switch uses a sliding metal washer to rub against the tracks of a PCB (printed circuit board) which limits its useful working life. As the image shows, it has a very simple design and is expected to be screwed underneath the baseboard, as shown in the illustration. The operating pin protrudes through a hole/slot in the baseboard and slides the tie bar. The Seep point motor can also be fitted above the baseboard, if preferred, as shown in the second illustration. The motor has to held above the baseboard using spacers, to allow room for an extension arm to slide back and forth. Atlas The basic Atlas point motor has its coils encased, with just the three connection points visible. It has a slim profile but, unlike other point motors, only has a flimsy plastic operating rod. The second image is of the Atlas Deluxe Undertable Switch Machine. It has a similar mechanism but embeds a DPDT (double pole-double throw) relay for use in frog wiring, panel lights, etc.
Peco Like Hornby, Peco manufacture solenoids that plug directly underneath their own brand of point, resting in a slot cut out of the baseboard. The image shows the basic PL10 model, operating on 16v AC. Peco also sell a PL-9, which is a plastic mounting plate to make it easy to fit the solenoid above or under the baseboard. If fitted under the baseboard, they recommend the PL10E, which is identical to the PL-10 but has a longer operating rod. The other item sold for the PL-10 is the PL-13 accessory switch. It fits under the PL-10 and is operated by the lower part of the solenoid's operating rod. It provides a single changeover switch. Again, it uses a sliding metal washer contact with possible long term problems. Wiring Points 103
Back to Contents Page 5
If you need two changeover switches, or simply more reliable switches, they sell the PL-15 accessory switch, as shown in this image.
This image shows the PL-11 model, which is designed to snap on to the side of a Peco point. Due to its smaller size, the use of a CDU is recommended to ensure positive point switching.
Non-solenoid point motors Although a proven generally reliable system, the solenoid/CDU combination suffers from a number of problems:
The long runs of wire between the switches and the solenoids requires heavy gauge wire to avoid voltage drops, due to the heavy current they have to carry. The fast operation of the solenoid armature produces annoying noisy thumps and clicks. The fierce operation of the points can loosen and damage point parts. The fierce operation of the solenoid's armature can hit the end so hard that it slightly rebounds, resulting in the point blades not lying flat against the stock rails. The movement of the point blades is too fast to look realistic. Most solenoid point motors have no adjustment – the armature simply travels from one extreme to the other. The user has to employ mechanical corrections to make the required point travel match the solenoid's actual travel. This usually involves fitting an omega loop between the solenoid and the point's tie bar, to absorb any unwanted movement (the shape of the loop allows it to compress or stretch). It may also involve fitting levers to adjust between the difference in tie bar throw and solenoid throw.
Most of these problems are solved by using motor-driven mechanisms. They have the following advantages: They don't rely on short bursts of heavy current, so wiring is less crucial. They are much quieter when moving the point blades. There is no thump at the end of travel, so less wear on point parts. They produce a more definitive end stop, with no bounce back. The slow movement of the point blades is much more realistic. In some cases, you can set the end points, eliminating the need for omega loops. Note If your point has an over-centre spring fitted, so that the blades snap to either side once they pass the mid position, this should be removed to allow the smooth movement that motorised mechanisms provide. Wiring Points 104
Back to Contents Page 5
Fulgurex The Fulgurex point motor is not the most popular seller but we start with this one because you can clearly see how it works (the other brands have their mechanisms encased in plastic). A DC motor drives a worm and worm gear to produce a linear movement. A rod to operate the point's tie bar can either be attached vertically to the moving bar (for under the baseboard mounting) or horizontally to the moving bar (for above board mounting). The motor runs on 10V-14V DC at around 200mA. There are two layers of switches on each side of the motor. The bottom layer is used to switch off the motor power when the bar reaches the end of its movement. The two upper sets of changeovers are available for frog switching, lighting LEDs, etc. It is fairly large at 85mm x 50mm. Hoffman This is the Hoffman MWA02-S Point Machine. It works on 16V at a fairly high current of 1A. It has built-in limit switches that cut off power to the motor when the operating lever reaches the ends of its travel. The operating wire rests on on a moveable cam that allows the lengths of travel to be adjusted. It also contains an internal changeover microswitch. It is substantially smaller at 68mm x 24mm. Conrad Like the Hoffman, the Conrad point motor works on 16V at 1A. This motor moves faster than other motorised mechanisms but is still slower and quieter than solenoids. Part 219999-62 is the basic mechanism and Part 219998-62 includes a changeover switch (using copper brush contacts which are not as reliable as microswitches in the longer term.
Tortoise The Tortoise switch machine works different from the others above, as its motor is continuously powered. It is known as a 'stall motor' because it stalls at the end of each throw, avoiding the need for cut-off switches. An unloaded tortoise draws 4mA while running, rising to around 15mA at stall. The constant current means that there is constant tension between the point blades and the stock rails. It is intended for mounting under the baseboard and is quite large at 60mm x 55mm x 85mm. It has two built-in changeover switches. MERG Technical Bulletin A06/2/2/2 cover the Tortoise in more detail. Wiring Points 105
Back to Contents Page 5
Servos Servos have become very popular in model railways in the last few years. Servos are available in a large range of sizes, for industrial/military uses such as automatic machine tools and satellite tracking to domestic hobby uses such as autofocus cameras and radio controlled planes and cars. It is the smaller, lighter servos that are common in model aircraft that are now found in railway layouts. Apart from their use in operating points, they can be found in semaphore signals, crossing gates and barriers, uncouplers, cranes, and a variety of lineside animations (moving people, animals, cars, aerials, radar heads, guns, etc.). Solenoid mechanisms and most motorised mechanisms only move an operating rod between two fixed positions. This leaves the user to make mechanical adjustments to ensure that the point motor movement is accurately reflected in the required movement of the point's tie bar. With servos, this task is eliminated. A servo can be made to stop at any position in its mechanical range – it does not have to go from absolute end to end. So, the servo can be made to move the point tie bar by the exact amount needed each time. Not only can you decide where its end stop points are – you can decide what speed you want to move the point blades (from super-slow to the snap speed of a solenoid). As the illustration shows, a servo is a plastic box with some mounting lugs, an output shaft that partially rotates. Apart from a connecting cable, there is nothing more on the outside. Think of a servo as a motor that turns an output shaft (called a 'horn') through about 180 degrees (see later). With appropriate external electronics, the horn can be rotated to a precise point in that rotation.
Benefits
Readily available from many sources. Cheaper than point motors. High torque. Accurate repeatable positioning. Can provide a fast movement like a solenoid, or can provide a slow smooth movement, which is more realistic and more gentle on point parts. Speed can be varied for each direction (e.g. to mimic a semaphore signal arm). Adjustments are electronic or computer based, rather than mechanical. So, point settings can be carried out remotely from the point. Unlike a solenoid that is either fully one direction or the other, servos can be rotated to many different positions (e.g. for a turntable, or flying a flag at halfmast). No annoying ‘thump’ as with solenoids. Works for all gauges Works with DC, DCC, CBUS, etc.
Wiring Points 106
Back to Contents Page 5
Drawbacks
Normal point motors can be fitted ‘straight from the box’. Servos need additional mounting arrangements and additional control circuitry. Unlike solenoids (with fixed distance movements) or Tortoise-like motors (with microswitches to set end stops) servos need to have a source of electrical pulses to determine their positions. Hence the need for extra electronics. Servos don’t come with mounts for baseboards, unlike devices designed for model railway use. Modellers have to make their own mounting brackets, or buy commercial mounts that often cost more than the servo. Requires a little more technical expertise to construct and set up. Most servos work at around 5V, which is not a common power output from loco controllers – hence the need for extra electronics. Cheaper servos wear out after only 25 hours of use (on the other hand, that is 30,000 point operations based on 3 seconds per point movement).
Choosing a servo With such a variety to choose from, its best to look at their specifications. This image shows some of the smaller servos that are available. In most cases the middle two servos are employed for most tasks.
Servo specifications cover these factors: Torque A measure of the ‘turning power’ of a servo. It measures the amount of 'push' or 'pull' that the servo can handle before the motor stalls. Torque is measured in ounces*inch or kilograms*centimetre. Consider a servo that is rated at 2kg*cm, and has a horn with a hole drilled through it that is exactly 1cm distance from the horn centre. The servo would stall if it had move a mass of 2kg at that point; any mass less than 2kg can be moved by the servo. If the hole in the horn had a distance of 2cms, it would stall at 1kg. It makes sense – the further out from the centre of the motor, the less able the motor is at handling mass. The horns that are supplied with servos have a number of holes at different distances out from the centre (see the earlier drawing). These allow operating rods,
cables, etc. to be attached to them. Servos are available in a wide range of operating torques. For example, the DYS0206 has a Wiring Points 107
Back to Contents Page 5
torque of 1.5Kg.cm, while the mighty Multiplex RHINO digi 4 has 24.47Kg.cm. For comparison, the smallest servo in the photograph has a torque of 1.5Kg.cm, while the largest has a torque of 3Kg.cm. For operating lightweight fittings (e.g. signals or crossing gates) even the least-endowed servo will have no problem. If you intend to keep using centre-sprung points, a little extra torque is required, compared to other points.
Operating speed Retailers describe the servo’s speed (or transit time, or servo turn rate) as the time the servo takes to rotate a certain amount. Thus, the Protech B305’s speed is quoted as taking 0.2 seconds to rotate 60 degrees (0.25sec/60) and the tiny DYS0206 has a performance of 0.12s to rotate 60º. Servo speed is important when used to fly a model aeroplane but even the slowest operating speed is fast enough for model railway applications.
Weight Again, this is very important for model aircraft but not normally a significant factor for railway modelling.
Size This is less of an issue for operating points, as there is usually sufficient space under the baseboard. Smaller servos might prove useful inside small buildings and structures (e.g. people moving inside a signal box, or where a point has to be operated from above the baseboard). The most commonly used servos are significantly smaller than point motors. Type
Case size
Possible uses
Large-scale
60mm x 51mm x 28mm
Robots, heavy work. Mostly non railway
Standard
38mm x 35mm x 19mm
Heavy work on layout
Mini
28mm x 25mm 16mm
Medium / light work
Micro
22mm x 16mm 10mm
Light work, small places
Ultra
20mm 15mm x 11mm
Linear (sliding door, semaphores)
Performance The construction of the servo and the materials used have an effect on how smooth and reliable the servo operates. Compared to model aircraft and boats, servos in model railways would not likely suffer the same amount of constant use during a session. While an aircraft operator is constantly altering servo settings (i.e. many thousands of changes) during a flight, points or signals will probably enact much fewer changes in a session. Nevertheless, reliability can be enhanced by purchasing servos that offer improved construction such as higher-quality motors, double ball races, long life bearings or long life motor brushes. The higher quality servos are designed for sudden acceleration and fast sequences of movements. Servos with metal gears and metal output shafts have the most strength, handle the highest torque and are used where heavy or jarring loads are being handled. However, the gradual wearing away of the metal results in accuracy being slowly lost over time. Nylon gears are cheaper, suffer much less wear but are less durable in adverse conditions, being prone to snap the shaft or a gear wheel when over-worked. Karbonite gears are stronger and even more long-wearing than nylon gears and are found in servos such as the Hitec HS-6965. For most railway applications, the cheaper nylon geared-servos are quite sufficient.
Wiring Points 108
Back to Contents Page 5
Here is a typical advert, providing specification details of a commonly used servo:
Analogue / digital Servos are available both as analogue (by far the most common) and digital versions. Both use the same motors, gears, etc. The difference is in the electronics inside the servo. The analogue servo checks its position 50 times per second and adjusts the rotation if required. The digital servo checks and adjusts 300 times per second. This results in faster operating speeds and a more constant torque. Digital versions are more expensive and provide no real added benefit for the tasks performed in model railways.
Connections Most servos have three wires exiting the casing and terminating in a 3-pin socket connector as shown in the image. The wires are colour-coded and their uses are: Wire Colour
Signal
Red
+5V
Black (sometimes brown)
Ground (OV)
White (sometimes Yellow or Orange).
Signal input
Description Draws anything from 10mA to over 1A, depending on how powerful the servo is (read each servo’s specification) Common connection for both the supply and the input signal. The incoming signal to the servo, to set the servo’s position. The input can be fed from transistors, ICs (both TTL and CMOS), PICs, etc.
Most servos seem to use red, black and white wires but this varies between manufacturers. Also, most servos use the same order of wires on the connector with the red wire in the middle. Again, this is not always the case, so check before connecting. The socket has square holes spaced 2.5mm apart, to accommodate PCB header plugs. These are available from MERG, Rapid, Farnell, etc. They can be purchased as 3-way
Wiring Points 109
Back to Contents Page 5
single row PCB header plugs but is more economic to buy a 36-way strip and cut it into twelve 3-way pieces. Note The socket is not polarised, so the plug can easily be inserted the wrong way round. It is up to you to ensure that the plug is wired to match the servo socket – and is inserted the correct way round.
Control signals to the servo Assume for the moment that the three wires from the plug are connected to some electronic device that is capable of controlling the servo (more on servo controllers later). The servo, in addition to its motor and gearbox, has a small printed circuit board with its own electronics, including some noise suppression. The internal electronics translate the state of the incoming signals into the rotational position of the output shaft. The servo operates on an input signal of 5 volts.
Low signal, also known as logic 0, is 0 volts High signal, also known as logic 1, is +5V
The ground wire (usually the black wire) is held at zero volts. The red wire supplies the power to the servo and is always held at +5V. In fact, various servos can operate over a range of supply voltages from 3V to over 7V, depending upon the model. However, its best to work on a standard of a +5V supply, since this is a voltage that all servos can expect to operate at. The remaining wire sends +5V pules from the controlling electronics to the servo. Many people place a 10k resistor in series with the lead to the signal input, to limit the signal current into the servo. The input signal sits at low level and is taken high for a certain period of time before being returned to low. This looks a square wave pulse as shown in the illustration.
Timing and rotation The control of the servo depends on this simple rule: The width of the input pulse to the servo determines where the output shaft rotates to. So a particular pulse width should always result in the same movement of the servo horn. All servos are designed so that a pulse width of 1.5ms rotates the output shaft to a mid position. For the purpose of the illustration, a pulse of width 1ms (a millisecond – a thousand of one second) makes the output shaft rotate to its most counter-clockwise position and a pulse width of 2ms rotates the shaft fully clockwise. This relationship between pulse width and rotational position is shown in the diagram. This supposes that the servo has a 180-degree maximum rotation. In practice, servos can be found with maximums that vary from around 90 to 180 degrees. Some servos allow an input pulse to be as short as 0.75ms and as long as 2.25ms.
Wiring Points 110
Back to Contents Page 5
Note While all servos of a particular make and model are identical, the range of available rotation and the pulse width required for that range could vary between different models. Modellers might consider sticking to one model for identical operations (such as points), or ensuring that replacement/additional servos have the same specification as those currently in use.
Other, physical, alterations to the servo are possible to obtain continual rotation with no ends stops. This is not normally needed for our purposes (if you need a rotating motor – buy a motor!) but interested readers can find details on this via Google. Normally, pulses should be sent to the servo 50 times per second (i.e. every 20ms) to keep the shaft in any fixed position. So, for example, to keep the shaft in mid-position, pulses of 1.5ms duration would be sent every 20ms. Many experiments using different servos has shown that while desirable, this is not strictly necessary. Where a servo is under strain, such as supporting a weight or acting against a spring, repeated pulses are required to ensure that the load does not move the shaft from its chosen position. In other situations, such as centre-sprung points, a few pulses are sufficient to move the blades, which are then kept, in place by the spring. Also, light loads such as signals and swing gates do not require constant refreshing, as the friction in the servo gears is sufficient to maintain position. Where a stream of pulses is used, the pulses do not have to be at the exact 20ms rate. Anywhere between 15ms and 40ms works quite happily. Repeating the pulses too frequently (e.g. 10ms) may cause servo jitter/chatter, produce a buzzing sound, or make uncontrolled movements. Repeating too infrequently (e.g. 70ms) may cause the servo to shut off and the shaft might lose its rotational position. Also, the pulses do not have to be repeated at exactly the same rate. So, there could be a 25ms between some pulses and 35ms at another point in time. This is because the length of the pulse is the most significant characteristic of the input signal
How a servo works inside This raises two questions: How does the servo motor know when it has reached its required position? How does the servo automatically maintain its position, assuming a regular pulse stream? The answers lie in the internal workings of the servo. The image shows a servo with its upper casing removed. On the left is the output shaft and this is rotated via nylon gears to a motor whose shaft can just be seen on the right of the servo. Inside the case, there is a small potentiometer (variable resistor) connected to the output shaft. As the shaft rotates, the potentiometer’s value is altered and the resulting change is fed back into the servo’s circuitry. This allows the circuitry to act as a ‘closed loop’. It knows
Wiring Points 111
Back to Contents Page 5
what value should be fed back from the resistor for any given incoming pulse width. If both values correctly match, the motor is not energised since the servo is already in the correct rotational position. If the value of the requested position (given by the pulse width) doesn’t match the current actual position (given by the value from the variable resistor), the motor is turned in the appropriate direction until the two values match. At that stage, the motor stops drawing power.
More technical explanation The servo’s circuitry uses a pulse width comparator. It compares the width of the incoming pulse with a pulse from a one-shot timer whose period is set by the potentiometer value. The difference signal feeds a flip-flop circuit whose outputs determine the motor direction and drive an H-bridge circuit to provide the high current to supply the motor The in-built feedback mechanism will handle any external force that tries to alter its position. So, if a heavy load begins to turn a servo from its designated position, the movement is detected and the motor is re-energised to bring the shaft back to the chosen position. Just try turning a horn with your fingers when the servo is being sent positional pulses!
Servo accuracy To be really useful, you have to be able to depend on the accuracy and repeatability of the servo's rotation – for any given pulse width, it must always rotate to the same position every time. However, tiny overshoot adjustments must be minimised, otherwise the servo would be continually drawing current as it makes tiny jittering movements back and forth. For most servos, therefore, there is a trade-off between absolute resolution and ignoring tiny insignificant signal changes (known as the 'deadband'). Lets look at an example. A servo's incoming signal can vary from 1ms to 2ms – a difference of 1ms, or 1000μs (microseconds). There are no occasions when you would require the servo to take 1,000 steps to get from one end of travel to the other. For the sake of the example, let's say we are happy with using 50 different steps (still quite a lot). That means the width of the incoming signal would change by 20μs (1,000μs divided by 50 steps) to move to the next step. If the servo had a deadband value of 10μs, it would ignore all pulse width changes of 10μs or less – resulting in greatly reduced unwanted small movements, less current draw and less overheating of the servo motor and its electronic components. In practice, servo deadbands vary between 1μs and 8μs. In precision military and scientific applications very high specification servos are used with a very narrow deadband and this allows for greater resolution for the servos. In a hobby situation, where the incoming signal cannot be guaranteed to be stable, or where cheaper servos are in use, a wider deadband allows for greater stability at the cost of resolution. If we look at a servo with a 90º maximum rotation and a 2μs deadband, the resolution that is available would be 90 x 2 / 1000 = 0.18º, which is more than sufficient for all model railway activities.
Wiring Points 112
Back to Contents Page 5
Servo problems Servo systems are generally very dependable but, like all electronic and mechanical systems, there are potential problems that may need addressed.
Buzzing The servo's deadband prevents unwanted servo movement for tiny pulse width changes. But there are other problems that might prevent the servo reaching its deadband area. Sticky / blocked points – if the servo cannot move the point blades to the required position, due to debris on the track or a gummy tie bar, the servo will carry on trying to finish its task. The servo motor will buzz as it tries to reach its final stopping point. Incorrect alignment – the mechanical linkage between the servo's horn and the tie bar are improperly aligned, preventing the servo from reaching its final destination. Incorrect settings – the mechanical arrangements are fine but the servo has been given an incorrect final stopping point and is trying to move the tie bar beyond the stock rail. Poor power regulation – the glitches in the power supply to the servo, or its controller, or both, affect the voltages fed to the servo's internal comparator circuit. A servo only consumes a few mA when stationary but this can rise to 500mA when rotating, depending on the servo size and model. Interference – pickup of unwanted signals (noisy loco motor, DCC messages, CBUS messages, etc. ) appear to the servo's signal wire input as movement instructions. These problems can be resolved by ensuring that the points are kept clean and clear, the mechanical link between servo and tie bar are aligned properly, the servo is correctly configured and that the power and signal wires are routed to avoid interference.
Kicking It is well-known that most servos produce a 'kick' (an unwanted movement) when they are first powered up. This is a feature of their internal electronics and is cleared in almost all cases by soldering a 10k resistor between the servo's signal wire and the +5V supply line. In some cases, it only effective if wired across the signal line and the 0V line. Configuration of the control electronics can also minimise this effect.
Twitching Unlike the kick, which only happens during power up, servo twitching occurs during the running session. This is almost always a result of external interference and can tackled by careful routing of layout wires, or placing a capacitor between the signal wire signal and 0v to shunt away any high frequency spikes on the signal wire. Alternatively, the problem could be tackled at the servo controller end. If the servo needs to keep pressure on, it requires the constant repetition of the incoming pulses. Otherwise, the servo controller could be organised to stop sending pulses after a few seconds. Although this looks like a long list of problems, in practice they are all either avoidable or are usually easily remedied.
Wiring Points 113
Back to Contents Page 5
Fitting servos The illustration shows the key elements for fitting servos. Usually, the lever (called a ‘horn’) and fitting screw is supplied with the servo. Often, a selection of horn types is supplied. The horn has multiple holes drilled in it. The choice of horn, and the way it is used, allows a servo to provide either a rotational or linear motion. There are mounting lugs lips on the side of servos; larger servos have four holes, two each short side and the smaller servos provide a single hole at each end. Some retailers also supply rubber grommets. These fit in the holes to provide a degree of suspension, which is useful in vibrating environments such as model aircraft.. They are often left unfitted to ensure accurate repeatable positioning of the servo horn. There are two problems facing modellers: Mounting servos to baseboards, inside buildings, etc. Fitting operating arms, cables, etc.
Commercial mounts These images show a range of the mounting brackets that are available from dealers.
Top row:
Small plastic mounts (eBay) Solid one-piece plastic mount (SLEC Ltd) – plastic version from Conrad Plywood self-assembly bracket (J Perkins) Bottom row: Aluminium bracket (Active Robots) Plastic self-assembly bracket, with two microswitches (MERG) Servo1 PCB that acts as a mounting bracket as well as providing the control electronics (MERG) The images, which are not to scale, show that a variety of materials have been used in their manufacture. Unfortunately, in most cases, the cost of the brackets exceed the cost of the servos themselves, although the MERG version is cheapest and provides additional facilities. Wiring Points 114
Back to Contents Page 5
Home brew mounts The relatively high cost of commercial mounts has led to hobbyists developing their own cheaper alternatives. Modellers will provide endless alternative means of fitting servos and using them to operate devices. These images show three such approaches.
The servo on the left is screwed onto two small wooden cubes of the type that you buy as a bag's worth in a craft shop. The blocks are then glued to the underside of the baseboard. The middle servo uses a piece of aluminium angle that you can buy in DIY stores. Two holes are drilled in the side and the servo is held in place by plastic ties. Two other screws hold the angle piece to the baseboard The servo on the right uses L-shaped plastic brackets that you buy in DIY stores for fixing shelves and cabinets. A slot is cut in one side and the servo sits in the recess and two screws hold the servo to the bracket. The plastic bracket can then be screwed to a block for fixing to the baseboard (screwed or glued). All three methods allow the mount to be fabricated before fitting to the layout.
Attaching points to the servo You can still use a servo to operate a point using the traditional indirect methods such wire in tube, omega loops, cranks and levers. In fact, this might be the best way for points that are not easily directly accessible through the baseboard. For most servo users, however, the servo operates the points using a length of piano wire. There are two ways to achieve this:
Direct This is the most simple method and is shown in these images. The piano wire is connected to the servo horn, bending the wire through the horn holes (some even securing it with additional wire binding and enclosing with epoxy). The piano wire passes through a slot in the baseboard and protrudes through a hole in the point’s tie-bar. It needs no other mechanical linkage; as the servo rotates, the piano wire slides the tie bar. This method works happily in many situations but has some limitations. Wiring Points 115
Back to Contents Page 5
Consider this illustration showing the direct movement of the point tie bar with servo rotation. As you can see, the servo is capable of a much greater range of rotation than that being used to move the tie bar. In fact, as the piano wire length is increased, the servo will rotate less and less to achieve the same amount of lateral movement of the point. This has two effects:
Although the servo can complete its arc of travel using many different step (e.g. 256 steps) the tie bar is moved end to end with very few steps (e.g. 8). This greatly affects the movement resolution, as a slow motion point change would finish in just 8 steps, resulting in a more jerky movement. Small changes in servo rotation result in large swings at the end of the piano wire. This turns small unwanted kicks into potentially large and destructive jolts of the tie bar, unless stringent steps are taken to minimise start-up kicks, interference, etc.
Pivot This method is safer and more realistic. Looking again at these two homebrew mounts, we can see that they also have long piano wire actuators – but the fulcrum is not at the servo end, it is near to the tie bar. So we have the opposite effect of direct linkage. A large rotation of the servo results in a smaller lateral movement of the tie bar. Thus, we have the horn rotating almost from end to end. The many steps to move the point provide smooth slow motion. Also, any 'kicks' have no effect, since the servo works at its extremes anyway. There must be a small hole at the fulcrum – no wiggle room. The pivot method is the most configurable, with plenty of options for tweaking the movement of the wire actuator. The piano wire can be inserted in any hole in the horn arm, providing different amounts of leverage. You can also set the distance from the horn to the tie bar and the position of fulcrum. Finally, you have the ability to change the servo's end stop positions in software. The image on the left shows how the Tortoise point motor using a sliding fulcrum to adjust the amount of leverage. Moving accessories Servos are commonly used for point control but can be used for a wide range of lineside accessories, such as crossing gates, sliding doors, cranes, semaphore signals, uncouplers, grade brakes, etc. The image on the right shows a model crane epoxied to a plastic tube that is run through a hole in the baseboard and is a push fit on to a servo’s output shaft. Servo use is only limited by your ingenuity. Wiring Points 116
Back to Contents Page 5
Controlling servos To control a servo, we need a source of pulses as described earlier. The circuit is called a 'servo controller' and can be built from transistors, 555 timer chips, flip-flop ICs or PICs. The circuits can be controlled from mimic boards or from computers. They can be built from scratch, from MERG kits and from commercial control boards.
A basic homebrew controller The circuit below is ideal if you want to experiment with servos without committing too much cash. The only costs are a cheap NE555 IC, a handful of components and a single servo. It is a tried and tested circuit.
The 555 chip is a timer IC which is just what is needed for creating timing pulses. Servos expect to receive regular pulses on their 'Signal' wire (the other two wires on the servo are for our 5V power). The pulses on the signal wire should vary in duration between 1ms and 2ms and be repeated every 20ms. The 390k resistor and the 150nF capacitor are used to control the time between pulses, while these same capacitors are used in conjunction with the two resistors and 10k potentiometer to control the length of the pulses. So, varying the resistance of the potentiometer controls the servo arm's rotation. The circuit works from a standard 12V DC supply and uses a 7805 voltage regulator to bring the voltage down to 5V for the chip and the servo. For more details on 555 timers, read John Matthew's article in the MERG Winter 2006/7 Journal. Another very simple servo circuit is printed in the Elektor magazine Jul/Aug 2008 edition. This circuit uses a 7400 IC. Although simple, its uses include:
A cheap introduction to playing with servos. A module to test servos before fitting them on a layout. Manual control of aerials, radar heads, guns (great for kids). When you need to move to intermediate positions (e.g. a flag at half mast) Mounting a cam on the arm, so you can scan a hidden area of the layout. An asymmetric turntable for smaller gauges (the pivot point is near one end rather than the centre). Any manual control for occasional use.
For many purposes, a more comprehensive controller is required. Wiring Points 117
Back to Contents Page 5
So, what are the requirements for a model railway servo controller: 1. Easily operated by switches (control panel) 2. Easily operated from other railway modules (e.g. track detectors) 3. Easily operated by a computer 4. Easy to set a servo's endpoints (the limit of travel in each direction) 5. Easy to set the speed of servo rotation, preferably with each end point being able to be set independent of the other (e.g. able to move fast in one direction but slow in the other direction). The first three requirements are usually met by having a controller that has a separate input pin for each servo. Pulling the pin to 0v makes the servo rotate in one direction, while pulling the pin up to +5V makes the servo rotate in the opposite direction. By operating from a simply change of voltage level, the servo controller input can be attached to anything that produces that voltage change. In most cases, this would be a simple on/off switch in the control panel, as shown in the illustration. Otherwise, any circuit that switches logic level (between +5V and 0V) can be attached to the servo controller input pin. The fourth requirement, setting the end points, is either accomplished by a computer software application, or by using switches / pushbuttons on the servo controller board. The last requirement, altering the speed of servo travel, is provided by some controllers, while others simply switch at a set speed.
Commercial controllers The benefits of these boards are that they are supplied ready-built and tested. There are three categories of servo controller: Industrial / military / scientific / medical – High specification, high price, modules that are not covered here. Hobbyist robot builders. Model railway controllers.
Model Railway Controllers These three models are specifically designed for the model railway market.
Viessmann 5268 Servo-Control This servo controller uses a supply of 10V to 16V, AC or DC and converts it down to 5V to operate the servo. Unfortunately, it only operates a single servo. This is fine if you only want to have the odd feature here and there on your layout (e.g. a signal or a crane). It is too bulky and is not cost-effective if you want to operate dozens of points. The end stops are set using two separate adjusters. There is no control over servo speed. Wiring Points 118
Back to Contents Page 5
Conrad Train Module 73726
This controller is a little better, as it handles two servos. It uses a supply 7V to 24V, AC or DC and converts it down to 5V to operate the servo. Like the Viessmann, it is really only suitable for occasional servo use on a layout. There is no control over servo speed.
Heathcote Dual Servo Motor Controller It uses a supply of 9V to 16V, AC or DC. It also only handles two servos, limiting its appeal for point operations. The endstops are set using two pushbuttons. Seven different speeds can be set, using another pushbutton. The sockets that can be seen at the back of the board are for connecting a remote setting box that replicates the boards pushbuttons. This saves you having to adjust point servos while crouching under a baseboard. It has an interesting sequence facility, allowing you to control one servo from another. This can be used for crossing gates, as the second servo will only start to move when the first has finished rotating. Tam Valley
The image shows the Tam Valley Octopus II model. It uses a supply of 7V to 18V, DC only. The rows of pins along the bottom are for connecting 8 servos. The rows of pins on the left are for connecting 8 toggle switches, or digital inputs. There is no control over servo speed. It provides automated endpoint adjustments. You turn the rotary switch (the white one in the image) to the servo you want to set, then press the pushbutton above it. The controller automatically finds the end points for you.
Robot servo controllers A larger range of servo controllers has been developed for designers of robots. They are more comprehensive and more complicated. Some of the earlier controllers we looked at handled too few servos to be useful on a large layout. Robot controllers, on the other hand, can handle up to 48 servos from the one module. However, this is not as great an advantage as might be initially considered, since it would mean having a central servo controller with many extension leads snaking all over the layout to reach each servo. The biggest drawback for most robot controllers is that they do not have a simple on/off switch approach to moving servos, relying instead on computer serial or USB port connections or special microprocessor signals. Although they often provide extra facilities beyond simple servo switching, they require a degree of programming knowledge. Wiring Points 119
Back to Contents Page 5
Here is a list of some robot servo controllers.
Here, for example, is the Lynxmotion SSC-32 controller It can handle 32 servos and supports servos that can rotate a full 180º. Its resolution is an impressive 1μs (0.09º) – it can rotate a servo's horn in steps of only 0.09º. It is operated via a computer serial cable
MERG controllers MERG members have developed a number of controller options. One of these, the Servo4, is available in kit form and another, the Servo1 is sold as a PCB and pre-programmed chip.
Servo 4 This image shows an assembled Servo 4 kit. It uses a supply of 12V DC or 9V AC. There are four servo connections at the top of the board. The four left-most connections in the lower screw connector block are the inputs that control the servos. They are held at +5V internally but can be brought to 0v when they are wired to switches that are connected to the module's 0v line (the fifth connection). These switches would most likely be on a mimic board or control panel. This module allows both a servo's endpoints and speed to be set, via the serial connector, using MERG's software utility (free to members). You can program the board directly, if your computer has a serial port, or through a USB-to-serial adaptor if your computer only has a USB socket. If you prefer, you can plug MERG's setting box into the serial connector, instead of using a computer. Wiring Points 120
Back to Contents Page 5
Servo4R This image is of the Servo4R, which is similar in most ways to the Servo4 module above – except that it adds four relays to the board. It uses a 12V DC supply. These are used for point frog switching, etc. This is a member's modification and is not available as a kit or as a PCB, although the schematic diagram, parts list, PCB layout, etc. are available on the MERG website. Like the Servo4, it is set up via the serial connector.
CANSERVO8 This image shows a module that is a combination of a CBUS board and a servo driver board. It only works with other CBUS modules, where it controls up to 8 servos. This is a member's design and is not available as a kit or as a PCB, although the schematic diagram, parts list, PCB layout, etc. are available on the MERG website. If preferred, an existing CANAC8 module can be converted to do the same functions. The module is programmed over the CBUS cable and both endstops and servo speed can be configured. There is no provision for relay switching. The CBUS system is covered in a later chapter.
Servo1 Like the Viessmann 5268 Servo-Control module looked at earlier, this design from MERG member Trevor Stockill only operates a single servo. However, it has a number of additional features. The PCB has a rectangular slot with holes either side, as shown in this image. This allows a servo to be be screwed or bolted to the PCB, which has holes in each corner for mounting on a baseboard. This saves the expense of a separate mount. It has two output connections that change state at end of the servos' rotation – ideal for LEDs. It has another connection for operating a relay – ideal for frog switching. The servo's endstops are set with a pot and pushbutton. Unlike the Viessmann or Conrad controller, the Servo1 lets you choose the servo's speed (using a single pushbutton). It operates on either 5V or 12V DC. It uses surface mount components (some as tiny as a grain of rice) which requires good soldering skills and good eyesight/large magnifier. It is not available as a full kit, but the PCB and a pre-programmed PIC chip are available.
Wiring Points 121
Back to Contents Page 5
Installing a servo This depends on the exact nature of the installation – where it sits (above board, under board), the method of actuation (piano wire, levers, wire-in-tube), etc. Lets assume for this explanation, that we have servo screwed on a mount, wired to a controller for under baseboard operation using piano wire. Before screwing the mount to the baseboard: 1. Use the servo controller to rotate the servo to its mid-position. 2. Fit the servo horn so that the hole being used for the piano wire lines up with this mid rotation. 3. Move the point tie bar by hand to mid position between both stock rails. Secure in that position with a piece of card/balsa/ foam. 4. Slip the piano wire through the hole in the baseboard from underneath and gently insert into the hole in the point's tie bar. 5. Move the servo and its mount to a position where there is no side pressure on the piano wire (i.e. the entire servo/wire/tie bar are in alignment).
Then: 6. Screw the mount to the baseboard. 7. Adjust both servo endpoints using the servo controller (this may be using pushbuttons, switches or software depending on the controller being used).
Configuring the Servo4 module The Servo4 controller is MERG's most popular kit and the software used to configure the servos can be downloaded from the MERG website (MERG Software Download Pages). When installed on your computer and run, it shows the following menu screen:
You choose which servo to configure by clicking in the “Servo Select” options. The two left-hand sliders set the endstop and servo speed when the controller's chosen input goes high. The two right-hand sliders set the endstop and speed when the input goes low. As you move the 'ON' and 'OFF' sliders, the servo position is instantly altered. Also, you can click the “Test” arrows to check that the servo swings are satisfactory before selecting another servo to configure. When finished, clicking the “Write data to board” saves all the settings and the connection cable can be removed.
Wiring Points 122
Back to Contents Page 5
Chapter 8 Scenic lighting
Scenic Lighting 123
Back to Contents Page 5
Scenic lighting So far, we have concentrated on the technology that makes the layout run. Now, lets have a look at some features that can enhance the look and feel of a layout. Many layouts look good and run well but still seem to lack some sense of life. This can be partly caused by the lack of movement – the only things moving being the trains. The previous chapter on servos opens up possibilities to bring other movement on your layout – people, doors, crossing, semaphores, etc. This chapter looks at lighting your layout, to provide that lived-in look. Lighting is often overlooked in otherwise excellent layouts. Yet it mostly easy to add to a layout, whether under construction or already existing.
Benefits These are just some of the lineside features that could be illuminated to good effect; Street lamps Traffic lights Station lights Yard lights Crossing lights Semaphore signal lamps Lamps on buffer stops Buildings and factories Lighthouse Flickering fires / welding flashes Neon signs Flashing beacons in police cars/ambulances/fire engine/breakdown trucks Vehicle headlights Night scenes / sunset behind the mountains / skyline These lights would certainly add appeal to trains: Loco cab lights. headlights, Mars lights, ditch lights Guards van / caboose lights Steam loco fire box Coach lighting To these could be added cinemas, concerts, roadworks, crash scenes, searchlights, and so on – limited only by your imagination. Clearly, having the layout looking more like a Xmas tree would not be helpful, but the judicious use of lighting can greatly enhance a layout. Many of the features require little electronic knowledge and you can buy ready built units for some of the more complicated lighting features. If you are willing to build your own circuits, you can make substantial savings and build lighting features that perfectly match your layout's character. Scenic Lighting 124
Back to Contents Page 5
Filament bulbs Before the coming of LEDs, all layout lighting used tiny incandescent bulbs. These are just much smaller, lower voltage, versions of the house light bulbs in common use. Sufficient current is passed through the bulb's wire filament to heat it to the point where it gives off light. The bulbs are available in two sizes, known as 'Grain of wheat' and 'Grain of rice'. Grain of wheat bulbs are 3mm in diameter, while grain of rice bulbs are 1.8mm in diameter, with some as small as 1.4mm. They produce a natural light but can be purchased with coloured glass bulbs or lenses. They are available in 3V, 6V and 12V versions. They work on AC or DC and typical bulb currents are: Grain of wheat bulbs 12V at 50mA or 80mA 6V at 50mA or 60mA 3V at 120mA Grain of rice bulbs 12V at 30ma
Series and parallel wiring Since 12V is a common supply on a layout, a 12V bulb can simply be wired across the 12V. You can fit as many 12V bulb across the supply as you want, subject only to the supply and the wiring being able to cope with the current demands. If you use 6V bulbs,you can wire two in series across the 12V supply, giving each bulb the 6V it needs. Similarly, you can wire four 3V bulbs in series across the 12V supply.
If you only want to light a single bulb, and it has a lower voltage rating than the supply, you have to put a resistor in series with the bulb to lower the current through the bulb. Take, for example. Using a 6V 50mA bulb on a 12V supply. The value of the resistor can be calculated as: R=V/I where V is the 6V we want to drop across the resistor (leaving 6V for the bulb) and I is 50mA. So the value of the resistance would be: R=V/I = 6/0.05 = 120 ohms That works fine where a single bulb is being lit in a single location. If you want to have multiple bulbs lighting a building or a station platform, then you would not use multiple bulbs in parallel. If we look at wiring four 3V Scenic Lighting 125
Back to Contents Page 5
120mA bulbs as in the illustration, then 120mA is flowing through each resistor/bulb combination. The total current draw is 480mA (nearly half an Amp) and the power consumption is almost 6W. Wire a dozen inside a mainline station and you have used up 18W – more power than many soldering irons. Compare that with the earlier example of wiring four bulbs in series across the 12V supply. The current drawn is 120mA (the same current flows through each bulb) and the power consumption is a smaller 1.4W. Since filament lamps heat their elements to produce light, around 90% of the power consumed by the bulb is dissipated as heat – a clear fire risk. So, you have to be careful that you don't fit too many into a closed location (e.g. inside a building) without adequate ventilation. Some users deliberately run their bulbs at less than their quoted voltage rating. This results in less heat, a warmer glow and an extended life. Here is a comparison of incandescent bulbs to LEDs: Pros A more natural white light Colour more suited to lamps of period layouts, Very thin leads – great for positioning, compared to stiff leads on LEDs Cons More expensive More fragile Run hot Consume too much power
Light Emitting Diodes LEDs have been mentioned a few times in previous chapters, since we have all come across them in many different domestic devices. They have many advantages over using filament bulbs: Longer life Consumes far less current (some as low as 3mA) Run cool Available in many colours More robust Cheap Available in high intensity versions Rapid switching on and off does not decrease their life. To make best use of them in a layout, we should look at how they work and how they can be wired. The symbol for a LED is shown in the illustration. It looks similar to the symbol of a diode because it acts like a diode – it passes current in one direction only. In addition, it emits light when an appropriate amount of current passes through it. Inside the epoxy resin case, there is a small piece of semiconductor material that emits photon energy. This is called 'electroluminescence' and consumes very little power and generates very little heat, compared to filament bulbs. Scenic Lighting 126
Back to Contents Page 5
LED types LEDs are available in a range of sizes, colours, shapes and features.
Shapes This images shows some of the types you are likely to use. They are not shown to scale. The last image on the right, for example, is the smallest of all. They are produced in diameters of 1.8mm, 3mm, 5mm. 8mm and10mm
From left to right: Standard, triangular, square, cylindrical, rectangular, lighthouse, sub-miniature, PCB mount, tri-colour, surface mount. Most of the ones shown are known as 'through hole' LEDs, as they are intended to be mounted on some kind of panel (in our case, a mimic panel). Others, like the one with three LEDs and the one on the far right, are intended for mounting on a PCB. This image shows a LED strip which can be bought by the metre or in 5m rolls. It runs on 12V and can be cut into smaller lengths.
Colours A LED's colour comes from the semiconductor material used, not from additional filters or a coloured epoxy casing. The colours include red, pink, orange, yellow, amber. Green, blue, white and warm white. They are available in versions known as diffused (a frosty casing that results in a wider viewing angle) or clear encapsulation (produces a viewing narrower angle but a more intense brightness). Bi-colour LED This is just two different-coloured LEDs built into the one casing, wired in reverse of each other. It has only two connecting leads. If you connect the power one way, the top LED lights. If you reverse the power, the lower LED lights. To the user, the LED seems to change between the two colours. Tri-colour LED This also has two differently-coloured LEDs inside a single casing but this time they are not wired in reverse. It has three wires, with two of them commoned to the negative lead of the supply. Connecting any one of the remaining LED leads to the positive supply lights that particular LED – giving two possible colours. Now, if the positive supply is connected to both leads, the colour mix produces a third colour. The most common combination is red and green LEDs that produces a yellow colour when both are lit at the same time.
Scenic Lighting 127
Back to Contents Page 5
Brightness The brightness of LEDs is measured in millicandelas (mcd), being one-thousandth of a candela, so higher values of mcd mean brighter output. As mentioned, LEDs can be designed for different viewing angles, depending on whether you want a spotlight effect of a general illumination effect. Viewing angles can vary from 15º degrees to 120º degrees The unit of measure commonly used to describe LED intensity is the 'mcd' – the millicandela. 000 millicandela equals 1 candela. Here are some typical specifications taken from suppliers material. Colour
Max voltage
Max current
Viewing angle
Brightness
Blue
3.2V – 3.8V
20mA
20º
10,000 mcd
Green
3.5V
20mA
20º
6,000 mcd
Red
1.8V – 2.2V
20mA
60º
5.000 mcd
Orange
2V
20mA
20º
4.000 mcd
White
3.5V
20mA
45º
100,000 mcd
The 'max voltage' is known as the 'forward voltage drop' and is the voltage across the LED when it is running with its maximum current, providing its maximum brightness and specified colour.
It is important to recognise that these are examples, intended to stress that the specifications vary between different manufacturers and different products. For example, while one LED might use a 3.8V potential across it to illuminate, that might be enough blow a different LED. If in doubt, error on the side of caution or, even better , read the specification. Surface Mount LEDs These LEDs are very small and are useful for signals, traffic lights, lamps and lanterns, etc. They are available in a range of sizes, with their code describing their dimensions. LEDs in the smaller range are described in thousands of an inch. Take, for example, the 0402 LED. The 04 indicates that it is 0.04” long (i.e. 40 thou) and the 02 indicates that it is 0.02” (i.e. 20 thou) wide. This equates to a tiny 1mm x 0.5mm. Confusingly, the 3000 and 5000 ranges describe the measurements in mm. So, for example, a 3528 LED measures 3.528mm x 2.8mm. Here are some of the more common surface mount LED types: inches
mm
mm
4002
0.04 x 0.02
0.02
3014
3x4
0603
0.06 x 0.03
0.03
3528
3.5 x 2.8
0805
0.08 x 0.05
5050
5x5
1206
0.12 x 0.06
5630
5.6 x 3
Other LEDs Apart from those already mentioned, LEDs are available that produce infrared or ultra-violet radiation. There is even a LED with a built-in flasher, so that it flashes on and off at a rate of around 2Hz when powered. No need to build electronic circuits to flash your LEDs, unless you need a different rate of flash. Scenic Lighting 128
Back to Contents Page 5
Wiring LEDs A LED has two leads, called the anode and the cathode. The cathode lead is the shortest and goes to the negative side of a supply. The epoxy casing often has a flat edge along the cathode side. The anode connects to the positive side of the supply. If you are using a pre-used LED, the leads will have been cut. If your LED does not have a flattened surface, you can always look inside the LED, as shown in the illustration. The larger, wedge-shaped, piece is the cathode. If all else fails, you can just use the trial and error method – it will only illuminate when wired the correct way round. Surface mount LEDs have various possible markings to identify the cathode as shown. LEDs are current driven devices, which means that their brightness level increases as the current through it increases, with two provisos:
A LED will only start to illuminate after it reaches certain critical voltage level. A LED cannot be given more than its maximum rated current without affecting its performance and eventually destroying it.
From the earlier table of typical LEDs, we can see that they work from voltages that are not common on model layouts. So, we have to reduce the voltage by placing a resistor in series with the LED.
Resistor calculations To work out the required resistance, you need to know:
The voltage of your supply The forward voltage drop of the LED The maximum current of the LED
Consider the example shown in the illustration. It uses a 12V supply and the LED needs a maximum voltage across it of 3V. That means the resistor must drop 9V across it. Since we know the maximum current of the LED, we can calculate the resistor value by Ohms Law thus: R = V/I R=9/0.02 R= 450 ohms. Since you can't buy a 450 ohm resistor, you would always choose the nearest higher value of resistor in the preferred series (to avoid excessive current). You would use a 470 ohm resistor in this example. If you are technical, the formula is R = (VS-VF) / IF where R is the resistance being calculated, VS is the supply voltage, VF is the forward voltage of the LED and IF is the maximum LED current. If you are not technical, you can use an on-line calculator to do the sums for you. Look, for instance, at http://led.linear1.org/1led.wiz/ These calculations are based on running the LED at its maximum specification. In practice, LEDs can often be run at much lower current levels (as low as 5mA) and still produce satisfactory illumination. Scenic Lighting 129
Back to Contents Page 5
LEDs in series LEDs can easily be wired in series, as shown in the illustration. The same current flows through all the LEDs and the resistor, but the LEDs may have different forward voltages and this has to be taken into account when calculating the resistor value. The formula for LEDs in series is: R = (VS-(VF1 + VF2 + VF3)) / IF As an example, let's look at wiring four LEDs to a 12V supply. All four LEDs run at 25mA but have different forward voltages of 3.5V, 2.2V , 2V and 3.8V. The calculation is R = (12 – (2.5 + 2.2 + 2 + 3.8)) / 0.025 R = (12 – 10.5) / 0.025 R = 1.5 / 0.025 R = 60 ohms
Therefore a 62 ohm or 68 ohm resistor would be used.
Parallel LEDs Wiring LEDs in parallel should be avoided. This graph shows how the current through a LED changes with increasing voltage. If you placed a variable voltage supply across a LED and slowly increased the voltage from zero, for some time nothing would happen. Then, suddenly, current would start to flow at an ever increasing rate for very small voltage increases. The point at which this occurs depends on the characteristics of the LED. It is about 1.7V in the example but can vary between LEDs of different colour and even within the same batch of LEDs. The problem with a bunch of LEDs in parallel is that they will all have different voltages at which current starts to flow. If you set the voltage sufficiently high to ensure that the LED with the highest characteristic voltage passes current, then the others are passing too much current. The LED with the lowest characteristic voltage then passes most current and finally dies. This results in the LED with the next lowest characteristic voltage passing even more current … and so on. On the other hand, if you set the supply voltage to a level that is correct for the LED with the lowest characteristic voltage, it illuminates but the rest don't. If you need to have LEDs close to each other, simply wire them in series. If there is not enough voltage to handle a couple of LEDs, then use a separate resistor in each LED, to match the individual LEDs, as in the right hand diagram. The left hand diagram should be avoided.
Scenic Lighting 130
Back to Contents Page 5
Fading LEDs If you look at the earlier graph, you will see that eventually very small voltages increases result in large current increases. This makes altering LED brightnesses very difficult simply by using voltage changes. So, for example, you could not dim a LED by placing it in series with a variable resistor. In the chapter on loco controllers, we looked at pulse width modulation as a means of controlling the current through a motor. The same principle can be used to control LED brightness. Firstly, the resistor value is calculated for the required maximum brightness. Then power to a LED, or a string of LEDs in series, is delivered as a succession of on/off pulses. If the pulse period is long, with hardly any off time, the lamp illuminates brightly. Conversely, if the on period is short, with long periods off, the LED will be dim. In other words, altering the pulse width changes the LED brightness. The rate at which the pules repeat has to be fast enough to prevent the LED simply flashing on and off. The device that sends the pulses can be built from a simple 555 IC or a PIC chip. It can be a commercial dimmer (see Microminiatures) , or a complex DMX controller that handles all kinds of devices such as fog machines and moving lights. Even at its simplest, the ability to simulate dusk, dawn, sunsets, etc., opens up ways to bring interesting effects to a layout.
LEDs on AC Some loco controllers provide a 15V AC socket for running accessories and this could be used to illuminate LEDS, with some precautions. The diagram shows a single LED connected to an AC supply, with the usual dropper resistor to set the current level. The problem with AC in this case is: It is not always at a constant level It reverses polarity In chapter 1, we showed a AC supply as a sine wave, constantly changing both its amplitude and direction. Now the LED is a diode, so it will ignore voltages that swing in the opposite direction to its conducting polarity. That means that the LED is not lit for half the time when it is forward biased. It is turning on and off at the frequency of the mains supply (e.g. 50Hz in the UK). Some users can detect the flicker. Even when the supply is connected during the correct polarity, the amplitude is always changing. If we set the resistor value to switch on during the highest point in the voltage swing, it will not be illuminated for the rest of the half-cycle. If we lower the resistance value, the LED stays illuminated longer but we risk reaching currents at the peak which will destroy the LED. In short, we cannot achieve the optimum LED brightness with AC. The diagram on the previous page shows a diode wired in series with the supply. This is fitted to prevent excessive reverse polarity voltage damaging the LED, as the diode can tolerate a much higher reverse voltage than a LED. This diagram shows an alternative approach, using a diode (e.g. a 1N4001) being connected across the LED but in reverse polarity. The diode and resistor then absorb the power when the voltage is reversed.
Scenic Lighting 131
Back to Contents Page 5
This diagram takes the idea a little further by wiring two sets of series LEDs, such that one set illuminates during one half cycle of the sine wave and the other set illuminates on the opposite half cycle. Another factor to bear in mind with a 15V AC supply, is that the value is stated as an RMS value (see chapter 1). The peak value is 1.4 times higher, so during the 'on' half cycle, there is actually a peak voltage of 21V being supplied. This must be factored into the calculation for the resistor value, otherwise the LEDs will be destroyed. The other approach is to take the AC supply, turn it into a DC supply using a bridge rectifier, then smooth it with a capacitor, before using it to power LEDs (look at the section on power supplies in Chapter 1).
Constant current supplies Since LEDs are current-driven devices, and we know the current we want for any particular LED or set of LEDs, we can build a simple circuit that always provides that exact amount of current. The circuit uses a 'constant current regulator' and a widely used example is the LM317, which is a simple 3-wire device. As the diagram below shows, it is inserted in series with one or more LEDs, and has its 'Out' and 'Adjust' leads connected across the resistor.
There is a very simple equation for calculating the resistor value: R = 1.25 / LED current
So, for example, if the required LED(s) current was 25mA, the equation is: R = 1.25 / 0.025 R = 50 ohms
The resistor value is not dependent on the voltage of the supply. However, you do have to ensure that the supply voltage is sufficient to handle all the LED forward voltages, plus an allowance of 3V for losses in the regulator. If the above circuit used a 12V DC supply and the LEDs each had 2.2V forward voltage, then the circuit could handle four LEDs in series. If you wanted to use multiple strings of LEDs, the following circuit is required, with each string having its own limiting resistor. The LM317 regulates the current to total current draw from each string. So, if the upper series used 25mA and the lower series used 20mA, the value of the resistor for the LM317 would be selected to provide 45mA.
Scenic Lighting 132
Back to Contents Page 5
The specification for the LM317 regulator states that it can handle up to 1.5A, with an input voltage between 3V to 40V. If you use this circuit with a much higher input voltage than that required by the regulator and LEDs, the excess voltage is dropped across the regulator. Also, if you use the circuit to control high-power LEDs, or many strings of LEDs, the current through the regulator will be high. In both these cases, you would have to ensure that the LM317 did not overheat. Fitting a heatsink to the regulator, or bolting the regulator to a metal chassis (suitably insulated) helps prevent overheating.
Fitting LEDs Once you start using lights on a layout, you find all sorts of uses for them. These are only some suggestions on how to use them. You will find your own uses and your own ingenious ways to fit them.
LED holders The images show two different methods of attaching LEDs to control panels. The one on the left is popped into a hole drilled in the panel, the nut is fitted from the rear and the LED is inserted so that is appears on the panel. The other image is of a simpler plastic holder that is a push fit into a hole in the panel. It is a matter of taste, although many prefer the less intrusive look of the simpler holder. Panels lights can be used for:
Indicating that the panel is powered. Confirmation of which direction a point is switched. Reporting back track occupancy information (see later chapter). Indicating which blocks / sections are switched.
LED mounts Apart from control panels / mimic panels, LED holders are not required. In many cases, the LEDs are hidden from direct view, illuminating buildings, etc. The images shows a couple of approaches to attaching LEDs. These are known as 'LED mounts' and the LED is plugged into a holder that is connected to the rest of the layout wiring. You can, of course, solder wires directly to the wires of the LEDs. Bear in mind that LEDs are heat sensitive and avoid applying the soldering iron for more than about 3 secs when soldering. Scenic Lighting 133
Back to Contents Page 5
Also, don't bend the LED's leads too close (say 3mm) to the case, to avoid damage. Finally, don't forget that you can buy LEDs pre-mounted on strips with self-adhesive backing. They can be used in long runs, or cut into groups of three LEDs and pressed against a surface to hold it in position. Then, you run a 12V supply to it. Attaching Lights Before placing lights all over your layout, it is best to have a plan. That plan should cover what switches, cables, fuses/cutouts, you might need. You might want to be able to switch different areas of light separate from others. It should cover working out the current loads for different groups of lights and ensuring that the supply can meet your needs and there is no significant voltage drop in cables making long runs. There is no 'correct' way to attach lights, as circumstances can be different in different parts of your layout. A variety of methods have been used to attach lights to parts of the layout, depending on the space available, ease of access, etc. These include soldering to existing devices (e.g. relays), using a hot glue gun, double-sided tape, staples, homebrew brackets, choc blocks, terminal strips, tag strips, and so on.
Lights in buildings While street lights, signal lamps, etc. add to a layout's appeal, it is the illumination of buildings and structures that most gives the impression of life going on. It is particularly impressive when the house/overhead lights are dimmed and the glow and twinkle of the lights are most evident. Power The first task is to decide how a structure receives the power. This is almost always through a hole drilled in the baseboard. If the structure is removable (e.g. for protection during transporting to exhibitions), then a plug and socket arrangement will be most likely. If the structure is permanently attached to the baseboard, the light can be permanently wired in. Remember, however, to allow for future access to the lights for future maintenance. This is most important when using filament bulbs with shorter lives. A removable back or lift-off roof is the most likely approach. Sound structure When you add lights to a building, the light should only be visible in the areas you want people to see. You have to ensure that the building's structure meet this need. Plastic kits and some cardboard kits are often sufficiently translucent to make the building look like a lampshade. Even home-built structures can allow light to leak from joints and seams. This is easily checked by placing a light in the building and viewing it in a darkened room. If the walls and/or roof glow then you can either paint the interior walls/roof with black paint, or line them with extra card (leaving holes for the windows). Any gaps in joints can be covered with card or taped over. Windows/doors The placing of lights should reflect their use in real life. So, you might expect all the lights in a factory/restaurant/car showroom to be illuminated but not all the windows in a block of flats. The lobby, hallways and stairways of a hotel would be illuminated but not every
Scenic Lighting 134
Back to Contents Page 5
room. You could use soft white, yellow or amber lights for period layouts and cool white for modern layouts. If you have built a kit, it probably included glazing sheets. Often, they are transparent and some of the windows have to be rendered translucent while other are blocked off with card/tape. The Wills pack of plastic windows is supplied in a clear plastic 'blister' pack and you cut pieces from the packaging to glaze their windows. If you have built your own structures, you can create windows from various materials. A popular option is the clear acetate sheets that are sold for overhead projectors or for laminating machines. To make them translucent, they can be lightly sanded with a fine grade grit paper. Alternatively, the light can be diffused by covering the window material with masking tape or 3M Invisible Tape, depending on the degree of dimming you want. The picture shows a range of other materials that could be put to use. The 'frosty' sheet and the red plastic sheet at the top of the picture were recovered from the packaging of domestic goods. The orange and yellow crinkly sheets are sweet wrappers and the yellow sheet in the lower right-hand corner is from a plastic folder for storing files. On the right, you can see a piece of clear plastic with its corner sanded to make it translucent. Care is required when fitting multiple lights in a structure, specially if you use particularly high brightness lights. You may have to fit card partitions between floors or between sections of a floor, to prevent light seeping into unwanted areas. If a single light can illuminate a number of windows, that's good. Otherwise, you can fit lights to a single window or group of windows,by fitting a container over the window(s), as in the illustration. The box, usually cardboard, prevents light seepage and helps focus on the window. The drawing on the left shows a LED being mounted at the rear of the box and this may be satisfactory where the window glazing is quite dense; otherwise the LED would be seen as a separate entity. The drawing on the right shows a LED mounted above the window and shining down on the rear wall. The LED is out of sight and all you see is the illumination of the real panel (which should be made from white or reflective material). Note You can widen and diffuse the narrow beam of light from a LED by gently filing down its dome end and polishing the flattened surface with toothpaste.
Another little touch is to cut out the silhouette of a person and stand it between the window glazing and the rear wall, casting a shadow. Don't place the cutout directly on the window glazing as this reduces the effect.
Scenic Lighting 135
Back to Contents Page 5
Remember, not all windows in all building should have the same degree of brightness – just as in real life. For added realism, you can place curtains or blinds on the windows. In industrial situations, some windows may be boarded up or covered in corrugated iron sheets. Interior details To provide additional realism, you can allow people to look into certain parts of a building and see its contents. This may be a room in a home, a shop front, a car dealership, a loading bay interior, a loco workshop, etc. In these cases, the window glazing is clear and you have to take extra care to provide sufficient even illumination, without the lights being visible. The visible contents are up to the individual modeller. You can print images, or cut them from magazines, and glue them to the inside walls of the room. You can go further, by adding internal details such as furniture or machinery. Exterior details Buildings often have exterior lights in addition to interior lights. Domestic buildings may have porch lights and industrial buildings often have lights under canopies and arches, or over entrances. Commercial buildings may have lights over their signs or even neon signs. Business signs are easy to make if you have a computer but functioning miniature neon signs are best purchased (e.g. see Express Models). Express Models also sell a multi-LED strip that looks like a fluorescent panel. Other effects Static lighting can be augmented by lighting that conveys a feeling of activity. For example, commercial, MERG kits and homebrew circuits are available that simulate the flashing of a welding operation. They switch LEDs on and off in random bursts to achieve this effect. This can be used in various situations – loco shop, car repair shop, fabrication plant, roadside repairs, construction sites, and so on. Another strategy to convey real life, is to have timers that switch various lights on an off in a random pattern – not too quickly of course. There are also circuits that allow a LED to slowly increase then decrease its brightness – effective when built into a lighthouse.
Lineside lights Lighting should not be confined to buildings. There are lots of lineside situations where lighting can be effective. Consider station platform lighting, yard lights, lights in crossing gates and barriers, lamps in buffer stops, etc. While platform lamps and yard lights are available commercially, you may consider it worthwhile fabricating your own. This image shows a factory building and a semaphore signal. The building's top floor is permanently illuminated and you can just see a welding operation starting on the ground floor. The 'welder' is made from a MERG “Twinkler”
Scenic Lighting 136
Back to Contents Page 5
kit supported by extra brightness LEDs. The image shows a commercial semaphore signal with two modifications;
The arm is operated by a servo. It uses a bi-colour LED for illuminating the lamp.
The image on the right shows how the LED is inserted into a hole drilled in the body of the signal. The two connections to the LED are soldered to short lengths of Kynar wire (very thin wire that can easily be hidden) which are fed through the base of the signal. The LED is a red/green bi-polar type. When fed with its voltage in one direction, the green light illuminates; reversing the voltage illuminates the red light. The reversal of the LED's polarity could be achieved by a relay, logic chips or a PIC chip. In the example shown, a PIC chip was chosen to provide a delay before switching, to allow the semaphore arm to travel.
Scenic lighting There are many occasions when you come across lights, other than in buildings or railways. Examples include street lamps, traffic lights, vehicles headlights, flashing beacons in police cars/ambulances/fire engine/breakdown trucks. Model railway versions can be purchased or built from simple circuits. A variation on the welding flashes mentioned earlier is to achieve the flickering effect of an open fire. It uses much the same circuit but with different timings and different coloured LEDs. For the ambitious, there is also the option to install 'mood lighting' on your layout. Imagine your scenic background being illuminated to simulate different parts of the day and /or different weather conditions. Different coloureds lights and different light levels could be used to convey mood (bright sunlight, the glow of a sunset, cold or snowy conditions, moonlight, etc.). It requires multiple lights whose light patterns must overlap, otherwise you simply get a row of light 'spots'). The lights could be hidden behind buildings or walls and angled to shine on to the layout background. If preferred, lights could be hidden behind a valance that skirts the top of the background. An even better approach is to have hills/mountains/low relief buildings set back slightly from the background board; the lights fit in the space and the resultant light appears to come from behind the hills. The effect can be stunning but requires a lot of lights and electronic controls. If you want more than one effect, you would have to fit separate rows of lights for each effect – an amber row for sunsets, a blue row for cold mornings, etc. Fortunately, the LED strips mentioned earlier are available in 5m strips at a relatively moderate price.
Scenic Lighting 137
Back to Contents Page 5
Commercial lamps The images below show a range of commercially-available lamps (they are not to scale). They include gas lamps and electric lamps, old lamps and modern. They are available as wall lamps, street lamps, platform lamps, yard lamps, etc. Most use LEDs but some are still produced using grain of wheat bulbs.
Manufacturers include Busch, Viessmann, Brawa – and unknown brands available on eBay. Double check before you buy, because some street lights, such as those from Faller and Ratio, are dummies. They are cheap but contain no bulbs or LEDs.
Homebrew lamps Some of the commercial lamps are quite intricate and would take a lot of effort to replicate. However, they are quite expensive and it is quite easy to make some other types yourself. The image on the right is of a commercial lamp using a filament bulb. The image on the left is a partly-made lamp using an LED. It is cheaper than the commercial version, uses a longer lasting lamp and its construction is quite straightforward. The pole is a thin copper tube, which also acts as one of the conductors to the LED. The other conductor is a length of fine Kynar wire that is threaded down inside the tube. One lead from the LED is soldered directly on to the mast, with the other being soldered to the Kynar wire. The mast is made from copper wire, or paper clips. Ornate swirls are associated with period lamps, while modern lamps are more plain. Similarly, you may select a yellow, white or ultra-white LED, depending on the period in which the layout is based. A washer is glued to LED to appear as a lampshade; the top of the LED would be painted to prevent unwanted light being seen above the lamp. The lamp is left unfinished to make it easier to see how it is constructed. A hole would be drilled in the baseboard and the copper tube would be inserted and secured in the hole. The wire and the copper tube protruding under the baseboard would be wired to the lighting circuit.
Scenic Lighting 138
Back to Contents Page 5
This image shows a wall light made from an LED. Again, a washer is glued to the LED and the LED area above the washer is painted to exclude light. The wires from the LED are bent as shown in the sketch, to represent the lamp's bracket. Two tiny holes are drilled in the wall of the building and the two wires are inserted into the holes. After soldering the two wires to the leads of the lighting circuit, the wires can be secured in place behind the building wall. A simple bend of the LED's leads will stop the lamp from moving but you can always use glue or a glue gun if you prefer. For very small lamps, or for smaller railway gauges, you could consider using surface mount LEDs. These are very small indeed (e.g. 0.mm x 1.6mm from Bromsgrove Models). They are also suitable for fabricating railway lamps for wagons and coaches, buffer stops, guard's lamps, etc. Their extra small size allows them to be fitted into seriously small spaces that other lamps could not use.
Fibre optics Fibre optic filaments are used to transmit light over distances as, for example, in carrying data over telephone phone lines. The light source is attached at one end of the fibre strands and the light bounces along the strands. The separation of light source from the eventual point of light is very useful for railway modellers, as it allows lights to be fitted where filament bulbs or even LEDs cannot be located. Example uses of fibre optic lighting include: Headlights in small gauge vehicles. Headlights in locos. Guards' lanterns. Miners' helmets. Signs. Fluorescent tubes. As one light source can handle multiple individual strands, it is ideal for places where many small lights are required. How about a star-lit sky, or the the city lights of a background scene? Fibre optics are produced in glass and plastic – we would use the polymer-based versions. These are sold either in single strands or as multi-strand cables. You can buy single strands in different diameters ranging from 10mil to 120mil (e.g. 0.25mm to 3mm), depending on how much light you want to shift and how much space is available. You can also buy mulit-strand versions, where 32 or 64 strands are contained within a single covering. While any light source can be used, ultrabright white LEDs are commonly preferred.
Scenic Lighting 139
Back to Contents Page 5
Unlike bulbs and LEDs, a single fibre optic strand does not project much of a beam of light; its light is meant to looked at, not used for illuminating other things (unless you use a bundle of strands). At the LED end The strand(s) to be used should be prepared prior to fitting. The ends should be flat for maximum light transmission. A scalpel will normally cut a length of fibre strand neatly. If not, the end can be gently rub on a piece of wet and dry paper, fine grit paper or emery board. You can take it further by polishing the end by rubbing it with toothpaste. The strand(s) should be fitted close to the LED's body. If using a single LED, a hole the same diameter as the strand can be drilled through the LED's epoxy casing (as deep as possible without damaging the LED elements). Ensure that the hole is drilled as close to the centre of the dome as possible; alignment is more important than proximity. The strand is inserted into the hole and secured using any plastic-friendly glues. This includes a glue gun, epoxy, silicone glue, polyurethane glues but not Super Glue or any Cyanoacrylate (CA) as these will attack the plastic of the strand(s). A multi-strand cable can be attached to the LED by covering both with a length of tape or, better still, a length of heat shrink tubing. If using heat shrink tubing, make sure you avoid overheating the fibre strands inside, as this will degrade their light transmitting properties. You can make your own multi-strand fibre cables, using as many strands as you need. You would bundle them together using a suitable diameter length of heat shrink tubing. Then you would cut and polish for best effect before encasing the bundle ends with the LED in a larger diameter length of heat shrink tubing. At the light end Single strands are so thin that they can be easily routed in most layouts. The LED can be located under the baseboard or in a lineside structure. The strand can be routed through a hole in the baseboard or structure and is flexible. It can bent to a radius of around 9mm radius for thinner strands or 20mm for thicker strands, although over-bending may result in some loss of light. Because they are so thin, they can be routed above the baseboard; under grass, roadways, track (there are no mutual interference problems). Strands can be painted with no ill effects on the fibre strands. Fibre optic strands do not a very wide viewing angle – you have to be looking directly at the end of the strand. This can be improved by shaping the end of the strand. The first drawing shows creating a 'bell end', by briefly touching the end of the strand against the stalk of a soldering iron and gently pushing into the strand. The end now offers an improved viewing angle. If you heat the end of the strand and then, before it cools, flatten it with any tool. This produces a disc-like illuminated surface that can be viewed side-on instead of the usual end-on. See the second drawing. Scenic Lighting 140
Back to Contents Page 5
Other effects The light zig-zags along the fibre strand, bouncing off the smooth wall surfaces. If you scratch the strand surface, you will lose some of the light. This can be a problem but is also an opportunity. If you scrape the outer surface of a length of fibre strand, using wet-and-dry or fine grit paper, you create an illuminated length that looks very much like a fluorescent tube. If you want to take it further, you can light the strand from a LED that is driven by 'twinkler' circuit, and you get the effect of a flickering fluorescent light. The same approach can be used to create neon signs, using coloured LEDs. How about making your own sign? Take a piece of plastic sheet, drill holes where you want the lights to be and insert strands into each hole. The sign can be your own design, using as many strands as are required from a multi-strand source. Even better, you could animate the sign by having two or more sets of LED-fed strands and switching between them. Lastly, for those with the eyesight and necessary skills, how about lighting figures on your layout? Station staff holding lanterns, miners' helmets, etc. are possible. Once more, your imagination can add to the effects listed above.
Scenic Lighting 141
Back to Contents Page 5
Chapter 9 Train lighting
Train Lighting 142
Back to Contents Page 5
Train lighting Now that we have our stations, streets, factories, houses, etc., all lit, we can turn our attention to our rolling stock. Locos with headlights and tail lights could be a good starting point. Then, imagine the effect of a glow from the cab of a steam loco, or coaches illuminating their passengers and internal details. This chapter looks at how this can be implemented both in DC and DCC layouts. Of course, it is not quite as simple as scenic lighting, since the objects we want to illuminate keep moving. There are other restrictions such as avoiding excessive current draw, space restrictions, difficulty of fitting, and so on. Nevertheless, it is well worth the effort.
Choice of lights There are three types of light that we can use for train lighting. 1.5V lamps These are marketed as 'Grain of rice' bulbs and are available from Rapid Electronics (part number 41-0186) or from many model railway stores such as Kytes Lights. They light at a lower voltage than LEDs but consume a higher current (15mA) compared to many LEDs. They also produce heat and have a shorter life. They are small, at only 1.4mm diameter and, being incandescent, they are non-polarised (they can be fitted either way round). Generally, they are being sidelined in favour of LEDs. The examples used later all assume using LEDs. Single LEDs Single LEDs are mostly used where a single light is required, such as a loco's headlight or a train's tail light. They require a higher voltage before they illuminate – around 2V for yellow LEDs and 3V for white LEDs. They are more robust than grain of wheat bulbs, and produce usable light at currents as low as 5mA and sometimes even 2mA (well below the figures given as their maximum ratings). LED strips LED strips are purchased as a long continuous strip or roll of LEDs, with an adhesive backing. This makes them ideal for lighting coaches with a long LED strip; it saves wiring lots of individual LEDs and the strip can have its backing strip removed and be pressed on to the coach ceiling. You can choose which LED spacing suits your project best. The strip/roll is available with either 60 or 120 LEDs per metre length. Although continuous, the strip consists of a chain of individual sets of three LEDs with their own dropper resistor. Each section has its own solder pads, so you can cut off a group of three, a group of six, or whatever length you require. You only require a single pair of wires to connect to a chain of any length. LED strips rated at 12V, and the current consumption for a group of three LEDs is 20mA. They start to illuminate at 8.5V and provide adequate illumination at 9V, where they only consume 5mA per group of three LEDs. This means that a LED strip can be supplied by a 9V voltage regulator or even a PP3 battery. At the time of writing, a 600-LED 5m roll cost £5. This makes home-brewed lighting a much cheaper option than commercial products. Train Lighting 143
Back to Contents Page 5
Lighting features The circuits for train lighting should meet some, or all, of these requirements. Constant brightness The intensity of the light(s) should remain constant regardless of the loco's speed or load. This is easily achieved on DCC systems because the track voltage level remains unchanged at all times. With DC, the track voltage varies from 0V up to 12V or more. At the lower levels (between 0V and around 3V) there is insufficient voltage to illuminate the LEDs and special approaches need to be adopted. Flicker-free The track voltage that is at a sufficiently high level to power the LED(s) may still be interrupted due to dirt on the track, the wheels or the pickups, or due to crossing a point's frog. This affects both DC and DCC systems. The circuit should maintain current to the lights during any track power interruptions. Directional lighting The use of headlights and rear lights varies with the era, the company and the country. For example, with double-ended diesels, there may be a white light at the end moving forward and a red light at the trailing end. This is easily achieved in DC and with DCC decoders that implement directional lighting. Variety Locomotives, in particular, may have various lights and lighting effects. These might include a flickering glow in the firebox of steam loco, flashing ditch lights, a rotary beacon, a gyra light, single and double pulse strobe lights, Mars lights and headlight dimming. Switchable Constant brightness lighting is fine, but we may not always want the lights to be constantly illuminated. When coaches or wagons are out of service and sitting in a siding, we don't want them to have any working lights. With DC, its a bit easier, as the lights will only be lit if they rolling stock is sitting in a section of track that is powered. So, with block control, removing the power from a siding, etc. automatically switches off any lights. Otherwise, other means have to be used. With DCC, some of the lights can be switched on and off through instructions issued by the command station. For lights that are not controlled by decoders, there is a similar problem of how to switch them on and off. Small size Some of the circuits use very few components and these can usually be tucked away out of sight. In other cases, particularly where onboard power storage is used, space is an issue in the smaller gauges.
Powering the lights There are two ways to supply power to train lighting: Power on-board Power from the track
Train Lighting 144
Back to Contents Page 5
Power on-board The idea of using battery power to run trains has been around for a long time and is still a common feature in cheaper 'toy' trains. Some modellers with garden railways also use battery power to run their locos. These use re-chargeable NiMh battery packs. We can install batteries in our locos and rolling stock, dedicated to powering lights. This provides reliable, flicker-free lighting. On the other hand, batteries need replacing or recharging and are bulky. Here is a very simple homebrew circuit comprising a PP3 9V battery, a switch and a length of LED strip. Using an alkaline battery with a capacity of 550mAh, lighting a LED strip that uses 10mA gives a theoretical 55 hours of continuous running before needing replacing (120 hours if using a lithium version). This is the basis of many commercial offerings. For example, Layouts4u's coach lighting kit comprises a LED strip (white or amber), a coin cell battery and holder and a miniature slide switch. For more details, see: www.layouts4u.net/coachlighting.html T&M Models provide LED strips, a switched battery box and either AA or AAA rechargeable batteries. For more details, see: www.tmmodels.net/Lighting%20Pages/Lighting_Main_Page.html The 'O' Gauge Coach Lighting kit from First Class Trains comprises a white LED strip (Standard or Bright), a switch and a battery holder for AA NiMh rechargeable batteries. For more details, see: www.ukmodelshops.co.uk/catalogue/firstclass All the above products use a switch to control the lights, which can be inconvenient. The need to replace or wait while batteries recharge is also a nuisance. This results in onboard power only being used where track-powered lights is impossible or inconvenient (e.g. with plastic tracks or unpowered tracks).
Power from the track Most model railways run their locos from power picked up from the track rails. This same power connection can be used to light loco and rolling stock. Every loco has its own track pickups and these can also be used to provide lighting within or on the locomotive body. Coaches and wagons do not have their own power pickups and therefore the power for lighting has to obtained in one of two ways: Getting power from the loco, using connectors between the loco and the first coach, between the first and second coach, and so on. Getting power directly into each coach or wagon by fitting it with its own track pickups. Train Lighting 145
Back to Contents Page 5
Micro-connectors Fitting your own pickups to coaches can be a bit of a challenge to some and they prefer to utilise the power that is already present in the loco. The image shows a range of miniature connectors that can be used to connect between the loco and items of rolling stock. With the two-wire version, you solder the socket's two wires to the loco pickups and the socket exits from the rear of the loco. The two wires from the plug are used to wire up lighting circuits in the coach. If desired, this can be repeated to connect each coach in a train. The downside is having to plug and unplug the connectors every time you couple or uncouple a coach from a train. If you run trains of fixed length, this is not a problem. Although very small, the connectors are nevertheless visible, particularly when used with smaller scales. For more details, see: www.expressmodels.co.uk/acatalog/Micro_Connectors.html www.digitrains.co.uk/ecommerce/electronics/micro-connectors/micro-connector-2-
pin-pair.aspx www.dccsupplies.com/shop/product_info.php?products_id=469
Home made The micro-connectors are relatively expensive and a home-brewed version is shown in this image. It uses PCB interconnect headers and sockets. You can just see a four-pin socket mounted on the side of the coach. In this example, it is used to take track power from the loco's pickups into a coach which contains a DCC decoder and stay-alive capacitor, as these are too large to be hidden in the open-cab loco. The motor output from the decoder is then fed back to the loco's motor. The header and sockets can be bought as strips and cut into the sizes needed – a 2-pin version would be less conspicuous. For details of the connectors, see: http://uk.farnell.com The socket is Order Code 1577754 and the header is Order Code 1577743.
Electric couplers In an effort to hide the electrical connection, Viessmann has built connectors into its own couplers. The image shows their 2-pole electric couplers and these are available from: www.modeltrainsuk.co.uk www.railroomelectronics.co.uk www.gaugemaster.com www.expressmodels.co.uk www.dccsupplies.com Gaugemaster also sell a four-pole version. Unfortunately, they are fairly expensive and may not match an existing coupling/uncoupling system on a layout. Train Lighting 146
Back to Contents Page 5
Using additional pickups You don't have to depend on loco power and external connectors for coach lighting, if you fit your own track pick-ups to the coach or wagon you want to illuminate. If your coach's wheels are plastic, you will have to replace them with metal wheels. These must be mounted on an axle that insulates the metal wheels from each other, to prevent a short across the track. Often the axle is metal but the wheel at both ends are insulated from the axle. Other wheel sets have only one wheel insulated from the axle. You can buy these ready made or can convert your own axles. After replacing the plastic wheels, the coach's wheels are 'live' and we can pick up power from them. The illustration shows one approach to this but enthusiasts will adopt a method that best suits their situation. In this example, two lengths of phosphorbronze wire (maybe 28swg) are held in tension against the inner disc of the wheels. This has to be a balance between getting a reliable contact and avoiding excessive friction. Suitable wire for this can be obtained from suppliers such as: www.eileensemporium.com www.mainlytrains.co.uk/acatalog/4mm-loc-pick-ups.html www.dccsupplies.com/shop/product_info.php?products_id=2023
If you prefer, you can use phosphor bronze strips instead of wire. Wipers introduce extra rolling friction and this will increase with every coach that is similarly wired. To minimise friction, another method is to use coiled springs as shown in the image. This relies on the metal axle being electrically connected to one of the wheels. These are the DCCconcepts 'Flickerfree pickup springs' and are available in N and OO/HO from www.dccconcepts.com/index_files/DCCflickerfree.htm
Since there is much more surface contact between the phosphor bronze spring and the metal axle, a more reliable pickup is obtained with much reduced friction. You need less tension as there is always one part of the spring likely to be touching the axle at any one moment. To fit the spring, you have to remove one of the wheels, slide on the coil and then refit the wheel to exact gauge. You repeat this with the other wheelset, ensuring that it is refitted to the chassis such that both springs wires are connecting to opposite track rails. The great benefit of fitting coach pickups is that they are hidden, unlike the system of connecting plugs and sockets. On the other hand, being separate from the loco's power, the lights will illuminate whether or not the coach is attached to a train. Although there are similarities, there are also some differences between lighting on DC and Train Lighting 147
Back to Contents Page 5
DCC systems. Therefore, they are considered separately. In each case, the reference to track pickups includes whichever method you use to get the power from the track to the coach or wagon.
DC Track pickup This first lighting circuit is very simple, using only three small components. The items cost pennies and will fit into small spaces. It uses two LEDs, wired in inverse parallel with each other. This ensures that one of the LEDs will light as long as the loco is travelling in either direction. This would be ideal to illuminate a loco's firebox using two red or amber LEDs, or simply to illuminate a cab's interior. The diagram shows a 1k resistor and this can be altered to suit the LED you are using. Being very simple, it has some limitations:
It needs around 3V and higher to illuminate The LEDs brightness will vary with the loco speed. When the train stops, the lights will go out. The LEDs will flicker as the power suffers temporary interruptions.
Later circuits show how to improve this. This circuit takes us a little further forward. It provides directional loco lights for double-ended diesel locos, with either one or two white lights at the end that is moving forward and a red light at the trailing end. In this case, separate resistors are used with each LED, as the white and red LEDs will have different minimum working voltages. When the track pickup that connects to all four/six LEDs is negative with respect to the other pickup, the red LED on the left hand side and the white LED(s) on the right hand side illuminate. When the track polarity is reversed, the other two/three LEDs illuminate.
Constant brightness lamps The problem of varying lamp brightness can be partially overcome with this circuit from MERG member Chris Stanforth. It ensures a constant brightness from the two LEDs, as long as the output from the bridge rectifier is between 3V and 15V. It uses a handful of cheap, easily obtained, components and the addition of the bridge rectifier ensures that the LEDs illuminate whether the loco is moving forwards or in reverse. It also work with DCC power, where the LEDs will be lit – even when the loco is stationary.
Train Lighting 148
Back to Contents Page 5
DCC track pickup With DCC, the track is always powered. This is a potential constant source of power for lighting – both lineside and on rolling stock. For example, why run a long cable just to illuminate a single semaphore lamp, isolated cottage, or buffer stop lamp, when you can just tap into the nearby DCC traction bus? This circuit connects to the track and permanently illuminates a LED. As the chapter on DCC pointed out, the track voltage polarity is constantly reversing. When the track that connects to the resistor is negative with respect to the other pickup, the LED will illuminate. When the track polarity is reversed, a diode (e.g. a 1N4001) may be fitted in inverse parallel across the LED. This protects the LED from any excessive reverse polarity voltages. While useful for the occasional remote light, the DCC bus should not be used as the main power supply for all your lineside lighting – use a dedicated power supply. This approach can be used for lighting locos and rolling stock, by using track pickups instead of direct connections. Since the LED only uses DCC power for half the time (during alternate half cycles), its light is dimmer than when fed by a DC supply.
LED strips with DCC As mentioned earlier, LED strips are purchased as a long continuous strip or roll of LEDs, with an adhesive backing. The strip/roll is available with either 60 or 120 LEDs per metre length. You can choose which LED spacing suits your project best. The strips are rated as working on 12V. At this voltage, the strip consumes 20mA for every group of three LEDs. In practice, most strips first illuminate at around 8.5V and provide adequate illumination at 9V, taking only 5mA per group of three LEDs. This circuit uses only two or three components and is capable of driving a strip of up to 600 LEDs, although you will more likely be using a strip of 3,6,9, or depending on the size of the coach. The DCC is fed through a bridge rectifier so that both cycles of the waveform are used. This is fed to a 7809 voltage regulator, which ensures that its output is always at 9V. To minimise flicker, a capacitor (4700uF 16V) can be wired across the regulator's output. If your coach is large enough, you might consider connecting two of these capacitors in parallel, to provide even more stable illumination. Here is the pinout of the regulator. Note that the metal tab with the fixing hole is actually connected to the Ground pin, so be careful the tab does not touch other components.
Train Lighting 149
Back to Contents Page 5
Using an LM317 The LM317 is a three-pin device that can be used as a voltage regulator but can also be used as a 'constant current source'. Here is the Wikipedia definition of constant current source: “a circuit element where the current through it is independent of the voltage across it “ This circuit uses the LM317 as a constant current source to feed a chain of LEDs wired in series.
Since the same current flows through each LED, all the LEDs in the chain should have identical characteristics (don't mix LEDs that work on 5mA with LEDs that need 25mA). The maximum number of LEDs in the chain depends on three factors:
The DCC voltage from your command station. The voltage drop in the LM317. The output can be expected to be 3V lower than its input voltage. The forward voltage drop of the LEDs used. Different coloured LEDs usually have different voltage levels before they illuminate (e.g. yellow LEDs are usually 2V, while white LEDs are usually 3V)
So long as the output voltage from the LM317 is sufficient to illuminate the series of LEDs, there is no need for a series dropper resistor. A 1A 100PIV bridge rectifier is sufficient. The LM317T is a larger tabbed device (like the 7809) while the smaller LM317L is rated at 100mA, which is more than sufficient for our needs. The value of R1 is calculated as 1.25 / current required; here are some examples: for 10mA, the resistance is 1.25/.01 = 125 ohms for 20mA, R = 1.25/.02 = 75 ohms for 5mA R = 1.25/.005 = 250 ohms If you prefer, you can always use this calculator: www.reuk.co.uk/LM317-Current-Calculator.htm After calculating, you would use the nearest resistor value. In the above examples, the most likely choices are 120 ohms, 68 ohms or 75 ohms, and 240 ohms or 270 ohms. The current you choose to feed to the LEDs need not be their maximum rated current. For example, many 20mA rated LEDs illuminate quite brightly at 5mA. To minimise flickering, a large value capacitor (4700uF or better) can be used. R2 is a 100 ohm ¼W resistor. When you first place this circuit across the track, there would be a surge of high current to charge the capacitor and this would trip command station overload detector – it would see it as a short. The resistor ensures that the capacitor is charged more slowly. The diode allows the current to flow unimpeded from the capacitor to the LM317. We charge the capacitor gently but discharge it quickly. Train Lighting 150
Back to Contents Page 5
Rechargeable batteries If you have the space in your coaches to store three rechargeable Nickel-Metal Hydride NimH cells, then you can combine on-board storage with track power. This will provide a light source that is completely flicker-free and will illuminate your coach for hours, even when track power is removed. As before, the DCC track supply is fed through a bridge rectifier to obtain a DC supply. This is used to keep the three rechargeable batteries fully charged during normal running. The 100 ohm resistor prevents current surges during initial charging and provides trickle charging of the cells. At 1.2V per cell, the set of batteries can then supply 3.6V.
The batteries' positive connection is fed into the input of an LE33 chip. This is a 3-pin voltage regulator that provides a stable 3.3V output. With most voltage regulators a few volts are lost between their inputs and outputs. That would normally mean that an input voltage of 5V or 6V would be required to ensure a stable 3.3V output. However, the LE33 is a 'very low dropout voltage regulator'. As the description suggests, very little voltage is lost across this regulator. So, three cells (3.6V) are sufficient and saves having to use extra batteries as would be required with a normal voltage regulator. Here is the pinout of the regulator, viewed from underneath. It has a maximum 100mA rating which is more than enough for our needs. The values of the dropper resistors depends on what LEDs you use. White LEDs operate from 3V upwards and you will probably find that they can be directly connected across the LE33 output without any dropper resistors. Yellow LEDs will need in the region of a 100 ohm resistor, depending on the brightness you require. You can connect as many LEDs across the LE33 output as you require, subject to the 100mA maximum current draw. In practice, this could be 20 or more LEDs running at 3mA to 5mA. You can use AA or AA rechargeable cells. The AA cells are larger but have a greater storage capacity. This is measured in maH (mA per hour), with AA cells starting from 1700mAh upwards and AAA starting from 600mAh upwards. So, for example, a 1000mAh cell would provide up to 50 hours of light at 20mA. An alternative is to use the battery packs for cordless phones. They are smaller (e.g. 50x32x11mm) but have less capacity (400mAh upwards). Even smaller (e.g. 22x16x14) are backup batteries and these, although around 150mAh and 200mAH, should prove more than sufficient for most purposes.
Train Lighting 151
Back to Contents Page 5
Commercial options If you don't want to try constructing your own DIY circuits, you can always purchase commercial products. Some are simple plug-and-play units, where the loco or coach has already been fitted with pickups and connectors. Like the Dapol 156 and Mk3 coach units, described here: www.ehattons.com/25472/Dapol_Model_Railways_NC040a_Light_Bar_coach_lighting_uni t_for_modern_coaches_multiple_units_Class_156_MkIII_/StockDetail.aspx
Some are designed for specific models and the kit supplies the necessary track pickups. www.kato-unitrack.co.uk/kato-11-201-coach-lighting-kit-1959-0.html www.topslotsntrains.com/topslotsntrains/final.asp?ref=KATO-11-210-N-GAUGE -INTERIOR-LIGHTING-KIT-WHITE-LED---6-CAR-PACK-&id=7268&manufacturer= KATO%20N%20Gauge'
Some are general-purpose, leaving it you to find a source of track power. www.ukmodelshops.co.uk/catalogue/firstclass www.digitrains.co.uk/ecommerce/electronics/leds/interior-car-lighting---
incandescent--coach-lighting-kit-.aspx This image shows the 'Flickerfree' module from DCC Concepts.
It provides a set of coiled spring pickups and uses a super capacitor (a very high value storage capacitor) to ensure longrunning, flicker-free lighting. For more details, see: http://www.dccconcepts.com/index_files/DCCflickerfree.htm
Mounting the lights The actual steps in fitting lights will depend on your particular loco, coach or wagon. These are just some general suggestions. Don't make any lights too bright, even though you can – it will not look realistic. Make sure that light does not escape through thin plastic walls or joints. If necessary, paint the inside of the body, or line the inside with a printed coach interior, such as: www.mousa.biz/downloads/coach_seats.html www.kitmaster.org.uk/PecoCoachInt.htm Aluminium silver foil self adhesive tape can be stuck to the ceiling of coaches, prior to fitting LEDs, to achieve maximum even reflection. Sometimes it can be more effective to hide the LEDs on the coach floor and bounce the light off the ceiling. Consider using 30AWG Kynar wire to wire the LEDs and connectors, as it is very thin and
comes in a range of colours. There are some situations where even Kynar wire is awkward to use, for fear of the soldering iron melting plastic or the difficulty in making connections to tiny surface mount LEDs. In these instances, consider using conductive silver paint. It is available from Rapid Electronics, Maplin, Farnell, etc. It comes in a small bottle but a little goes a long way.
Train Lighting 152
Back to Contents Page 5
Using a DCC decoder The circuits covered so far are easy and cheap to build but they all suffer from the same deficiency – switchability. The lights are either only lit when the train is moving – or they are often permanently lit. This is not realistic, since not all locos and coaches are constantly illuminated. Of course, we could lean over and throw switches on the locos/coaches, or we could introduce automatic light switching using reed switches, Hall Effect switches and the like. Neither of these is particularly satisfactory. That is where using a DCC decoder offers advantages. We, as controllers, can switch lights on and off using our command station or handheld. That involves sending specific instructions to the decoders. The chapter on DCC included an illustration of a DCC decoder. For clarity, it only included the motor, headlight and rear light wiring. Here it is again, stripped of the motor wiring. As a minimum, a decoder will have two function outputs, as shown. Often, manufacturers provide additional function outputs. In this example, the decoder provides three additional function outputs. Each of these can be connected to a light or light strip. The blue wire is the common return wire for all function outputs. These additional outputs can be used to provide any effect you require such as a firebox glow, hazard lights, ditch lights, beacons, etc. The output voltage of a function connection is approximately the DCC track voltage level. There is usually a current limit for each individual function output – often 100mA. There is also a total current limit that the decoder can handle (e.g. 500mA or 1A). This can be found in your decoder specification, but you would not expect to approach this limit since LEDs consume so little current. Programming the lights Your DCC controller will have buttons marked as 'f0', 'f1', etc. You want to be able to press one of these buttons, knowing that it will switch a particular decoder output. Deciding which button should switch output and then setting it up is known as 'function mapping'. There are three ways to do this: You can look up the manual for your particular decoder, work out what you want and then use your controller to program the decoder. This can be a fiddly and errorprone process. You can us an on-line calculator to work out the values for you. Have a look at: www.digitrax.com/support/cv/calculators/ Train Lighting 153
Back to Contents Page 5
This image shows an extract from the calculator and you tick the boxes to match the function number to the wire to be switched. It then displays the values that you need to enter into the appropriate CVs in your decoder. This image shows an alteration being made such that f1 switches the violet (purple) output and f2 switches the green output. As you can see, the values to be entered for CV35 and CV36 have been altered as a consequence.
You can use Decoder Pro. Like the above calculator, it lets you match functions to outputs. However, it is more intelligent. It only shows the white and yellow options because the decoder being programmed does not have any other function outputs. Even more useful, you don't have to calculate or remember any values; they are all hidden from view. In addition, your decoder may have other facilities than can be set, such as directional lights, headlight dimming, flashing, flickering, etc. Read your manual, or see if Decoder Pro offers you those options.
Coach decoders Using the decoder's function outputs gives you control over the loco's lights – both internal cab lights and externally lamps. That still leaves coaches and wagons to be made switchable. Of course, you could extend the wires from the function outputs into the train's coaches, using the plugs and socket previously mentioned. Alternatively, you can fit track pickups to a coach and install a separate DCC decoder into the coach. You would simply use the function outputs for controlling the lights in the coach, ignoring the loco outputs. The decoder would have its own unique address, separate from the loco and this allows the coach to be used on a loco with no other modifications. DCC accessory decoders can also be used in coaches. Although larger and more expensive than most DCC motor decoders, they can carry out activities that are not readily suited to loco decoders.
Train Lighting 154
Back to Contents Page 5
Using accessory decoders The accessory decoder is really intended for use at the lineside, where it can operate points, signals, etc. Consequently, they are designed for higher currents and are on large PCBs. These can still be used inside coaches, if you have enough room to fit them. The big advantage of using these decoders is the larger range of outputs and/or features. The Tam Valley LEDecoder only has three outputs but can handle a bi-colour LED and flickering effects. For more details, see: www.tamvalleydepot.com/products/lighting.html The ESU LokPilot Fx v4.0 has six function outputs with a maximum current of 250mA per output. For more details, see: http://www.esu.eu/en/products/lokpilot/lokpilot-fx-v40/ If you fancy building your own, have a look at: http://atoomnet.net/circuits/tiny-dcc-decoder-for-leds/ The MERG Kit 53 is a DCC accessory decoder with 8 steady state outputs
Special features Why stop at just lights? Accessory decoders can be used to operate any animation in your coach or wagon that you can think of – space permitting. You can now consider modelling: A maintenance or track-laying crane. A guard waving his lantern (another LED?) from the guard's van. On-board uncouplers. A moving pantograph or trolley pole. Sliding carriage doors. A remote-operated smoke or steam unit. And so on and so on. We know from a previous chapter that we can animate things using servos – and some accessory decoders are able to also control servos. Check out: www.dccsupplies.com/shop/product_info.php?products_id=2063
controls one servo and one relay www.dccsupplies.com/shop/product_info.php?products_id=2058
controls four servos and four stall motors www.digitrains.co.uk/ecommerce/accessory-decoders/multi-function/mx82v-turnout-
accessory-decoder.aspx The Zimo MX82V controls four servos and four LEDs If you are working in larger scales, the commonly used servos such as the Tower Pro SG90 could be installed.
Train Lighting 155
Back to Contents Page 5
For smaller scales, the tiny Spektrum linear servos can be used. These come in standard throw, as in this image, and in long throw (just under 1”). For more details, see: http://www.4-max.co.uk/servo-015a.htm http://www.indoorflyer.co.uk/spektrum-15g-linear-servo---no-packaging-572-p.asp http://www.rcpitstop.co.uk/spektrum-29gm-linear-tail-servospmsh2040t---in-stock-3141-p.asp
Another feature that can be controlled via DCC are the smoke units and steam units marketed by Seuthe. These are available from: www.gaugemaster.com/seuthe.html
They have a handy chart detailing all models and their current requirements www.ukmodelshops.co.uk/catalogue/firstclass
Includes great advice from Harvey Godber on installing and using these units. There is also a lot of information on smoke units at: www.trainweb.org/girr/tips/tips3/smoke_tips.html
Power for additional devices The voltage level from decoder function outputs are just a little less than the DCC voltage and this is sufficient for anything we want to switch. In fact, we will have to reduce the voltage for connecting servos and LEDs. The bigger issue is the current limit from any one function output – often a 100mA maximum. Since the Seuthe Smoke Unit uses 149mA at between 11V and 16V, and the Seuthe Steam Generator needs 130mA at between 10V and16V, we cannot drive these directly from a decoder output. Instead, we use the decoder output to operate a transistor switch and/or a relay, which in turn supplies power to the device (see the chapter on interfacing). This circuit gives an idea of how to interface a Seuthe smoke unit. A 12V low current relay is connected between a decoder output and the blue wire which is always positive Suitable relays are widely available, such as those from Rapid Electronics (part number 60-2410 or 60-4662), or the BT 47W/6H relay from MERG. Don't forget to fit a protection diode, such as a 1N4148 across the relay coil. The decoder has its own circuitry that converts the incoming DCC into a DC supply. This must not be used to power any high-current devices. Use the bridge rectifier, with the voltage regulator if necessary, described earlier in this chapter.
Train Lighting 156
Back to Contents Page 5
Chapter 10 Adding sound
Adding Sound 157
Back to Contents Page 5
Adding sound Many layouts are miniature masterpieces, yet still seem to lack something. That something is often the extra authenticity that comes from movement (other than trains), lighting and sound. Mostly, a model railway is a visual experience, watching trains travelling through scenic layouts. We can add to the effect by animating lineside and scenic features using motors and servos. We can further improve the layout further with the careful use of scenic and train lighting. This chapter looks at improving a layout by stimulating another of your senses – that of hearing. Noise is all around us, yet most layouts produce only the sound of electric motors and points operating. This can be corrected, as everything we hear in real life can be reproduced on your layout. This is a much wider area than may initially be thought and this chapter is really an introduction to the subject. Layout sounds can be divided into two broad categories. Train-related sounds
These are associated with the direct running of the railway and include:
Hissing and chuffing Diesel engines Horns and whistles Wheels squealing round tight corners Station announcements
Some of these sounds are more easily created using DCC sound decoders, while others can be easily created for both DC and DCC layouts. Scenic-related sounds
These sounds add to the general ‘feel’ of the layout and might include:
Factories and mills Quarries and mines Traffic Water Farms Weather
All of these can be created for both DC and DCC layouts. Sound Types General sound categories include: Man-made sounds (e.g. guns, machinery) Natural sounds (e.g. water, thunder, rain) Ambient/Environmental/Atmospheric sounds This involves the combination of various sounds to create the overall effect. For example, a rural scene might combine the sound of a brook with bird and/or animal sounds, while an urban scene might mix traffic noise with general population hubbub. Likewise, a fairground needs not only organ sounds but the sounds of children and laughter while a factory complex will mix a variety of mechanical sounds. Incidental (i.e. one-off) sounds, such as: Gunshots, foghorns, dogs barking, crossing bells, station announcements Adding Sound 158
Back to Contents Page 5
Sound in perspective Before we start, we must bear in mind the importance of 'getting it right'. The indiscriminate addition of sounds can easily produce a horrendous cacophony which seriously detracts from the experience. Just because you can reproduce the sound of everything on a layout does not mean that they all have to be played, at the same volume, at the same time. The coherence principle rests on the maxim that ‘less is more’ – i.e. adding too many unnecessary sounds impedes the user’s appreciation of the main content. This situation can be avoided by a few simple rules. Layout sounds should be: Appropriate The sounds should add to the layout, not detract from it. A layout may offer a range of possible sources of sound. However, it is likely that balancing some of the most predominant sources would suffice. Even then, common sense should prevail. For example, it is unlikely that you will hear factory sounds on a day that church bells ring. In the words of Joe Meek (1960’s record producer) “If it sounds right, it IS right!” Atmospheric The sounds chosen must reflect the nature of the layout. While layouts may have some elements in common (e.g. vehicles, people, stations, etc.), the dominant sounds must be those most sympathetic to the layout's character. Rural, urban and industrial layouts all have different characters, as do different periods in time. Better to choose the sounds that most characterise the layout than trying to include every possible sound. The sounds chosen should be both harmonious and proportionate. Scaled Your layout is a miniature of a much larger area. The baseboard may only be a few feet deep but that will represent quite a scaled distance. The addition of low relief building and detailed backdrops add another layer of perceived depth. The smaller the scale you model in, the greater the scale distance between the front of the baseboard and the rear details. It follows, therefore, that sounds from the rear of the layout should be quieter than those closer to the front. Otherwise, the overall perception is jarred. The sounds should provide the impression of depth to a layout. This supposes different volume levels for different distances (see later). Overall though, we are discussing background sounds, so a subdued sound level should apply even to sounds from the front of the layout. Switchable Above all, layout sound should be under the control of the operator, who can decide what is played and when. Lots of noise might be perfect for the visits from children and grandchildren but be most unwelcome at exhibitions or during late at night/early morning sessions. Firstly, then, is the ability to disable all sound at the flick of a switch or the click of a mouse. You may also wish to make individual sounds switchable (e.g. disabling diesel sounds and enabling steam sounds). After that, there are decisions regarding timing of sounds. For example, running water is expected to make a continuous sound, while incidental Adding Sound 159
Back to Contents Page 5
sounds such as bird or animal sounds would only occur at irregular intervals. Other sound effects, such as whistles and wheel squeals, would only be triggered by events such as a loco entering a specific section of track. This chapter looks at the following areas:
Deciding which sounds are appropriate and which reproduction system to adopt. Finding and using layout audio clips. Sound players. Speakers and their placement. Triggering of sounds.
Sound options There are different methods available for adding sound to your layout. There two different categories; Trackside sound, on the baseboard Sound modules in locos
Trackside layout sound A number of different approaches have been adopted, both for commercial and homebrew sound systems. The main approaches are shown below, on a typical layout.
Centralised As the name suggests, the layout uses a single audio player and a single loudspeaker placed in the middle of the layout. This has the benefit of simplicity and cheapness (although some expensive commercial systems also use this method).
The downside to this method is that it does not deceive the listener, whose ears detect sounds in stereo. With this system, all sounds are detected as being in the middle, even although the church, factory, etc., may be situated at the extremities of the layout. While this method might work for small layouts, the difference between expectations and reality worsens as the layout becomes larger. It is not very effective in large layouts as the sound does not appear to come from specific objects or buildings.
Distributed With this system, there is still a single source of all sounds but there are individual
Adding Sound 160
Back to Contents Page 5
loudspeakers situated at each sound location and these are switched on and off to make the sound come from specific areas of the layout. In this way, the sounds are heard from their correct positions on the layout.
The downside in this method is the need to direct the audio from the player to the correct loudspeaker at the correct time, using either manual or electronic switching. Also, only a single sound can be produced at any one time. This reduces the richness of the overall effect. It also prevents continuous sounds (e.g. rivers) from being played.
Local This system uses a separate sound player and loudspeaker for each location. This allows sounds to be heard from their expected locations and also allows multiple sounds to be played at the same time if necessary. So, a waterfall will have its own sound module, with another module producing sound for the sawmill, and so on. The speakers for these modules are located in, or next to, the supposed source of the original sound.
The modules can be left to play continuously, for background sounds such as with a waterfall or station hubbub. Alternatively, they can be wired to only play when triggered by train-on-track detectors. For example, the sound of a loco whistle/horn or wheel squeals could be produced when a train enters a particular section of track. They could also be under operator control, switched on/off by MERG CBUS output modules (e.g. CANACC8) or controlled by switches on a control panel. It can also save on all the extras switch wiring needed with distributed systems. The downside is the extra expense of providing more players, although this not need be prohibitive.
Adding Sound 161
Back to Contents Page 5
Sound basics Before moving on, it may be useful to recap on some basic sound concepts. Sound is produced and carried by the rapid variation of the pressure of the air surrounding the object that is creating the sound. Consider the loudspeaker inside your TV or HiFi. The speaker cone vibrates in sympathy with the audio content. As the cone vibrates, the air next to it is alternately compressed and rarefied. This constant change of air pressure sets up sound pressure waves, which travel through the air until they reach the listener's eardrum. The air does not actually travel between the speaker and the ear. As the air next to the speaker cone moves back and forth, it passes on this movement to the air next to it - and so on. It is similar to the water in a pool when a stone is dropped in it. The waves move outwards but the water does not travel outwards. The knock-on effects of the variations diminish as the sound waves travel outwards, resulting in sound becoming quieter the further away the listener is from the source. As this illustration shows, the audio source has a sound intensity I at distance r from the sound source. If we look at twice the distance (i.e. 2r), the area at r2 has to influence four times the area as that at distance r. Similarly, at distance 3r, it has to influence an area that is nine times larger. This effect is known as the “Inverse Square Law”. This chart shows just how quickly sounds diminish with distance. In model railways, this is sometimes considered as 'scale sound'. Although a layout may be physically small, it represents a much larger area (depending on the scale – e.g. 76 times greater in OO and 220 times greater in Z). Clearly, then, sounds at the rear of a layout should not be heard at the same amplitude as those at the front of the layout. Also, if you are standing at one end of a long layout, you should hardly hear sounds from the other end of the layout. In addition, we have to remember that the dominant impression of a layout should be the movement of the trains, not the sound from various features. Even the loudest sound should not detract from the layout. In the words of Jim 'Enginears' Wells (of Fantasonics) "your audience should feel like they want to lean in to hear the sound better"
Adding Sound 162
Back to Contents Page 5
Commercial sound systems There are quite a few commercial systems that are specifically designed to produce sounds for model railway layouts. They are generally well specified but expensive. This image shows a module from the HQ series of modules produced by ITTC (available from Bromsgrove Models). They are designed for fitting in local situations, with each module producing a different sound. The sounds vary from US loco sounds to lineside sounds such as a construction site, a sawmill, thunder, church bells, and much more. The module is connected to power, a speaker and a connection for external switching. This image shows the 'Master Blaster' from Model Sounds. It is a combined sound module and loudspeaker in the one case. It has a built-in battery, making it fully portable – it could be installed in a lineside building or fitted inside a coach or wagon (probably from 'O' gauge upwards). It runs for three hours on a charge and can be recharged from a computer's USB port or from a battery charger. It uses a MicroSD memory card to store the sounds and the different cards can be swapped in to get different sounds (purchased separately). For details see: http://www.modelsounds.co.uk/ An example of a centralised sound module is the “Steam Whistle and Two Tone Horn” model EXH/TTW from Express Models. http://www.expressmodels.co.uk/acatalog/Sound_Modules.html It stores the sound of a whistle and a two tone horn and the sounds are played by pressing a push button (although this could be replaced by relay contacts, a reed relay, etc.). This image shows another centralised sound system – the Model Rectifier Corporation Symphony 77. The system is powered by an AC adapter and comprises two loudspeakers and a handheld controller The speakers do not provide stereo sound. Instead, one speaker one set of sounds (e.g. steam chuff/diesel rumble, brakes, crossing gate, etc.) and the other speakers produces a different set of sounds (e.g. diesel horn/steam whistle, air release, uncoupling, etc.). In all, over 25 different sounds can be produced by the operator choosing options on the controller. Despite the variety of sounds, the sounds cannot be located next to all the objects that are supposed to be making the sounds. Also, there is no provision for automatically triggering a sound. It is available from US suppliers, Amazon or eBay. Adding Sound 163
Back to Contents Page 5
This is an example of a centralised sound module with additional facilities. It is the Pricom Dream Player. At the top of the board is a row of inputs and there is a row of outputs along the bottom. This allows a very flexible set of options. For example, an input can be triggered that plays a sound – and also changes the state of one of the outputs. For example, a change on one input could play a warning alarm while crossing gates close. The sounds are stored in SD memory cards (see left of image) and therefore are changeable. Although very flexible, its big downside that it has only one audio output (see right of image); this makes it less suitable to cover a large area of a layout. For details see: http://www.pricom.com/Trains/DreamPlayer.shtml http://www.dccsupplies.com/shop/product_info.php?products_id=2088 An even more versatile, and more expensive, sound module is the RLW 4400 SLITE Animation Board from Republic Locomotive Works. It has two audio outputs that can be used independently or used in stereo. The sounds are stored in a micro SD memory card. It also has 12 input channels and 16 output channels and can be programmed by a computer through the serial port to carry out sequences of operations. The program sequence is stored in the SD card. The board has its own microprocessor that can run through a pre-programmed set of sounds and output switching. The module provides facilities such as PWM (pulse width modulation) for dimming LEDs or setting the speed of motors, A/D convertors to read analogue changes such as light levels, and more. It is not currently marketed in the UK. The top-of-the-price-range trackside sound system is the Surroundtrax DSP-80. It is a distributed sound system, as it places six speakers around the layout. Each channel can produce sound independently of the others. Although it is a trackside system, it aims to provide the sounds of locos as they move round the layout. It requires additional track block sensors, one for each speaker. As a loco enters a track block, the main module is informed and sound is directed to that speaker. Cleverly, as the Adding Sound 164
Back to Contents Page 5
loco moves from one block to another, the sound in their allocated speakers cross-fade (the volume declines in one speaker while increasing in the other). This provides a smooth stereo-type sound transition. Unfortunately, six speakers may not be sufficient for larger layouts. It uses DCC technology, but without fitting sound decoders in each loco. This may be an advantage for those with large numbers of locos, or limited skills in fitting decoders. On the other hand, it does not provide the large variety of options that are available in loco sound decoders. Also, it is limited to loco sounds only, with no lineside or other effects. It is a very expensive system and further details are at: http://www.soundtraxx.com/surround/
In the UK, it is sold by DCC Supplies http://www.dccsupplies.com/shop/product_info.php?cPath=24_157_676&products_id=4780
Limitations of commercial options Most commercial modules only play built-in sounds with no provision for the user to alter or add their own. The Trax DHM-12 and the Express Models EXX/TTW each have two preset sounds, while the Quasar SG01M module provides 4 preset sounds. The HQ series modules produce only a single preset sound. The Master Blaster module uses memory cards, each storing a different sound. These can be purchased separately, although only one can be installed and used at a time. Others, such as the Symphony 77, provide more sounds but have to be manually operated; there is no provision for automatic triggering (e.g. from track detectors, relays, CBUS, etc.). The Symphony 77 has 25 unalterable sounds. The top of the range SoundTrax DS-P80 only works with Digitrax block detectors and transponder equipped locos.
DIY sound systems Despite their considerable prices, commercial modules have practical limitations. However, there are a number of devices that are easily obtainable, are considerably cheaper and can provide more flexible and user-alterable sound players. Here are five different devices, of varying complexities, all requiring little or no alteration.
Option 1 - Talking cards Let’s begin with the simplest and cheapest sound player that can be used straight out of the box. Although not of the greatest audio quality it is available for around £2 from eBay. It is intended for incorporating into greetings cards, so that personal recorded messages can be included (“Merry Xmas Gran, from little Timmy in Australia”) It is complete and ready to use, as it has its own built in batteries, microphone, speaker and operating pushbuttons. It may be supplied bare as shown in this photograph or be enclosed in a plastic case. The boards are available with slightly differing layouts e.g. some have two batteries and some have three. Adding Sound 165
Back to Contents Page 5
It is extremely simple to use. Just press the record button and hold the mike close to the source of the audio. This may be a sound clip being played through a computer’s loudspeaker or be the spoken word (e.g. for a station announcement). The recording limit is 10 seconds. To play back the recording, simply hold down the play button. Although cheap and simple, this module can be surprisingly effective. Possible modifications A likely modification is to remove the on board batteries and replace them with a 78L05 5V regulator so that the module can run from a standard 12V supply. I also unsolder the record button after making the recording, to prevent it being accidentally pressed later. It can always be re-connected later if you want to alter the recording. It is likely that you will want to operate the module from a distance and this would normally require two wires for the power and two wires for the play switch. This can be reduced to just three connecting wires, as shown in the image. In my module, one of the two ‘play’ connections has to be taken to +5V to play the sound (the orange wire in the image). This wire can be taken to any device that can provide a switchable +5V (e.g. a switch, relay contacts, output from atrainon-track detector or a MERG CBUS CANACC8). I included a 1K resistor in series with the orange wire to limit the switching current. If you have an old loudspeaker lying around, you will probably find that it is a good replacement for the tiny speaker that comes with the card. It should also be possible to remove the microphone and record directly from the computer’s ‘Audio Out’ socket. This is likely to improve the audio quality but I did not pursue the circuit for this. Wiring a regulator All five modules operate from either 3.3V or 5V supplies, so these notes on converting to use with a 12V supply apply to all options. Since they all consume relatively little current, they can use the 100mA style regulators (the ones that look like transistors) instead of the larger regulators (the ones with metal tabs). They have three connecting leads, as shown in the illustration. The 12V is wired to the regulator’s ‘In’ pin and the regulated voltage of 3.3V or 5V is available from the ‘Out’ Pin. The third pin is shown as ‘Gnd’, also referred to as the COM (common) pin. This is wired to the 0V line of the incoming voltage and also acts as the 0V of the regulated output.The 78L33 is used for a +3.3V output and a 78L05 is used for a +5V output. Both have the same size and shape and identified by the printing on them.
Adding Sound 166
Back to Contents Page 5
Capacitors with values of 330nF and 100nf are fitted across the input and output pins, as shown in the diagram. They are used to smooth the incoming supply and to prevent any possible internal oscillation. These values are non-critical and some circuits omit them altogether. However, given their small cost, they are best fitted.
Option 2 – MP3 player Many cheap MP3 players are flooding the market and can be purchased on eBay for around £2. Although designed for playing music on the move, they make great little sound players for a layout. They store the sounds on a microSD memory card that is inserted into a slot in the player. These cards can be bought separately for around £2 and can store long sound samples. The sounds can be of higher quality and this player can handle stereo sounds, The player has a built-in battery that can be recharged from any USB socket (often the one on your computer). The same USB lead is used to copy MP3 sound files from the computer into the player’s memory, The player is intended to be used with headphones so an external audio amplifier needs to be connected to the player’s audio out socket. The steps for this module are: Find, or create, a suitable sound file in MP3 format. Insert the microSD card into the player. Connect the player’s output to an amplifier. Connect the supplied USB cable between the player and the computer’s USB socket. Copy the sound file into the memory card. Remove the cable. Operate the power switch to hear the sound being played. If you are happy to use the internal battery, then the player can be used as is, without any modifications. Possible modifications Having to regularly recharge the module’s internal battery can be a nuisance. Fortunately, it can be easily replaced with a +5V regulator, allowing the player to be powered from a standard 12V supply. Two small screws secure the player’s outer casing. Then, the internal battery can be unsoldered. A 5V regulator circuit can then be wired to the player’s power connections as shown below. You can wire your own switch in place of the one fitted to the player, to allow you to operate the player from a distance (see the image below).
Adding Sound 167
Back to Contents Page 5
You can also keep the switch in the ON position and switch the power to the player. The circuit below shows a transistor, type BC557, being used to act like a switch. When its base connection is taken to 0V, current is allowed to flow between the emitter and collector connections and the MP3 player is powered. The transistor’s base can be taken to 0V with a switch, as shown in the diagram. Alternatively, the switch can be replaced with any other device whose output can switch between +5V
and 0V (e.g. relay contacts, the output from a CANACC8, the output from a track occupancy detector, etc.).
Option 3 - The ISD1820 This device is readily available on eBay for just over £3. It has a built-in microphone, built-in amplifier and is supplied along with a loudspeaker. The basic version is just 33mm x 42mm. It needs a power supply of between 3V and 5V, so the 78L05 5V regulator circuit described earlier would allow it to be run from a standard 12V supply. The module has three buttons. Holding down the red button allows a recording to be made using the microphone. The recording limit is 10 seconds. Adding Sound 168
Back to Contents Page 5
The module also has two black buttons, marked as 'single-pass' and 'jog', or 'PLAYE' and 'PLAYL'. PLAYE stands for edge-activated and even the shortest press of the 'single-pass' button results in the entire recording being played back. PLAYL stands for levelactivated and the 'jog' button only plays back the recording for as long as the button is held down. Possible modifications
The black playback buttons are handy for testing the module but it is likely that you will want to operate the module from some external triggering device. Fortunately, there is a row of pins on the board that replicate the job of the buttons. So, for example, taking the REC pin high is the same as pressing the REC button. Raising the PLAYE pin to 5v is the same as pressing the 'single pass' or PLAYE button. Similarly, raising the PLAYL pin to 5v is the same as pressing the 'jog' or PLAYL button. So the PLAYE or PLAYL pins can be wired to switches, relay contacts, the output from a CANACC8, the output from a track occupancy detector, etc. The microphone that is on board the module (shown in the top right corner of the module in the photograph) produces reasonable results for the price but there is scope for replacing the mike with a better quality model or with a connection to the audio output from a computer.
Option 4 - The WTV020-SD This is another sound player that plays sounds stored on a microSD memory card. It supports up to a 1GB max microSD card so can play long sound files. It is readily available on eBay for just over £3. It has a built-in amplifier but needs a loudspeaker. Alternatively, it can be connected to an external amplifier. It is about the size of a postage stamp and requires few other components, as can be seen from this diagram.
It is a 16 pin module, although most pins are not used in our circuit.. The LED and its resistor are optional. The LED flashes while a sound is playing and would not normally be needed except perhaps for test purposes. The module would normally be mounted under the baseboard or inside a building, so the LED would not be visible. Adding Sound 169
Back to Contents Page 5
The module works from a power supply of between 2.5V and 3.6V, so a 78L33 3.3V regulator circuit described earlier would allow it to be run from a standard 12V supply.
Preparing the audio files This and the next module require the preparation of the audio clips prior to them being installed in the module. With the WTV020, the audio clips have to be stored in the memory card in ad4 format (4-bit adaptive PCM), with a sampling rate of 32KHz. Files should be saved as 0000.ad4, 0001.ad4, etc. This is easier than it sounds, as there is free software that converts audio files into the required format. The process uses two software packages that are free and easily available. After obtaining, or creating, your required audio file, carry out these two steps. Step 1 - Convert the file to a sampling rate of 32khz The most poplar software for this is the free open source application called 'Audacity', which is downloadable from www.audacity.sourceforge.net
When you use the program to open an audio file, the audio track appears in the main window. The current sampling rate of the file is displayed in bottom-right corner. If it needs to be altered (i.e. it is not currently 32000) then 32000 can be selected from the drop down box. The example shows that the file has an 8KHz sampling rate.
Adding Sound 170
Back to Contents Page 5
After selecting 32000, the File/Export menu option is chosen to save the file in the new sampling rate. Although it takes a little effort to learn this technique, it is well worth it, as you can also use this software to edit the audio (convert from MP3 to WAV, mix two or more audio files, remove noise, add echo, introduce fading in/out, etc.). Step 2 – Convert the file to ad4 format The conversion software is called USBRecorder and is downloadable from www.waytronic.com/download.asp The software has a single window that looks like this:
The left-hand pane lets you select a folder to view. From here, you select the file you want to convert. The example shows that the wheelsqueal4.wav file is already using a 32KHz sampling rate, so an ad4 file version can be created by simply clicking on the 'Encode' button. The newly encoded file would be called whealsqueal4.ad4 and can then be renamed 0000.ad4. Installing the audio clip Now that you have the audio file stored in your computer in the correct format, you need a way to copy the file into your memory card. If you already own a digital camera, MP3 player or phone that uses a microSD card, then you are probably familiar with copying files between the device and your PC (probably using the computer's USB port). You simply, take out your existing microSD card from the device and insert the card you will use with the sound module. After copying the file to the memory card, you replace the original card in the device. An alternative is to use a memory card reader (about £1 on eBay) to copy the file into the microSD memory card.
Adding Sound 171
Back to Contents Page 5
So, the steps are:
Prepare the audio file as described above Copy the audio file onto the microSD memory card. Insert the microSD card into the WTV020 player. Connect a loudspeaker to the player’s pins 4 and 5, or connect to an external amplifier using pins 2 and 8. Connect to a 3.3V power supply (see the diagram). Press to play, press to stop.
Option 5 - The WT588 This is the most expensive module (around £6 from eBay) but also the most versatile. Multiple configurations are possible, with the example showing four different inputs, allowing it to play four different audio tracks. It has its own built in memory (no need for a memory card) and built in amplifier (although you have to supply your own speaker). The image shows one of these modules mounted on a piece of stripboard. In the top left of the board, above the crystal, is a miniature USB socket ( a Mini-B socket). This is used to transfer the audio clips from your computer into the module. The pin numbering starts from the pin nearest the crystal. Pins 14 and 22 connect to the 0V and 5V respectively. Pins 9 and 10 can be connected to an 8 ohm/0.5W speaker. Alternatively, pins 8 and 14 can be used to connect the module to an external amplifier.
The WTV020 module supports audio files in WAV format and sampling rates of either 6KHz, 8KHz, 10KHz, 12KHz, 14KHz, 16KHz, 18KHz or 20KHz.
Linking sounds to switches The module can store multiple sounds and so has to be told which sound(s) to play when a particular key is pressed. This is achieved with yet another piece of free software and it can be downloaded from: http://www.waytronic.com/download.asp Adding Sound 172
Back to Contents Page 5
From this menu, choose 'WTD588d VoiceChip Setup' When run, you may wish to change the default language to English. The application has a single screen, as shown in the illustration.
When first run, both main panels will be empty. Right-clicking in the left panel allows you to load your audio files. It will refuse to load an improperly formatted audio file, displaying an appropriate error message (e.g. “Sampling rate can not be greater than 22000” or “Inappropriate sampling rate”). The narrow middle column corresponds to the possible key presses. In the example, one sound is attached to a keypress. If required, multiple audio files can be attached to a single keypress and they will be played in succession. The program also lets you insert pauses between the playing of a set audio clips, when initiated from a single keypress. Imagine a station making four different announcements, depending on which train arrives (maybe using RFID or CBUS?) DIY Comparisons DIY sound players are of varying complexity, quality, length of audio, price, etc. This table gives a broad comparison of the different types. As always, it is a matter of choice and ability – but think of the possibilities! Greeting card
MP3 player
ISD1820
WTV020
WT588
10 secs
Long
20 secs
Long
Long
Audio source
Mike
microSD
Mike
microSD
Memory
Type
Mono
Stereo
Mono
Mono
Mono
Looping
N
Y
Some models
Y
N
Amp
Y
N
Y
Y
N
Speaker
Y
N
Y
N
N
Play time
Adding Sound 173
Back to Contents Page 5
Sound sources Some commercial sound systems are supplied complete with their own embedded sound(s). Often, their audio content cannot be altered, although some allow additional sounds to be purchased. Apart from the expense, the available sounds can be limiting. Others sound players, including DIY versions, need to have suitable sound files installed in them. In these cases, you have to find your own sound files, usually from the Internet. The most likely options are for commercial (but royalty-free sites) and public domain and free download sites. Here are some commercial “pay per sound” sites: www.pond5.com - royalty-free files www.sounddogs.com www.pricom.com/Trains/Downloads-DreamSounds.shtml www.soundsnap.com Here are some free download sites: www.grsites.com/archive/sounds www.audiomicro.com/free-sound-effects/free-transport-and-vehicles/free-train http://trainweb.org/mdamtrak199/trainsounds.html http://20th-century-fox-sound-effects.freedownloadmp3.net/steam-trains-trolleys-etc/ www.naturesoundsfor.me
Making your own For those who have the time, the resources and the skills, home-recorded sound files from real world locations can provide unique layout sounds. Visiting specific locations (e.g. station announcements at a particular station, sounds from a local factory, etc.) can bring even greater authenticity to a layout. Even very basic recording techniques can produce useful results, while additional recording and editing skills can further enhance the files. This could include adding echo, compression, file conversion, volume adjustment, noise elimination, panning, cropping, looping, fading up/down.
This is really beyond the scope of this book but a useful website on this subject is: www.qsisolutions.com/products/techinfo/record-sounds.html
Once you have your audio files, downloaded or recorded, you have to to decide whether the sound is played as a one-off (e.g. a train whistle) or is played as a continuous loop (e.g. running water or city background hubub). If you are creating continuous loops, leave breaks in the sound, or have variations in volume; this relieves the listener from a constant barrage of sound. Alterations to a sound file require the use of a computer and audio editing software. There are many such applications available and the most commonly used free software is called 'Audacity' and it can be downloaded for free from: http://audacity.sourceforge.net/ It has an impressive list of features for a piece of free software. The site even provides manuals and tutorials on how to use the software. Check out: http://audacity.sourceforge.net/manual-1.2/ http://manual.audacityteam.org/o/
For general discussion on matters relating to sound on your layout, you can join a well-used Yahoo Group: http://groups.yahoo.com/group/LayoutSound/ Adding Sound 174
Back to Contents Page 5
Synthetic sound For best results, use the actual recordings of the sounds you want to play on your layout. This is specially true for complex sounds comprising multiple sources (e.g. street scenes, football crowds and so on). Fortunately, some of the more common railway sounds are less complex. That means that we can create an electronic approximation to the real sound – the result sound like the real thing. Such sounds are the hiss of steam, whistles and horns. For these, you will find a number of circuits available on the Internet. For example: www.ehow.com/how_12099618_build-electronic-steam-engine-sound-circuit.html http://members.shaw.ca/roma/train.html www.circuitstoday.com/dual-tone-train-horn-circuit
Audio players An audio system comprises three parts: The audio file to be played An audio player A loudspeaker The player is an important part of the system, in terms of audio reproduction (e.g. quality, mono/stereo), facilities (e.g. looping, maximum length of audio clip supported) and method of operation (e.g. handheld controller, switches). Most, but not all, players have built-in amplifiers. Some use internal batteries, some use power packs and some get their power from another device (e.g. phone or PC).
Types of speaker The task of the loudspeaker is to translate audio signals into sound waves. Therefore, larger speakers are able to influence more of the surrounding air than smaller speakers. Of course, large speakers are not always practical on layouts. Fortunately, we don't need high volume levels on our layouts so small speakers are adequate in most situations unless we are going for high-quality reproduction. You may also consider using a larger speaker for reproducing the lower frequency rumbles. Bear in mind that even a poorish quality clip will sound better on a better speaker, while a high quality clip will suffer when played on a cheap speaker. That said, experience shows that perfectly satisfactory results can be achieved with the many small speakers purchased from eBay. These range from speakers a few inches in diameter to the tiny speakers that are sold as spares for games consoles, mobile phones, laptops and toys. The picture shows a 38mm speaker, a pair of replacement speakers for a Dell laptop and a replacement speaker for NDS Lite games machine. For the budget conscious, you can also recover speakers from discarded radios, televisions, etc. Speakers for mounting inside trains are discussed later.
Adding Sound 175
Back to Contents Page 5
Apart from size, there are two main considerations when buying or reusing a speaker – its impedance and its rated wattage. The speaker coil commonly has an impedance of 4 ohms or 8 ohms. Impedance is the 'resistance' of a device when used in non-DC circuits; in these cases the inherent inductance and capacitance of the speaker coil has an additional inhibiting effect. Speakers also have a wattage rating. This is not a measure of the power it normally consumes; it is a measure of the maximum audio power it can handle without producing distortion to the audio or damage to itself. The maximum transfer of power to the speaker occurs when the speaker impedance matches the output impedance of the audio module/amplifier. Using a lower impedance speaker than that specified will usually result in poor audio reproduction and often destruction of the speaker. You can use a speaker with a higher impedance than specified, This will cause no damage but is likely to result in a reduced audio level.
Wiring speakers Connecting a single speaker to an amplifier or sound module is straightforward, with only two wires to connect them. There may be times when you want to connect extra speakers to a single module (e.g. to spread the sound of thunder or traffic over a large area). Or, you may have some speakers whose impedance do not match the requirements of the module. This illustration shows various ways to connect speakers. The images on the left show two 8 ohm speakers wired in parallel to present a 4ohm impedance to the amplifier. If required, you could even wire two sets of 4 ohm speakers as shown. The upper pair and lower pair are both wired in parallel, resulting in 2 ohms each. The pairs are then wired in series, to present a final 4 ohm impedance to the module. Similarly, the images on the right show combinations for 8 ohm systems. You must not end up with a final impedance that is less than the specified load. Polarity
The diagrams above show that many, but not all, speakers have positive and negative markings on them, or red and black leads. A speaker should be connected with its positive lead to the amplifier's positive output terminal and negative lead to the negative terminal. In practice, the ear is not sensitive to the absolute phase of an audio output. Connecting a conventional speaker in reverse has no impact on how we hear the sound. However, things change when we connect two or more speakers to the same audio output. If one speaker is wired differently from another, they are said to be 'out of phase'. This means that at any one given moment, one speaker will be 'pushing' the air while the other is 'pulling' the air. If you were positioned mid-way between the two speakers. The sound would be completely cancelled out in theory. In practice, the effect is less less drastic although noticeable, particularly at lower frequencies. Adding Sound 176
Back to Contents Page 5
Mounting speakers You may want to consider these suggestions before placing speakers on your layout. A loudspeaker works by using a cone shape to vibrate the air. So, you have to ensure that there is no impediment to this free movement. Firstly, don't just screw the speaker to a flat surface, such as the wall of a building or the underside of the baseboard. This illustration shows the building being used as the speaker enclosure. This method will weaken and muffle the sound. We also want to avoid unwanted vibrations – only the speaker should be producing the sounds. Instead, make a hole in the baseboard/building wall and mount the loudspeaker as shown in this illustration. This way, the material supporting the speaker acts as a baffle board. A baffle board has two purposes: • It increases the volume and clarity. The air is no longer trapped between the cone and the surface it is mounted on and the pressure variations are not absorbed by the material. • It prevents unwanted interference from the air vibrating at the rear of the cone. Remember that when the cone is 'pushing' air at the front it is 'pulling' air at the rear. We don't want the out-of-phase sound waves from the rear interfering with the wanted sound waves, partially cancelling or distorting them or arriving slightly later to produce unintended echo effects. The hole in the board should be as large as possible, to allow the maximum effect of the speaker on the air, and should be no less than two thirds of the speaker size. It is best not to screw or bolt the speaker directly to the material, as this can lead to the problems associated with sound transference, such as absorption and unwanted resonance. The speaker can be insulated from the baffle material using doubled-sided foam tape, or a glue gun or silicone sealant. These illustrations shows the speaker mounted in its own enclosure then secured to the side or floor of the building. Although these may be the only options in some circumstances, they are not the ideal mounting method, as the air is confined in the building and sound is only heard by transference through the building walls and roof. A better method is shown in this illustration. The speaker is mounted on the rear wall of the building, out of sight. The foam mounting minimises sound transference to the building structure and the hole in the rear wall ensures free movement of air. This is preferable to having speakers pointed directly at the listeners. The sound is being reflected off other buildings or bouncing back off the backscene towards the listener, a situation that often exists in real life. It's a bit like when you first hear a fire engine or the chimes of an ice cream van in the distance. You can hear the sound but can't initially work out where it is coming from. You may identify the general direction but can only pinpoint an exact source when it is closer to you. Adding Sound 177
Back to Contents Page 5
An alternative, where the situation allows, is to mount speakers under the baseboard as shown in this illustration. You can position the speaker hole behind objects such as trees, bushes, walls, hills and buildings. It is best to cover the hole with a grill or piece of cloth, to prevent junk from falling into it. If the hole has to be in a less hidden position, it can be covered with a material that allows air to pass through it – such as lichen. Lastly, it helps to use the largest size of speakers possible, subject to the physical restrictions on a layout. This improves the fidelity of the sound, particularly for low-frequency sounds such as thunder, machine rumble and diesel engines.
Sound switching A variety of methods are available, depending on the effect that is required. In addition, some sound modules only play as long as an input is held low/high, while others will play an entire sound clip when an input pulse is detected. Permanent sounds Some sound modules can be set up permanently plays sounds on a loop, perfect for running water, country sounds, etc. These modules run continuously when connected to power. Random sounds The sound module can be operated from a circuit that sends out randomly spaced pulses to start the module playing. This is useful for the sound of birds, dogs, saws, car horns, etc. Pulsing circuits are easily found on the Internet and the modules can run unattended. Timed sounds The sound module is operated from a timer circuit that runs on its own. This can be useful for any 'scale time' sounds such as a town clock, church bells, etc. Triggered sounds This is probably the most useful approach. The sound modules are operated by an event on the layout. For example, a Hector detector located at a tight bend could detect a train and initiate a 'wheel screeching' sound. Similarly, a DC or DCC train-on-track detector could initiate a station announcement when a train enters a station. If you don't want certain trains (e.g. goods trains) to initiate the announcement, then you could use a reed relay under the track as the detector and only fit magnets to the train that should trigger announcements. Synchronised sounds This approach allows a trigger to synchronise sound to other events on the layout. So, for example, a signal to a Servo4 board to operate a crossing barrier could also start the sound of crossing bells. Similarly, the flash from a welder (LED) could be accompanied by a 'frazzling' sound, or a flash of lightning could be followed by a roll of thunder. Manual operation The simplest approach is to have a manually-operated switch that powers or initiates a sound. Some users may wish to have control over every individual sound, while others may find it an unnecessary intrusion into the running of their layouts. Even automatic sound systems may benefit from the occasional manually-operated sound. For example, kids may like to press a button that starts all the fairground attractions light/moving while the sound of fairground organ is played.
Of course, you may also consider having a single master switch that disables all audio on the layout (very useful for those late night sessions).
Adding Sound 178
Back to Contents Page 5
On board train sounds The previous pages covered trackside sound but it is increasing common to also add sound modules inside the loco. There are two types of on board sound module: Self-contained units that work on DC or DCC. DCC decoders that specially designed for handling sound
Self contained modules This image shows the Trax Controls DHM-12 and DHM-24 Two-Tone Diesel Horn Modules, working on 12v and 24v respectively. Its size is 110mm x 60mm and it is intended for fitting inside O gauge and larger locos. The row of small preset controls allow the pitch and duration of each tone to adjusted separately. For onboard use, it can be triggered by having reed relay switch mounted under the loco; the switch is operated by a magnet set in the track. For lineside use, it can be triggered by a pushbutton or by a reed relay embedded in the track that is operated by a magnet mounted under a passing loco. The SWM-1 module is the Steam Whistle equivalent. Trax Controls also produce steam and diesel sound modules that reproduce the sound of the locos in motion. The sound content and volume alters as the voltage to the track increases. In the steam module, the sound varies from a hiss while stationary to a chuff repetition that increases with increasing track voltage. For more details, see: www.traxcontrols.com/ Quasar Electronics produce the SG01M module. At 30mm x 16mm, it can be fitted into smaller gauge locos, maybe in the tender or a wagon. Like the DHM-12 above, it needs a separate power supply. It produces three different sounds and these are triggered by fitting reed relay switches under the train. Magnets can be fitted round the track, wherever a sound should be triggered. Careful positioning of the reed relays and magnets is necessary, if you wish to use all three sounds. It is very simply wired, as shown in this illustration. It uses a tiny 1 microamp standby current and under a milliamp when producing sounds. Being so economical, the battery could be left installed for long periods. For more details, see: www.quasarelectronics.com/sg01m-four-train-sounds-generator.htm
Adding Sound 179
Back to Contents Page 5
Mr Rails produce the MistyMK2 sound module, as shown in this image. There are two versions, for OO and O scale. They use the same 50mm x 29mm board, with the O gauge version using a larger speaker. It uses a 9v battery which has to be fitted somewhere on the train. Like the DHM-12 module, it senses the voltage level coming from the track and produces a chuffing rate that matches it. It has a control for adjusting the voltage/chuffing rate for the particular loco it is fitted to. For more details, see: http://www.mrrails.com/html/misty.html
DCC sound If your layout is DC only, then the above sound modules are the types you have to use to achieve on board sound. These boards can also be used with DCC systems but the modules designed solely for DCC working, although more expensive, are considerably more versatile and configurable. At its simplest, a DCC sound decoder is a small board with sophisticated electronics that has two wires that are connected to the loco's power pickups, and two wires that connect to a small loudspeaker. At the other end of the range, some decoders can handle 8 simultaneous sound channels, multiple speakers, etc. Because it is DCC, the decoder's sounds can be triggered by lineside events (e.g. track occupancy detectors), manually from the operator's handheld controller, or through a computer program. See the chapter on DCC for details on how the system works. Sound decoders are available in a variety of formats. Some are sold pre-fitted in locos, so the user has nothing to do but learn how to use it. Some handle sound only and a separate loco decoder is needed for the motor's speed and direction control. The image shows an MRC sound decoder, available in steam and diesel versions. The user has to fit and wire the decoder, or have it professionally done. Since it is a standalone unit, it need not be fitted in the loco along with the loco decoder; it could be fitted in the loco's tender or first coach. Some combine handling sound and controlling the loco's motor (Digitrax, Zimo, etc.). Some are designed as a drop-in to particular loco chassis, as in this MRC module for a dropin to a Kato chassis. Some are designed as plug-ins to loco decoders (e.g. the Digitrax Soundbug plugs into the Digitrax DH165 series decoders). Adding Sound 180
Back to Contents Page 5
This is the MyLocoSound DCC Steam Decoder
Apart from handling sound, it handles a couple of function outputs. It also has option to fit a stay-alive capacitor. This is a storage capacitor that powers the sound module during any short interruptions in power from the track (e.g. dirty track, navigating frogs, etc.). It is used to prevent the sound from dropping out during these interruptions. For more details see: www.mylocosound.com This image is the LokSound 4.0 from ESU It can store up to 276 secs of sound and can play eight different sounds simultaneously through its eight audio channels. You can purchase an (expensive) add-on, the LokProgrammer, that allows you to change the sounds stored in the decoder. Apart from handling sound, the loco motor and various function outputs, it has the ability to drive four servos. This allows additional possibilities such as a rescue crane, a guard waving a flag or a lamp, and so on. It provides for the addition of a “PowerPack”, a stay-alive of 2 secs. As with all DCC decoders, values are stored in configuration variables (CVs). This table shows part of the CV list for steam. There is another table for diesel and one for electric locos. For more details, see: www.esu.eu/en/products/loksound /loksound-v40/
Adding Sound 181
Back to Contents Page 5
Speakers for locos Large, quality speakers can give a rich sound that spans the frequency range from highpitched whistles to the deep grumbling of diesels. However, unless you are working in larger gauges, speaker size is a considerable factor given the limited amount of space inside most locos. Smaller speakers suffer from two main performance limitations: Frequency range Their small size means that they never produce full deep bass sounds – although some models are better than others. Audio output They produce limited audio power output without distortion – although is that really a problem? Their output is more than sufficient in most situations. What's available? Speakers are available from major model railway suppliers such as ESU, SoundTraxx, Zimo and TCS. The image shows a tiny 'Sugar Cube' speaker. Speakers are also available on eBay at much lower prices, although you would be best to buy just one try it before buying in any quantity. Many commercial speakers for model railways are variants on the types that are used in laptops, tablets, MP3 players and cellphones. Here are just some example speakers: Manufacturer
Dimensions
Impedance
Wattage
Frequency range
ESU Sugar Cube
12x14mm
8 Ohms
1~2W
ESU 50331
20mm
4 Ohms
1~2W
Zimo MicroCube
12x8x8mm
8 Ohms
1W
Zimo Sugar Cube
15x11x9mm
8 Ohms
1W
300Hz-20KHz
Zimo SugarLump
15x11x12mm
8 Ohms
1W
“More bass”
Zimo LS20R
20mm
8 Ohms
0.5W
SoundTraxx 810053
20.5mm
8 Ohms
0.2W
550Hz-7KHz
SoundTraxx 810089
15mm
8 Ohms
0.2W
540Hz-20KHz
SoundTraxx Mega Bass
28x28x11mm
8 Ohms
2W
310Hz-1KHz
TCS WOW
20mm, 28mm
8 Ohms
0.8W
The above table details some of the smaller speakers, with varying power handling capacities. There also have differences in the frequency ranges they can handle (it is difficult to find frequency range data from some manufacturers). The SoundTraxx Mega Bass speaker is intended for reproducing mainly low frequency sounds, with its larger 39.5x19.5mm speaker covering the wider range of 550Hz-12KHz. Larger gauges The range for larger gauges is greater, with circular, oval and rectangular shapes, larger power handling – and increased size. For example, the Zimo LSFRS5 is a large 50mm 8 Ohm speaker but can handle 5W at 150Hz -20KHz. Note that to fully utilise larger speakers ( e.g. greater than 3W) you will probably need a large-scale decoder. Adding Sound 182
Back to Contents Page 5
Mounting speakers This is always a problem, particularly in smaller gauges. While speakers are more easily fitted in coaches or wagons, this loses some of the authenticity of the sound (sounds come from locos not rolling stock). However, in extreme cases, this may be an only option. From OO upwards, life is a little easier, as there is often room to squeeze in a speaker, e.g. inside the cab of a diesel or inside the boiler of a steam loco. Some of the smaller speakers, e..g. the Sugar Cubes, are already mounted in their own enclosures to maximum sound output. Some notes on mounting Sugar Cube speakers can be found at: http://www.sbs4dcc.com/tutorialstipstricks/sugarcubespeakernotes.html
Fitting two speakers , where space is available, will result in increased volume.
Loco sounds There is a huge range of authentic recorded loco sounds available in DCC sound decoders. For example, check out the YouChoos website: http://www.youchoos.co.uk/Index-Shop.asp?L1=Sounds
This company provides sound decoders with steam sounds from GWR, LMS, LNER, SECR, LSWR, SR and BR standard sources. Its diesel selections include shunters, locos, and DMUs. It also has a selection of electric loco sounds. Many other DCC sound decoder manufacturers offer similar products. If you still can't find what you want, Howes Models offer a service that replaces the existing sound files on ESU LOKSOUND decoders with our own sound recordings .
Adding Sound 183
Back to Contents Page 5
Chapter 11 Track occupancy detectors
Track occupancy detectors 184
Back to Contents Page 5
Track occupancy detectors Detecting the presence of a train has been a useful facility on many model railways, although perhaps still under-used. This chapter looks at different methods of detecting track occupancy and compares their relative merits. The chapter covers nine different methods and MERG currently sells components or kits for six of these (using reed switches, Hall Effect switches, current detection kits, infra-red and RFID modules). Others technologies exist, utilising radio transceivers or even GPS systems. Track occupancy detectors are often called 'TOTIs' – train-on-track-indicators.
Track occupancy detectors uses Hobbyists will have different uses for detectors, including a mix of some of those below. Improving look/feel A train enters a siding and the yard light comes on. Track side animations. On-screen timetable announcements. On-screen train descriptions. Sound effects (station announcements, whistles, bells). Improving functionality Feedback to mimic panel (the image shows part of an exhibition layout with TOTI modules lighting LEDS as a loco travels round a loop). Automatic crossing gates and barriers. Automatic signalling. Reverse loops. Collision prevention. Improving control Detecting train lengths. Detecting direction of travel. Detecting a wagon that becomes detached from a train. Selective switching of points. This list is by no means exhaustive. You can no doubt add many more possible uses, as the only limit is our imagination. While many of these features can be implemented by all users, some require the use of computers.
Levels of detection Not all detectors are interchangeable, as they work and operate differently. Firstly, there is a distinction between 'spot detection' and 'stretch detection'. The detector's output is only changed when a train passes the Spot detection
detector. The output reverts to its original state when the train leaves the detectable area (although sometime you can add a delay before switching back). This method, therefore is momentary and relies on movement past the detector. This method is useful for triggering
Track occupancy detectors 185
Back to Contents Page 5
events (sounds, CBUS notifications, etc.) Stretch detection
The detector's output is changed when a train sits in any part of a track section. The output only reverts back to its original state once the train (usually the loco or a specially adapted coach) vacates the entire track section. This method, therefore, does not rely on movement but on occupancy. This method is useful for stationary information (knowing a hidden siding is occupied, maintaining a signal at green while the train passes, etc.)
Another distinction is between 'Occupancy' and 'Identification'.
Occupancy
The operator, or computer, knows that a track section is occupied by 'something'. This is not as bad as it sounds and this method is still very useful and is the most widely used.
Identification
The operator, or computer, knows not only that a track section is occupied; the details of the train are made available (allowing for station announcements, different train whistles, selective action for point operations, etc.)
Starting at the beginning The chapter looks at the different methods, starting with the simplest and ending with the most complex. Hopefully, readers at all levels will get something out of it. So, lets start with a detector that even the newest beginner can tackle.
Microswitches Microswitches are available in a range of sizes, current handling abilities and switch contacts arrangements. As the image shows, all have a plunger that operates the switch. This is often supplemented by a lever that operates the plunger. As it provides greater leverage, it needs less effort to operate the switch. Some levers are a simple strip of metal, while other have rollers (see the photo) to reduce any friction against the lever. Some microswitches are simple ON/OFF devices and have two tags that are shorted when the lever is pressed. This simple action, known as single-pole single-throw (SPST) is similar to a push-button - the switch is designed to release again when the pressure is removed from the lever. The microswitch shown in the image is a single-pole double throw type (SPDT). It has three tags with the lower tag shorting to one of the upper tags when the lever is pressed and shorting instead to the other tag when the lever is released. An alternative is the 'leaf switch'. It is much smaller and need very little operating force. It is designed for low current switching and can be use for indicating point positions, when mounted close to the point's tie bar. Its main weakness is that is open to the elements. Track occupancy detectors 186
Back to Contents Page 5
Basic use We all know that if we take a power supply and wire it across a bulb, the bulb lights. We also know that we can wire a switch in series with one of the wires, so that we can switch the lamp on and off. Let's start from there. The illustration shows the simplest form of train detector possible. The lever of the microswitch protrudes from between the buffers of a siding. When the loco reaches the end of the siding, the lever is pressed and the lamp lights. So simple, so basic, yet so handy when you have hidden sidings. The next step might be to replace the filament lamp with an LED and dropper resistor. If we now use two microswitches and add in a relay and a resistor, we have a cheap alternative to a rolling road, or even a very basic DC shuttle system. Microswitches are positioned at each end of a section of track. The image shows that I added an extension to the microswitch operating arm, using a piece of tin taken from a beans can. The relay is a 3-pole double-throw type. Two change-over switches are used to switch the polarity of the controller power to the track, while the other is used a single switch to the relay. The relay is available from RadioSpares. The circuit relies on the 'hysteresis effect'. This means that the relay takes a certain current to move the switch assembly but, once activated, requires a lesser current to hold the relay switched. In my own circuit, my 12v relay needs 15mA to operates the relay contacts – but they will stay operated until the current drop below 5mA.
The value of the resistor depends on the relay's operating voltage and its internal resistance. In my case, a 220 ohm resistor was used. Track occupancy detectors 187
Back to Contents Page 5
The sequence of events is: When power is applied, the relay is not operated and the power is switched as shown in the illustration. The loco moves rightwards until it presses against and switches microswitch Y. This creates a path from the relay's +ve supply, through the relay, through microswitch Y to 0V. The relay operates. This results in two activities. The relay switches the two changeover contacts S1 and S2, resulting in the loco power to the track being reversed. It also switches S3, which connects the relay to 0V through resistor R. When the loco starts moving leftwards, microswitch Y is released but the relay remains held operated as there is sufficient current being supplied through resistor R to hold in the relay. When the loco reaches the end of the track, it operates microswitch X. This shorts across the relay, making it drop out (there is no short to 0V due to the presence of resistor R). The relay releases all the switches and the wiring reverts back to that shown in the illustration. The process starts all over again. Place a loco on the track and connect the power to watch the loco traverse up and down the track at a speed determined by the controller. This allows it to warm up locos, instead of using an expensive rolling road. It can even act as basic shuttle, although there is no pause at each end before changing direction. Again, this is not the most sophisticated project but, given the small component count, it makes a good starter project. Pros: Cheap, easily obtained, simple. Good for beginner's projects. Easily fitted to an existing layout. No modifications to track/power/etc. are required. Unaffected by light No modifications to locos or rolling stock. Cons: Limited use, due the way the detector can only be placed at the ends of track sections (although experiments have been made with the microswitch being under the baseboard with the operating lever being operated by trains passing over them). Here is an alternative approach that uses a 555 chip in 'bistable' mode. That means that it happily stays in either one of two possible states – i.e. with its output pin 3 or low. A microswitch, or leaf switch, is mounted at each end of the track and one of these will bring pin 2 down to 0V when the loco pushes it. The other microswitch brings pin4 low when the loco pushes it. When pin 2 goes low, it makes pin3 goes high. Pin 4 going low makes pin 3 go low. The output from the chip is taken to a transistor that switches the relay on and off, as the loco reaches on end of the track then the other.
Track occupancy detectors 188
Back to Contents Page 5
Reed switches This was one of the most popular early detectors used for model railways. Its is covered in the MERG Technical Bulletin A7/1. Two strips of metal are held in a sealed glass tube. When a magnet is positioned nearby, one of the strips is attracted by the magnetic field and bends; in so doing it makes contact with the other strip. They are in common use in burglar alarm systems and a range of industrial applications such as in wind turbines, mines, and as fluid level switches. Their airtight situation makes the contacts immune from external problems such as dampness. Also, there is no danger of sparking hazards in potentially combustible areas. This means that they are made in large quantities and easily available from a range of suppliers. The image shows part on exhibition layout. A reed switch is embedded under the track of the siding. A loco pulls a wagon that is fitted with a magnet. When the wagon passes over the reed switch, the switch operates and lights the yard lamp (on the right); it also sends back a pulse to a PIC that controls the overall sequence. The PIC makes the train stop and activates a series of servos that opens a door, rotates a crane, moves a lorry, etc.
Track occupancy detectors 189
Back to Contents Page 5
Pros:
Cheap, easily available. Easily fitted. No modifications required to locos or rolling stock. No modifications to track/power/etc. are required. Unaffected by light. Good for garden layouts, due to their waterproof construction. Can have conditional trains, with some fitted with magnets and others not. So, for example, points may only move to let goods trains enter a shunting yard; while the express train (not fitted with a magnet) cannot activate the point.
Cons: Each piece of rolling stock requires its own magnet. Only produces a momentary pulse output, so will probably require additional circuitry (such as latches or delays) in most circumstances – unless the pulse is used to send event information back to computers.
Hall effect switches Hall Effect switches are widely used in the automobile industry and most cars have many such switches (transmission sensors, ignition sensors, gearstick position sensors, etc.). More details are available from Technical Bulletin A7/2, on the MERG website. Like reed switches, Hall Effect devices are switched by the presence of a magnetic field. Unlike reed devices, they need power to operate. They are simple, 3-pin devices, with two of the pins connecting to a power supply (typically between 4.5V and 24V). The third pin is the output pin that changes state when the device detects the presence of a changing magnetic flux. With output currents of 10mA upwards, their outputs can be directly connected to LEDs, via the usual voltage drop resistors. These devices are open collector, which means that they need a load between the collector and the positive supply. These switches are available from the MERG Kit Locker. An interesting feature of Hall Effect switches is that they can differentiate between a magnet's North and South Poles, unlike reed switches. The output changes when a North pole passes the flat side of the device, or when a South pole passes the chamfered side. So, a North pole passing the chamfered side creates no change in output. Similarly, nothing happens when a South pole passes the flat side.
Latching types A variation on these switches is the 'latching' switch, available for about 40p each from eBay. It is still a 3-pin device but it behaves like a toggle switch (a bistable). It needs to use both the North and South poles of a magnet to switch states. As the illustration shows, a North pole makes the output go high. However, when the magnet is removed, the output remains high (unlike the normal Hall Effect switch which reverts back to its previous state).
Track occupancy detectors 190
Back to Contents Page 5
When a South pole now passes the switch, its output goes low – and stays low until switched again by a passing North pole. The MERG Technical Bulletin A7/4 suggests a use for a latching switch involving putting magnets at both end of a train, The front magnet would be mounted with its North face pointing towards the Hall Effect switch, while the rear magnet mounted to present its South face. As the train passes the switch, its output goes high and stays high until the end of the train passes. Paul King cleverly shows how a normal Hall Effect switch can act like a latching type, at the expense of an extra magnet being placed behind the switch. Although requiring an extra magnet for each switch, it has the additional benefit of increasing the range over which the switch operates. Of course, this extra benefit is only available when used in latching mode. Pros: No modifications to track/power/etc. are required. No modifications required to locos or rolling stock. Unaffected by light. Small component count. Clean ONs/OFFs (they use internal Schmitt triggers). Can be used as a latching sensor Cons: Possible problems in positioning magnets and detector switches. Needs a powerful magnet, as the detector has only a small sensing distance (around 5mm). Only a momentary pulse output, unless using latching type.
LDRs Light dependent resistors (LDRs), as you might expect from the name, are devices whose resistance changes with the amount of light that falls on them. They are two-wire devices and can be wired either way round. In their 'normal' state (i.e. in darkness) they have a very high value of resistance, usually measured in Millions of Ohms. As the amount of light shining on them increases, their resistance progressively lowers to a low point measured in hundred of Ohms. This output is different from the other detectors which are either fully ON or fully OFF. The output resistance can be at any value within its range, depending on the amount of light shining on it. This characteristic could be used to improve the lighting on a layout. If the layout is operated in a subdued light, the lights inside the buildings could be dimmed a little to prevent an unrealistic glare. If the layout, however, was then operated in a brightly-lit room, the lights could be brought up to full illumination. In most cases, though, LDRs are used to detect the presence of objects passing along the track. LDRs are usually mounted under the track with the light sensitive area located between the sleepers. Track occupancy detectors 191
Back to Contents Page 5
The normal ambient light in the railway room results in the LDR having a relatively low resistance. As the loco/wagon/coach passes over that section of track, it lowers the amount of light that reaches the LDR and the LDR resistance increases. This change of resistance is used to sense the event and trigger some activity. The diagram shows a typical circuit diagram for boosting an LDR's output. The 1k resistor and the 10k variable resistor are used to tweak the light level at which the LED will illuminate. These can be replaced by a single resistor once the required value for a particular LDR and light surroundings is determined. Mostly any NPN transistor will do in this circuit, including the BC547B that is available from the MERG Kit Locker. MERG Technical Bulletin T33_25 describes another interface using a LM358 dual op-amp IC.I If you Google for 'LDR circuit' you will find a wide range of different circuits using different transistors and ICs. Pros: Cheap. Works for locos or wagons/coaches. No modifications required to locos or rolling stock. No modifications to track/power/etc. are required. Cons: Sensitive to ambient light changes (e.g. at exhibitions). May require careful shielding to minimise unwanted switching from peripheral light changes (e.g. as you stretch across your layout). Only a momentary pulse output. Not a clean switch between on and off, unless using additional circuitry.
Infrared detectors Infrared (IR) waves sit between microwaves and visible light in the electromagnetic spectrum. Humans radiate some infrared energy and this is utilised by the motion detectors that are used in burglar alarms and automatic security lights. Almost every member will have a TV that control with remote that uses infrared.. In the modelling world, if we use a source of infrared emissions in conjunction with an infrared detector, we can detect the presence of locos and/or rolling stock as they pass by. There are two methods of detection: The IR is bounced off the rolling stock. An IR beam link is broken when rolling stock passes through it. In the first configuration, the emitter radiates the IR, which reflects off the undercarriage of any passing rolling stock. This reflected IR is detected by the IR diode, which allows current to flow and generates a voltage pulse. Track occupancy detectors 192
Back to Contents Page 5
The illustration shows the radiation from an infrared transmitter bouncing off the undercarriage of a wagon and reflecting back to an infrared receiver. The emitter and the detector diode are available as separate components. They can also be bought with both enclosed in a single case and these are ideal for mounting under the track. In the second configuration, we use a separate IR emitting diode and IR receiver diode. This allows us to mount the two devices above the baseboard. They are spaced apart, such that the emitter points directly at the detector across a railway track. The illustration shows two possible mounting methods. On the right of the illustration, the two devices are placed directly opposite each other across the track. In the example, there are three items passing the detector. Since there are gaps between each item, it would result in the beam being broken three times and three output pulses being generated. Mounted this way, it could act as a counter of how many items were in a particular train.
However, most users would prefer an output that stays set for the duration of the passing of the entire train, no matter how many items were attached. The left hand of the illustration shows the two devices set at a diagonal across the track. The gaps between items of rolling stock are no longer detected. This results in the output being set when the first item passes and only being reset after the last item passes.
Track occupancy detectors 193
Back to Contents Page 5
IR detector types The three types shown in the illustration provide different levels of sensitivity. The basic photodiode can be improved by using a phototransistor, which acts like a photodiode and amplifying transistor in one device. The Darlington phototransistor provide even greater levels of sensitivity with the extra high gain provided by the two transistors.
Mounting Many IR phototransistors can be sensitive to light in the visible spectrum and it may be necessary to shield the detector to minimise unwanted effects from ambient room lighting. This may involve placing the detector in a lineside building or hiding it in a bush. Often, the detector is mounted inside a piece of tubing that is opaque (don't forget to seal or paint the back of the tube). Line-of-sight mounting, particularly if the detector is shielded or at a distance, requires accurate alignment for reliable results. Some users recommend using multiple LED emitters, to increase the usable range of the system.
Hector The MERG 'Hector' (Kit 72) is an infrared detector kit. The two LEDs on the left of the board are the detector and the emitter. Although mounted on the board in this example, they can be mounted off-board and wired taken back to the board (e.g. for above-board operation). Detected IR changes result in the indicator LED (the one in the middle of the board) illuminating. The board also provides a variety of logic level outputs that can directly drive colour signal lights or interface to CBUS/other logic circuits. It can detect a piece of white paper at around 2”. Pros: Can work over a long distance. Can be mounted under track or trackside. Low power requirements. Can detect entire trains, or act as a stock counter. No modifications to track/power/etc. are required. No modifications required to locos or rolling stock. Output is digital (clean ON/OFFs). Cons: Can be a little affected by ambient light. May need shielding. May need careful alignment. Relatively expensive. Track occupancy detectors 194
Back to Contents Page 5
Shuttle using infrared detectors This circuit employs the same 555 bistable chip as used in the previous shuttle circuit that used microswitches as detectors.
The microswitches are replaced with two infrared emitters/detectors, one at each end of the track. When the loco moves over one of the detectors, its output goes low and the output is wired back to the 555 chip where it triggers a change of output state. The output can be wired directly to a relay if it is a low current type, or it can be used to switch a transistor on and off.
Barcode readers We have all watched or used barcode scanners when our groceries are swiped across a supermarket checkout. The technology is widely used and bar code labels can be found on most goods. At its simplest, a bar code is a series of black bars on a white background, the width and spacing of the bars representing different characters. The bar code reader bounces light off the label as it passes and detects the changes in in the amount of light that is reflected back. In the model railway world, the reflected data is more than just an indication of occupancy; it can send back detailed information on every loco, coach or wagon that has a label fitted (see the photo for an example). Free software is available that can print barcodes on to sticky labels. However, this system is not widely used, mainly due to the complexities of integrating it into a model railway control system. Commercial barcode readers have USB interfaces, requiring computer software to decode the barcodes and act on the data found. Where multiple readers are to be used, as in most layouts, ways have to be found to Track occupancy detectors 195
Back to Contents Page 5
interface them all to a computer. While not insurmountable, it requires hardware and software expertise not widely available. Alternative options include: Hack a USB interfaced scanner to get at the TTL output. Use a home-made infrared detector as discussed earlier. Buy a barcode scanner wand that already has a TTL output. The image shows one sold for under £10 on eBay. The output from these readers still has to be decoded to extract the data. This could be achieved via the computer's software or by feeding the TTL output into a PIC whose output pins would feed other logic (or a CBUS CANACE8C). Until this system is available into a reliable kit that can be implemented by most hobbyists, it remains mostly for those who relish a challenge. Pros:
No modifications to track/power/etc. are required. Returns detailed info. Can be used to take selective action (e.g. moving points, train whistles) Can be used for on-screen announcements.
Cons:
Requires rolling stock to be labelled. Needs reader under every spot to be detected. Not easily integrated. Expensive option. Relies on keeping labels clean and unsmudged. The greater the detailed required, the longer the printed label. This may present problems with smaller gauges.
Ultrasonic detectors Ultrasonics are acoustic frequencies (i.e. they work by vibrating air) that are higher than those audible to the human ear. An ultrasonic detection system can therefore be thought of as a loudspeaker and a microphone, tweaked to only operate within a small range of ultrasonic frequencies. The products marketed by Parsonics range from operating frequencies of 14.6KHz to 420KHz and can operate at distances up to 150 feet. Ultrasonic detectors are used in car parking sensors, burglar alarms, range finding, process control, etc. The most commonly used systems operate at around 40KHz. The units can purchased separately, as shown in the image, and they are marked as TX (transmitter) and RX (receiver). Other transducers can be used as either transmitters or receivers (known as 'transceivers'). Like infrared systems, they can be used facing each (e.g. beam breaking) or mounted to detect reflections. Many circuits are available for providing the 40KHz transmission and for the detection of the ultrasonic waves. They all tend to have many components.
Track occupancy detectors 196
Back to Contents Page 5
Another option is to use the HC-SR04 module, as shown in the image. This module can be picked up for around £2.50 on eBay and consists of a PCB with both transmitter and receiver modules mounted on it, along with much of the required circuitry already mounted. Apart from the power connections, it has only two other pins. One pin, when pulsed low by a PIC, sends out a short ultrasonic burst. The other pin changes state if it detects an echo being returned (i.e. something is within its reflective range). I can adjust the PIC to switch anywhere between 1” and 24”. If necessary, you can even check the time it took for the echo to return to calculate how far away an object is (as used by car parking sensors). The problem with the cheaper ultrasonic receivers, apart from reduced range, is the wide angle of detection (some 15o in either direction). While this might be useful to see if there is any movement in an entire marshalling yard or group of hidden tracks/sidings, it limits its use to short distances in situations where tracks are closely laid (i.e. most layouts apart from larger gauges and garden layouts). Pros:
No modifications to track/power/etc. are required. Can operate over long distances. Unaffected by light. Low current consumption.
Cons:
Needs additional circuitry (either lots of components or a PIC) Large; problems in hiding on layouts. Wide detection spread, particularly at longer distances. Not recommended for continued operation at high temperatures. Not recommended for continued operation at high humidity. Subject to vibration.
Current Detection systems Previously discussed detection systems were 'spot detectors' – they only triggered when a loco or wagon passed a specific point in the track. When the loco/wagon moved beyond that point, the detector reverted to its previous state (unless a delay was added to the output). This momentary or extended change in output is often sufficient to carry out a required task such as changing a signal or sending a pulse back to a computer or a PIC. There are many occasions, however, when you want the output to stay changed as long as a section of track is occupied, only reverting back to its original state when the track is unoccupied. Consider, for example, a hidden siding in a tunnel or in a building. The train may have passed beyond a detector but still be occupying the track. You can avoid running a train into an occupied hidden section by relying on your memory or your jottings. Better still is to have an indication that all operators can see, using lights on a control panel or on a computer screen.
Track occupancy detectors 197
Back to Contents Page 5
On a layout, we could simply use street/yard lamps to indicate track occupancy. This same output can be sent back to computers for use in automation software. To achieve this, the detector must activate when a train is sitting in any part of a track section, not just adjacent to a spot detector. Current detectors work by sensing even a small current being drawn from a section of track, through a loco or adapted wagon/coach sitting on that section. Since we need to detect occupancy on different sections of track, it follows that the layout has to incorporate track sections that are isolated from each other – the biggest drawback with current detectors.
The above diagram illustrates a controller feeding one of its outputs to a common rail, while the other output is fed to each individual track section by passing through a TOTI detector. Note This is not the same as a block control system. In our example, all the sections are powered all the time. Three types of current detectors are sold by MERG TOTI-4 and TOTI-12 – diode drop based. DTC8 – transformer based. PMP7 – diode drop module for a single section.
How current detectors work There are two methods that are widely used.
Diode Drop Detector A diode, when a current is passed through it, develops a voltage across itself. This voltage remains almost unchanged over a range of different current levels, from small to large. As the illustration shows, a varying voltage source Vs (e.g. a loco controller) can produce varying current draws through a load, while the voltage across the diode, Vd, remains Track occupancy detectors 198
Back to Contents Page 5
almost constant at 0.7V. If we place two diodes in parallel, then a voltage drop of +0.7V or -0.7V can be detected across them when a load is present to complete the circuit. This positive or negative voltage depends on whether the controller is moving the loco forward or in reverse. In practice, the load is usually a loco that is sitting in a particular track section. However, a load can be rolling stock fitted with resistors on their axles, as in the image. The loco or rolling stock does not need to be moving to be detected; it could be be stationary in a siding and still be detected. The current required to allow this detection is so small that it will not cause the loco to move or overheat, but is still sufficient to generate a 0.7V voltage across the diode combination. The block diagram below shows the four main stages that the MERG TOTI board (Kit 62) uses to process the output from the diode combination. The lines shown in purple indicate the initial detection of current produced by a loco occupying the track section. The voltage developed across the diodes is passed to a chip that has four separate parts. One part of the IC produces an output if a positive voltage across the diodes is detected, with another part producing an output if a negative voltage is detected. The third part of the IC provides a delay before reverting back to a previous state, once a
voltage drop is no longer detected, while the fourth part interfaces the module to the outside world. The necessity to handle both positive-going and negative-going voltage means that the module needs a dual supply of +5V and -5V (available as MERG Kits 64 and 65). The TOT-4 and TOTI-12 modules work with both DC and DCC systems.
Track occupancy detectors 199
Back to Contents Page 5
Transformer Block Detector MERG's DTC8 module (Kit 56) also detects the flow of current but only works with DCC systems, unlike the TOTI-4 and TOTI-12 modules which work happily with either DC or DCC. Again, the output from the controller passes through the detector module. This time, instead of passing through diodes, the current passes through a transformer's primary winding on the detector module. If the track is occupied, a current flows through the transformer secondary and is detected. Unlike the diode drop version, the module's circuitry is isolated from the track circuitry and there is no voltage drop caused by its use. Current detection systems require no additional circuitry and can interface directly to mimic panel LEDS, servos boards, CBUS modules, etc. Pros:
Detects any occupancy on an entire section of track. Does not rely on movement. Can detect rolling stock. Unaffected by light.
Cons:
Need to create track sections. Requires modification to rolling stock. TOTI modules needs a split supply. TOTI modules slightly reduce the track voltage, due to the voltage drop across the diodes.
Summary of features Micro Reed Hall LDRs Infrared Barcode Ultrasonic Current RFID switches switches Effect detectors Cheap
Y
Y
Y
Y
n
n
n
Y
n
Affected by light
n
n
n
Y
Y
Y
n
n
n
Must modify loco
n
Y
Y
n
n
Y
n
n
Y
Modify rolling stock
n
Y
Y
n
n
Y
n
Y
Y
Must modify track
n
n
n
n
n
n
n
Y
n
Computer 'essential'
n
n
n
n
n
Y
n
n
Y
Stretch detection
n
n
n
n
n
n
n
Y
n
Identification
n
n
n
n
n
Y
n
n
Y
Detect stationary train
n
n
n
n
n
n
n
Y
n
Good immunity
Y
Y
Y
Y
n
n
Y
n
n
Track occupancy detectors 200
Back to Contents Page 5
Notes
Some of these are characteristics are definite (e.g. either train modifications are required, or they are not). Others are relative to each other (e.g. an RFID reader can cost over £20, while a reed switch can cost 30p, but is £6.60 for a Hector kit cheap or expensive?). Others are indicative (a barcode reader may only be susceptible to ambient light under certain conditions). The table is a quick guide only; refer to specific pages and product specifications for greater details.
Interfacing detectors Many of the detectors simply produce a change of voltage when activated and may require additional circuitry to be usefully deployed. Some examples of interfaces Direct connection
Controls devices by direct wiring to them (e.g. switching a solenoid point)
Delay circuits
Introducing a pause before reverting to previous state (e.g. keeping crossing gates open while train passes)
Latched circuits
Short pulse switches an add-on's output to stay switched, until unswitched by another pulse (usually from a different detector).
Computer
Providing control of semi/fully automated layouts via serial or USB ports.
PIC
Controlling devices by direct wiring to them (e.g. operating multiple devices, LEDs servos, etc. - including delays, latching and conditional operations).
CBUS
Providing control of semi/fully automated layouts via a CAN_SB or CANRS module.
Track occupancy detectors 201
Back to Contents Page 5
Chapter 12 RFID
RFID 202
Back to Contents Page 5
RFID Radio-frequency identification is probably the most complex and most expensive of the various detection systems. It also offers the greatest possibilities, particularly when used for automation of layouts and other computer-controlled activities. The system is covered in MERG Technical Bulletins A39/1 and A39/2. Note
RFID is not a beginner's project, requiring some electronics and computing expertise.
How it works Locos, coaches or wagons are fitted with 'tags'. Each tag is a little transmitter that has its own unique code (ID). A RFID reader module (a little radio transmitter/receiver) is placed under, or to the side of, the track. When the tag passes close to the reader it transmits its ID. The reader receives this ID and lights a LED to indicate successful reception. In this way, it acts as momentary track occupancy detector.
More usefully, the module passes the ID out for processing via a serial port, for processing by a computer via a PIC, for local/special activities The reader may consist of two parts. There is a module that is used to read and decode the tag's ID and there is a separate circuit that interfaces the reader to a computer. Both these modules, and the tags, are available from the MERG online Kit Locker.
How it can be used When linked to the programming power of a computer, the RFID system can be used for everything from a simple block detector system to hugely complex automated system. Below are the most common model railway applications as provided by RFID users: Control operations Move points; e.g. trigger point routing for express/shunter. Detect wagons coming detached, if last wagon is tagged.
RFID 203
Back to Contents Page 5
Detect a loco's DCC address, in order to control it (e.g. assigning the engine to a throttle). Generate switch lists (handling instructions) for operators of fiddle yards, goods yards, etc. Determine an item's location by looking back to the last reader it passed. Calculate the length of the train, if all rolling stock is tagged. Know when train has passed (tag in last wagon/coach). Maintain stock lists Spot if a new loco has same DCC address as one on the track. Compile sidings contents (hump yards). Generate a list of cars on the train. Scan a manifest upon coming in/out of a yard. Generate a list of discrepancies (cars not on the train that should be; cars on the train that shouldn't be). Ascertain the location of missing cars between operating sessions. Sign in and sign out locos at club layouts/exhibitions. Trigger sound effects Station announcements The fiddle yard one speaks out the destination of the approaching trains. Whistles / bells. Trigger screen announcements On-screen timetable updates. Readers can pass information onto the fiddle yard/goods yard operators as to which trains are approaching them. On-screen display of loco picture/info and train info that describes the train that has just passed over a detector.
Tags The tags used in the MERG kits conform to the EM4102 specification, which is the low frequency band operating at 125KHz. Tags are available in a range of outlines, including key fobs, wristbands, stickers and cards. The most commonly used for our purposes are either discs (available in 20mm and 30mm) or glass tags (available through MERG in 12mm and 34mm lengths). These are known as 'passive' tags, which means that they do not need a power supply to operate (very handy – no need for track pickups or batteries). As the tag passes over the reader, the little coil (look inside the glass tag) passes power from the electromagnetic field generated by the reader to the circuit inside the tag. When charged up, the tag transmits its ID. Every tag that is manufactured has a different ID number. Don't worry, we won't run out of numbers any time soon, as there are 100 billion possible tag numbers!
RFID 204
Back to Contents Page 5
Tag positioning Since we are working with low power levels, the tag needs to be as close to the reader as practical. The larger tags can harvest more power and therefore work over a greater range – which is OK when you are working with 00 upwards. However, it takes a bit of ingenuity to fit a 30mm or 34mm tag in N gauge or smaller. In most cases, the reader is mounted under the track (see later). For smaller gauges, it is common to fit the tags as low as possible under the loco/ wagon/ coach This ensures that it is as close to the reader as possible. It also minimises any losses caused by the presence of metal (e.g. weights placed in wagons). A glass tag is normally positioned from end to end along the length of the loco or wagon. Alternative positions include: Mounting the tag vertically, where undercarriage space is restricted. Mounting the tag across the buffers, with the reader standing vertical to the track. Mounting the tag on/under the roof of the coach, with the reader on an overhead mount. The larger tags and discs, due to their increased range, are often placed inside a coach or wagon's body (particularly if there is no metal floor on its chassis). Lastly, it should be noted that if two tags are located too close to each other, neither will be read by the reader.
Readers A number of 125KHz RFID readers are available commercially. The two that are used and sold by MERG are made by ID-Innovations and are the: ID-12 Smaller (26 x 25 mm x 7 mm - approx 1" square by 1/4" thick) Smaller working read range (12cm+) Uses 30mA at 5V (4.6V min, 5.4V max) ID-20 Larger (40 x 40 mm x 9 mm - approx 1.6" square by 1/3" thick). Greater working read range (16cm+) Uses 50mA at 5V (4.6V min, 5.4V max) The advertised working ranges are over-optimistic due to the usual obstructions and reflections in railway layouts. Both modules are cased in black plastic, with the connecting pins under the body. The picture shows an ID-12 mounted on the MERG reader PCB (Kit 31). Both these models have an internal aerial, with pins for connecting an external aerial. Another model, the ID-2 has no internal aerial and is not used in MERG projects as external aerials tend to be bulky and therefore prone to picking up tags from adjacent tracks. The ID-12 and ID-20 readers are both 11-pin devices and the circuit diagram shows the minimum connections used in the MERG reader PCB (viewed from underneath the reader). RFID 205
Back to Contents Page 5
When a tag is passed near the reader, the LED will light and the decoded ID will be sent out on pin 9. Pin 9 can also be used to sound a beeper, although the beeper should be driven by an added transistor. To use the reader with a higher supply voltage, a 5V voltage regulator would have to be included in the circuit. Note that no dropper resistor is required in series with the LED. Pins 3 and 4 are used if an external aerial is to be connected. Pin 8 is the same decoded output as on pin 9, only inverted.
Connection to your computer The output from the above circuit can be fed directly into a PIC, with no other circuitry inbetween. Of course, you then have to know how to write PIC programs to read the data being fed in. More common is that the output is fed into a computer, using its serial port or USB port. MERG Kit 30 includes a module that converts TTL level output from pin 9 to the RS232 signal expected by a computer's serial port. The picture shows a typical setup for a single reader.
The reader (Kit 31) feeds its ID data into the MERG serial output module. The output from the serial output module is connected to a serial cable. If your computer does not have a serial port, a serial to USB converter cable can be used, as shown in the picture. How the computer uses the processed ID is looked at later.
RFID 206
Back to Contents Page 5
Reader positioning As with tags, the positioning of readers has a marked effect on performance. There is a trade-off between sensitivity and selectivity. On the one hand, we want the best sensitivity possible. On the other hand, we don't want to pick up signals from tags on adjacent tracks. For example, using 34mm tags increases the effective range but also increases the possibility of triggering neighbouring readers that are insufficiently spaced apart. Ideally, the reader should be mounted under the baseboard, out of sight. Depending on the thickness/density of the baseboard material, this may not be possible. Other alternatives include mounting it immediately under the track (removing some of the baseboard material), at the side of the track, or above the track in certain circumstances. The picture shows an extreme case where the sleepers have been removed so that the reader can be as close to the rolling stock as possible. User experience suggests that each reader should be allocated at least a 6” square area to itself – preferably more. Other approaches include: Mounting readers slightly offset from the centre, with two adjacent tracks, to maximise the separation of the readers. Placing shielding materiel round the reader, to minimise unwanted pickup. If you are using DDC on your layout, it would be advisable to minimise potential interference between DCC wiring and reader cabling. This could be aided by careful routing of the cables. Also, as the reader connections are 3-wire (+5V, 0V and data), it is possible to use a screened single pair cable for the connections. 7/0.2mm screened wire can be used here.
Reading speed Clearly, there is a trade off between the speed of the tag, the distance between the tag and the reader, the efficiency of the tag (usually its size) and the sensitivity of the reader used (e.g. ID-12 or ID-20). The reader takes about 400mS to process a single read, so the reader has to be allowed that amount of time before having another tag passed over it. This determines the maximum reading speed for any given setup. If the tag is whisked past the reader too quickly, it may not be read properly. There is no such thing as reading tags 'too slowly'. Leaving a tag stationary over a reader, or moving it slowly across a reader, does not result in continuous readings. A tag has to leave the reading zone and re-enter again before it will be read again. If tags in rolling stock are not spaced sufficiently apart, both tags may be in the reading zone at the same time, preventing any being read successfully. Six inches to 8 inches has been suggested as a suitable distance between tags in different items of rolling stock. However, this might vary depending on the size of the tags and the efficiency of the reader. The 12mm tags used with the ID-12, for example, present a smaller reading zone than 34mm tags with an ID-20 reader.
RFID 207
Back to Contents Page 5
Concentrators So far, we have looked at connecting a single reader. In practice, a layout will require multiple readers and we can't allocate a separate serial port for every reader. The answer is to use a 'concentrator'. This module accepts the input from eight different readers and produces a single serial output. The data from individual readers are still able to be uniquely identified and processed (see later). Kit 33a is MERG's complete concentrator kit or Kit 33b can be purchased to upgrade an existing serial output board into a concentrator module. The MERG concentrator has a serial output and connects to a computer via its serial port, or USB port is a serial-to-USB converter adaptor is used. When you need more than eight readers, you can wire extra concentrators to other serial/USB ports on your computer. The MERG concentrator kit includes 'bank jumpers' that allow multiple concentrators to be used with each being individually recognised by the software. Clearly, for large layouts, there will be many readers and concentrators, resulting in extra cables between the layout and the computer and added complications in the computer software that handles them. Also, of course, you will eventually run out of computer ports. Another approach, if you are a CBUS user, is to feed the outputs from the concentrators into the single CBUS cable. A possible such interface option is the CANRP164, which allows reader output to be fed into the CBUS system. There is no kit or PCB in the Kit Locker for this module but Bob Vetterlein placed the documentation for this module in the 'Files' section in Yahoo. See the can_rpc folder in the 'Files' area of the MERGCBUS Yahoo group. Finally, in cooperation with the Rocrail team, Peter Giling has developed a range of hardware kits and PCBs that match the MERG CBUS specification. It includes an 8-channel interface between RFID reader modules and CBUS. It is known as the CAN-GC4 mergCBUS 8 Channel RFID and more details are available at: http://www.phgiling.net/ The cables that connect the readers to the concentrators can be of a considerable length, providing a little care is taken with routing the cables away from power and DCC cables. A quoted maximum "guarantee" limit of 15m has been stretched in practice to two or three times that distance which is more than enough for even the largest of layouts.
RFID 208
Back to Contents Page 5
Reader output The final output from a reader is a stream of RS232 serial data in ASCII format and this can be read by any terminal program. The terminal program has to be set to read at 9600 Baud, 8 data bits, no parity and 1 stop bit to match the format of the reader's output. Older versions of Windows provided an application called 'HyperTerminal'. This handy utility was dropped in more recent versions such as Vista or Windows 7, although you can install HyperTerminal on these newer versions if you have a valid CD of Windows XP. There are full details available on the internet if you Google it. Instead, I use a free application called PuTTY.exe. You can download it at www.putty.org
The output format Each time a tag is read, the reader module sends out 16 ASCII characters out on the RS232 connection. In fact, the actual ID is made up of only 40 bits (ONs and OFFs) but is packaged in a way that allows easy transmission and reception. Apart from the first and last byte, the contents of all the other bytes have an effect on the screen content. STX
Reader ID
Checksum
CR
LF
ETX
1 byte
5 bytes (40 bits)
2 bytes (16 bits)
1 byte
1 byte
1 byte
'smiley face'
10 characters
2 characters
Carriage return
Line feed
'heart'
Start of text (02h)
The ID shown as ASCII text
Check shown as ASCII text
Go back to start of line (0Dh)
Go to new line (0Ah)
End of Text (03h)
The STX byte informs the terminal program that a string of data is ready to be processed. The 5 bytes of the reader ID are converted into 10 readable ASCII text characters. Note All the ASCII characters are in the range 0 to 9 or A to F. Why? Because these are the values for hex notation. It makes for simple conversion from bit patterns to hex characters. The 40 bits of the ID are split into ten groups of four bits ( four OFFs and/or ONs). So, for example, if a group was 0011, then that represents the value 3 and the ASCII character '3' is transmitted. If the a group was 1011, that represents B in hex and the ASCII character 'B' is transmitted. The illustration shows the construction of a typical ID.
RFID 209
Back to Contents Page 5
The STX is displayed as a 'smiley' face, while the ETX is displayed as a heart shape. In practice, using HyperTerminal, the effect of the CR and LF result in the ETX character appearing at the start of the next line, as shown in the next illustration.
The checksum is generated by adding together all the values of the reader ID and sending this value as the checksum bytes. The terminal program also creates a checksum from the receiver ID. If both checksums are identical (it is called the XOR checksum method) then the terminal program knows that the ID has been received correctly, with no alteration due to interference, etc. The CR and LF bytes are used to ensure that the next ID read appears on the following line on the monitor screen. Finally, an ETX byte is sent to let the terminal program know that this is the end of that transmission. This illustration shows the output as seen on the PuTTY screen. Note that it ignores the STX, CR, LF and ETX characters and only displays the 10 ID characters and the 2 checksum characters.
Concentrator output The above illustrations and screenshots show the output from a single reader. Where multiple readers are in use, the output has to indicate not only the tag ID but the reader that is sending the ID. This is achieved by amendments to the ID string. A concentrator can handle 8 readers and it recognise input 1 as 'A', input 2 as 'B', up to input 8 as 'H' The STX character is then replaced by the appropriate letter. So, for example, if tag FE4000FF7637 was read from input 4, the beginning of the string is changed from STX FE4000FF7637 to DFE4000FF7637. The ETX character at the end of the string is replaced by the > character. Now every character has an impact on the screen display; all the characters are printable, with the exception of the carriage return and line feed.
Software Many existing layout control applications already support RFID input. These include RocRail, JMRI, Tcc and SSI. Users can use existing scripts, or create their own scripts, to handle a variety of tasks, including visual display updates, point switching, etc.. MERG members have also produced applications that are available for download from the MERG website. Phil Herbert describes his Train Announcer program in the Winter 2010 Journal.
RFID 210
Back to Contents Page 5
Mark Riddoch has written two programs. One uses tag inputs to display different pages from a PowerPoint slide show (great for impressing visitors at exhibitions). The other is “an Excel application based around the concept of providing a timetable sequence to a fiddle yard operator. The RFID readers are used to feed information to the operator as to the train movements.” Although the most expensive and complex of systems, RFID offers the greatest scope for layout control; scan previous Journals and the MERG website for plenty of discussion and suggestions.
RFID 211
Back to Contents Page 5
Chapter 13 Digital Command Control
Digital Command Control 212
Back to Contents Page 5
DCC - Digital Command Control Chapter 2 on Loco Controllers covered the basics of DCC. Let's start with a quick recap before we look deeper.
How does DCC work Unlike DC, which varies the voltage to the track to control motor speed, DCC has the track powered at full voltage all of the time. Altering the voltage to the electric motors takes place within each individual loco. This is achieved by fitting a little circuit board, called a 'DCC decoder', between the motor connections and the loco's wheel pickups. A DC controller only sends out the power to the track. A DCC controller, called a 'Command Station', also sends out the power. Additionally, it sends out commands to the various decoders that are connected to the track Usually the decoders are fitted to the locos but others can be fitted at the trackside, to control points, lights, signals, etc.
The illustration shows three locos on the same section of track, being operated from a single command station. They could be actually anywhere on the layout, since all the track is regarded as a single piece. Each loco is fitted with its own decoder, each with a unique identifying address (1, 2 and 3 in the example). Decoders only respond to messages that are sent to its unique address, ignoring all other messages. When a message is received that matches its address, the instruction from the command station is acted upon. The message could be to go faster, go slower, stop, reverse, etc. In the example, the operator wants loco 3 to drive forward at half speed, so he/she selects loco 3 on the command station and turns the speed control to half way forward. The command station converts those movements of the speed control into an electronic message that is sent out along the track. Although the message is received by all the loco decoders, only the decoder with address 3 acts on the message. A similar process takes place when the operator wants to move a point or accessory. The accessory decoder for that device also has its own unique address. In the example, the command station has a set of function buttons and pressing function 2 operates a semaphore signal. Digital Command Control 213
Back to Contents Page 5
With accessory decoders, the message is not picked up from the loco's wheels and pickups. The decoder is permanently wired across the track near where it is to be used. Although the decoder will be receiving messages via the track, it may require additional power for running the accessories it is attached to. Its also worth repeating some of the benefits of using DCC
Simplified wiring: no complex block/section control with switches and/or relays; fewer wires, fewer faults. Simplified working: multiple locos on same track section; consists. Improved running: PWM; fewer problems with voltage drop. Motor tuning: set the min/max voltage, acceleration/deceleration rate . More than loco motors: point, signals, lights, sound. Computer control easier: control locos; don't have to worry about block switching. Comparison of DC and DCC systems With DC
With DCC
Track voltage
Varies from 0V to max (12V?).
Always at max voltage.
Power availability
Only on sections that are switched.
All track powered at all times.
Multiple trains on same track at the same time
No
Yes No, unless you want a track occupancy system, or a very large layout.
Need to split track into blocks
Yes, for anything but the simplest layout.
Multiple operators
Entire layout controlled by a single Each operator needs own power command station. Each operator has controller. their own CAB controller that links to the command station.
Run consists
Only with some difficulty.
Yes
PWM running
Depends on controller used.
Yes
Changes to loco
None.
Need to fit encoder in each loco.
Voltage drops
Can be a problem.
Less of a problem.
Handles bemf
Depends on the controller used. Depends on the decoder used.
Motor tuning
No
Yes
Points and accessories
Need separate wiring.
Can use DCC accessory decoders.
Computer control
Generally complicated.
Easier.
Locos run straight from the box
Yes
Needs to be given a unique number.
For a working DCC system, as we have seen, we need a command station to send out the commands and a decoder that will act on these commands. So, let's start by looking at decoders in some more detail. Digital Command Control 214
Back to Contents Page 5
DCC decoders Locos draw different amounts of current depending on their size. An N gauge motor may only consume a quarter of an Amp, while large scale motors may consume a number of Amps. Accordingly, DCC decoders are produced with different current handling capabilities, at different prices. For example, the Lenz Silver Mini decoder only handles 0.5A, while the Lenz Gold Maxi decoder handles 3A. Remember to choose a decoder that can handle the loco's stall current, not just its running current. As expected, the decoders that handle larger currents are also bigger in size. The Lenz Silver Mini is only 1mm x 9mm. The Lenz Gold Maxi, shown in the bottom image, is 70mm x 28mm. A basic loco decoder is able to control the speed and direction of the motor. Most also have function outputs – connections to switch lights on headlights or lights in the cabin.
Wiring decoders to locos You can buy locos with decoders already installed in them. There is nothing inside the loco that you need to touch, although you might want to tweak the decoder to maximise performance (this is carried out externally - see later). DC locos can be converted to DCC working by installing a decoder. If you are wary about tackling the conversion, or have a difficult installation (e.g. a loco with a non-isolated frame), you can use a fitting service to do the job for you. Of course, this adds more expense to the conversion. These illustrations show what is involved in upgrading a DC loco to DCC.
The left hand drawing shows a DC loco with the power from the track being wired directly to the motor. The right hand drawing shows the track power only reaching the motor through the electronics on board the decoder. This is the electronics that controls the motor speed and direction.
Digital Command Control 215
Back to Contents Page 5
There are three types of decoder connection, and you can see two of the images at the top of the previous page. Wired – You have to solder the wires yourself. Plug – The end of the decoder has connection pins that plug into a socket. Harness – Like the plug version, only with a wire extension (as in this image).
Installing Wired Decoders If you can solder, you can fit your own decoders. There are only a few things to watch out for:
Space Finding space inside a loco body can be a problem, especially for smaller gauges. While there is often sufficient room inside a large diesel, an N gauge 0-4-0 poses a bigger challenge. Fortunately, smaller gauge locos use motors that draw less current and can use the smaller decoders. In extreme cases, the decoder can be fitted inside the loco's coal tender or a following coach/wagon. Isolation Some, specially older, locos had a split chassis. The left and right hand sides of the chassis were isolated from each other, but were used to carry current from the wheels to the motor. Ensuring isolation from chassis. This direct connection between wheel/chassis/motor tag has to be interrupted to allow the decoder to be wired in. A quick test with a multimeter will determine whether your loco uses a split chassis and requires alterations to isolate the motor from the chassis. Following colour codes The wires that emerge from a decoder follow an agreed code, as laid out in the NMRA Recommended Practice RP9.1.1. This means that whichever decoder you buy, you should be confident that the main connections are identical with other decoders. The four main wires, available on all decoders, are: Red
Goes to the loco's power pickup from the right hand track rail, when in forward travel.
Black
Goes to the loco's power pickup from the left hand track rail, when in forward travel.
Orange
Goes to the motor's positive brush.
Grey
Goes to the motor's negative brush.
The image shows a decoder wired to a Kato chassis. In some loco's, the motor is fitted in a chassis in such a way that the orange and grey leads need to be reversed, otherwise the loco would run backwards. Alternatively, the decoder's CV can be altered, as discussed later. Digital Command Control 216
Back to Contents Page 5
Note
Take great care to avoid the red and black wires shorting to the orange or grey wires, as this will almost certainly blow the decoder's main chip.
The other decoder wires may include: White
Goes to the forward headlight.
Yellow
Goes to the rear headlight.
Blue
This is always positive and is the common return for the lights and any other functions. Not provided on a 6-pin socket; available on 8-pin sockets.
Green
Provides an extra function output (if the decoder supports it). Not provided on a 6-pin socket; available on 8-pin sockets.
Here is the wiring diagram for a decoder that provides basic motor and headlight functions.
Plug-and-play decoders The decoders that have pins or harnesses are used in 'DCC Ready' locos. A DCC ready loco is one that has the wires from the track pickups, the motor and the lights all connected to a socket. The illustrations show the two most popular socket types – the 6-pin and the 8-pin. The 6-pin socket is designed for N gauge motors and is rated at 500mA continuous (750mA peak). The 8-pin socket is rated at 1.5A continuous (3A peak). Not all decoders match this specification, so check before buying.
Digital Command Control 217
Back to Contents Page 5
In DC mode, a 'dummy plug' sits in the socket, as shown in the following diagram.
This allows the loco to function as a normal DC loco. If you trace the wires, you will see that the motor and lights are simply wired in parallel across the track pickups. For conversion to DCC running, the dummy plug is removed and the decoder's pins or harness is plugged directly into the socket. The loco is now a DCC loco, with no soldering involved. You will have noticed that the 6-pin socket has no blue or green connections. Since the blue wire is used as a common return for the headlights, this method is not available. Instead, the lights are taken to the track pickups. That's OK for DC, but for DCC they only work on half wave. This reduces the light's brightness which some overcome by reducing the value of the LED's series resistor. This illustration shows how a 6-pin decoder interfaces with the loco wiring .
The DCC power from the track pickups are connected to a bridge rectifier in the decoder, which provides a DC voltage for the decoder's circuitry. The decoder shown has circuitry for controlling the loco speed and direction, along with additional circuitry to switch headlights. An 8-pin version would use its blue connection to carry a positive voltage across from the decoder into the socket, where it would act as a common return for the two headlights. Note DCC sockets and dummy plugs are available as separate items for purchase. You can buy a socket and wire it yourself, to create a DCC Ready loco. That way, you can use the loco on a DCC layout or a DC layout by simply swapping the decoder and the dummy plug. Digital Command Control 218
Back to Contents Page 5
Stay-alives You can never guarantee that a loco will always get the power it needs from the track, without any losses whatsoever. Problems caused by dirty track, dirty wheels, dirty pickups, insulfrogs, short wheelbases, etc. can lead to power glitches. In extreme cases, the loco just comes to a halt. Temporary power dropouts can lead to the loco lurching or a sound decoder's sound dropping out or starting to repeat from the beginning. Gradually, more decoders provide for the additional of an on-board power store. This stores power during normal running and powers the decoder and loco during short track power glitches. A common demonstration shows a loco running over a length of track that is covered with an insulating material. Check out: www.tcsdcc.com/public_html/Customer_Content/Web_Tools/Videos/Main.html to see an N gauge loco fitted with a TCS stay-alive running over an 18”section of unpowered track. A heavy OO gauge 16-wheeled diesel, with its large wheels and multiple power pickups can span across dirty track sections or a point frog. On the other hand, an light N gauge 0-4-0 with its much shorter wheelbase, smaller wheels and fewer pickups would benefit the most from fitting stay-alives. Commercial versions
In some cases, the stay-alives are sold as optional extras, while others are sold as a matched pair. The image shows a Lenz Gold Mini fitted with its optional stay alive, known as a 'Power 1'. An effective, although expensive, combination. Alternatives are the TCS KAT24 mentioned above and the DCC concepts “DCC-S4SAP 4 Function 8-Pin S Series Decoder With Stay Alive" available from eHattons.com. Bear in mind that commercial stay-alives have different storage abilities, with some providing much shorter support; check before you buy. Zimo decoders allow you to buy and add your own capacitors, rather than having users tied to branded storage products. DIY
If you have the experience, the skills and the confidence, you can make and fit your own stay-alives and save money. The website at: www.members.optusnet.com.au/mainnorth/alive.htm
provides details on how to tackle a range of different manufacturers' decoders. A Google search for “dcc decoder hacking” also provides details on this. Remember, this will almost certainly invalidate your decoder warranty. There is a bit of a predicament here; the smaller locos are the ones to most benefit from stayalives, yet they are the ones with the least space to house them. While it is usually possible to install a decoder inside a small loco's body, the stay-alives are much larger. The image shows a decoder and stay-alive installed inside a coach, with wire links between the coach and the loco. This works but means that the coach must always be attached to the loco.
Digital Command Control 219
Back to Contents Page 5
Accessory decoders Accessory decoders also connect across the track and get their instructions from the command station (e.g. put a light on, switch a point, move a semaphore arm). Some accessory decoder outputs can handle lights or Tortoise motors directly, using the power derived from the DCC on the track. For more power-hungry devices (e.g. solenoid motors), the decoder would need a separate power supply. This image shows the MERG Steady State Accessory Decoder kit that has 8 outputs. These outputs can control low power devices such as LEDs and Tortoise-type point motors (when used in pairs). Examples of commercial versions are the DC10 and DC20 from CML Electronics, the Lenz LS100, the Zimo MX82E, the Digitrax DS64, the ESU SwitchPilot 4. Other accessory decoders are designed to control servos. For example, the ESU SwitchPilot Servo module and the Team Digital SMC4 module both control up to 4 servos. The LDT TT-DEC-B kit is specifically designed for controlling a turntable. CML sell the MSC Scenery Animator, shown in this image. It can control a mix of devices including motors, servos and lights. It also supports creating sequences and 'flicker' effects. All the accessory decoders have one thing in common- they all are controlled by the messages issued from the DCC command station.
Wiring for DCC Chapter 3 explained that DC layouts split the track into multiple sections/blocks using lots of cuts in the track. Each section has to be individually powered using switches (or sometimes relays). The chapter also explained that for a one-operator DCC layout running a few trains, there was no need for track sections. The layout could be reasonably large and complex and still be run with a simple wiring scheme. That scheme involved running power round the entire layout, to every bit of track, allowing locos to go anywhere on layout without any section switching. This illustration shows how a simple DCC layout operates. The whole layout is controlled by a single command station. Its output is permanently wired to every piece of track on the layout. The locos get their power and operating instructions from the track. Digital Command Control 220
Back to Contents Page 5
Commercial command stations Command stations are also called DCC controllers, DCC control units and DCC throttles by various manufacturers. They are available from many manufacturers including Digitrax, ESU, Hornby, Lenz, NCE, Viessmann and Zimo. These offer a range of facilities and cover a wide price range At the lower end of the price range is the Hornby Digital Select, shown in this image. It is an entry level command station and comes with a separate power supply that provides 1A to the track. Locos are selected using the keypad and speed is controlled using the central knob. The direction of the loco is selected by pressing one of the arrow keys on the keypad. It provides basic functions such as setting a locos' unique address, its acceleration and deceleration. It can control up to 10 locos simultaneously, although the 1A maximum clearly limits the number (without extra power being added). A similar product is the Digitrax Zephyr Starter Set, with a maximum output of 3A. At the other end of the price range is the ESU ECOS 50200. It can control up to 16384 locos simultaneously, as well as 2048 points. It has a 7” colour touch screen display and the operator can use it like a mimic panel.. The user's layout is displayed on the 800x 480 pixel screen and points can be changed by touching them with a stylus. Without any additions, it only provides 4A, which is not a lot at the price being asked. The Viessmann Commander uses a similar approach with the user's layout displayed on a 7” 800x480 pixel colour touch screen, and 1.5A continuous current without a booster. The The ESU supports operating shuttles, while the Commander supports full automation if required. Both of the above expect the user to operate from wherever the command station is sited. For those who prefer the flexibility of moving around a layout while operating, manufacturers provide handheld controllers. These may plug into an existing command station or be matched with a less glamorous box containing the power unit. The image shows an example of this – the Lenz Start Set 100, which has an output of 5A. Other similar products include the modestly-named Digitrax Super Empire Builder and the Super Chief, both working at 5A. The NCE Power Pro 10A Large Scale Set, as the name suggests, is intended for O Gauge and above. For even more flexibility, some command stations get round the restrictions of having a handheld tied to the layout by a cable – by providing wireless communication between the handset and the power unit. The operator is free to move anywhere round the layout without having to find a socket to plug in the hand controller. Example are the Digitrax SCFXD8 8A system which uses infra-red communication (perhaps not the best choice for a link) and the soon to be released Zimo MX 12A system based on a radio link.
Digital Command Control 221
Back to Contents Page 5
MERG command station MERG has two kits that provide a cheaper alternative to the commercial offerings. The image on the right shows the CANCMD kit. This command station module provides up to 1A but can be connected to a booster for extra power. It connects to MERG's CBUS system (see the next chapter), which allows it to be controlled either by a suitable handheld controller or by a computer. It provides the power and the instruction messages to the track. This image shows the CANCAB kit, a handheld controller that connects to the CANCMD. It can control up to 32 locos simultaneously, along with points and accessories. Locos are selected using the keypad and speed is controlled using the thumb-operated knob on the top-left of the case. The direction of the loco is selected by pressing a button and LEDs indicate the current loco direction. Pressing the STOP button once, stops the loco that is currently being controlled. Pressing the button a second time stops all locos on the layout.
Multiple operators There may be circumstances when you want more than one person to be operating a layout. Examples are club layouts, large home layouts, or the grandkids coming round. Fortunately, many command stations allow you to connect more than one hand controller. The illustration shows three operators sharing a command station. One is using the command station controls, while the others use a wired throttle and a wireless throttle.
Digital Command Control 222
Back to Contents Page 5
Although there are multiple operators, there is still only a single DCC command station which controls the entire layout. The operators press their buttons, etc. and these actions are sent as messages to the command station. The command station translates these messages into the instructions that are sent to the track. The connection between the handheld controls and the command station is known as the 'CAB Bus' or 'Throttle Bus'. The way the bus is wired is often specific to a particular commercial DCC system, as there is no NMRA standard for CAB buses. Most manufacturer's modules are not interchangeable (e.g. CabBus/NCE, LocoNet/DigitTrax). Some use Expressnet (e.g. Lenz, Atlas, ZTC, Hornby, Roco – although they call theirs RocoNet). To allow the maximum flexibility of operation, it is common to wire the CAB Bus round the edges of a layout, with sockets at strategic points. The operator can then plug a handheld controller into the nearest socket, while moving round the layout. CAB cables commonly terminate in an RJ12/RJ25 plug or a RJ45 plug. The RJ25 plug, shown on the left looks like a plug you find on the end of a telephone, but it is different. The wires are straightthrough (no inversions) and it has six contacts. These are found on Lenz, Hornby, NCE, XpressNet/Loconet Atlas, Roco, etc. handhelds. The RJ45 plug is the type used for Cat 5 Ethernet cabling. It uses duplicate connections for increased reliability. Used by MRC, Gaugemaster, etc, handsets. Although not shown in the illustration, the CAB bus can also be used as a means of controlling a layout using a computer or a control panel.
Handling high currents As your layout grows, you may find that the 1A or 3A command station you own is not sufficient to meet the current demands of your expanding fleet of locos and accessories. If you are working in larger gauges, or running multiple locos, you can expand the capabilities of your existing command station by adding a 'power booster', sometimes also known as a 'power station'. Many command stations provide for this improvement.
Digital Command Control 223
Back to Contents Page 5
The illustration shows that the booster provides the track power and requires a beefed-up power supply to provide the higher amperage. The booster also receives the messages from the command station and send them out on the track. In all other respects, the setup runs as before. Locos still move freely throughout the layout without any block or block switches. A power booster unit is usually housed in a plain case, as can be seen in the earlier image of the Lenz Starter 111 Set. Digitrax sell 5A and 8A boosters, while NCE have a 10A version. The image shows the MERG NB1B Booster, which can provide an output of 5A or 10A depending upon the components that are used. It connects to the MERG CANCMD command station.
Large scale DCC When we look at really big layouts, the ones with many large power-hungry locos running at the same time, they need even more power than a 10A booster can handle. The answer is to use extra boosters. Unfortunately, its not that easy, as multiple boosters can't be wired in parallel with each other. The answer still lies in using multiple boosters – but with each booster providing power to a part of the layout. For the first time, we have to break the layout up into independently powered blocks, known as 'power districts'.
This is different from DC block working in a number of important respects; All pieces of track are still powered at all times. There is still a single command station that controls the entire layout. The instructions from the command station are fed to all boosters and from them to all power districts. Locos can still move freely between districts, without the need for switches or relays. It makes sense to separate a layout into distinct work areas (e.g. goods depot, marshalling yard, mainline station, etc.) with an operator in charge of the loco operations within each work area. Since each work area can expect heavy traffic, it is allocated its own power booster. That way, power districts match the main activities of the layout and the command station and its wiring does not have to carry the total current of the entire layout. Power districts result in more complex wiring. On the other hand, having separate identifiable sections can help help in tracing layout faults.
Digital Command Control 224
Back to Contents Page 5
Here is a possible configuration for a large layout.
In this example, the layout's DCC accessories require too much power to connect them to the track. In such a case, a separate cable can be taken from a booster and fed directly to the accessory modules. This is known as an 'Accessory Bus'. Bear in mind that power districts are not required for most layouts – although there is still a case for creating independent track sections for feedback purposes (see the chapter on track occupancy detectors).
Handling shorts Despite our best efforts, short circuits are a common occurrence on model railways, mostly caused by loco derailments. Short circuit protection is an absolute must to protect the layout and to avoid the serious risk of fire. You may have wondered why we bothered to have multiple power boosters instead of one giant power booster. We could, of course, build a 50A booster, instead of using five 10A power districts. Now, consider what would happen if there was a short with a booster running at 20V. Power, you will know by now, is voltage times current. So the power that would be dissipated in event of a short would be: P=IxV P = 50 x 20 = 1kW
In other words, a short would produce the same heating effect as a single-bar electric fire! No wonder, then, that command stations and boosters provide: Short circuit protection – closing down the power when an excessive current is detected. Thermal protection – closing down the power when the components inside the command station or booster are detected as overheating. Most cutouts spring into effect after about 50mS. They then test every 0.5 secs to see whether the short is removed and power can be restored. The image shows the NCE EB1 circuit breaker. Chapter 5 looked in detail at DC and DCC overload protection.
Digital Command Control 225
Back to Contents Page 5
Setting up decoders A decoder is supplied with some default settings. For example, the unique address is always set to 3. If you want to run other DCC locos on your layout then the decoders have to be given new addresses. This is called 'programming the decoder'. Apart from addresses, decoders can store all kinds of details regarding the loco's performance – minimum and maximum motor voltage, acceleration, deceleration, lights, and much more. All these performance factors are stored inside the decoder and can be altered by the user. These values are known as CVs (Configuration Variables). This illustration shows some of the internal workings of a decoder.
The loco's motor, lights, functions, etc. are all controlled by a microprocessor on the decoder. The chip contains a number of separate memory locations, each one able to store details of the way that particular loco is configured. They are called 'variables' because they are alterable and may well be different for different locos (each decoder would certainly have to store a different address). By altering the values stored in the CVs, you can tweak each loco for maximum performance.
Programming hardware Most command stations can program the contents of a decoder, although it can often be a laborious process requiring multiple button presses and some knowledge of all the CV numbers and their options. Command stations may have two outputs, with a separate output for Service Mode programming (see next). A popular alternative is to use the SPROG DCC decoder programmer, as shown in this image. You connect a power supply and the track to the terminal block and use a USB cable to connect the unit to a computer. For more details on the SPROG, check out: www.sprog-dcc.co.uk Digital Command Control 226
Back to Contents Page 5
Wiring for programming There are three ways that you can connect your programmer and decoder.
Ops Mode This is often referred to POM (Programming on the Main). The output of the command station or programmer is fed to the main layout track. This means that a loco can be anywhere on the layout and still be programmed. Even better, the alterations can be carried out while the loco is moving. So, you can check the effects of altering loco parameters (e.g. max speed, matching locos for consists, adjusting sound levels, etc.). This mode works by specifically sending the new data to a specified loco address. An example Ops Mode instruction could be considered as “Loco 7, change your acceleration momentum to 109” All the decoders in other locos should ignore the instruction and carry on as before. Note
The programming hardware, the decoder and the software must all support Ops Mode for this to work. Older command stations (Lenz Compact, Atlas Commander, Digitrax UT4 Throttle) and older decoders may not support POM. Check before using POM. Unless you are absolutely sure, consider Service Mode programming. A couple of other limitations:
You cannot read and examine the existing stored CV values while in Ops Mode; you need to be in Service Mode. Some systems don't allow you change the unique address while in Ops Mode.
Service Mode The output of the command station or programmer is fed to a length of 'programming track' that is electrically isolated from the rest of the layout. This could be an unused siding, a length of track in the fiddle yard, or even a piece of track sitting on your workbench. The programming track must not connect to the layout track in any way. An example Service Mode instruction could be considered as “Change your acceleration momentum to 109”. This is called 'broadcast programming', as the instruction is not specific to any one decoder address. Since no loco address is specified, all locos on a programming track would have their decoder CVs programmed at the same time. Your command station may have separate outputs for the main layout and for a programming track. Although this mode loses the benefit of altering CVs while the loco is in motion, it provides other benefits: You are guaranteed not to program other decoders by mistake. You can change the decoder's address. You can read existing CVs values stored in the decoder. You can only read one decoder at a time, so disconnect the sound decoder to read the loco decoder – and vice versa. You can reset a decoder back to its factory defaults (see manuals) if you get totally muddled or get unexpected results. Digital Command Control 227
Back to Contents Page 5
Test Rig Some users prefer to use a 'test rig' for their decoders. This is a board with all the connections to a spare motor, lights, DCC power etc. The decoder is either plugged in or wired to these connections. It has similar benefits to working on a programming track. However, the decoder can be programmed and tested before fitting it into a loco. That way, you know everything works prior to the fitting. The image shows a commercial tester, the NCE DTK Decoder Tester, available from Bromsgrove Models, Digitrains, etc. It has connections for both wired and plugin decoders, plus connection to the DCC power (via the track) and a connection for an external test motor. Once wired up, it can test for motor control including direction, plus four functions. The ESU 51900 is similar but has a motor mounted on the board. If preferred, a homebuilt version is easily made up from a piece of stripboard, some LEDs with resistors, and various connectors.
Programming software You can download a very useful software application called 'DecoderPro' which makes the process of setting up a decoder much more user friendly. DecoderPro works with Windows, Linux, Macintosh (OS 8.6 through 9.2 and MacOS X), and OS/2 For a detailed tour and guide to DecoderPro, check out: http://jmri.sourceforge.net/help/en/html/apps/DecoderPro/
or look at tutorial videos at: http://model-railroad-hobbyist.com/mrht_decoderpro
The examples that follow are from DecoderPro.
Decoder standards Before looking at programming a decoder, we should be aware of the standards expected from a decoder. The NMRA (National Model Railroad Association) presents itself as the lead body on helping to set standards with the model railway industry. In fact, the NMRA produce both 'Standards' and 'Recommended Practices' in relation to many electrical and electronic issues – including DCC decoders. Standards are mandatory, if a manufacturer want to claim NMRA compliance for their products. For example Standard S-9.1 describes the electrical standards for DCC (e.g. pulse amplitude, length, etc.) while S-9.2 describes how instruction packets are coded. For a mine of information, check out: www.nmra.org/standards/sandrp/consist.html
Recommended Practices cover decoder abilities but, as the title implies, not all its proposals are mandatory. NMRA do have a 'Baseline' standard for compliance, covering issues such as basic speed and direction, the need to offer up to 127 unique addresses, etc. All manufacturers have to meet this baseline to be able to describe their products as meeting NMRA conformance. The 'Extended Packet Format' (RP-9.2.1) covers additional features such as offering more than 127 addresses, functions, accessories, consists, etc. Since these are not mandatory, the list of facilities offered in a decoder varies between manufacturers and individual models. Digital Command Control 228
Back to Contents Page 5
Decoder CVs Here is a sobering thought - decoders CVs are so useful that there are hundreds of them! The NMRA standard CV definitions go up to 512, including some for future expansion. The Lenz Gold Mini, for example, stores 128 CV values. Inside the decoder, the CV values are stored as a long table containing CV numbers and the values they are currently storing. The hard way This image shows only part of the long list of CVs, being viewed on a DecoderPro screen.
This screen can be used to alter the contents of any of the CVs as long as: you know what each CV number is used for you know the effect of any value you change. Over a period of time, with regular usage, you might start to recognise the main CVs and their likely settings. Fortunately, there is an easier way. The easy way This chapter does not include a tutorial on using DecoderPro, as there is a lot of material already available on that subject, including the links provided earlier. However, a number of screenshots from that package are shown to demonstrate some of main CVs that hobbyists alter or tweak. So, if there are hundreds of possible CVs, how do you know which ones are usable with your particular decoder? Digital Command Control 229
Back to Contents Page 5
There are two ways to go:
Look up the tables provided in the manual that come with the decoder. This will list the CVs supported by your decoder. The hard way. Let DecoderPro interrogate your decoder, find out what make and model it is, and only show you the CVs that you can view and alter. The easy way.
Here is a screenshot of a decoder, using the 'Basic' tab.
You will notice that all the entries are in plain descriptive English; there is no mention of CV numbers. They are hidden from the user, so there is no need to know the CV that tweaks each parameter. In fact, two of the CV locations (CV8 and CV7) store the make and model of the decoder. When DecoderPro reads these CVs, it knows what that particular decoder is capable of and only shows you its variables. In the example, CV8's stored value is 99, which mean that it was made by Lenz, while the value of 51 in CV7 means that it is a 4th generation model that is capable of handling BEMF. But you don't need to know this, as Decoderpro figures it out for you. CV1 stores the current unique address of the decoder. This is the one that is factory set to 3 when purchased and needs to be altered when using multiple locos. You may have noticed that some CVs have a numeric value, while others are simply storing 'On' or 'Off'. Each CV can store a byte of data, which means values between 0 and 255. That is a waste for on/off values, so some CVs split the byte up into 8 separate bits. Each bit can then store a 1 for On and a 0 for Off. Again, this is all invisible to you. In the above example, CV1 CV7 and CV8 store values, while CV29 uses individual bits. CV29, bit 0 is handy if you have wired your decoder's motor wires incorrectly and the loco goes in reverse when you want it to go forward. You can either dismantle the loco and rewire the motor – or alter bit 0 so that the error is corrected in the decoder's electronics. Digital Command Control 230
Back to Contents Page 5
If you want the loco to be able to run on DC layouts as well as DCC tracks, you set CV29, bit 2 to Yes. Here is DecoderPro's 'Basic Speed Control' screen:
CV2 sets the loco's minimum working voltage, so it stores a byte of data. The motor is supplied with this voltage as soon as the operator advances the speed control to the very first notch. There is no need to turn the speed knob part way round, just to get the loco moving. CV5 sets the loco's maximum voltage that will be supplied to the motor. So, for example, a shunter will be prevented from racing round the yard. The screenshot of DecoderPro's 'Motor' screen shows three options.
Digital Command Control 231
Back to Contents Page 5
CV3 sets the acceleration momentum. If you suddenly jerk the speed control higher, the loco will not take off like a bullet. Instead, it will gradually accelerate until it reaches the speed set by the command station. The rate of acceleration is controlled by the value stored in CV3 and may be different for different trains. For example, a small 0-4-0 pulling a long rake of coal wagons would be set to a slower than normal rate of acceleration. CV4 sets the deceleration rate. Trains jerking to a halt is not very realistic, so CV4 lets you set the rate at which the train comes to a halt. Even if you suddenly reduce the controller's speed to zero, the train will slowly brake to a halt. Again, the value set will depend on the loco is an express train or a shunter. CV5 sets the BEMF repetition rate for maximum performance for that loco. See the chapter on Loco Controllers to remind you of how BEMF works. This option will not be present if your decoder does not support BEMF. Here is a screenshot of DecoderPro's 'Speed Table' screen.
It is used for ultimate control over the speed of the loco for different setting of the command station's speed control. It is mostly used to match the performance of multiple locos, to allow smooth-running consists. As you alter CV values, they are temporarily stored by the software. When you are finished altering values and setting, you write all the changes away to the decoder. Remember, these are only samples to give you an idea of the process. Read the tutorials for more details.
Digital Command Control 232
Back to Contents Page 5
The remainder of this chapter is for those who are curious about the inner workings of DCC. It is not required to use DCC, but gives an insight into the way messages are constructed and handled.
Inside a DCC packet A DCC command station sends both power and decoder instructions to the track – both at the same time. The power is delivered as a continuous repetition of pulses, as shown in the illustration.
First it swings positive then negative, in what is described as 'bipolar DC'. This is passed through a bridge rectifier in the decoder to obtain the DC power that the decoder, motor and lights use. The decoder's specification calls for a minimum swing of 7V in each direction and a maximum of 22V. Here is a table of common voltages. Common DCC track voltages, by gauge Z
N
OO/ HO/ O
Large scale
10V-12V
12V-14V
14V-16V
20V-22V
Since the voltage is constantly changing polarity, we can slightly alter the length of time it remains at at any one polarity. In other words, we can alter the pulse width to introduce digital information on the signal. In the above illustration, we can see that a shorter pulse represents a '1' logic while a longer pulse represents a '0' logic. A 1 bit last 58usecs (microseconds) positive and 58usecs negative – a total of 116usces. A 0 bit last 100usecs positive and 100usecs negative – a total of 200usces – although this can be increased to 9900usecs under certain circumstances. This is the approximate equivalent to a 7KHz signal. The command station's instructions to change speed, direction, etc. are encoded into a stream of 1 and 0 bits to send out with the DCC signal. Note It is possible to run a single DC loco on a DCC layout, although not part of the official DCC specification. You set the command station to an address of zero and moving the speed control results in the 0 bit being stretched so that it appears more like a DC signal.
Digital Command Control 233
Back to Contents Page 5
This image is an example of an actual DCC signal, as captured by an oscilloscope and shown unedited. This is the signal that is sent out of the command station and this is what is received and processed by the DCC decoder.
And here is the same image, edited so that the positive and negative transitions are more clearly identifiable.
Although it looks a bit of mess, it contains the DCC instructions, packaged in a way that does not get in the way of supplying the power to the decoder and motor.
Digital Command Control 234
Back to Contents Page 5
This illustration shows how a baseline DCC packet is made up.
Both positive and negative transitions are used to provide power. From a packet point of view, the same information appears in both the positive and negative transitions. That is why the bottom section of the illustration is ignored. The DCC packet is made up of several different parts: The Preamble This is a series of '1' bits that is used to alert decoders that a packet is about to be transmitted, allowing the decoder to synchronis its timings with the incoming signal. There is a degree of confusion on the number of bits required, with 10, 12 and 14 bits being stated from different sources. The answer lies in the NMRA Standard S-9.2: “A digital decoder must not accept as valid, any preamble that has less than 10 complete one bits, or require for proper reception of a packet with more than 12 complete one bits. A command station must send a minimum of 14 full preamble bits.”
The Packet Start Bit This tells the decoder that the preamble is ended and the message data is about to begin. If the first bit of the message happened to be a '1' bit, the decoder would not know when the preamble ended and the message began. To prevent this, the preamble is always followed by a '0' start bit. The Address Byte This byte contains the address of the decoder that is to act on the instruction. All others with different addresses will ignore the rest of the packet. If the address is one byte, it is for decoders in the 1 to 127 range. For address above 127, there will be two address bytes. The Data Start Bit This informs the decoder that what follows is the instruction data. The Data Byte For simple instructions, there will only be a single byte of data, with two bytes being used for more complex instructions.
Digital Command Control 235
Back to Contents Page 5
The Error Detection Byte There is the possibility of the incoming message being corrupted by electrical interference or interruption to the packet reception due to dirty track/pickups. To avoid acting on corrupted signals, the command station finishes the transmission of the packet with an error correction byte. This is a checksum on all the data sent in the packet. The decoder calculates its own checksum on the incoming data. If the two checksums are identical, the decoder knows that the packet is genuine; otherwise, it rejects the packet. This illustration shows the actual message that was contained in the packet.
The Address Byte stored the eight bits 00000111. This is the binary number for 7, so the message was for the loco that is fitted with a decoder with the address of 7. The Data Byte breaks up its 8 bits into three distinct groups of bits. The first two bits stores 01 which indicates that what follows is loco direction and loco speed data. The next bit is a 1, indicating an instruction to go forward. The remaining five bits are 11111, which indicates full speed (00000 being stop).
Handling errors Not all the instruction packets arrive intact at the decoder end. Packets can get interrupted by dirt on the track or poor wheel pickups. Packets contents can also get distorted due to electrical interference. The error correction byte prevents incomplete or garbled messages from being acted on – but the packet is still lost. In most circumstances, this is not a great problem, as the command station sends out the packets are repeatedly. So, if there was only one loco on the layout, all the packets would be directed at that decoder address. If there were three locos on the layout, each would receive their own packets on a time-sharing basis. Given the pulse widths specified in the NMRA documents, a command station could issue up to 180 three-byte data packets per second. If there is only a single loco on the layout, using a baseline working, it is capable of receiving 180 instruction messages per second. When there are 10 locos operating on a layout, they could expect to receive up to 18 instructions per second. If the decoders are using extended packet formats, up to 110 five-byte packets can be sent every second. Unless you are operating an extremely busy layout in a very harsh electrical environment, the loss of packets should not pose any problems. Digital Command Control 236
Back to Contents Page 5
Handling congestion Although packet losses don't usually prevent decoders from eventually receiving their own messages, the lost packets represent loss of 'bandwidth' – every interrupted or corrupted packet is one less useable time slot. The command station can only issue between about 100 and 180 messages per second and every lost packet reduces the number of valid messages on the system. Let us consider a bad case of congestion. A layout is running 50 locos, each with an additional sound decoder. The 100 decoders have to share the 110 packets per second, which mean that they might expect an average of 1.1. packets per second. If a decoder loses one of its packets, it has to wait about 2 seconds before receiving a duplicate message. For a speeding express, that might mean the difference between stopping and crashing into buffers or points, overshooting a platform, etc. This can be minimised using CV11, which is a packet timeout variable. This can be set to bring the loco to a halt if no commands are received after a preset time. Such drastic occurrences are not likely to happen on most layouts but designers have to consider the worst case. There are a number of ways to combat congestion, with the main ones being queuing and prioritisation. Once a decoder receives a command, it acts on and continues to act on that same instruction until it is given a new command. In theory, therefore, a single command should suffice. In practice, as we have seen, periodic repetition of the command ensures that the packet arrives at the decoder. At any one time, the command station is storing a list of all the packets that need to be sent out periodically. If there are too many additional incoming requests to the command station, there will not be sufficient time slots to send them all. The command station has to form a queue to allow all the packets to be sent eventually. When there is a queue, the command station has to decide the order in which the packets will be sent out and this order could be constantly changing. Decisions could include: Placing new packets ahead of older packets in the queue, since it is likely that the older packets have already been received by the decoder. This regards responding to changes in the system as more important than the repetition of older messages. Placing packets controlling sound and/or functions ahead of speed and direction messages. This recognises that the operator does not make rapid speed changes in any given time period (human movement being slow compared to the speed of the system). If the system supports feedback, track occupancy sensors would be given a high priority, as they affect a loco's speed and position. Advanced consisting, also called Decoder Assisted Consist, saves packet bandwidth by having a single command station packet controls all the locos in a consist. With the use of congestion controls, several hundred locos can be run simultaneously – more than most operators could ever imagine
Digital Command Control 237
Back to Contents Page 5
Measuring DCC voltage Checking for the presence of a DCC signal is easy enough. You can use a car light bulb, a LED with a dropper resistor, or a multimeter set to the AC range. They will all tell you if DCC is available at the point you test. If you use the multimeter, it will also tell you if you are suffering from any voltage drop at any point, just by comparing the reading with that leaving the command station. Getting an accurate measure of the DCC voltage is a little more complex than you might first imagine. You can avoid any problems by using the RRampMeter by DCC Specialities, available from DCC supplies and Digitrains. Although expensive, it has a 2% accuracy. Just connect the two left-hand terminals to the point to be tested, to get an accurate reading of the DCC voltage at that point. It is designed so that these terminals can be held across the track, making for a quick check on voltage presence and amplitude. It can be used as a hand-held tester or it can be permanently installed in a control panel. It can also read current, as described later. Expensive models aside, most multimeters are unable to accurately read DCC voltages. Multimeter on DC range To measure DC, you just place a multimeter's leads across the controller's output terminals. However, DCC is more like AC, since it's polarity constantly switches (hence its description of bipolar DC). So, every pulse of one polarity is followed by a pulse of the opposite polarity – cancelling each other out and producing no meter reading on DC. The only exception to this is to set the command station to address 0. This places the output in DC compatibility mode and provides a reading, although not too accurate. Multimeter on AC range Most digital multimeters are designed to read voltages that are derived from the mains supply (i.e. either reading the mains voltage or the AC voltage output from a transformer). They expect AC readings at 50Hz (UK, Australia, etc.) or 60Hz (USA, Canada, etc.) and also expect the waveform to be a sine wave. The meter's electronics makes the necessary 'averaging' processing prior to displaying the reading based on these expectations. DCC though, operates at a much higher rate (approx 7KHz) and is not a sine wave. The meter cannot sample at a fast enough rate and this introduces readings that can be anywhere between 10% and 40% different from the true voltage. These readings are, at best, only a guide or can be used for comparison purposes. Using a true RMS meter A meter than can accurately report voltages on waveforms that are not sinusoidal is known as a 'True RMS' meter. A commercial example is the Fluke 115 for industry or the RRampMeter for model railways. Unlike the cheaper average responding meters, true RMS meters can sample faster, process better and produce much more accurate readings. If you know someone with a True RMS meter or a RRampMeter, you can compare the readings with your own meter, note the difference and use it in future meter readings.
Digital Command Control 238
Back to Contents Page 5
Measuring DCC current Like voltage, getting an accurate reading of DCC current requires using a True RMS meter. The illustration shows the RRampMeter connected between the command station's output and the track. Wired this way, it gives readings of both DCC voltage and current (assuming that there is a load on the track such as a loco to draw current). The meter can read up to 28V and 10A.
DIY projects The RRampMeter, sells for over £70 at the time of writing, which is around the same starting price for industry's digital True-RMS meters. If you are looking for a cheaper, homebuilt, alternative, try out the projects that are explained on these websites: http://www.wiringfordcc.com/track.htm#a4 http://home.cogeco.ca/~rpaisley4/DCCvolts.html http://www.awrr.com/dccacces.html http://www.members.optusnet.com.au/nswmn2/DCC_Meters.htm#Ammeter
A DCC 'sniffer' If you are adventurous and feel the need to examine the DCC packets, have a look at: www.opendcc.de/elektronik/dcc_sniffer/dcc_sniffer_e.html
The module shown connects to the track and plugs into a computer's USB port. The software description reads: “This software allows for a complete tracking of all commands on the rails as well gives sophisticated trigger features to capture only special events. Local LEDs provide a quick overview of the status and the actual DCC commands.”
Digital Command Control 239
Back to Contents Page 5
Chapter 14 CBUS
CBUS 240
Back to Contents Page 5
An introduction to CBUS Many excellent layouts would further benefit from improved efficiency and greater functionality if it could successfully tackle a couple of problems:
The huge amount of wires and connectors used, particularly on layouts built using multiple boards. The lack of two-way communication, getting feedback from points, train detectors, automating some features, even adding computer control.
The CBUS 2-wire layout control system was developed by MERG members Mike Bolton and Gil Fuchs, to tackle these issues. Lets start by looking at some the problems with traditional layout wiring.
The conventional way These layouts have a central control panel that is used to activate points, switch lights etc. This involves running wires from each switch and pushbutton to each point, light or accessory. On a large layout, this results in masses of wires running under the baseboard. Where multiple boards are used, this collection of wires has to be carried over between baseboard sections, using multipole plugs and sockets. The sheer number of wires and connections increases the complexity and fault liability of the layout.
The DCC way The previous chapter on DCC showed how points and accessories can be operated by sending signals along with the DCC power. Accessory decoder modules connect across the track and get their instructions from the command station. This cuts down on wiring, with the accessory decoders only requiring power from the layout's power bus when handling high-current devices. In many respects, it is a 2-wire control system, although it is was really designed for oneway communication – from the command station to the decoders. Although the NMRA recognises the need for bi-direction working (see RP-9.3.1 and RP9.3.2), it is about the loco decoder sending information back to the command station. Helpful though this is, it does not cater for a range of other needs such as a point or track detector sending back information. The other limitation is how the accessory decoders are controlled by the operator. While some operators are happy to use buttons on a handheld controller, many would still prefer to be able to operate the layout's points and accessories from a control panel. They would also like feedback on track occupancy, etc. to be fed back to the control panel. Another limitation of DCC is that all control passes through the command station and there is no provision for local autonomous activities using the DCC bus. What we need, then, is an accessory system that combines the benefits of a 2-wire system with true 2-way communication, the ability to use mimic panels, the ability to have modules talk to each other over the two wires without using any central intelligence, and the ability to provide all this with or without the use of a computer. This is what the CBUS system offers – plus more.
CBUS 241
Back to Contents Page 5
The MERG CBUS way Imagine building a new layout consisting of four boards. With CBUS all you need do is run four wires the length of the layout – two for power and two for the control system. No matter how many switches, button, lights, points, track occupancy detectors, accessories, etc. you now add to the layout, you still only need those four wires. The accessory connections between boards are always just these four wires – not the scores of wires associated with conventional wiring. Like DCC, all accessories are linked via messages. These messages can be transmitted by small modules that can be fitted anywhere on the layout. Indeed, you can have multiple control panels if you like. You could have a mimic panel for a main station, one for a goods yard, and so on. Or, if you prefer, you can control the entire layout from a single panel. A message could be an instruction from a control panel switch to a point motor controller, telling it to switch the point. A message could be from a track occupancy detector to a light on a control panel, informing that a siding or loop is occupied.
This diagram shows some of the range of options that are provided for by the CBUS system. Some of them give instructions, like the panel switches or the train sensors. Others act on these instructions, like the range of point motor controllers, lights, relays, etc. All these modules, and more, are produced as kits by MERG and you can choose which
CBUS 242
Back to Contents Page 5
ones best meet your needs. Lets look again at our imaginary four-board layout which is currently empty apart from a power bus and a two-wire control bus – both running the length of the layout. If we lay track for a goods yard on one of the boards, we can install a CBUS output module to control their points. The module is connected to the nearest point on the 2-wire bus, to its power supply and to the point motors. This is called a 'consumer' module since it cannot create any messages. It can only act on incoming messages. To control the points, we need an input module that can send the instructions to the points module. The input module is called a 'producer' module since it creates messages when its switch inputs are altered. Like the output module, it connects to its power supply and to the nearest point on the CBUS. It uses a set of switches as inputs (ideal for a control panel). This illustration shows a basic minimum setup for a CBUS system.
When you throw a switch, the input module recognises the change and sends a message on to the CBUS wires. It is picked up by the output module which translates it into a change of output on the corresponding pin. So, for example, throwing a switch on the input module's pin 3 might result in moving the point motor that is attached to pin 5 (or whatever pin you choose) of the output module . Two relatively inexpensive modules allow 8 switches to control 8 points. The modules could be at opposite end of our layout, since they can connect anywhere along the CBUS wiring. As we extend our layout, we can add more switch modules and more point modules as before. We could have 50 or 100 switches on a control panel operating 50 or 100 points – and all using the same two CBUS wires! Another benefit of CBUS is the ability to get feedback from the layout. This illustration shows an input module whose input pins are connected to track occupancy detectors. When a train enters that section of track, an input pin's voltage is altered and this results in a message being sent out onto the bus. On the control panel, this messages is received by the output module which illuminates the corresponding LED on the mimic panel.
CBUS 243
Back to Contents Page 5
Example layout Here is an example of implementing CBUS on a typical layout. The layout has 28 servooperated points and is spread over several boards to allow long rural stretches of track. The points are in four distinct groups. The fiddle yard has 6 points at one end and 5 at the other end. Each station has 7 points and there is a small group of 3 points on the main line. The lower illustration shows how the points could be operated by five CBUS output modules (a typical output module having 8 outputs). Since the points on the left side of the layout are fairly closely bunched, you could even use two 8-output modules at that end.
If we were to examine the underside of this layout's baseboard, we would only see the loco's power bus, layout power and the CBUS wiring. Four (or five) boards would be positioned close to the groups of points. If we decided to add extra points or features to the middle section of the layout at a later date, we would only need to add another module to the CBUS. The layout would also have a control panel attached to the same CBUS. It would contain the switches and the modules that send out the control instructions to the board's output modules. The panel can look and operate like a conventional ‘hard wired’ system.
Advantages of CBUS The many advantages of CBUS include: A big reduction in wiring and connectors, with all the accessory modules sharing the same power bus and the same 2-wire cotrol bus. Fewer faults. With far fewer wires and connections (e.g. no multiplugs between boards), there is much less to go wrong. It supports feedback, You can get confirmation that points have moved, tracks are occupied, etc. It is easier to make changes and additions. Adding that extra railway station or goods yard requires no baseboard wiring changes. Just add the modules to the existing power and CBUS wires. It is suitable for automation / computer control. CBUS 244
Back to Contents Page 5
Different levels of use While CBUS offers a comprehensive range of facilities, you can use as much or as little of it as you need. If you already have a fully functioning layout, you may want to use CBUS output modules to add additional features. If you are planning a new layout, you may decide to use a full implementation of CBUS across the entire layout. It is up to you. Here are some suggestions for different levels of implementation:
Output modules to switch on lights in buildings. Output modules to operate signals. Output modules to operate animations (e.g. cranes, level crossings). Feedback from track detectors to indicate occupation of hidden sidings. Control of point motors. Control of locos (CBUS includes modules to control DCC locos). Computer automation of layout.
The first four suggestions can be added to any existing layout without any changes to its existing wiring and control systems.
What is CBUS CBUS is based on the widely used CAN Bus (Controller Area Network) system, adapted for use with model railways. The CAN bus was developed for cars in the 80's and found its way into many industrial, medical and military pieces of equipment. Everything from a coffee machine to the Las Vegas monorail works using the CAN bus, not forgetting Otis elevators, fork lifts, radar stations, drones and CERN. The CAN bus, with tens of millions of controllers sold each year, is a tried and tested system. It is robust, reliable and resistant to external interference. After all, you would expect nothing less from a chip that is controlling aircraft, cars, lifts and medical equipment. Due its widespread use, the main interface chip is easily available and is cheap. CBUS is based on the industry standard CAN bus, using its interface chips and basic principles. In addition, it gives special consideration to how it can aid model railway hobbyists.
Benefits of CBUS
Low cost. Not tied to any manufacturer. Works with any scale or gauge. Works with DC or DCC layouts (although loco control is DCC only). Works with both small home layouts and large club layouts. Operates on wiring lengths of up to 500 metres, enough for all but the most ambitious garden layouts. Provides manual, semi-automatic or automatic control of devices (see later). Can be used on new layouts or integrated into existing layouts. Available as a range of self –build kits, with all parts and construction notes supplied. Module construction only needs basic soldering skills. Easily set up. No programming skills required (additional modules are available for those who wish to have computer control of their layout). Lots of support from MERG members.
CBUS 245
Back to Contents Page 5
The CBUS cable The pair of wires that carry the messages throughout the layout should be 'unshielded twisted pair'. This simply means that the two wires should be twisted round each other to prevent unwanted interference. There is no need to buy shielded cables that have foil covering. In fact, you can make your own cable from any wires as long as they are loosely twisted together as shown in the image. Since the wires only carry messages, there is no need to use heavy gauge wires. The speed of the system dictates that the maximum length of the bus is 500m, so it can handle very large layouts. The bus has to be 'terminated'. This involves fitting a resistor across the two wires. Without this, there is a danger that signals will reach the end of the cable and reflect back down the wire, interfering with the wanted signals. Depending on your age, you may remember seeing 'ghousting' on your TV picture, which is an identical phenomenon. Fitting a resistor allows for the signal to be absorbed and prevents reflected electromagnetic waves from distorting the messages. The resistor is also required for proper CAN arbitration to work (i.e. preventing two producer modules from sending messages at the same time). A 68 ohm resistor is fine for small cable runs; for most layouts, fit a 180 ohm resistor at each end of the bus. The bus wires should run the length of the layout. It need not run in a straight line; it can snake along to go where it is needed. Stubs are allowed; these are short stretches of cable that run off from the main bus (e.g. to feed a board in a T-shaped layout). Stubs should not exceed 3m in length.
Connecting the modules Adding a CBUS module to a layout consists of a few steps:
Connect the module to its power supply. Connect the module to the CBUS cable. Connect the inputs (e.g. from track occupancy detectors) or outputs (e.g. to point controllers, lights, etc.) Configure the module the way you want it to operate (see later).
The connections can be soldered, or use connectors. Plugs and sockets can be used to allow the quick replacement of a faulty unit (handy at exhibitions). Once connected to the CBUS network, modules can be used in various configuration:
Between the layout's modules and a control panel. Within the layout (e.g. the arrival at a station brings on the station lights) Between baseboard panels (e.g. providing communication between multiple operators) Between the layout and a computer.
You can use one of these, or all of them, depending what you want to do.
Expandability At its simplest, a layout using CBUS need only have one module that sends commands and one module that acts on the commands. However, the CBUS was devised to allow for huge expansion potential. You can fit an unlimited number of consumer modules, if they are used in SLiM mode (more later). Producer modules are limited to 110 nodes (the CBUS name for a producer module) on a single segment (an unbroken stretch of CBUS cable). Since some modules can handle 64 inputs and some can handle 64 outputs, a single segment can handle 3520 inputs and 3520 outputs. If that is still not enough, you can connect different segments
CBUS 246
Back to Contents Page 5
using a bridge module, until you reach a maximum of 65,536 nodes on the system! Depending on how they are configured, each node can produce up to 65,536 'events' (different instructions). So, the system can handle 4.29 billion different instructions!
How CBUS works CBUS modules either send messages or receive messages (although there is one module that can both send and receive). Some modules only ever send messages on to the bus. They are called ‘producers’ since they produce messages when activated. An example might be a module connected to track occupancy detectors. This small board may have inputs from, say, eight track occupancy detectors. The message sent by the module would depend upon which change is detected. An even simpler example might be a bank of off/on switches used to control points, signals, trackside lights etc. The group of switches could be held in a frame or could be mounted on a mimic board/control panel. Throwing a switch produces a message that uniquely identifies which switch was thrown and whether it was switched on or off. In these examples, changing one of eight inputs to a module results in one of sixteen unique messages being transmitted on the bus (one message when an input goes high and a separate message when that input goes low). Other modules are designed to only ever receive messages and to act upon them. These are called ‘consumer’ modules and examples include point actuation and LEDs on mimic boards. So, for example, a message received by a module’s might result in one of its output lines being switched on or off. These output lines can be used to switch eight different point motors. Another module can light up to 64 different LEDs depending upon the input messages received. The user does not need to know how the message is constructed and how it works in order to use the system. The user simply throws a few setup switches and the module’s electronics take care of everything.
A small example The diagram shows a simple setup, with a baseboard that has eight points and eight track occupancy detectors. The control panel has eight point switches and eight LEDs. Along with power connections, the CBUS links the control panel and baseboard and carries messages between them. The baseboard modules are connected to the user’s point activation units and track occupancy detectors. Assuming that the four modules have already been set up (see later) their operation is straightforward. So, if a train activates track detector number 5, the producer module sends out a unique message on the bus. The consumer module on the control panel
CBUS 247
Back to Contents Page 5
translates that message into switching on LED number 5. Similarly, throwing point switch 3 makes that producer module transmit a unique message over the bus that results in point number 3 being activated.
CBUS Modules Most CBUS modules use the same basic arrangement shown in this illustration. It has three main parts: The CBUS interface, known as a 'CAN
transceiver'. Every CBUS module needs one of these so that it can send to, or receive messages from, other modules connected to the bus. A PIC chip, which is like a small computer that stores a program and data. Its contents are programmable so that it has multiple possible uses, depending on what the module is used for. This is the 'brains' of the module. The Input/Output, which is the connection to the hardware devices. A producer module, for instance, might have switch inputs, while a consumer module may have outputs for controlling point motors.
MERG are constantly developing new modules, and providing new features to existing modules. Using PICs is a benefit, as the program built into it can be updated; there is no need to throw away a module when an improved version comes out. Let us look at the range of CBUS modules that are available.
Eight input module This is known as the CAN-ACE8C. It has eight input connections. Each connection is normally held to +5V internally. Bringing that connection down to 0V results in a message being sent out on the CBUS. Removing the 0V lets the connection revert back to +5V and this results in a different message being sent on to the CBUS. So, the module can produce two different messages for each connection – one when a connection is at +5V and one when it is at 0V. Any device that can switch between a high and 0V voltage can be used as an input. The most common inputs are toggle switches, microswitches and track occupancy detectors, although other electronic modules could also act as inputs. If this module is mounted in a small control panel (e.g. to control a small layout or a small local goods yard in a larger layout), it would use switches to control points/lights on the layout. If the module is mounted under the baseboard, it could be used to send back information to a control panel, that a track section is occupied or to indicate the direction a point is facing.
CBUS 248
Back to Contents Page 5
Eight output module The is known as the CAN-ACC8. Apart from the connections for power and the CBUS cable, there are eight outputs that can be switched between 0v and anywhere from +5v and +15V. The little white square is actually a preset potentiometer that sets the voltage. Being able to vary the output voltage means that it can switch 5V relays or 12V relays, LEDs, lamps and even small DC motors. Each output can handle a maximum current of 500MA, although the sum of all outputs must not exceed 1A. It is commonly used to operate points and animated accessories (crossing gates, semaphore signals, etc.) using servo motors. The outputs can operate relays to switch point frogs. Also used to remotely switch lights in buildings.
Simple example This image shows how to connect a single input module (the CAN-ACE8C) to a single output module (the CAN-ACC8), so that throwing a switch controls the LED. For simplicity, it does not show the power connections.
The points to note are:
The CBUS has CANH and CANL wires, marked as H and L on the modules. The H connection on a module should be taken to the H wire of the bus; similarly, the L connection on all CBUS modules should be taken to the L wire of the CBUS. A terminating resistor of 68 ohms has been wired across the CBUS. The variable resistor has been rotated to produce a +5V output. The switch is connected to input 4 of the input module, while the LED is connected to output 1 of the output module. Input 1 does not have to control output 1 and so on. You can decide which output will be switched by any particular input.
Four solenoid module This is known as the CAN-ACC4. It is specifically designed to handle four solenoid-type point motors, such as the Hornby, Peco, Atlas or Seep type.
CBUS 249
Back to Contents Page 5
The module has a capacitive discharge unit (CDU) built in to the board and connects directly to the point motors as shown in the illustration. Each point is allocated two messages – one to operate the point in one direction and another to operate the point in the opposite direction.
Four point motor module This is known as the CAN-ACC5. It is specifically designed to handle four motorised point motors, such as the Tortoise, Hoffman or Conrad types. The illustration shows a Fulgurex point motor being connected – although not to scale. The module's outputs consist of four sets of two connections. Each point is allocated two messages – one to place a voltage across the two connection (e.g. as in the illustration) and another to reverse the polarity of the connections. The recommended maximum current is 1 amp total for continuous operation. Note
The three output modules shown above can be controlled by using two unique messages for each output. If you wish, you can have several, or all, of the outputs controlled by the same pair of messages. This is useful for route switching, where one command can move a set of points and another command resets the route.
Mimic panel modules The eight input and eight output modules are ideal for mounting under baseboards, to operate points and send back feedback. The benefit of the CBUS system is having small local modules where you need them rather than having wires trailing all over your layout. They are not very useful, however, when used on a control panel or mimic panel, unless you have a very small layout or are using a number of small controls panels spread across the layout. For large panels, there is a need for modules that can handle larger numbers of switches or LEDs. Consider, for example, having a control panel with 50 switches and 50 LEDS. You would need 7 input modules and 7 output modules built into the panelwhich would be very cumbersome. So, MERG have a couple of modules that are specifically for use in control panels. This module is known as the CAN-ACE3. It is a switch interface that can handle 128 toggle switches or 64 pairs of push buttons.
CBUS 250
Back to Contents Page 5
The module on the left is known as the CAN-LED. It can handle 64 LEDs. Using just one of each module in a control panel, you can control up to 64 points/accessories and indicate feedback from 64 devices. The large sockets on the right of each module are provided for the connections to the switches/pushbuttons/LEDs.
CAN-Relay 16 Although designed for control panels, the CANLED can be adapted for use on your layout, to operate relays. If you have a need for a large number of relays on your layout, you can fit the 'CAN-LED to relay driver interface'. As the name suggests, the CANLED board can be converted from operating 64 LEDs to operating 64 relays. Each relay board can control up to 16 relays and you can attach four boards to one CAN-LED. So you can, if you wish, control 64 relays over a single 2-wire connection.
CANSERVO8 The CAN-ACC8 module can switch eight outputs on and off and these outputs can be taken to servo driver modules. MERG's Servo-4 modules handle four servos. So, if your layout had multiple points in close location to each other (e.g. station throat, fiddle yard, goods, yard) you would need three modules to control those eight points. For such dense use of servos, there is an alternative for CBUS users. The image shows the CANSERVO8 module which combines a CBUS interface with the control of up to eight servos that plug into the connections shown on the right of the module. There is manual method (switches) of setting up the CANSERVO8 module; each servo's settings have to be set up using computer software (see FLIM later). CBUS 251
Back to Contents Page 5
Computer Interface The CBUS system was designed to able to be set up and used without the need for a computer. For those with computers and a bit of knowledge, MERG have a kit known as the CAN-USB. It connects to the CBUS and plugs into a USB port on your computer. With appropriate software, it can provide useful new facilities such as: Testing CBUS modules, to confirm whether they are functioning correctly. You can send messages on to the CBUS from the computer and see whether an output module responds as it should, Alternatively, you can check an input module by examining its messages on the computer screen. Controlling a layout. Using computer software (covered later), you can operate points, accessories and even trains from a computer screen, using your mouse. Setting up your modules, using the free configuration software for MERG members. This saves fiddling with switches and For those with older computers (ones with no USB sockets), MERG produce a kit for plugging into a computer's serial port. It is known as the CAN-RS and is useful for setting up modules, although a bit too slow for controlling larger layouts.
DCC Command Station For many, the benefits of CBUS lie in controlling points and accessories, or getting feedback from track detectors, etc. For DCC users, the CBUS system extends into controlling locos using a couple of modules. The image on the right shows the CAN-CMD module which is a complete DCC command station. It has connections for power, the CBUS and the layout track (either directly or through a power booster). It can be controlled via the CBUS in either of two ways: Using a handheld controller. Using computer software For those who like to walk round their layout while controlling their trains, MERG have a CAN_CAB kit. The image shows a completed CAN-CAB module, with a cable to connect to the CBUS. Pressing the buttons, or turning the speed knob, results in instructions being sent to the command station which are translated into control messages for the layout's locos. An alternative, for those so-minded, is controlling the command station via the computer. This would require a CAN-USB computer interface module to be fitted. Suitable software is looked at later. CBUS 252
Back to Contents Page 5
CBUS messages So far, there has been a lot of talk about modules sending messages and receiving messages. We do not need to know exactly how a message is made up in order to use the system. We do, however, need to consider a few general points: At the sending (i.e. producer) end A message should be sent when something changes in an input module – e.g. a switch has been thrown or a button has been pressed. CBUS calls this an 'event' The message should say which pin has changed – e.g. pin 4 in our example. The message should say how it has changed – e.g. it has been changed to a high or a low voltage. So, part of the message might say “The fourth input connection has changed to low” or “The fourth input connection has changed to high” So far, so good. But a system might have a number of producer modules and each one of them will have a input connection number 4. If they all sent out the same message, output modules would not know which one they were supposed to act upon. The message, therefore, also has to contain information about which module is sending the message. This is achieved by giving each producer module its own unique number, known as a 'node number'.
Consider the example in this diagram, if the producer module with the switch attached was given a node number of 7. Throwing switch 4 from high to low would produce a message with the following essential information: “Node 7’s fourth input connection has changed to low” Every message now contains information on what has changed and what module sent the message. The simplest way to allocate a module its unique number is by throwing the switches highlighted in the illustration. On the bus When an event occurs in a producer module, it sends out a message without knowing whether any consumer module will respond to it. It just sends the message anyway. This is
CBUS 253
Back to Contents Page 5
known as 'fire and forget'. The producer module does not check for any acknowledgement that its message has been received by another module. There are a number of possible situations.
There may not even be any consumer modules attached to the bus. The messages are being sent but no-one is listening. There may be many consumer modules attached to bus. They will all receive the message but none may be set up to act on the message. A single module may receive the message and act upon it. Several modules may receive and act on the same message.
CBUS messaging is not equivalent to sending a text message to a particular friend, where that person's phone is the only one to receive the message. It is more like the Saturday night Lottery broadcast. The results of the draw are broadcast to all who want to listen but only a few will act on the message. At the receiving (i.e. consumer) end Since all producer modules have their distinctive node numbers, we can now distinguish between messages. We may know, for example, that all the messages from node 5 come from track occupancy detectors, while messages from nodes 4 and 6 come from switch panels, and so on. In such a case, we could use an output module to drive panel lights when it receives messages from node 5, while using an output module for driving points motors when messages are received from nodes 4 and switching lights in buildings when messages are received from node 6. The next step is to decide what each module should do, if anything, with an incoming message. You have a lot of flexibility in how you configure your output modules. This is achieved using the bank of switches shown in the earlier illustration. The options include:
Ignoring a message. This will be the most common reaction, since most messages are of no interest to the majority of consumer modules. A consumer module's outputs all being dedicated to the same type of outputs – all LEDS or all point motors. A consumer module (e.g. the 8 outputs of the CAN-ACC8) being used various purposes – some connections switching lights, others switching relays or point motors. Different outputs of a consumer module being activated by the same message. This allows a single switch on a control panel to change a group of outputs – very useful for setting up routes and signal aspects.
Setting up modules For a basic 8-input producer module, the only setup needed is allocating a node number to the module. At its simplest, you can throw a couple of switches and the job is done. CBUS modules can be set up using switches or using a computer. Once set up, a module acts in exactly the same way, regardless of what was used to configure it. It is just two different ways to achieve the same end. Modules set up by switches and modules set up by computer can be used happily on the same layout. SLiM The default mode is called 'SLiM' (The Small Layout Model). This method has the following advantages: CBUS 254
Back to Contents Page 5
It allows modules to be set up using switches – no computer is required. Modules can be configured and tested before fitting under the baseboard.
It also has a few disadvantages:
The setup process can be fiddly and error-prone, unless you really concentrate. You have to carefully document what outputs are changed by which inputs, otherwise it will cause serious inconvenience if you have to make changes later. Replacing a faulty board is more time-consuming than with FLiM. Reconfiguring the module means fiddling with switches while perched under a baseboard, or removing the module for alteration.
The exact method of configuring SLiM CBUS modules is documented in each kit's instructions. There are also excellent articles that cover practical implementations of CBUS. For further reading on this, see “Experiments with CBUS” by Howard Watkins (MERG Journals for Spring, Summer, Autumn Winter 2008 and Spring 2009) “A Starter CBUS Project” by Davy Dick (MERG Journals for Summer, Autumn and Winter 2009).
FLiM The method using a computer for configuring modules is called 'FLiM' mode (The Full Layout Model). This method has the following advantages:
You just fit and wire the modules, then all configuration takes place while sitting in front of your computer. The configuration software maintains a database of all the modules, what triggers them and what their outputs do. No need to keep paper records. Changes in your layout track plan or points routing are easily dealt with as the software updates all the changed relationships for you. It is quick and easy to replace a faulty module. Plug in the replacement module then download the previous module's settings into it from the database. Complicated configurations, such as the CAN-ACE3 and the CAN-LED are easier to accomplish using software. The CANSERVO8 module can only be configured via a computer. Future complex modules may also require computer configuration.
FLiM also has a few disadvantages: It needs a computer. It needs a CAN-USB module. The configuration process takes a bit of getting used to.
The FLiM setup The illustration shows the setup for configuring modules.
CBUS 255
Back to Contents Page 5
A CBUS-to-computer interface module, the CAN-USB, is plugged into the USB port of a computer and connected to the CBUS cable. The module to be configured is connected to the CBUS and to its power supply. A consumer module can be switched between SLiM and FLiM modes by holding down the pushbutton for about 8 seconds, until the yellow LED illuminates (indicating FLiM mode) or the green LED illuminates (indicating SLiM mode). The computer should have a software utility, called the FCU (FLiM Configuration Utility) installed on it. The utility creates and maintains a 'configuration file' which stores the configuration details for all CBUS modules on the layout's bus. Unlike SLiM, which only allocated node numbers to producer modules, every module is allocated a node number in FLiM mode. This is necessary so that the utility can identify individual consumer modules for configuration. Here is a typical configuration screen for a CAN-ACC8, eight output module. Each of its eight outputs has been given a handy text description (Relay 1, etc.) and the boxes shows what states the outputs can be switched to.
It shows that when the 'Switch 1' event in the producer node called 'Mini Switch Panel' is activated, the Relay 1 output is switched; all the other outputs are unaffected by this incoming message. When many modules are connected to a layout, giving meaningful names to all the producer modules and their events, plus all the modules and their outputs, makes later identification and understanding much easier. There is an excellent Guide, written by the utility's author Roger Healey, which explains the process in great detail.
CBUS 256
Back to Contents Page 5
You only use the computer during the setting up operation, or any subsequent additions or alterations. It does not need to be permanently connected, unless you decide to automate, or semi-automate your layout with other control software. Notes This chapter only provides an overview of the basics of CBUS. CBUS is extensively covered in MERG's Technical Bulletins (there are 10 different Technical Bulletins in the G32 list). There are also many practical articles in back copies of the MERG Journal. The MERG CBUS system is constantly evolving with new boards being added that offer even more features and greater flexibility. They begin as a member's idea, followed by a circuit diagram, followed by making a PCB available. If the demand is sufficient, it will appear as a full kit of parts. So … watch this space!
CBUS 257
Back to Contents Page 5
Chapter 15 An introduction to transistors, ICs and PICs
Transistors, ICs and PICs 5
Return to Contents Page 4
Transistors, ICs and PICs These three semiconductors can be found in all but the simplest of household, industrial, military and medical electronic objects – and model railways. This chapter is only an introduction to these components, as they are very wide in their scope and there is a lot of detailed information out there. Fortunately, we can do a lot with them without having to delve too deeply into their inner workings. This chapter only hopes to give a flavour of these semiconductors, highlighting some of their main features. All three types are fascinating, offering unlimited prospects for model railways.
Transistors These are available in a range of shapes and sizes, using different materials and providing different functions and different power handling capabilities. They are generally used in two ways: As an amplifier, to boost small audio or radio-frequency signals. As an electronic switch, to control LEDs, relays, etc. As the images show, they have three wire leads. In most transistors, these are called the emitter, base and collector. Although other types are used, we will examine the most common types of transistor – those known as PNP and NPN types. The difference lies in their physical construction. A PNP type has a layer of n-type semiconductor that is sandwiched between two layers of p-type semiconductor. The NPN type is more common nowadays and it has a layer of p-type semiconductor that is sandwiched between two layers of n-type semiconductor. The illustration shows the symbols for the two types. It also shows how current flows through them. With a PNP type, the collector is taken to 0V while the emitter is taken to the positive supply. This is the reverse for NPN types; the emitter is taken to 0V. In both cases, the base connection can be thought of as a tap that regulates the amount of current flowing between the other two connections (another type of transistor, the FET, even calls the connections the 'source', the 'gate' and the 'drain'). The PNP transistor Applying a voltage across the emitter and collector produces a current flow between them. If you now gradually increase the voltage between the base and emitter, the current flow will be reduced until it completely stops (known as 'cutoff'). Conversely, decreasing the voltage across the base/emitter junction, increases the flow of current between the emitter and collector.
Transistors, ICs and PICs 6
Return to Contents Page 4
The NPN transistor Applying a voltage between the emitter and collector produces no current flow. If you now gradually increase the voltage between the base and emitter, the current flow will be increased until it reaches the maximum that is possible with that transistor (see below). Conversely, decreasing the voltage across the base/emitter junction, decreases the flow of current between the emitter and collector until it eventually stops.
Gain and saturation There is a direct relationship between the input current and the output current of a transistor and this is called its 'gain'. For example, a BC547 transistor (an NPN type) has a maximum current gain of 800. So, a current of 1uA (one microamp) flowing from base to collector should result in a current flow of 800uA from collector to emitter. Similarly, a 2uA base/emitter current should result in a 1.6mA collector/emitter current and a 10uA base/emitter current should result in an 8mA collector/emitter current. This current amplification cannot carry on indefinitely, as the BC547 can only handle a maximum current of 100mA from collector to emitter. Once the transistor reaches the 100mA flow, any further increase in base/emitter current has no further effect on the output current. This stage is known as 'saturation'. The larger power transistor shown in the above picture is a TIP122 and is an NPN type with a gain of 1000 and a maximum current of 5A. So, a 1mA base/emitter current should result in a maximum of 1A collector/emitter current. As with other power transistors, its collector is bonded to a metal plate to allow a heat sink to be fitted to transfer away heat when high currents are being drawn. Note The arrows in the above illustration show the flow of 'conventional current' (see chapter 1) which thought that current flowed from a positive potential to a negative potential. In fact, actual current comprises a flow of electrons which is attracted to a positive potential (the opposite of the directions shown in the arrows). As long as you are aware of the distinction, you will not be puzzled when different diagrams and explanations describe current flow differently.
Further reading That was only a brief outline of the transistor's main characteristics. If you want to know more about transistors, here are a few places to look: www.electronics-tutorials.com/basics/transistors.htm www.kpsec.freeuk.com/components/tran.htm http://vsagar.com/2011/12/how-npn-transistor-works-understanding-forward-reversebiasing-of-an-npn-transistor/ www.rason.org/Projects/transwit/transwit.htm www.electronics-tutorials.ws/transistor/tran_4.html
Also, see Electric Circuit Basics 6 by John Matthews, in the Jan 2006 MERG Journal.
Transistors, ICs and PICs 7
Return to Contents Page 4
Practical examples Here are some example circuits which might further explain how transistors work.
Single LED This circuit uses an NPN transistor, with its emitter taken to 0V and in this configuration acts as an electronic switch. The 1k resistor limits the current through the LED (and also through the collector-emitter junction). As shown, no emitter/collector current will flow and the LED will be unlit. If we now throw the switch, conventional current flows from +12V through the 100k resistor and through the base-emitter junction. The 100k resistor is used to limit the maximum base-emitter current. The smaller current through the base-emitter junction results in a much greater current through the collector-emitter junction and the LED will light. This circuit is used to illuminate a much brighter 100mA LED and uses a TIP122 power NPN transistor. The 150 ohm resistor limits the maximum collector current. The output from a TOTI (Train On Track Indicator) or other electronic module is unlikely to be able to provide the larger current requirements of this high-current LED. This is solved by using a power transistor switch like the one shown. In this case, the output of the other device is used to produce the TIP122's base-emitter current. Once again, the smaller base-emitter current results in a much greater collector-emitter current.
Logic probe Many modellers own multimeters, which are extremely useful tools for testing and faultfinding on layouts and on electronic modules. The ability to read different voltage levels helps trace bad joints, etc. But, when dealing with modules that work on digital inputs and outputs, you only want to know whether a particular point in your circuit is at +5v or at 0v. That is where a logic tester is handy. This circuit works by connecting it to the +5v and 0v of the module you are checking. Then you touch any point in the circuit with the probe. If +5v is on that point, a green LED lights up. If there is 0v at that point, the red LED lights up. All other voltages, or points not connected to anything, either keep the LEDs unlit or dimly lit. The BC547 is an NPN type and current flows from its collector to emitter when its base is at Transistors, ICs and PICs 8
Return to Contents Page 4
a higher voltage than its emitter. The BC557 is a PNP and allows current to flow from its emitter to collector when its base is at a lower voltage than its emitter. That's why the red LED lights on 0V while the green LED lights on 5V.
Relay Some relays operate with a relatively small current. Others require a transistor to act as a current amplifier to switch the relay. You have to check the manufacturer's specifications. In this circuit, the relay resistance is 250 ohms, therefore requiring 48mA to operate it. The BC547 provides the required current amplification. As mentioned in a previous chapter, the diode prevents an back EMF from damaging the transistor when the relay is switched off.
Integrated Circuits These are often simply referred to as 'ICs'. As the description implies, it is a single electronic component that carries out a task that would normally require multiple individual components. The semiconductor layers inside the chip are created in such a way that they carry out the functions of multiple transistors, diodes, capacitors, resistors, etc. - all integrated within a single small casing. With the advent of ICs, large boards jam packed with components were replaced by much smaller, more efficient, lower current, cheaper devices. Just how far this process has gone can be demonstrated by the 'brains' of a humble Xbox 1 computer which uses 5 billion transistors – all built in to a device the size of an After Eight mint! A simple IC may have only 6 pins to connect to the outside world, while complex ICs may have 80 external pins. There is a huge range of ICs and each one is designed to carry out a particular function or set of functions. Their internal workings are pre-set at manufacture to carry out specific tasks and these cannot be altered, although their performance can often be tweaked using external components. Examples include: Voltage regulators – to ensure a constant fixed supply voltage output, regardless of most input voltage fluctuations and changing current demands. Timers – to create timed pulses for scale time clocks, control brightness of LEDs, control servo movements, control loco motors using PWM (pulse width modulation). Amplifiers – to boost the level of audio or radio signals, or act as current amplifiers for switching or control purposes. Convertors - to convert digital values to analogue values (and vice-versa), to convert voltage levels into frequencies. Transistors, ICs and PICs 9
Return to Contents Page 4
Logic – to implement simple switching decisions (e.g. the output only changes to low when all its inputs are set to low) or more complex logic operations (e.g. using only 4 input lines to change the output level of any one of 16 output lines). Display drivers – to control bargraph displays, 7-segment LEDs and LCD displays. Remote control encoders/decoders – to control toys, televisions, garage openers, etc. Memory chips – to store data for later use (e.g. in digital cameras, audio players, etc.) or to store applications while being run in computers. Motor drivers – to handle DC motors, stepper motors and servo motors. All of these IC chips are connected to devices or components in the outside world. Sometimes the components are connected in order to adjust performance (within the range allowed by the IC). For example, the settings of a timing chip are set by the choice of external timing components. In other instances, the IC acts on external stimuli (e.g. a remote control encoder) or controls other circuits (e.g. a voltage regulator).
Practical examples Here are some typical examples of integrated circuits. Voltage regulators Chapter 1 looked at power supplies and voltage regulation. One of the simplest ICs is the voltage regulator. It has only three pins. The one shown in the illustration is a 7812, which means that it produce a steady 12V output, at up to 1.5A, even when the voltage at its input varies from 15V DC up to 35V DC. The 7812 has an internal voltage loss of 2.5V, so needs a minimum of 14.5V DC input to ensure a smooth regulated output.
Its case, and common pin, are bonded to a metal plate to which can be bolted a heat sink. This is necessary when dropping large voltages at high currents, to prevent the IC overheating. When used in a circuit for this purpose, it would also normally have smoothing capacitors fitted. The circuit is reproduced to demonstrate that even a simple IC can be complex inside. The 7812 has over 40 internal 'components', including 17 transistors.
Transistors, ICs and PICs 10
Return to Contents Page 4
Flashing LED This is a very well-known, well-used circuit and many variations can be found on the Internet. It uses a 555 timer IC. This chip can be used as a timer, an oscillator or a pulse generator (as in this circuit). Here, the output is a continuous stream of pulses that make the LED flash. The frequency at which the LED flashes is controlled by the charging and discharging of the capacitor The rate of charge/discharge is determined by the values of the two resistors and the capacitor Pin 3 goes high while the capacitor is being charged and goes low when the capacitor is being discharged. The 555 timer chip is also used to control the delays in a shuttle – a loco that runs back and forth along a section of track. Apart from altering the frequency of the pules, the mark/space ratio (the time the pulse stays compared to its off time) can be altered and this is used to good effect to control servo motors, dim LEDs, etc. For more details on 555 timers, read John Matthew's article in the Winter 2006/7 Journal, or look at http://talkingelectronics.com/projects/50%20-%20555%20Circuits/50%20-%20555%20Circuits.html
Motor control This diagram shows an L293D, an integrated circuit described as 'Quadruple Half-H Drivers'. They are designed to be used in pairs, where they offer bidirectional control (i.e. the outputs can be reversed – handy for DC motors).. Pins 1,2 3, 6 and 7 on the left side comprise one set of drivers and pins 9, 10, 11, 14 and 15 make up an identical set of drivers. It is designed to control high current devices including inductive loads such as motors, stepper motors and relays. In this circuit, it only requires few resistors to make it into an IC capable of independently controlling two motors.
Transistors, ICs and PICs 11
Return to Contents Page 4
Pin 16, marked in red, is taken to a +5V supply and the pins marked in black are taken to 0V. These supply the power for the IC. The illustrations shows a single motor being controlled. Pin 9, marked as EN2, is the 'Enable' pin for the right-hand side of the chip. It is taken to +5V to make these drivers active (taking the pin to 0V disables these drivers). Pins 11 and 14, marked in blue, are taken to the DC motor. These outputs are capable of handling motor currents up to 500mA (1.2A peak), so cover most locos. Pins 10 and 15, marked in green, control the direction of the motor. This table shows the motor logic. Pins 15 and 10, labelled as DirB1 and DirB2, are held high to +5V by the two resistors. The motor will not move. Bringing either of these pins low to 0V will make the motor rotate. The three-position centre-off switch controls the motor direction, with the centre position bringing the motor to a halt. The power for the motor is provided at Pin 8 and can be from +4.5V to +36V – probably +12V for model railways. Note that the power for the motor is independent of the supply to the IC, making it able to cover a wide range of motors with differing voltage requirements. If required, the input to Pin 8 can even be a PWM (Pulse Width Modulation) source. See the chapter on Loco Controllers for a description of PWM. The pins on the left hand side of the chip perform in exactly the same way if a second motor is to be controlled. While the above circuit uses a switch to control the motor, it can easily be controlled by logic from other circuits (train detectors, PICs, computers, CBUS modules, etc.). contains two identical sets of driver circuits.
PICs While very useful, integrated circuits are dedicated to a single function, or set of functions. This has led to the development of a range of 'microcontrollers' which, like ICs, combine a lot of components into the chip, but allow the user to program its activities. This opens up a whole new approach, since the same PIC chip (Peripheral Interface Controller) can be employed to carry out many different actions depending on what program it contains. The biggest seller of microcontrollers (with sales in billions of units) is Microchip Technology Inc, who manufacture a large range under the heading of PICs.
How they work PIC microcontrollers can be regarded as similar to a computer, as shown below. They both have a CPU, the main brains of the system; they both have a memory area to store the program being used; they both a smaller memory area to store data when the power is removed; and they both have connections to the outside world. Naturally, the computer system is much more sophisticated. Then again, all the parts that you see on the PIC diagram are embedded inside the chip. This arrangement makes PICs extremely flexible.
Transistors, ICs and PICs 12
Return to Contents Page 4
There are other manufacturers who make microcontrollers, including Arduino, PicAXE, AVR and Propellor. These, and the range of PICs, share the same advantages:
Low cost. Easily programmed and reprogrammed. Many can be programmed in situ (i.e. the chip remains in the module it is designed for). Large body of support through documentation, source code, user groups, etc.
PICs look very similar to ICs. Many have the same shapes, same number of pins, etc. However, they are easily distinguished by the markings on their bodies. For example, an L293D is an IC while a 12F675 is a PIC. PICs are available in sizes from 6 pins to 144 pins, in either QFN (Quad Flat No Leads), DIL or surface mount pin formats. Despite their size and pin differences, they have common features such as inbuilt oscillators and I/O (input output) pins to interface to external devices. Beyond that, different PICs offer additional facilities such as: ADC
Analogue to Digital Conversion. The ability to read analogue values into a pin. Useful for reading the voltage levels from potentiometers, heat sensors, light sensors, etc. A circuit inside the PIC converts these analogue values into digital equivalents that the PIC can process.
DAC
Digital to Analogue Conversion. The ability to turn stored digital values into analogue equivalents that are sent out of a PIC's pin Useful for creating sound effects, playing sound samples (e.g. WAV files), etc.
PWM
Pulse Width Modulation. The ability to generate pwm outputs on one or more of a PIC's output pins. Useful for controlling motors, dimming LEDs, etc.
Timers
The ability to generate signals in regular time intervals. Useful for data communications, counters, etc.
Some also provide a range of interfaces with commonly used communications systems, such as CAN, USB, UART, Ethernet, etc.
Transistors, ICs and PICs 13
Return to Contents Page 4
Programming a PIC This is a whole new subject and whilst the actual steps will depend on the programmer and hardware being used, a typical process is: Write a program on a computer, using commercial software or free software such as
JAL (Just Another Language). Turn the program into the form that the PIC will understand (usually called a compiled 'hex' file). Connect the computer to a 'PIC programmer' Connect the PIC programmer to the circuit board being used. Insert the PIC into the circuit board. Copy the hex file into the PIC.
Practical examples Here are some typical examples of PIC microcontrollers for use with model railways.
Dual purpose flasher Apart from the LED and its resistor, the PIC only uses two other components. All the decision making, timing and output switching is done inside the PIC as it carries out its stored program. In fact, there are two separate programs stored inside the PIC and the choice of which program to run is determined by how pin 5 is wired. Pin 5 can be wired either to +5V or 0V in this example. When it is connected to +5V, the PIC detects that Pin 5 is at a high level and runs a welder emulation program. This produces periods of LED flashing followed by pauses. When pin 2 connects to a white or blue (or maybe both) it simulates the arcing of a welding machine. When pin 5 is connected to 0V, the PIC runs a program that emulates the pulsating lights that you see on top of tall buildings and structures to act as aircraft warning lights. Unlike the rapid on/off output provided with the welding program, the output slowly illuminates and dims a red LED.
Traffic Lights This circuit uses a larger PIC, as it needs more output pins than are available on an 8pin PIC. Again, it uses only two components, with all the timing, sequencing and LED switching being carried out by the single program stored inside the PIC. It uses six pins as outputs, to provide a fourway traffic lights system. These are covered in greater detail in the chapter on 'Pocket Money Projects'.
Transistors, ICs and PICs 14
Return to Contents Page 4
Controlling 4 Servos Here is a simplified version of the MERG Servo4 board that is used to control four servos (used for operating points and various animations). Its main features are: It has four inputs that are normally held high but can be brought down to 0V using switches, the output from a track occupancy detector, a CANBUS module, or any other 5V digital output. Each input, when switched between +5V and 0V, alters the corresponding servo's rotation (input 1 controls servo 1, etc.). The PIC can be connected to a computer, using the serial port input connection. The computer's software application can set the amounts of rotation (the 'endpoints') for each servo. The final settings can be stored in the PIC's internal memory. This PIC, therefore, uses digital inputs, pulse width outputs and a serial interface. For more information on PICs, just do a Google search for 'PIC tutorials' – there are more than you can read. For information on the JAL programming language, a good starting point is this website: http://justanotherlanguage.org/content/tutorial_book
Transistors, ICs and PICs 15
Return to Contents Page 4
Chapter 16 Interfacing
Interfacing 16
Return to Contents Page 4
Interfacing
What is interfacing We use interfaces every day. We communicate with each other using speech, sign language and the written word. We communicate with each other over distances using interfaces such as the telephone, radio, texting, social networks, etc. We use interfaces such as ATMs and credit card readers. We interface with our computers using keyboards, touch screens, mice, monitors, etc. The computer input/output devices can use electronic interfaces such as USB, Ethernet, wifi dongles, serial ports, HDMI, SATA ports, etc. In the model railway world, we interface with our layouts using the switches, knobs, lights, etc. on our control panels and also using our loco controller. The electronic interfaces may use direct wiring, DCC, Cbus, Loconet, etc. In all the above cases, interfaces enable communication between separate, usually dissimilar, things. For example, human to computer, computer to printer, etc.
Electronic interfacing From our point of view, interfacing has two main purposes: Connecting input and output devices to an electronic module. Connecting two electronic modules to each other. You may have built some kits or bought some electronic modules. That raises questions such as: What things can I connect as inputs to my modules (e.g. switches, track occupancy detectors, etc.)? What things can I connect as outputs to my modules (e.g. relays. LEDs, etc.)? Can I connect two modules to each other? Can I connect modules to each other even if they work at different voltages? If these things are possible, how do I do it? This is a very wide-ranging area, as there are so many different circuits and devices but it is still possible to look at the general approaches. Apart from DC power to the track, most circuits interconnect using digital signals, not analogue. A module's pin is either high or low. Many electronic circuits use a 5v power supply (or a 12v supply reduced to 5v). So their inputs and outputs are designed to work at 5V or 0V. However, the auxiliary power from many controllers is either 15VAC or 12V DC. Consequently, some modules are designed to run on 12V. This chapter looks at connecting modules and devices of various kinds, so that they interact with each other without any problems. Interfacing 17
Return to Contents Page 4
Connecting inputs In model railways, the inputs to our electronic circuits will mostly be expecting to detect changing voltage levels. Sometimes the changes will be analogue and sometimes digital. With a few exceptions (e.g. CBUS, DCC decoder) the voltage levels are compared to 0V. So a 5V reading means that it is 5 volts more positive than the 0V supply line. The task for the various input devices is to convert their changes into voltage changes at a module's input. Sometimes this will involve converting from changes in light or magnetic fields, or current, sound, temperature or pressure changes.
Switch inputs This is probably the most common interface to an electronic device. In the example shown in the illustration, the module's input is detecting a change of voltage. With the switch open, the input line is held by the 10K resistor to a high voltage. The resistor is known as a 'pull-up resistor' as it pulls the input up to the supply voltage under normal conditions. When the switch is closed, the input line is taken down to 0V. So the input switches between 0V and the supply voltage level. In many circuits, this would mean switching between 0V and +5V. Of course, the switch could be replaced by a push-button, a microswitch or even the contacts from a relay.
Output to Input This illustration shows the output of one module connected directly to the input of another module. This is common in digital circuits where the first module's output switches between the supply voltage and 0V, and the input of the second module operates on the same voltage changes. Note Where the two modules operate on different voltages, special arrangements may be necessary to allow them to interface without problems (see later).
Analogue input Some circuits require an analogue voltage as its input. This illustration is a cut-down version of a circuit that illuminates an LED for a set period when the light at the LDR drops below a set level. The voltage at the junction of the LDR and the resistor/variable resistor combination changes with the light level.
Interfacing 18
Return to Contents Page 4
This analogue change of voltage is taken to the transistor – the purple line shows the transistor's analogue interface. At a certain input voltage level, the transistor's output level will change from high to low. This change is connected to the timer's input – the red line shows the digital interface. The variable resistor determines the voltage fed to the transistor and is used to set the level at which the module switches the LED on and off. The main interface here is the one between light level and voltage. Another light-to-voltage interface is that of the infrared detector. The illustration shows the TCRT5000 Reflective Optical Sensor. Its use in model railways is explained in the chapter on 'Track Occupancy Detectors'. The output voltage is a function of the distance between itself and the object reflecting the infrared light. The values of the two resistors are not critical , with different users having values between 100R and 1k and between 4k7 and 20K.
Magnetic inputs In this case we are using magnetic fields to change voltage levels. The simplest example is the reed switch which is just a switch that operates when a magnet is placed close to it (see the chapter on 'Track Occupancy Detectors'). It can be used in place of the switch or push button shown earlier. It is essentially an interface between magnetic fields and a digital voltage output (the reed switch is either made or released). An electronic version (i.e. no physical movement) of this is the Hall Effect switch. It produces a change of voltage at its output when a magnet is placed close to it. Since the Hall Effect switch's output is quite small, many Hall Effect sensors also contain a built-in high gain amplifier. They are available as either linear output (the output voltage is directly proportional to the magnetic field) or digital (the output is either high or low). Some have 'open collector' outputs which mean that the output has to be provided with an external load across which the voltage will develop.
Other inputs Some devices can be directly connected to a module's input. These include pressure pads (which act like switches) and temperature sensors. Other devices require additional electronics to make them work. These include current detectors, sound detectors and RFID sensors. All the components are mounted on its own board and can be treated as an output device (see the earlier Output to Input diagram). Interfacing 19
Return to Contents Page 4
Connecting output devices Your electronic modules have outputs that are designed to control and operate devices on your layout. These include control panel lights, motors, points, signals, gates, uncouplers, sound, smoke, etc. Since these devices may operate differently and have different voltage or current demands, the module has to be able to cope with those requirements.
LEDs In most cases, the current capacity of an electronic module's output is capable of switching an LED on and off - except for high-power LEDs which are looked at next. This illustration shows a LED being connected to a module using a resistor to limit the current through the LED. The actual value of the resistor used depends on the voltage and current requirements of LED. When the module's output goes low, there is a voltage difference between the its output and the power supply. This illuminates the LED. When the module's output is set to high, there is a high voltage on both ends of the LED and it will not illuminate. This circuit is an example of 'sinking output'. The load (LED and resistor) are provided with a high voltage from the positive supply, while the output provides a path for the current to flow to 0V. In effect, the module's output pin has 'sunk' to the level of 0V.
This illustration shows the LED being wired to 0V. In this case, the LED will illuminate when the module's output pin goes high. When the output is low, there is no voltage difference across the LED and it will not illuminate. This circuit is an example of a 'sourcing output'. One end of the LED is connected to the 0V of the supply. When activated, the module's output pin rises to the level of the +V supply. The output pin is now the 'source' of the current flow through the LED. In most cases, a module will be able to work in either mode, so both of the above connections are valid. Some components, are capable of sinking higher currents than they can source but you are unlikely to come across them.
Interfacing 20
Return to Contents Page 4
This illustration shows a module's output being connected to two LEDs that are connected in series across the power supply, along with their dropper resistors. The junction between them is connected to the module's output. When the output goes low, there is a voltage difference between the output pin and the +ve supply. The module sinks current through the green LED from the supply. The green LED illuminates. Since both ends of the red LED are at 0V, it stays unlit. When the output goes high, there is a voltage difference between the output pin and the 0V of the supply. The module sources current through the red LED from the supply. The red LED illuminates. Since both ends of the green LED are at the same voltage level, it stays unlit. This circuit is useful in a number of applications: Switching control panel LEDs from green to red when an error occurs. Indicating which way a point is set Changing lights for oncoming trains when it enters a section of track that is fitted with an occupancy detector.
High power LEDs As the chapter on 'Scenic Lighting' explained, LEDs specifications detail the maximum current that the LEDs can operate on. In practice, most can still illuminate at well below the maximum rating. This means that normal LEDs can be connected most modules that have a digital (i.e. high or low) output. There are occasions when you might want a module to switch a high brightness LED. As they need a higher current than most modules can supply, you need to use a transistor as a 'driver' to interface a low current output module to a high current component. These illustrations show two such circuits.
The one on the left uses a transistor as a switch for currents up to 100mA, the maximum that the transistor can handle. Interfacing 21
Return to Contents Page 4
The BC557 transistor is of a type known as a 'PNP transistor'. This means that when its base ('b' in the diagram) is brought down to 0V, it switches on. This allows current to flow through its emitter/collector pins and illuminate the LED. When the module's output goes high, the transistor is switched off and no current flows through the transistor. The LED is unlit. If you intend to illuminate a very high power LED or a LED strip that contains multiple LEDs, you need to use a transistor that can handle these larger currents. The TIP122 is a 'NPN power transistor' which can handle up to 5A. It works in the opposite way to the BC557 circuit above. When its base ('b' in the diagram) is brought high, it switches on. This allows current to flow through its emitter/collector pins and illuminate the LED or LED strip. The illustration shows a single high-power LED in the circuit but that could be replaced by a LED strip with the dropper resistor removed (the LED strip has its own inbuilt resistors). For more details on how transistors work as switches, look at: www.rason.org/Projects/transwit/transwit.htm www.electronics-tutorials.ws/transistor/tran_4.html
Bi-colour LEDs An illustration on a previous page showed how to control two LEDs from a single input line. If you want to have a single LED on your control panel or on your layout and still control two colours from a single inout line, you can use a bi-colour LED. As explained in the chapter on 'Scenic Lighting', a bi-colour LED is just two differently coloured LEDs built into the one casing, wired in reverse of each other. It has only two connecting leads. If you connect the power one way, the upper LED lights. If you reverse the power, the lower LED lights. This circuit is an illustration of both sinking and sourcing currents. If the module's output goes high, the green LED will illuminate, with the module sourcing current to the LED via the lower resistor. The red LED will remain unlit as it has a high voltage at both of its ends. If the module's output goes low, the red LED will illuminate, with the module sinking current to the LED via the upper resistor. The green LED will remain unlit as it has a low voltage at both of its ends. Interfacing 22
Return to Contents Page 4
Relays Although electronics is continually developing, many enthusiasts still feel more comfortable using relays for switching purposes. Many relays operate on quite small currents and so can be connected directly to the digital output of most modules. The illustration shows a single switch contact, although they are available with multiple switches and as changeover contacts. As mentioned previously, the diode prevents any back EMF from damaging the transistor when the relay is switched off. If there is any doubt about the above circuit, you can check what the module's current handling capacity is and compare it with that need to operate your relay. If you are lucky, you will have the relay's specification which will include its coil resistance, allowing you to calculate the expected current for the supply voltage you are using. If you do not have this information, it is quite easy to measure the relay's current using your multimeter set on its current range. The relay inscription will usually tell you what voltage it is designed to operate on (e.g. a 5V relay or a 12V relay). So for example, if the relay is a 12V type you would connect a 12 supply and read the current value from the multimeter. If the value read is capable of being driven directly from the module's output, you would use the circuit at the top of this page. If you are in any doubt, or you think you are operating too close to the module's maximum rating, you would use a transistor switch to operate the point. Since the transistor and resistor are pretty cheap, you may want to use this circuit anyway. This would ensure that the addition of any further circuits to the module's output would not exceed its current rating. You can also buy 'solid state' relays which work like normal relays but have no moving parts. They can handle large currents and are available for switching AC and DC. The AC types can be used for switching main appliances on and off, which is not a normal requirement in model railways. The DC types can be used for block switching, etc.
Interfacing 23
Return to Contents Page 4
Driving multiple devices If you only have a single high-power LED or relay to control, a transistor or power transistor is all you need. If you have multiple LEDs, relays, etc. to control you can use a single component that has eight entirely separately operated 'drivers' inside it. This illustration shows five LEDs and three relays being controlled through this single device. The ULN2803 is called a 'high-voltage, high-current Darlington transistor array'.
It has two rows of pins and pins 9 and 10 are connected to the power supply. The other pins are arranged in pairs with the input pin facing across from the output pin. So, pin1 is the input pin that controls output pin 18, pin 2 controls output pin 17 and so on. The drivers have 'open collector' outputs. which means that they require a load to be connected to their outputs to see the expected voltage changes. The outputs are 'inverted', which means that each output pin is always at the opposite polarity to its corresponding input pin. When pin1 goes high, it makes pin 18 go low. When pin 1 goes low, it makes pin 18 go high. The same applies to all of the drivers. So when pin 8 goes high, it makes pin 11 go low, and vice versa. The outputs can handle up to 50V and an individual output is capable of handling up to 500mA. However, that does not mean that the ULN2803 can simultaneously drive all 8 outputs at 500mA, as it would overload and burn out the chip. In practice, you could drive four outputs at 300mA each, or seven outputs at just under 200mA each. Since the inputs to the ULN2803 can handle PWM inputs, you can still drive all eight outputs at 500mA each – if you drive all inputs with a duty cycle of just under 25%. These are only limitations if all outputs are having to simultaneously control devices with heavy current demands. If you wanted to, you could connect inputs together, so that several outputs would operate from a single input change. For example, if you connected pins 2 and 3 together, a single input change would switch two relays on and off. The chip has built-in back emf protection for inductive loads such as relays, so there is no Interfacing 24
Return to Contents Page 4
need to fit external protection diodes. The ULN2003 device is very similar to the ULN2803. Since it only has seven sets of drivers, the chip has 16 pins compared to the 18 pins used by the ULN2803. Like its larger brother, the ULN2003 has its inputs pins facing their corresponding output pins; a very hand layout when designing circuit layouts. So, pin1 controls output pin16, etc. Its outputs are also inverted and it has similar voltage and current handling capabilities to the ULN2803. Although these chips have built-in back emf protection, some manufacturers recommend using additional external protection measures.
Motors The following electronic circuits could be used for controlling your DC locos but you probably already have a loco controller. Of course, if you are looking to automate your layout, these circuits could be very useful. The circuits are useful for all sorts of motor-driven features that you can add to your layout. You may already have some features, such as a windmill, on your layout that would benefit from being animated. There are different needs for motorised features.
Some, such as a windmill, a water mill, or a screw conveyor rotate constantly in the one direction and the motor is left to run unattended. The only consideration may be reducing the voltage of the layout's power to that of the motor. Some, such as a Ferris wheel or a Carousel /Merry-Go-Round, also rotate in one direction but also stop from time to time. The motor may be controlled manually or using a timer. Some, such as elevators/lifts, funicular railways, funfair pendulum/swinging chair rides also stop from time to time – but they also have to rotate the motor in both directions.
From some of the above examples, you will have noticed that a motor does not have to be used only to rotate things. If the motor shaft is attached to a threaded rod, with a nut free to move up and down the rod, the nut can be attached to all sorts of features to animate them. This image shows the basic idea. With this 14RPM motor fitted, the nut moves along at about one inch per minute. You choose the motor speed that suits your planned feature. The rod assembly could be under the baseboard, with a pin connecting the nut to the item to be moved back and forth. In this way, we can have barge slowly glide along a canal, as well as the elevators and funicular railways already mentioned. This technique allows to animate features horizontally, vertically or at any angle. This image shows an implementation of this technique, complete with microswitch sensors.
Interfacing 25
Return to Contents Page 4
Motor speeds There are three approaches to getting the speed you want from a motor:
Using gearing. This includes toothed gears (including built-in and external gearboxes), belts and pulleys, etc. Even with these, you may still want to tweak the final speed. Using a dropper. For motors with small to medium current requirements, a simple resistor can be placed in series with the motor (see below). Using a regulated supply. Droppers are not the most suitable for high current motors and a power supply that can be set to the required motor voltage is preferable.
Constant rotation If you are using a 12V motor and you have a 12V supply, you simply wire the motor to the supply – the correct way round, otherwise your watermill will be pushing water upstream! Of course, you may not want to run the motor at full speed. As long as the motor is a low current type, you can add a resistor in series with the motor. Lets consider two examples: Case 1 You have a 12V supply and a 3V motor that you want to run at full speed. So, you want to drop 9v across the resistor and 3V across the motor. Calculating the resistor to drop 12V down to your 3V motor depends on knowing the current the motor takes when run under load at full speed. Once you know the current requirements of the motor for your required speed, you can use Ohm Law to calculate a working value for the resistor. So, for example, if you knew that your motor took 20mA at full speed, the added resistance would be R = V/I. In our example, that would be 9/.02 = 450 ohms 470 ohms is the closest available value and could be used with no discernible effect on the motor speed. The power dropped in the resistor can be calculated thus: W=I * V = 0.2 * 9 = 0.18W So, a 470 ohms with a rating of 1/4W or preferably 1/2W could be used. If you don't know the motor's current at 3V, place your multimeter (set to read current) in series with the motor and across a 3V supply. Case 2 You have a 12V supply and a 12V motor that you want to run at a slower than maximum speed. If you have a variable power supply, connect it to your motor and adjust the voltage until you get the speed you want at its working load Read the voltage level that is used and then connect your meter in series as shown above to read the current consumed at that voltage. You now have the voltage and current that the motor should operate at. Subtract the motor voltage from the supply voltage to find the voltage drop required across the resistor and use Ohms Law to calculate the required resistance. Interfacing 26
Return to Contents Page 4
High current motors Case 1 above looked at running a 3V motor from a 12V supply. It took 20mA and so a relatively low wattage resistor could be used as the voltage dropper. Consider what would happen if the the motor current was 500mA instead of 20mA. The voltage drop across the resistor would still be 9v and the power consumed by the resistor would be W = I * V = 0.5 * 9 = 4.5W You can buy power resistors that can handle high currents, including those that are aluminium-clad for bolting to heat sinks. Switching the motor on an off is more of a problem, unless you are using manual switches. You could not normally connect the motor/resistor directly to the output of a module, as they are usually not capable of switching such high currents. You could use a relay, as described earlier – or you could use a transistor as a switch, as in this example.
Controllable motors To be fully controllable, a motor has to be be able to run both forward and reverse, able to be be switched on and off, and also have its speed alterable. Electronic circuits can be designed for these tasks. You can build a circuit using multiple transistors, etc. However, there is no need as there are integrated circuits that combine these features in a single chip. Indeed, some chips can handle two motors. Two such examples are the L293D and the SN754410 'Quad Half H-Bridge Motor Driver' chips.
The two chips have identical pin connections and work in exactly the same way. The only real difference is that the L293D can handle 600mA continuously, while the SN754410 can handle 1A continuously (both can handle double these currents for short periods). The 'Quad' in the chip title indicate that the chip contains four identical drivers, each with its own input pin and output pin. There are two such circuits on each side of the chip. So, for example, taking pin 15 high makes output pin 14 go high, while taking pin 10 high makes output pin 11 go high. So, the chip could be used to control four separate motors.
Interfacing 27
Return to Contents Page 4
This illustration shows a single motor being operate by its own switch. Taking pin 15 high results in the output pin 14 going high. The motor turns. Removing the +5V from pin 15 results in pin 14 going low. The motor stops. Although the diagram shows a switch, pin 15 could be switched by a push-button, relay contacts or from the output of another module. Although they can be switched on and off separately, they are unable to be reversed. That is where the 'H-Bridge' mode in the chip's title can be utilised. This illustration shows the operation of an H-bridge circuit, using conventional switches.
When switches A and C are closed, the motor has a positive potential on its left hand connection and 0v on it other connection. The motor will turn in one direction. If we now open switches A and C, and close switches B and D, the voltage across the motor is reversed and the motor turns in the opposite direction. An H-bridge can be constructed from four power transistors or even relay contacts, each carrying out the functions of the four switches in the above circuit. Better still, the L293D (and the SN754410) can be wired to provide two separate H-bridge circuits. If we switch pin 11 high and pin 14 low (see the L293D diagram) the motor will rotate in one direction. Reversing the polarity of these two output pins will rotate the motor in the opposite direction. If pins 10 and 15 are both at a supply voltage or both at zero volts, there is no potential difference across the motor and it will not rotate. The table below summarises the options: Pin 10
Pin 15
Result
Low
High
Rotate one direction
High
Low
Rotate other direction
High
High
Motor stopped
Low
Low
Motor stopped
If required, an input pin can be fed with a PWM signal, to achieve speed control. For example, pin 15 could be taken high, while pin 10 is fed with a PWM input. Interfacing 28
Return to Contents Page 4
Switching an H-bridge As can be seen from the above table, we need two inputs to control an H-bridge circuit, allowing us to have forward, reverse and stop. This example circuit uses a SPDT CO switch to handle the inputs. It has three positions, including a centre-off position. When the switch is left in the middle position, neither pin has a high voltage and the motor is stopped. Throwing the switch to the left brings pin 15 high (pin 14 goes high) and the motor rotates. Throwing the switch in the other direction, brings pin 10 high (pin 11 goes high) and the motor rotates in the opposite direction. Although a switch is shown, it could be replaced by relay contacts, a pair of pushbuttons, or the outputs from other modules. The other pins
Pin 16 is connected to the +5V supply. Pins 4, 5, 12 and 13 are connected to the 0V of the supply. Pin 8 is connected to the voltage supply for the motor, which may be different from the +5V supply for the chip (e.g. it might be connected to +12V to run a 12V motor). It supports from 4.5V to a maximum input of 36V. Pin 9 is the 'Enable' pin for the right-hand drivers. This can be switched externally, where bringing it down to 0V stops the left-hand drivers from working. If this is not needed, the pin can be permanently connected to +5V.
Notes
Although the examples show the input and output pins on the right hand side of the chip, the identical sets of pins are available on the left hand side inputs and outputs. Make sure you buy the L293D and not the other variations of this chip, as the 'D' indicates that the chip contains internal clamp diodes to allow it to work with inductive loads. If you need to switch even greater currents, you can parallel the inputs and outputs of both bridges, as shown in this illustration. This doubles the output handling capacity of the L293D to 1.2A. The blue lines show the inputs on each side being connected together. The green lines show the outputs of each side being connected together. The enable pins are also connected together and taken to +5V, or to a PWM signal if required.
Interfacing 29
Return to Contents Page 4
Sound The chapter on 'Layout Sound' covered how to interface various sound modules. Which just leaves the requirement to make a general sound that can be used as feedback that an action has happened. Examples are: A confirmation beep when a button is pressed. A warning tone for shorts, overheating, etc. Placing a microswitch on buffers at the end of a hidden siding. The user slowly runs the train forward until a beep is heard, indicating that the train has reached the end of the track. The user then reverses a little to stop the tone. A warning when you try to run a train in to a removable section that has not be refitted properly. You can use electromagnetic buzzers but piezo buzzers use less current and produce no unwanted electromagnetic radiation. A piezo buzzer is a thin piece of piezoelectric ceramic bonded to a disc. When subjected to an alternating voltage, the material stretches and compresses, making the sound. Some piezo buzzers are self driven and have their own built-in driver circuits. A typical example will operate at 3V to 24V, with a current consumption of around 15mA at 12V. If your module's output can handle that amount of current, you can connect the buzzer directly to the output pin. When a DC voltage is applied across it, it will emit a continuous high pitched tone. If there is any doubt about your module's current rating, you can use a transistor as a current switch, as shown in this diagram. The basic piezo buzzer is shown in this image. It is not self driven and requires an external driving circuit to excite the piezoelectric material. This circuit is a simple oscillator that can be turned on by raising its input pin 4 to the positive supply. While pin 4 is held low, the circuit does not oscillate. The output from pin 3 can be taken to either a piezo buzzer or to a loudspeaker. With an 8 ohm speaker connected, the circuit draws 10mA at 5V while oscillating and 40mA at 12V.
Interfacing 30
Return to Contents Page 4
Smoke Smoke and steam effects can greatly add to the realism of a layout. Smoke units are available from manufacturers such as Seuthe, Vollmer and LGB. They can be fitted into steam locos or used in the chimneys of scenic buildings such as houses, factories, pottery kilns, 'burning' buildings, campfires, etc. These units are available in different sizes and different voltage/current requirements but they all work on the same principle. Their construction and use is simple. They consist of a small metal tube that is sealed at the bottom and open at the top. There is a small heating element inside the tube, with external leads that connect to your power supply. The tube is filled with smoke oil and heated when power is applied to the element. The oil is vaporised and rises from the tube where it condenses to produce visible smoke or steam.
Different sizes The length and diameter of the tube determines how much oil the smoke unit can hold and a large range of sizes are available, to suit various uses. The full Seuthe range is described here: www.gaugemaster.com/seuthe.html
They recommend different units for HO, 0 and 1 gauges. Some are designed to fit into locos that are designed to accommodate them. Others are for you to fit in your own way. For HO and 00 users, voltages range from 8V to 22V and current requirements ranging from 70mA to 140mA. For O and 1 users, voltages range from 10V to 16V and current requirements of 140mA. For buildings, voltages range from 10V to 18V and current requirements of 50mA to 60mA. The Seuthe 117, shown in this illustration, is designed to fit in the chimney of a building. Seuthe also sell the 500 series "Super" Smoke Units. These have a large reservoir tank to keep the unit topped up, allowing for much longer periods of use. This unit is designed to fit in a boat but is suitable for large scale buildings: www.harbormodels.com/site08/main_pages/smoker.htm
This website show how someone made their large scale smoke unit: www.scale4x4rc.org/forums/showthread.php?t=25024
An this website shows how someone enlarge their reservoir for their loco: www.newrailwaymodellers.co.uk/Forums/viewtopic.php?p=180324
Different oils Unless you have a unit with a reservoir, you keep the oil level topped up by dripping oil into the top of the unit with a pipette. Don't refill the container while it is still hot as this will cause splatter. The fluid used is a mixture of light oils and ammonium chloride ( to quicken the vapourisation process). Manufacturers of smoke units also sell smoke oils and Peter's Spares produce a range of perfumed oils. Apart from producing smoke, they emit aromas such as Coal-Fired Steam, Fireplace, Diesel Power, Lumber Mill, Wood Stove, Barbecue, Coffee and Cut Grass. Check out: www.peterspares.com Interfacing 31
Return to Contents Page 4
A Google check reveals many ways of producing your own smoke oils at much cheaper prices. Suggestions include Paraffin Oil (Mineral Oil), Witch Hazel, Lamp Oil and Propylene Glycol (as used in e-cigarettes). This website describes using a glycerine mix with distilled water: www.ehow.co.uk/how_7671896_make-smoke-oil-model-trains.html
As always, these alternatives should be approached with caution and at your own risk. While many enthusiasts claim great success over long periods, you should make your own tests to be satisfied that they are safe to use. For example, vapourised paraffin (as compared to burnt paraffin e.g. candle wax) can collect in your lungs and cannot be expelled.
Other issues While smoke units can be a great asset to a layout, it is worth noting potential problems. When the vapour condenses, it drops back down on to the loco, or the track, or the scenery. The thin film of oil may attract dust and necessitate more frequent cleaning. Any oil spillages on to a loco body may eventually degrade its shell. The units should always be fed by a voltage within its specified range. Too high a voltage can overheat the unit and burn out its element, or melt/burn its surroundings. Too low a voltage will not sufficiently vapourise the oil and the unit will instead splatter out oil. It is vital that the unit never be allowed to completely run dry. This will also result in the element burning out and possible damage to its surroundings.
Fitting in Locos Some locomotives come prepared to accommodate the installation of Seuthe steam generators, including some Marklin, Fleischmann, Roco, Lilliput, Trix and Brawa models. For these selected models, both DC and DCC, the installation is fairly simple. For DC locos, the units leads can be wired directly across the power from the wheel pickups. So, the unit with the lowest operating voltage is best, as it will not sufficiently heat the oil until the track voltage reaches that voltage level. When the loco is stopped, there is no voltage at the element and it will cool down and not produce smoke. In other words, it cannot produce smoke while it is stationary. When the loco moves again, there will be a delay before smoke appears as the heating element takes time to come up to temperature. DCC locos, on the other hand, have power from the track at all times, even when stationary. So, a unit in the 16V to 22V range would be most suitable. If the unit is wired directly across the wheel pickups, it will be constantly vapourising oil which is not likely to be required; it will also require much more frequent topping up. If the unit is wired to an auxiliary pin of a DCC decoder, the smoke unit can be switched on an off as required. The unit is wired across an auxiliary pin and the blue common positive pad. Note It is important that you confirm the current handling of your decoder's auxiliary output can handle the current requirements of the smoke unit you purchase.
Interfacing 32
Return to Contents Page 4
Fitting in buildings Given the options for larger oil containers, and the simple two wire heating element, smoke units are easy to fit to layout buildings, etc. At its simplest, you wire the heating element through a switch to your 12V supply. You may consider wiring a timer output to the element, so that the smoke was emitted periodically. This timer circuit provides power to the smoke unit heater element every so often, depending on the values of the resistors and large capacitor. With the values shown, the timer's output pin goes low for around 15 seconds every 3 minutes. This website provides a calculator, if you want different timings: http://web.udl.es/usuaris/p7806757/555-calculadora/555%20Calculator.htm The 555 chip handles a maximum output of 200mA. To prevent the chip overheating, it is best to use a transistor switch. In fact, this will be essential for the units that draw more than 200mA. The TIP126 is a PNP type power transistor. When its base goes low, it turns on providing a supply to the smoke unit. At exhibitions, you might consider having a detector (see chapter on detectors) that senses the presence of visitors and switches on the smoke unit. During quiet periods, the smoke unit is switched off.
Electromagnetic uncouplers Kadee couplings are popular amongst a section of enthusiasts. To avoid having to manually uncouple rolling stock with hooks and sticks, Kadee brought out under-track permanent magnets. These sit under the sleepers so that the magnetic field opens the knuckles reliably. Although this is a great improvement on manual uncoupling, it is far from perfect. It involves some tricky shunting of the wagons back and forth to achieve uncoupling. In addition, moving a train over the magnets may lead to accidental uncoupling of rolling stock. For easier use, Kadee brought out their HO electromagnet uncoupler. This is fitted under the baseboard, as shown in the picture (it also shows the Seep EM1 version). You simply stop the train with the couplings over the electromagnet, energise the decoupler coil and pull the rest of the train away. Kadee recommend a 16V DC supply of at least 3A to power their uncoupler. The Seep EM1 model takes 1A at 12V DC and 1.5A at 18V DC. They can both be operated by a simple pushbutton of suitable current rating (check before you fit). Do not use a switch as it may be left on by mistake and overheat until the coil is burn out. Kadee recommend a maximum of two minutes continuous use, although users recommend a much shorter time.
Interfacing 33
Return to Contents Page 4
Inverters When connecting modules together, you cannot always guarantee a direct connection is suitable – i.e. connecting one module's output into another's input. For one thing, they may be operating at different voltage levels (interfacing 12V modules to 5V modules, etc. is covered later). A module's output may go high when activated but the other module expects a low voltage on its input. The diagram shows how this problem is overcome. The BC557 is wired as an 'inverter'. This means that a positive voltage on its base brings its collector down to 0V. Conversely, 0V on its base results in a positive voltage on its collector. In other words, its output is always the opposite of its input. In this way, two modules can be interfaced so that the correct outcome is achieved, at a cost of a few pence.
Fanning Sometimes you want the output from a module to connect to multiple other modules and devices (e.g. the output from a track occupancy detector connecting to relays, LEDs, timers, etc.). This is know as a 'fanout' and you have to ensure that the total current requirements of all the attached modules and devices does not exceed the available current output from the module feeding them.
Voltage incompatibilities Earlier pages demonstrated how to drive high current devices from modules with low current outputs. Another problem is interfacing devices that work at different voltage levels. Many digital devices work with a 5V supply and others with a 12V supply. The aim is to safely connect their inputs and outputs. Connecting high voltage outputs to low voltage modules This illustration shows a method of connecting a 12V output to a module that expects a 5V input. Two resistors are connected in series across the module's output pin and 0V. Together they form a 'potential divider', with some of the voltage being developed across each resistor. The voltage across the lower resistor is taken to the next module. The voltage across the lower resistor depends on the ratio of the two resistances. So, for example, if they were both 10k than a 12V across them would drop 6V across each resistor. Using the values shown, a 12V output from the module will produce 4.8V across the lower resistor. This will work in may circumstances, although the input circuit of the next module may have its own resistors.
Interfacing 34
Return to Contents Page 4
In addition, you may want to achieve electrical isolation, specially if you want a module to interface with a high voltage devices such as mains-driven circuits. In these cases, you can adopt the technique below. Connecting low voltage outputs to high voltage modules The input pin of a high voltage module may still switch with the +5V coming from a 5V module's output. On the other hand, you may not want to risk any damage to the 5V module by connecting it to a potentially higher voltage. One popular solution is ensure that there is no electrical connection between module outputs and inputs. Instead, it uses light as the link between the modules, using 'optocouplers'.
Optocouplers An optocoupler, sometimes called an opto-isolator or a photo-coupler, is essentially an infrared LED and photo-transistor in one package. The illustration shows the KB814 optocoupler. It is a small four pin package, with two pins connected to a source of infrared light and two pins that connect to a photo-sensitive transistor. When current passes through the LED, it emits infra-red light which hits the base of the phototransistor and switches it on. Current can now conduct between its output pins. Many optocouplers have a single LED inside its case, but the KB814 has two that are wired opposite to each other. This allows this particular optocoupler to work with an AC input if required. This ciruit shows the LED of an optocoupler being connected to a module that works at 5V, while the phototransistor is connected to a module that works at 12V. The only link between them is the infrared beam. This provides a high degree of electrical isolation between them, 5KV for the KB814. With the 4K7 load resistor in the emitter, the output is inverted – a high at the LED results in a low at the output. When the input to the LED is high, it will not emit light and the transistor will stay switched off. This results in the photo-transistor's emitter going low. When the input to the LED is low, it will emit light and the transistor will switched on, bringing the photo-transistor's emitter high. This circuit is known as a 'level shifter'. The input is either at 0V or +5V, while the output is either 0V or +12V. This arrangement can be used to interface many voltage differences (e.g. 12V to 5V, 5V to 18V, etc.). This variation on the above circuit places the load resistor in the photo-transistor's collector, to create a non-inverting output. When the LED is switched high, the LED does not emit and the photo-transistor is turned off. The output from its collector also goes high. Taking the LED's input low, makes it emit and the output also goes low. Interfacing 35
Return to Contents Page 4
Opto-isolator types These devices are available in the following varieties: DC input photo-transistor, with a single LED, such as the Sfh610-a2. The above example circuits are of this type. DC or AC input photo-couplers with two LEDs, such as the KB814. There is little use for AC inputs in model railways but it is commonly used with DC inputs. Photo-Darlington opto-couplers, such as the IS4N46. The specifications for all opto-isolators include their 'transfer ratio'. This is the ratio of the current flowing through the LED to the current flowing through the collector/emitter of the transistor. These can vary widely, from as little as 10% (e.g. 20mA through the LED results in only 2mA flowing through the transistor) up to 500% (e.g. a 20mA through the LED results in 100mA flowing through the transistor). For example the KB814 can produce a maximum transfer ratio of 300%. To achieve the highest transfer ratios, some optocouplers have a 'Darlington Pair' built in to them. A second transistor boosts the current from the phototransistor to provide an increased transfer ratio. Where even higher currents are required, further additional transistors can be connected to the output to handle higher current loads. Photo-SCRs, such as the H11C4. The SCR stands for 'Silicon Controlled Rectifier'. When the LED is powered, the diode conducts, allowing current to pass between its anode and cathode. It is mostly used to switch AC loads. It can be used to switch a DC output but once the diode conducts it stays conducting even after the LED is witched off. The only way to stop the output from conducting is to cut of its power. Photo-TRIACs, such as the MOC3020. TRIAC stands for 'Triode for Alternating Current' and it can conduct current in both directions. The photo-SCR and photo-TRIAC are included for completeness. You are unlikely to come across them in model railway circuits, although you may find TRIACs (not photo-TRIACs) being used to operate points in some layouts.
Conclusion All the above circuits are snippets; they are building blocks. You have to adapt to whatever modules you are working with. Don't forget to use the internet as a source of information about your specific modules. specific modules already documented For example, MERG members who want to connect CBUS units together can find details at: http://groups.yahoo.com/group/mergcbus/files/CBUS%20Module%20Connections/
Interfacing 36
Return to Contents Page 4
Chapter 17 Using computers
Using Computers 37
Return to Contents Page 4
Using computers This chapter looks at how computers can benefit your layout, what is available, and how to use it. Most people have access to computers, generally desktops and laptops. Along with mobile phones, they are mostly used for browsing, email and social networking. However, computers can make a major contribution to model railways. Some shy away from computers in their modelling but there are many levels at which computers can contribute to your layout. These range from finding out how to do things (e.g. lay track or build trees) up to implementing full-blown automated layouts.
Why use computers? You don't have to install new software or change anything on your computer to get loads of extra benefits. If your computer is connected to the Internet, you already have access to:
Information Help Free goodies Most model railway and electronics retailers
If you are comfortable about purchasing/downloading software and installing it on your computer, you can have any (or all) of these:
Train simulators. Track planners Stock inventory Layout control software Automation software
Information A Google search for 'model railway' returned over 41 million results! There is certainly plenty to keep you searching and reading for a long, long time. Getting more specific, a search for 'model rail turntables' returned 760,000 results and 'laying model railway track' returned 108.000 results There are whole websites dedicated to bringing together model railway news, views and product reviews. Examples of such sites are: www.model-railways-live.co.uk/ www.mremag.com/ http://mrr.trains.com/ For free track layout suggestions, check out: www.freetrackplans.com/ www.bandrmodelrailways.co.uk/Design%20ideas.html www.track-plans.net/ Using Computers 38
Return to Contents Page 4
Help Model railway enthusiasts are always happy to help newer members or members with specific problems. There are websites that are dedicated to answering questions and each Forum is worth a visit. Examples are: www.modelrailwayforum.co.uk/ www.modelrailwayforum.com www.newrailwaymodellers.co.uk/Forums/ www.rmweb.co.uk/community/ www.mrlforum.co.uk/ www.modeltrainforum.com/
This is one of the sections from the modelrailwayforum.co.uk website.
Other sections cover specific gauges, sales and wants, etc. Examples of more specific Forums are: www.hornby.com/forums/ www.merg.org.uk
Using Computers 39
Return to Contents Page 4
Freebies and savings Constructing buildings from pre-printed card is very popular, although some kits are now quite expensive. To the purchase, you have to add the cost of postage, unless you buy them at an exhibition. If you have Internet access, you can download the images and print them off yourself. This is cheaper than paying postage and has the advantage that the buildings' images can be printed again and again. One purchase can create multiple buildings. Even better, a number of websites provide free downloads of building kits. If you prefer constructing your own buildings and use brick paper, tile paper, etc., then you can also download these textures, including free versions. The image shows a building that was constructed from a free download from: www.modelrailwaybuildings.com/ Other sites worth a look are: www.wordsworthmodelrailway.co.uk/index.html (accepts voluntary PayPal donations) www.scenerybuilder.com/modelbuildingkits.html www.railwayscenics.com/free_downloads.php (also sells commercial card kits) These websites mainly sell kits but have free samples. www.modelrailwayscenery.com/ www.smartmodels.co.uk/ www.modeltrainsoftware.com/brickyard.html www.modeltrainsoftware.com/model-builder.html
Mail order suppliers In the past, you ordered from a limited number of catalogues and, if the items you wanted were not available locally, you had to send off cheques to the companies along with your order form. That facility is still available, although you can now place telephone orders using your credit/debit card. With the expansion of the Internet, even small local model railway shops and electronic suppliers are within your reach. www.ukmodelshops.co.uk/ provides a list of many local model railway shops.
eBay If you subscribe to eBay you can access sellers from all around the world, which is ideal for tracking spcecialist items, or for making significant savings. You can order from UK sellers, or worldwide sellers, although be prepared to wait up to five weeks for deliveries from Hong Kong, China, etc. A search for 'OO' resulted in 20574 items being sold, with 'HO loco' displaying 3125 items for sale. Overall, 480626 items for sale were found in the 'model train' category. Some items are for immediate purchase, while others are on auction. The next two pages provide a list of resources and suppliers that you can find on the Internet. Please note that some smaller companies may come and go; its difficult to keep such a list current. Using Computers 40
Return to Contents Page 4
Sources of information, calculators http://led.linear1.org/1led.wiz
- Calculates resistor need for LEDs
www.csgnetwork.com/resistcolcalc.html
- Identifies a resistor by its colour code
www.hobby-hour.com/electronics/resistorcalculator.php ditto http://home.cogeco.ca/~rpaisley4/CircuitIndex.html www.wiringfordcc.com
- Loads of DCC-related how-to articles
www.opendcc.de/index_e.html
- Build your own DCC modules
www.nmra.org/beginner/wiring.html www.elexp.com/t_acron.htm www.ntrakexpress.com/
- Loads of electronic circuits for railways
- NMRA's basics on layout wiring
- Commonly Used Acronyms explained
- Speed and scale calculators
www.electronics2000.co.uk/data/index.php
- Technical data archive
www.talkingelectronics.com/te_interactive_index.html - Loads of general electronic projects www.discovercircuits.com - Loads of general electronic projects www.electronics-lab.com - Loads of general electronic projects www.epanorama.net www.microchip.com - Loads of PIC specifications, suggestions http://www4.tpg.com.au/users/talking/index_of_chapters.html - Course on PICs www.elecfree.com/electronic www.bnoack.com/index.html - Information on a wide range of electronic devices www.siliconchip.com.au www.kpsec.freeuk.com - The Electronics Club
Using Computers 41
Return to Contents Page 4
General component suppliers www.rapidonline.com http://www.bitsbox.co.uk http://uk.farnell.com/ http://www1.uk.conrad.com http://cpc.farnell.com/jsp/home/homepage.jsp www.cricklewoodelectronics.com www.distel.co.uk www.expotools.com/ www.fastcomponents.co.uk
- Good range of motors
www.mainlinegroup.co.uk/ www.futurlec.com www.mindsetsonline.co.uk www.bardwells.co.uk www.partridgeelectronics.co.uk www.richmondcontrols.com - Modules for railways www.greenweld.co.uk www.bowood-electronics.co.uk www.toby.co.uk
- Mainly cables and connectors
www.pw-electronics.co.uk www.rshelectronics.co.uk
Specialist component suppliers www.active-robots.com
- A distributor and manufacturer of robotics & electronics technology
www.avitresearch.co.uk – Suppliers of specialist adaptors and cables www.decisioncards.com/
- Suppliers of interface cards
www.jperkinsdistribution.co.uk - Mainly aircraft but have a range of useful materials www.keene.co.uk - Mainly Audio/Video but selection of cables, etc. www.ultraleds.co.uk
- Large range of LEDs
www.mecanique.co.uk - PIC-related www.milinst.co.uk - PICs and robotics www.fored.co.uk - PIC-related www.millhillsupplies.co.uk
- Tools
www.skpang.co.uk - Mainly PICs but a selection of electronic components http://robosavvy.com - Robotics, servos, etc. Using Computers 42
Return to Contents Page 4
Model railway software The previous pages covered accessing a range of support, using just your computer and your web browser. Now we will look at software that you have to install on your computer, to get the benefits of their features. In most cases, the installation is easy and all you need is some time to get familiar with the application and all its options.
Train simulators Just a quick mention, since it is railway related software of a sort. You don't even need a layout for this, as it mainly for fun. Most packages have pre-determined routes that you follow as the train's driver. The image shows a screenshot from the RealRailway Train Simulator. Those that allow you to alter the trackwork, can provide the feel of a layout before committing to a real track plan. Examples are: ArcRail Train Simulation (http://arcrail-train-simulation.en.softonic.com/) RealRailway Train Simulator (www.railsimulator.com/) PC-Rail Simulations (www.pcrail.co.uk/index.php) Rail Simulator fro Electronic Arts (www.ea.com/uk/rail-simulator)
Although something to entertain you and the kids/grandkids, it does not make a serious contribution to your layout. The software that follows does.
Track planners When contemplating starting a new layout, modellers take many approaches. Some have a plan of sorts in their heads and just start laying track. Some draw a sketch on a postcard or a sheet of paper. Some are more organised and use graph paper to judge lengths and the radius of each bend and point. Clearly, making it up as you go along or working to a vague plan is a recipe for lots of mistakes. In fact, even the more disciplined approach of using graph paper has it drawbacks. Firstly, as you work through the planned layout, you will likely want to alter track positions, locations of points, the radius of a curve, etc. To make the changes, you have to rub out some the existing plan and start over. This can be a laborious and frustrating process, particularly when working with flexitrack. Sometimes the difficulty is visualising how the layout will look when it is finished. This is where track planning software becomes useful. The time spent in installing the software and learning how it works makes planning a layout an interesting and enjoyable experience. Even better, it need not cost too much – some programs are free.
Using Computers 43
Return to Contents Page 4
Features Some packages have basic (although useful) facilities while others are rich in their features. The most useful facilities could include: Works for any gauge. Works with both set track and flexitrack. Pre-defined track libraries for different manufacturers. Handles transition curves (a curve of constantly changing radius). Can print out layout sheets. Can print out track templates. Option to display a 3D view of the layout. Option to add in lineside features, trees, etc. This illustration shows a layout that has been designed using the 'Cadrail' package.
And this is the software displaying the same layout in 3D.
Using Computers 44
Return to Contents Page 4
Track planning packages Here is a look at some of the packages that are available. Some are completely free, some are commercial but allow free use on a limited basis and some are completely commercial.
Cadrail The images you saw on the last page were made using this package. It is available for download from: www.sandiasoftware.com/
It is a commercial package but allows free use with a maximum of 60 objects.
SCARM This stands for 'Simple Computer Aided Railway Modeller' and is a freeware package that is available from: www.scarm.info/index_en.html Here is a screenshot of the package in operation.
AnyRail This is another commercial package that allows free use, this time a maximum of 50 objects. It can be downloaded from: www.anyrail.com
Templot Templot is intended primarily for modellers who wish to construct their own track. It can handle slips, 3-way tandem turnouts, curved double-junctions and mixed-gauge formations. It is free to download and use, with a request for donations. It can be downloaded from: www.templot.com
It has its own user Forum.
Using Computers 45
Return to Contents Page 4
XTrkCad This is a fairly comprehensive package with benchwork, on-screen ruler, elevations and even 'Post It' notes. It is free and can be downloaded from: www.xtrkcad.org
It has its own Yahoo Group with over 5,000 members.
WinRail A commercial product that can be downloaded from: www.winrail.com
Has useful features such a tool to design 3-rail trackwork, for combining narrow-gauge and standard gauge track systems.
3rd PlanIt A very well featured commercial package that can be downloaded from www.trackplanning.com/3pi.htm
It has facilities for adding terrain including foliage and viewing in 3D. A special feature is the ability to design your own locos and run them on the track, as shown in this screenshot.
It allows you to use the software without payment, with a restriction of no more than 100 objects and no ability to save the layout.
The Right Track This is a freeware package that is available from: http://the-right-track-r-software.software.informer.com/10.0/
This application provides templates not just for track but also bridges, turntables, buildings and electrical controls.
Using Computers 46
Return to Contents Page 4
Stock inventory It is not uncommon for railway modellers to amass countless locos and pieces of rolling stock. When the cost of the trackwork, buildings, controls, etc. are added, the entire collection can easily be a four or even a five figure sum. That raises the question of how to protect these items in case of fire, flood, theft, damage in transit, accidental damage, etc. Household insurance policies don't fully cover collections of items and most will not cover layouts in garages or sheds, or garden layouts. In addition, layouts taken to exhibitions or stored in clubrooms are not included in household insurance policies. Luckily, a number of insurance companies offer special policies for model railways. To maintain proper coverage, an accurate and up-to-date record of all your model railway items need to be recorded and lodged with the insurers. A number of stock inventory systems are available for installation on your computer. You enter the details of each item and they are stored in the application's database. This can be a simple set of details, while the more advanced applications allow you to store additional information including photographs, scanned documents (e.g. receipts) and videos.
CMS Stock This is a fully-specified application that can be downloaded from: www.gppsoftware.com/ViewProd.aspx?P=41582C2324292128
or can be supplied on CD.
Using Computers 47
Return to Contents Page 4
It is a commercial product but you can download a free fully-functional one month trial version. The program stores Locomotives, Carriages and Wagons separately with no limit on the number of records. The program is also customisable, allowing you add your own extra categories to the database. Apart from creating a list for insurance purposes, the database can store valuable information for day-to-day use, such as servicing or maintenance schedules, exhibition dates, which locos have DCC decoders, what type of coupling is used, etc.
Track Those Trains This program can be downloaded from www.bacitsystems.com/index.php?p=1_8_Track-Those-Trains
It is 'shareware', which means that it can be freely distributed and used for evaluation purposes. Buying a license allows you to add unlimited records and adds printing, exporting in PDF format, a backup function, and other features. The program also allows you to attach multiple digital images, video clips and documents.
AP Railventory This is a commercial program although you can download a 30 day trial version that is limited to 50 items. It is available for download only from www.pothe.com
The database supports 26 categories including locomotives, rolling stock, track, buildings, electronics, software and literature. There is no limit to the number of items. You can include two images and unlimited text for each item.
Using Computers 48
Return to Contents Page 4
Control software The previous pages looked at what you could achieve using only your computer, the Internet and maybe a printer. These provide benefits that supported your model railway activities. This next section looks at using your computer to control what actually happens on your layout.
What is a computer controlled layout? Computer-assisted systems can provide different levels of operating support. There are three main operating modes: Fully manual The operator is in complete charge of all loco, point and accessory operations, using a mouse or pad to interact with buttons and sliders on an on-screen control panel. It is the responsibility of the operator to see where things are and what needs to happen next. Partially automated The computer software is left to run locos on the layout's main lines, with no attention needed from the operator. The operator is responsible for, and manually controls, locos in specific areas of the layout such as the shunting yard or fiddle yard. Fully automated The operator sets up a sequence of operations and the computer handles all the layout activities, while the operator sit backs and watches. To work, the layout needs to provide feedback to the computer, telling it when events have occurred (e.g. a train has arrived at a station). Well-written software allows the operator to switch between these different modes, with fully automated running on some occasions (e.g. at an exhibition) and fully operator controlled at other times. The operator can have both a normal physical control panel and also a screen-based control panel (sometimes called a 'glass panel'). Although it is possible to design automatic controls for DC systems, DCC systems have an advantage for computer control as they are already equipped with decoders in the locos.
What do you need? The computer has to interface to the layout's electronics, so that it can control activities (locos, points, accessories) on the layout. For this, it needs both hardware and software. The hardware makes the physical link between the computer and the model railway electronics (usually a DCC command station or a DCC booster). The software provides the user with the ability to operate locos, points, etc. using the computer monitor and an input device such as a mouse or a touch screen.
Hardware There are two main ways that the computer can interface to your layout:
Through your existing DCC command stations If your command station has a built-in USB port, then it can connect directly to your computer's USB port. Examples of this type are the ESU Navigator and the Hornby Elite. Using Computers 49
Return to Contents Page 4
The setup is as shown in this illustration.
The command station connects to power and to the track as normal. A USB cable is used to connect the command station to the computer. The control software (see examples of these later) is installed in the computer. The monitor screen layout can be as simple as a replica of a handheld control, where you click on screen buttons instead of pressing physical buttons. Most packages allow you to go much further and create a replica of your layout on the screen. There are no physical alterations to the computer; nothing needs to be added or tweaked; the case does not need to be opened. The only additional tasks are those of setting up and configuring the software. Proprietary interfaces For their own reasons, manufactures often use their own interface methods. To make these command stations work with a computer, you have to place an external module between the command station and the computer. This module's purpose is to translate the signals on the computer's USB port into signals that are understood by the manufacturer's own particular interface. Examples are Digitrax using a PR3 unit or a LocoBuffer-USB unit, NCE using the NCE USB interface module, and Lenz or Atlas Commander using the Lenz LI-USB interface module. The interface modules connect between the two ports and are usually powered from the computer's USB port.
Using Computers 50
Return to Contents Page 4
Through an independent interface unit The systems shown above use a command station that can be operated with or without connection to a computer, allowing you to switch between these uses. Another approach uses units that only work when controlled by a computer. They do not have external knobs, buttons or sliders that you can touch and manipulate. They rely solely on the instructions they receive from your computer. Their main advantage is their relatively cheap price compared to standard command stations. Hornby's 'eLink' This unit combines a USB connection to a computer and a DCC booster. It has outputs for the main layout track and for a separate programming track It is supplied with a 1A transformer, which is sufficient for many smaller layouts, but can be replaced with a 4A transformer if required. SPROG modules The first SPROG model was intended as a programmer for DCC decoders. The SPROG 2 is a combined USB interface and 1A DCC booster. When it was recognised that it could also be used for controlling layouts, a more powerful SPROG 3 version also became available. The SPROG3 looks similar to the one in the picture but includes a 2.5A DCC booster. If you own a DCC booster but no command station, SPROG have introduced the 's-Nano' which interfaces a computer's USB port to any any DCC booster. MERG Command Station Like the others, this module connects to both power and the track. Unlike the others, it can be connected to a handset to convert it into a conventional DCC command station. Its interface uses a variation of the CANBUS system (CBUS), so has to use a CBUS-to-USB interface card. The CBUS system is explained in a separate chapter. It is supplied as a kit and its ability to work from a handset or from a computer makes this unit very versatile. Using Computers 51
Return to Contents Page 4
Control Software Controlling layouts from a computer can be as simple or as complicated as you want. This chapter cannot provide tutorials on all the software applications out there. You need to choose the one that best suits your needs (and pocket) and be prepared to learn how to use it and get the most from its facilities. At its simplest, the computer screen can look just like a handheld DCC controller, as shown in this illustration. Once the program is running, you select which loco you want from the drop-down list near the bottom of the screen, click on the 'Forward' or 'Reverse' button and move the slider up and down to adjust the loco speed. This 'Throttle' facility is included as part of 'Decoder Pro' . The software is provided by the JMRI (Java Model Railroad Interface) Project group. This is an informal open-source software group who describe their project as: “a jumping-off point for hobbyists who want to control their layouts from a computer without having to create an entire system from scratch.”
The software is constantly being developed by this large group of enthusiasts who cooperate to provide free access to their two main programs. Their website explains that “JMRI can be used to automate parts of your layout, from simply controlling a crossing gate to running trains in the background”.
The Decoder Pro program is mainly used to make programming DCC decoders an easy task and this is described in the chapter on DCC. The 'Throttle' facility is a useful addition for those who do not want to go down the road of automation. JMRI's other application is called 'PanelPro' and it is used for handling automated or semiautomated layouts, using two methods. You can choose to use either method, or even both together. The 'Layout Editor' lets you draw your layout on your screen, as shown in this simple example.
Using Computers 52
Return to Contents Page 4
Once set up, the operator can control the layout's points and signals. The 'Panel Editor' lets you create an on-screen representation of a normal control panel like the one shown here.
It is an alternative approach to control locos, points, etc. from the screen – or have them run automatically. For automatic running you need feedback to the computer from sensors that tell the software when events have completed (e.g. a train has arrived at a station). See the chapter on track occupancy detectors for information on this.
JMRI software includes the ability to use iPhones, iPods and Android phones as handheld remote throttles. More information is available at: http://jmri.sourceforge.net/
The website provides a list of al the command stations and other hardware that it is able to work with.
Rocrail This another open source project that is free to download and use. It is also being continually developed by enthusiasts. It provides options for you to run the layout manually from your on-screen layout, or to configure it to run automatically or semi-automatically. As for JMRI, automatic running in Rocrail relies on feedback to the computer from sensors that tell the software when events have completed (e.g. a train has arrived at a station). See the chapter on track occupancy detectors for information on this. More information is available at: http://wiki.rocrail.net/doku.php
The website provides a list of al the command stations and other hardware that it is able to work with. Rocrail also has its own Forum where help and advice is available. http://forum.rocrail.net/viewforum.php?f=95
Using Computers 53
Return to Contents Page 4
Here is an example:
Hornby RailMaster Hornby's RailMaster software works with the Hornby Elite DCC controller or the e-Link DCC booster. It can be purchased on its own or bundled with e-Link. As the image shows, it uses the same approaches of drawing the layout on the screen and providing on-screen control of locos if required.. The movement of locos, points, uncouplers, etc. can be controlled either by your mouse or by using a computer with a touch screen. The points and accessories are controlled via DCC accessory decoders. Automation can be achieved in two ways. The software provides a programming option where you enter a list of activities such as starting or stopping locos, operating points and setting signals. These events are entered in the order that you want them to occur and you have to enter the times at which each event will happen. This may be a bit of a suck-it-and-see operation where you amend the timings after running the program. The alternative is to use the software's 'recording' option, where the software creates the list of activities and includes the actual times you took to run the locos, etc. While Hornby's timed list approach is simple to create, it has the serious drawback that it cannot cope with unexpected events such as stalling or derailments. The program Using Computers 54
Return to Contents Page 4
relentlessly progresses though its list of events, since it has no knowledge that a previous event failed. JMRI and Rocrail cope with mishaps by using feedback from track detectors. That way, it knows that a loco failed to arrive at its intended destination and won't carry on until the situation is rectified. Hornby are aware of this shortcoming and they are likely to introduce a range of their own detector modules, possibly including RFID. At the time of writing they are awaiting patents before bringing them to the market. Like the JMRI and Rocrail, Railmaster allows remote control of your layout using and iphone, iPad tablet, and Apple and Android devices. The device communicates via WiFi with your computer and you have to purchase their app.
TrainController This is another commercial product, created by Railroad & Co. It is available in three versions, Bronze, Silver and Gold, with differing amounts of facilities and prices ranging from around £100 to around £500. A comparison chart for the three versions can be read at: https://secure.freiwald.com/pages/traincontroller_bronze.htm
It claims to support the train detection systems of all leading manufacturers. You can check whether the software is compatible with your hardware by looking at: https://secure.freiwald.com/pages/traincontroller_bronze.htm
The program has several thousand users and has its own Forum. They offer a free trial download with no restrictions for the first 30 days.
Using Computers 55
Return to Contents Page 4
SSI SSI stands for Solid State Interlocking, since it provides full control of points and signalling and these can be interlocked. The software provides prototypical operation and control. Routes can be defined so that a series of points and signals can be set in one operation. A range of drivers is provided, allowing it work with various pieces of hardware (e.g. the MERG RPC, MERG CBUS, Lenz ExpressNet, Hornby Elite, and NCE DCC).
The software can be purchased from: www.gppsoftware.com/SSI/
You can also download a fully functional 30 day trial.
Using Computers 56
Return to Contents Page 4
TCC TCC (Train Control Centre) can drive three types of hardware interface module: CTI modules, RPC modules and QTU modules available from QtuTrains. It connects to your computer's serial port, or to your USB port using a serial-to-USB adaptor. More information is available at: www.qtutrains.com/SoftPane.html
In its most complex form it could be used to control signals and points with full interlocking, entry/exit route selection, automatic timetable running or fully automatic operation. To do these more complex things you have to write a configuration script.
Note
Although these programs can reduce a lot of the workload, the user will only get the best from these systems by tweaking them to their own needs. This is achieved through writing 'scripts', small sections of computer instructions. So, although of great help, computer-assisted layout operations still need you to learn a little about programming. Here is a line of JMRI code, expressed in their Jython language: turnout.commandedState = CLOSED
which hopefully is self-explantory. You may wish to dip your toe into this challenging and rewarding area of model railway control. Many of the software programs are free and the only investment is some time. But when you click on a button and move the slider and watch a loco slowly move off …... .
Using Computers 57
Return to Contents Page 4
Interfaces – technical notes First the good news You do not need to know a lot about how computers work in order to use railway control software. You only need to know how to install and run a computer program and connect some cables/wires. In most cases, the software installs automatically or leads you through the steps. Similarly, the hardware you buy will have installation notes. How it all works can remain invisible to you if you want. These next pages explain how serial and USB interfaces work. It is included for two reasons:
To satisfy the curiosity of those who like to know how things work and want to learn more. To help those who may be having problems with their setup.
The approach should be - read what you need – skip what you know. What is digital? Almost all computer activities involve data communication of some sort. Communications can take two forms: ‘Analogue’ or ‘Digital’. This describes how the signal level changes with time (usually the voltage level changes across two wires or between two points). Analogue
Data transmitted in analogue form has infinite potential variations. Examples include sounds recorded on a cassette tape and AM radio transmissions. In the model railway world, turning the knob on the DC controller results in voltages that can vary from zero to 12 volts or more – and every voltage level in between. Digital
Digital signals can be in one of only a set number of possible states for each item of data. For example, computer data consists purely of ones and zeroes, with nothing in between. Either the wire carries the full voltage or no voltage. It is either high or low, ON or OFF, 1 or 0. There are no intermediate levels. The ON, or HI, voltage level depends on the system. It is 5 volts for many electronic devices and systems (e.g. USB, PICs, many digital logic chips, CBUS) and 12 volts and above for others (e.g. RS232 ports, DCC). Examples of digital devices include printer cables, broadband connections, and DCC and CBUS in the model railway world.
What are bits and bytes? Most data is stored in multiples of a 'byte' – a byte being a collection of eight data bits. At any point in time, all bits could be at zero voltage, or all at high voltage, or any combination of Highs and Lows. This provides 256 possible different combinations and explains why a GIF image offers only 256 colours (one byte representing a screen pixel of a particular colour) or why early sound cards only produced 256 sound levels. Its also why some decoders offer a range of 256 CVs. A byte can also be used to store alphanumeric characters or numbers between 0 and 255. For larger numbers, bytes are grouped into multiples and handled in multiples. Hence, we have 32-bit, 64-bit, 128-bit or even 256-bit graphics cards and Windows 7 handling data in 64-bit chunks at a time. CBUS uses events that are 32 bits. And not forgetting CV 2-byte long addresses. Using Computers 58
Return to Contents Page 4
All storage and speed measurements are stated in bytes, with a typical hard disk being 1TB or a typical broadband modem speed being 10Mbps. The upper case B denotes the value is in bytes, while the lower-case denotes bits. So, in the examples, the 1TB hard drive stores 1,099,511,627,776 bytes while the modem receives at ten million bits per second. Note that when measuring weights, distances, transmission speeds, etc., kilo is a magnitude of 1,000. However, in computing memory and data storage, a kilo is 1024; this is due to the binary system used in computing ( 1 kilo = 2x2x2x2x2x2x2x2x2x2 = 1024). Similarly, Mega is 1024x1024 not 1000x1000.
How is data moved around? There are two ways in which data can be transmitted: ‘Parallel’ or ‘Serial’. The parallel method uses multiple data lines, to transfer multiple data bits in parallel with each other. The values on all the data lines are moved around at the same time. Within a computer, most data is moved round in parallel format on the various internal buses between the CPU and other chips. Older computers had parallel ports that were used to connect external peripherals such as a printer.
Serial This type of communication uses a single data line, with only one data bit being transferred at a time, as shown in the diagram. On a basic level, the serial device waits for a group of eight incoming bits to arrive and assembles them into a byte for use. Similarly, a string of data from the device to the PC is built up into byte-size chunks before being used by the PC programs. Modern computers pass data between computers and peripherals using one of a number of different serial types of connection. Serial systems are used for keyboards, mice, memory sticks, scanners, digital cameras, broadband routers and modems, local area networks, etc. Example interfaces are the serial port. USB, Firewire, external SATA ports, Bluetooth, IrDA, etc. In model railway systems, DCC and CBUS use serial techniques.
What is a serial port? The serial port is situated at the rear of older PCs. They are generally 9-pin D-type connectors, although the specification allows for 25-pin connectors. 9-pin to 25-pin adapter or cables are available. The connector at the rear of the PC is male (i.e. has pins) while the cable end is female (i.e. has sockets). As the illustration shows, one of the pins ('signal ground') is used as a common return for all connections on the port. The data signals are measured with respect to this pin. One pin is used for transmitting data down the serial cable, while another is used to receive data that has been sent to the computer. The other pins are used for various signalling purposes. The RS232 standard was designed to minimise interference on the wires carrying the data signals. Using Computers 59
Return to Contents Page 4
To aid this, the voltages carried are higher than the normal range for digital signals carried inside the PC. The logic states inside the PC carry voltages typically no more than 5 volts. With RS232, binary 0 is represented by a voltage of +3 to +15 volts and binary 1 is represented by a voltage of -3 to -15 volts. Ideally, the signals would be +15v and -15v but by specifying a positive and a negative range, allowance is made for signal losses along the line. Voltages between +3 volts and -3 volts cannot be converted to known values. These indeterminate values may be caused by interference spikes or may be the result of losses of signal on the line. They are shown shaded in the diagram. Note: The RS232 serial port uses values that swing both positive and negative of the common ground wire. Other serial systems only use data that swings positive with respect to the common ground (e.g. CBUS and USB).
Transmission Speeds The speed of data transfer is measured in bits per second (bps). So, for example, if a device had an output running at only 1bps, you could monitor the output every second and find either a high or a low value. Of course, data is moved round at much faster rates than that. The very early modem connections ran at just 110bps, later dial-up modems run at 56kbps, while the latest USB3.1 offers a transfer rate of up to 10Gbps. The maximum data rates for different interfaces are given in the table below. Interface
Speed
CBUS
125kbps
Serial RS232
115kbps
USB1
12Mbps
USB 2
480Mbps
USB 3
4.8Gbps
USB 3.1
10Gbps
When you connect two devices that operate at different speeds, the data can only be transferred at the lowest data rate, as the slowest one will not be able to keep up with and understand the fastest one. For example, if you use a USB-to-serial adaptor, the USB port will be able to operate at many Mbps or even Gbps but the serial end of the adaptor can only transfer data at at a maximum rate of 115kbps. The MERG series of CBUS modules operate at 125kbps. So, the modules communicate with each other at a data rate of 125kbps. However, if you use their CAN-to-serial adaptor (the CAN_RS) the communication between the computer and the modules is limited to 115kbps. This should not cause any problems unless a layout has a huge amount of traffic on the CBUS which could potentially result in loss of some data. This possible limitation can be overcome if a CAN_USB computer interface is used, as this will communicate with Using Computers 60
Return to Contents Page 4
the computer at the full CBUS speed of 125kbps.
Using the serial port with a serial device There are two steps to connecting a serial device to a computer's serial port. The first step is simple. Take a serial cable and plug one end into the computer and the other end into the device! In our realm, this might be a serial SPROG, a CAN_RS module, a Servo4 module, or a Lenz LI101F Computer Interface. Of course, the device will need to have its own power supply connected. The second step is to ensure that the necessary application software to control the device is installed on the computer. This may be Decoder Pro, MERG's CAN_RS software, Servo setting programs (Servoset or AltServo), etc.
Allocating a COM port In most cases, when the software is run, it asks which serial port is to be used with the application, with some offering an enumerated list to choose from. The computer supports a number of different serial ports, often numbered 1 to 4 but could go higher. The user can simply try selecting each port number in turn until the application works. In well-written applications, entering the wrong port number simply results in an 'Invalid port number' error message. The experienced user might wish to use Window's Device Manager to examine which COM ports may already be in use. One benefit of using a genuine serial port, compared to USB ports (or USB to serial adapters) is its robustness. If the device temporarily loses power or the cable disconnects, the system will begin working again as soon as the power/connection is restored. Such glitches in USB-connected systems could prove more of a problem.
USB All new computers have USB ports, with up to six external ports being common. USB (Universal Serial Bus) is designed to connect external peripherals such as mice, keyboards, scanners, digital cameras, printers, memory sticks, hard disks, networking components, etc. to computers. It has become the standard external connection method for Windows, Macs and Linux. USB and RS232 ports both send and receive data in serial format – but the format of each is different (in terms of speed, data format, etc.)
What does USB offer? The advantages for model railway systems include:
Can handle full CBUS data rates, unlike RS232. Never run out of interface ports, even with many devices attached. Overcomes lack of serial ports on many modern computers, despite some devices still using serial interfaces (e.g. Servo4, serial SPROG). Solved with USB to serial adapters. Good noise immunity (see later) USB ports can supply some power to externally connected devices. Like RS232, you don't have to open the computer case to add extra devices. USB devices can be ‘hot swapped’ - fitted and removed without rebooting or reconfiguring the computer. If a new device is plugged in while the computer is switched on, it may be configured with no need to throw DIP switches, add/remove jumpers or determine IRQ settings or I/O
Using Computers 61
Return to Contents Page 4
addresses.
USB Speeds The table shows the maximum data rates for different USB versions, measured in millions of bits per second. The actual data rate is usually lower, due to protocol overhead. USB Standard
Description
Max Data Rate
USB 1.1
Low Speed
1.5Mbps
USB 1.1
Full Speed
12Mbps
USB 2
Hi Speed
480Mbps
USB 3
SuperSpeed
4.8Gbps
USB 3.1
Superspeed+
10Gbps
The early USB standard, USB 1.1, is only found in the very earliest computers with USB. Most computers have either USB 2.0 or USB 3. The lower rate of 1.5Mbps was intended for slow devices such as keyboards and mice, while Hi Speed USB, SuperSpeed and SuperSpeed+ are designed for for quick data transfers on external drives, quick copying, and for playing video. For our purposes, even the slowest implementation of USB has a faster maximum data rate than CBUS. So, all computers with USB ports, even old computers, should run CBUS quite happily.
USB Cables Unlike the multi-wiring of 9/25 pin serial ports, USB 1.1 and USB 2 cables are light and flexible containing only four wires. They have two wires for power (+5 volts and ground) and a pair of wires to carry the data. There may be a fifth connection at the computer end, wired to a protective shield around the USB cable. USB 1.1 and USB 2 use a twisted pair for the data wires, to reduce noise and crosstalk. To achieve its higher data rates, USB 3.0 cables use two pairs of shielded data wires. The maximum length of a standard USB 1.1 and 2 cable is 5.0 metres (16.4 ft). The USB 3 standard only requires that the cable meet its electrical specification, although a cable that uses AWG26 copper wires is limited to 3m (9.8 ft). With most electronics, the voltage readings are taken with respect to ground (e.g. 5v higher than ground). USB uses 'differential signalling' instead. The receiving device reads the difference between the two signals wires D- and D+ and ignores the wires' voltages with respect to ground. This increases the system's noise immunity and minimises problems of unwanted electrical interference.
Can the 5m length be increased? While some enthusiasts have a computer dedicated to their model railway operations, others may have their computers installed some distance from their layouts. USB cables of 5m in length are readily available but care should be taken with 'USB Extension Cables'. Extension cables have a plug on one end and a socket on the other and one or more can be used to increase the cable length between the computer and the controlled device. Consequently, these cables can be used to exceed the cable length restrictions for USB. However, the length restriction exists for a good reason – it encompasses the permissible round-trip time delay of USB signals. If the computer's commands are not answered by the connected USB device within the allotted time, the computer treats the command as being lost. A safe way to increase cable runs is to use hubs Using Computers 62
Return to Contents Page 4
(see later).
USB Connections A variety of plug types are used on the end of USB cables and the ones most likely to be used with model railway electronics are shown in the illustration. The USB specification describes two main categories: Upstream These plugs and sockets are called Type-A (sometimes just 'USB-A') and are always used at the controlling 'host' end– usually the computer. Downstream These plugs and sockets (Type-B or USB-B) are always used at an attached device. The image on the preceding page shows a USB-B socket in use on a CAN-USB module and the same socket can be found on the Lenz USB interface module, etc.
So, in most cases, USB cables have a Type-A plug at one end and a Type-B at the other. The table shows the wiring for each pin in USB 1 and USB2 connectors. The illustration shows the connections on the plugs. The wiring on the sockets are reversed, so that the +5v on the socket connects to the +5v on the plug, and so on. As the illustrations show, the connectors have power pads that are longer than the data pads. This ensures that the device is powered up before data signals are applied. USB 3 connectors have the same four connection pads as earlier versions but have additional contacts recessed into them. These additional contacts provide the extra data lines for the SuperSpeed signals. Note
Smaller USB connectors are available. These are known as Micro USB and the older Mini USB and were introduced for connecting small devices such as PDAs, mobile phones and digital cameras. They are not common on model railway devices. Are they all compatible?
All USB systems maintain backwards compatibility. This means that older specification devices still work on newer ports. So, a USB 2.0 device can be work with a USB 1.1 port, but only at USB 1.1 speed. A USB 3 device will connect to either older port (USB1.1 or USB2) but will only perform at the data rate of that port. Mechanically, they will all connect although, because of its extra connections, the USB 3 plugs and port sockets are deeper than earlier types.
Power from USB? The computer's USB ports can provide power to any low-power devices that connect to it., eliminating the need for the external device to have its own power supply. Low-power devices (such as a mouse or a keyboard) can draw their power directly from the bus. High-power devices (such as printers and scanners) have their own power supplies and draw minimal power from the bus. USB 1.1 and USB 2 ports are capable of providing a maximum of 500mA at 5v, while Using Computers 63
Return to Contents Page 4
USB 3 ports can provide up to 900mA. These figures are for the total of all devices connecting to a USB port. If the power requirements of device, or a collection of devices, exceeds the port's limit, the computer will turn off the port. So don't be tempted to use the USB port to power modules, relays, LEDs, desk fans, drinks warmer pads, etc.
What are USB hubs? USB uses a master/slave implementation. The computer host is the master controlling all bus traffic. This is achieved by having a host controller that handles a 'root hub'. All devices connect to the computer through a root hub. Some computers now have two controller and two root hubs. With all the functions (controlling power, enabling and disabling ports, etc.) being handled inside the computer, external slave I/O devices are simplified and cheaper to make. Microsoft has a utility called USBView that can be downloaded from its website. This provides information on the hubs in use on your computer.
In the example shown, the computer has two host controllers and two root hubs. Two of the ports are used for connecting to memory cards readers built in to the computer, while the other root hub has two input devices (USB mouse and USB keyboard in this example) attached externally. External hubs
As computer users, we are more familiar with external hubs. They come in a range of shapes but they all have multiple input USB ports and a single lead to connect the hub unit to one of the computer's USB ports. A hub therefore connects a group of devices to a single connection point. So, for example, a laptop with only two USB ports can be expanded to allow the connection of multiple USB devices (e.g. external mouse, keyboard, CAN_USB3 module and a Using Computers 64
Return to Contents Page 4
SPROG) all at the same time. External hubs are of two types: Bus-powered
Bus-powered hubs use the power supplied from the computer's USB port to supply their internal electronics. With a permitted maximum of 500mA, a hub often uses 100mA, leaving 100mA to each of its four downstream devices. Self-powered
Self-powered hubs have their own mains power supply and can supply 500mA to each of its downstream devices. This allows further hubs to be connected downstream (see next).
Like USB ports, hubs are built to standard USB 1.1, 2.0 o r 3 specifications. Devices connected to a USB 1.1 hub will only operate at USB 1.1 rates. On an USB 2.0 controller, standards can be mixed; a connected USB 1.1 device can operate at USB1.1 speeds while a USB 2 device can operate simultaneously at USB 2 speed. When purchasing a hub, make sure that you check their speed. Cheaper hubs only operate at USB1.1 speeds.
Using external hubs External hubs are employed for two reasons: To connect multiple devices If the handful of USB ports on a computer are insufficient, hubs allow additional devices to be connected. In fact, up to 127 devices can connect to a single USB port if hubs are used to expand the system. The diagram shows a PC with two USB ports. Port 1 connects directly to a hub and this has four outlets connected to typical USB devices. If you have greater connections needs, you can replace one of the attached devices with another hub. This will provide further connection ports. In this case, however, the original hub will have to be a powered type, as an unpowered hub would be unable to handle the anticipated extra power requirements. In fact, USB supports a tired network of hubs cascaded up to five levels, providing for a maximum of 127 devices attached at any one time. As expected, the port's bandwidth has to be shared between all the devices connected to it. To overcome distance limitations In the example, all the cables attaching devices to Port 1 are shown as short 1m lengths. Due to timing restrictions, an individual USB cable cannot be longer than 5m. In the example, Port 2, connects to a hub over a 5m cable and the hub's connection to the device is a further 5m in length. The 10m coverage should be sufficient for most people's needs. However, the USB 2.0 specification allows up to five hubs to be connected in a long tiered daisy chain. If 5m cables are used between each connection, the maximum distance can be extended to 30m (although why would you want to operate your layout from a computer sited almost 100ft away?). Note
USB is marketed as being 'hot-swappable', with USB devices able be added and removed at Using Computers 65
Return to Contents Page 4
any time. This is not strictly true, otherwise Windows would not need to provide a 'Safely Remove Hardware' facility! The problem arises with the use of external storage devices. To prevent constant access to a hard drive, for example, software will not write data to it continually. Instead it will store some data in its cache (a chunk of memory) and only send the data in chunks. If the user removes a drive before all its data is successfully stored, the file on the drive can be corrupted. This is not a problem for model railway electronics which do not handle such large blocks of data to requires caching, so for example MERG's CAN_USB module can be inserted/removed without any problems.
What about Device Drivers? There are many hardware devices that can connect to a computer and the computer has to be able to communicate with devices that have completely different methods of passing data. A device driver is a small piece of software that provides a properly functioning interface to a particular piece of computer equipment. The equipment might be external such as a printer, plotter, digital camera or monitor – or it might be an internal such as a graphics card. Take, for example, connecting a printer to a computer. There are a huge range of printers, past and present, of different types (inkjet, laser, plotters, etc.). Even printers using the same basic technology may provide different facilities and employ different methods to achieve the same results. and offering different facilities. Since it is not practical to write a separate version of a word-processing package to interface to each available model of printer, the solution lies in placing a piece of conversion software between the wordprocessing package and the computer’s printer port. This is called the ‘device driver’. When the user prints a document, the material is processed by the driver software and sent to the printer in the specific format required by that particular printer model. That explains why many products are packaged along with CDs containing their own device drivers. Microsoft Windows includes many commonly-used drivers along with its operating system. However, unusual devices, including those for model railways, are not included in Windows and have to be installed by the user. The illustration shows a MERG CAN_USB3 module attached to a computer's USB port. A number of applications can communicate with this module, either working as a 'sniffer' allowing the user to view messages coming in from the module (e.g. track occupancy information) or sending messages to the module to operate devices on the CAN bus. FTDI, the company that manufacture the UM245R USB interface module used on the CAN_USB3 module, provide an appropriate royalty-free driver (VCOM or VCP- Virtual COM Port) from their website. It is packaged as the 'Combined Driver Model'. This driver emulates a standard PC serial port, saving program writers from the many complications of handling USB communications. When a user sends a message using the application software, the following things happen:
The software writes a CAN bus message to the serial port. The VCOM driver intercepts this and translates it into a message for the USB port. The USB port sends the message to the CAN_USB3 module. The CAB_USB3 modules translates the message into a CAN bus message.
Using Computers 66
Return to Contents Page 4
The original CANbus message remains the same throughout the process; it is only the way the message is packaged that changes with each step. Although it looks a bit over-complicated, it is the easiest way to do things, as many existing applications are written for serial ports. In addition, routines for reading/writing with serial ports are provided in a number of programming languages.
Installing a device driver There are a number of ways that a device driver can be installed If Windows recognises the device, one of these happens:
Windows automatically installs the specific associated driver from its own collection that was stored on the hard drive during the installation of the operating system. Windows automatically installs a generic driver (one that is common to many similar devices) from its collection.
In these cases, a message might pop up to inform the user that the device is successfully installed. If Windows does not already have the driver, it gives the user three options:
Windows will search the Internet for the driver, then install it. Windows will search the computer, or CD/DVD drive, looking for a folder that might have the driver stored there. If it finds it, Windows installs it. The user can tell Windows which folder to find the driver.
This may result the user being given the choice from a small menu of drivers and the user must select the one that exactly matches the device. There are variations on this procedure. Some manufacturers specify that their driver should be installed prior to installing their device. Others place an auto-run, menu-driven installation routine on their CD. In some cases, the computer has to be-booted after installing a driver. Windows may prompt for a re-boot, or it may be stipulated in the device's manual. Note Depending on the specific computer architecture, drivers can be 8-bit, 16-bit, 32-bit, or 64-bit. This corresponds directly to the architecture of the operating system for which those drivers were developed. For example, in 16-bit Windows 3.11, most drivers were 16-bit, while most drivers for 32-bit Windows XP are 32-bit. Modern 64-bit Linux and Windows versions have required hardware vendors to provide newer 64-bit drivers for their devices.
Using a USB device with a USB port Having read all the above, there is not much to say about this. Just plug the USB device into a USB port and, assuming that any necessary device driver is present, the device (and its controlling software) is ready to use. Examples here are memory sticks, Bluetooth and WiFi dongles, mice and keyboards – not forgetting the CAN_USB3 module.
Using a serial device with a USB port At one time, all older computers had serial ports. While serial devices (e.g. the Servo4 and CAN_RS modules) are easily used with serial ports, they cannot be used with modern USB ports. This is solved with the use of a 'USB to serial adapter'. It does what it says on the tin; it is a piece of hardware (often built into a cable) with one end plugging into the computer's USB socket and the other end plugging into a serial device. The adapter's hardware Using Computers 67
Return to Contents Page 4
carries out the conversion between USB and serial formats.
The illustration shows the steps involved in using a serial device (e.g. Servo4 module) on a modern computer that only has USB ports. The module's control software writes to a serial port but, since the computer has no serial ports, the drivers and adapters are used to transport the data to USB and then back to serial before connecting to a serial device.
COM ports When software is run that accesses a serial (or in our case a virtual COM port), it asks which serial port is to be used with the application. Although we are using a USB port for the external connection, the software still has to be allocated a serial port number to associate with the virtual driver. Once a COM port is allocated, the process shown in the above illustration is established. The illustration below shows the entries in Device Manager after connecting a CAN_BUS module.
In this example, COM3 has been automatically allocated to the module and this value is the one to enter into any application software when prompted for the COM port number. Note
It cannot be assumed that the COM port allocated will be the same each time the device is plugged in. So, for example, if another device is already allocated to COM3, it will use the next available COM port. With a computer dedicated to layout control, such changes are less likely. HyperTerminal can also be used to determine the COM port of a newly added USB device. Just check the available ports before adding the device and any new COM port added after inserting the device is listed. Hyperterminal is not available in Windows 7 but it can be Using Computers 68
Return to Contents Page 4
copied across from an existing XP computer; Google for details.
USB Problems As mentioned before. the serial port is a robust, if slow, communication mechanism. For example, if a serially-connected device temporarily lost power or had its serial cable temporarily disconnected, the port, the software and the modules would all work as normal as soon as the cable/power was restored. This without any additional action by the user. With USB, on the other hand, the loss of power or cable disconnection affects a USB connection badly. In both cases, the voltage from the device's pull-up resistors would be removed and the hub would detect this and disable the port. The usual remedy is to unplug and re-insert the USB cable, so that the device is detected and configured once again. As a consequence, the application software usually has to be restarted. When a USB device is enabled, its driver software is located and loaded into memory. When that same device is unplugged, its port is freed and its driver is unloaded from memory. However, the computer stills stores information about that device and its connection in the Windows Registry (use regedit to look under the 'Enum' key in the HKEY_LOCAL_MACHINE folder – but don't alter anything unless you know what you are doing). The illustration shows a computer's USB enumerations, as viewed by USBDeview, a freeware utility that improves on Microsoft's USBview and on Device Manager. While Microsoft's USBview utility only allows viewing of port information, USBDeview has options to disable and/or uninstall device allocations (when run using Administrator righ ts).
Note that only three devices are currently connected ( a mouse, keyboard and memory card reader). All other entries describe devices that were previously connected to various ports. Hub #003 is actually Hub 1, Hub #004 is actually Hub 2, while Hub #005 is an external hub.
Using Computers 69
Return to Contents Page 4
Using Computers 70
Return to Contents Page 4
Chapter 18 Assembling a tool kit
Assembling a toolkit 71
Return to Contents Page 4
Assembling a tool kit You may already have a selection of tools that you use for building your layout and some of these will also be of use in working with electronics. Those new to electronics often ask about which tools they should buy. This chapter looks at the wide range of tools that are available. Which ones you buy will depend on your needs – and your budget! Investing in the correct tools will make life easier, safer, and also more enjoyable. Although you can sometimes get by with a minimal selection, it is best to always have the correct tool for the job. A screwdriver is for tightening and loosening screws; it should not be used as a chisel or a scaper. Similarly, don't be tempted to use the tip of your soldering iron as a lever to pull components off a board.
A minimum starter set As a guide, everyone's toolkit should include: A soldering iron and solder A pair of pliers Cutters A selection of screwdrivers Wire strippers
These, and other tools, will be looked at later. In the meantime, take care over the quality of the tools you buy. The very cheap tools and kits of tools can cause both frustration and damage. If you buy a set of screwdrivers from a discount store, you may well find that they are made of inferior materials such as white metal and will distort during use. Their lifespan will be much shorter than a quality product. Even worse, they may chew the head of the screw that you are trying to extract, requiring it to be drilled out to remove it. You may consider buying an off-the-shelf toolkit. These usually come in their own case and, if chosen carefully, can be a good starting point. However, it is a case of 'buyer beware'. If something seems to good to be true, it usually is to good to be true. You can hardly expect to buy a 60-piece quality toolkit for a small outlay. That said, some useful toolkits can be found marketed as 'PC Repair Kits'. Tool collections are different from all-purpose toolkits and these can be useful. Sets of Allen keys (hex keys), socket sets, etc. provide a selection of sizes at a reasonable price.
Two other assets Apart from tools, there are two other important assets that you possess. Pencil and Paper Don't rely on your memory; what you remember today may not be recalled next week. So write down important details (e.g. what colours of wire are used for particular purposes, what settings you have used, what options you have chosen, simple wiring diagrams, etc.). Plenty of time and patience Don't rush at a job. You may be desperate to see things working but that leads to mistakes and botched results. Accept that projects may take twice as long as expected and leave time to understand, plan and properly execute what you are doing. Assembling a toolkit 72
Return to Contents Page 4
Safety on the bench/layout This chapter has to begin with some words of caution when working with electricity and with hand tools. Model railway equipment runs at relatively low voltages but that does not mean that there are no potential threats to health and safety. A few simple precautions, and a responsible approach, will ensure that the hobby can be enjoyed without any significant risk. The main areas of concern are listed below.
Electric shock Although the equipment runs at low voltages, the power supplies that feed it connect to the mains supply. It should go without saying that you should not open up mains power supplies unless you really know what you are doing. There is 240V AC lurking inside these units, which can be lethal. Here are a few simple rules: Ensure that power supplies are safe. Check the power cable for any
damage such as cracked or burnt insulation, cracked or bulging plastic casing, broken or loose plugs. If you are in any doubt, you can check whether any metal surfaces are live to the mains by touching it with a 'mains tester screwdriver' as shown. If the neon inside the handle lights, the surface being touched is live. The tester can be used with no risk to the user as the handle and shaft are insulated. If your mains-powered unit blows a fuse, ensure that the replacement is of the same rating as the original. If a plug has a 5A fuse, do not replace it with a 13A fuse – it uses a 5A fuse for a reason. Of course, the unit that blew the fuse should be thoroughly checked before being used again. If your layout is in a damp environment, you may consider fitting an RCD (Residual Current Device) between your power unit(s) and the mains outlet. An RCD device monitors the current passing through it and switches the power off very quickly (30 to 50 milliseconds) if the normal current balance is upset (e.g. a leak between live and earth). Some exhibition managers prefer to have these on every layout in their show where the hall does not provide this in their wiring.
Risk of fire/burns Although electric shock is a very serious condition, it is rarely a danger for modellers who follow some elementary precautions. More common are the minor accidents that occur at the workbench, mainly burns and cuts. Some pieces of equipment consume very little current and produce very little heat – unless things go wrong. Other modules are designed to handle larger currents and have components that are fitted with heatsinks, a piece of metal with fins designed to dissipate the unwanted heat. A short on a board, or other fault that results in excess current, results in excessive heat being generated. For example, if a 12V module suddenly shorts and draws 2A, the module is now dissipating 24 Watts, mostly in heat. If the unit has a thermal cut-out, things may be controlled; otherwise, you have the equivalent of a soldering iron inside your plastic box! The other danger, and probably more common, are the risks of minor to serious burns when using a soldering iron. Assembling a toolkit 73
Return to Contents Page 4
If you smell burning, or see smoke, turn off the module's power immediately. If you are working in an enclosed space, you may want to open a window to dispel any possible toxic fumes. If you are building a module that handles large currents, fit heat sinks to the power transistors and the voltage regulator. Do not overload a circuit by adding extra modules beyond the supply's working capacity. Heat sinks can get very hot, even during normal operation. So, use caution when touching a heatsink. The soldering iron should stay in its stand/holder when not in use. Do not leave it resting on your workbench; that is an accident waiting to happen. If the soldering iron should fall from your bench, your instinct is to catch it – Don't! Let it fall then carefully pick it up by its handle. Take care when soldering. This is when most accidents occur. While concentrating on juggling wires, components, soldering iron and solder, it is easy to accidentally touch the soldering iron or the work being soldered. Use aids that support the work being soldered (see later). This prevents burns caused by touching the objects being soldered; the heat from the soldering iron conducts along the metal and the soldered joint takes a little while to cool down. Wherever possible, avoid soldering joints that are above you, such as under baseboards. Stray blobs of falling solder are a real danger to your face and eyes.
Risk of fumes / poisoning Electronics components can contain toxic materials which can be released if mishandled. Some solders also fall into this category. Many users find 60/40 solder (i.e. 40% lead) much easier to work with than lead-free solder. Unfortunately, over-exposure to lead can affect the nervous system, the heart, bones, kidneys, etc. That is why lead is banned in paint, petrol, etc. 60/40 solder is still widely available and in regular use by hobbyists and is safe if handled correctly. Avoid the temptation to hold small components or solder in your mouth while you are
working. After a soldering session, wash your hands before eating. Avoid the fumes that are generated while soldering. Work in a well-ventilated area or use a fume extractor. A cheaper alternative to an extractor is to use a 12V fan recovered from an old computer to blow away the fumes. Burning plastic is particularly nasty, releasing very toxic dioxin fumes. If you come across burning plastic, hold your breath, switch off power to the module, open a window and quickly leave the room Most printed circuit boards are made from a material called FR-4. The 'FR' indicates that it is flame retardant. However, if any components on that board overheat or catch fire, the board will give off highly toxic halogen fumes. In that event, take the same actions as listed above. Caution should be observed when sawing or filing boards or components, to avoid inhaling the dust; or use a fume extractor/dispenser.
Risk of cuts As a railway modeller you have doubtless already suffered a number of cuts and the same advice applies to working with electronics. Use a wire stripper to remove insulation from wires (see later). Do not attempt to cut materials with a blunt knife. The blade is likely to skid off the work and cause damage elsewhere, including you. Assembling a toolkit 74
Return to Contents Page 4
Use the correct knife for the job (see later). Beware cheap quality knives that may break during use.
Risk to eyes While modellers are usually aware of the risks of burns and cuts, eye protection is often overlooked or seen as a burden. Taking risks can result in temporary or permanent damage to the eyes. The main risks are irritation or damage from fumes, dust or particles from sawing, grinding, filing, and solder blobs being accidentally flicked while soldering. For fumes, read the preceding section. Use safety glasses while working. Alternatively, view the job you are working on through an illuminated magnifier glass (you may already need this because of failing eyesight)
Risk to circuit Apart from keeping yourself safe, you want to avoid damaging your project. Static electricity can destroy some sensitive components and spilled fluids are the enemy of all electronic circuits. When working with integrated circuits that are sensitive to static, always take steps to avoid
static build-up on your body. The commonest method is to touch a bare metal area of a radiator to disperse the charge before handling chips. A cheap but effective approach is to use an anti-static wristband. The strap attaches to your wrist and the clip is attached to any ground connection. Do NOT make your own as the commercial band includes a high value resistance to prevent any high current flowing through its wearer. Regular users might want to invest in an anti-static floor mat. This prevents static from building up on the body. Avoid having fluids on the workbench. A spilled coffee can wreak havoc with your electronics project – and can be dangerous if spilled over mains-powered equipment. The single biggest threat to a project is connecting it to power before carefully checking it over. Any mistakes can lead to the destruction of some components. Do not solder components while the module is still connected to a power supply. Use insulated tools while working on projects that are connected to power. Sometimes you have to make adjustments on live modules and the insulation prevents accidental shorting. Be aware that large capacitors, like those used in capacitive discharge modules, can maintain a high voltage for some time after the power is disconnected.
Of course, there are other things that can damage a project and/or its components. Issues such as inserting components the wrong way round, inserting the wrong component, etc. These are not strictly health and safety issues although they can be costly and can cause damage in some cases. These issues are covered in the chapter on fault finding.
The work area An organised work bench is a major contributor to safety.
Have a well-lit work area. Have an uncluttered and clean work area, with only the things you need on the bench or to hand. Remove any flammable objects, drinks, etc. Have the appropriate tools to hand before starting a project. Do not remove safety shields or other protective devices from your tools.
Assembling a toolkit 75
Return to Contents Page 4
Maintain your tools in good working order. Have a printed copy of project's circuit diagram and assembly instructions. Read through the instructions before you begin. This will minimise errors and prevent expensive (and maybe dangerous) mistakes. If your tools need special handling, familiarise yourself with them. Make sure you switch your soldering iron off when not at the bench. What about having a First Aid Kit handy?
Finally ... The above pages try to point out potential working hazards and how to avoid them. In practice, you may never come across many of these dangers. However, knowledge of them and an alert mind goes a long way to having fun in a safe environment.
Electronics/Electrical tools The tools detailed in the following pages cover most of what you will ever need. They are not intended as a shopping list; you will find a useful home for some of them and may decide to add others to your collection as you progress.
Cutters / strippers You will often need to cut wire to specific lengths for your projects and to trim the wires from resistors and capacitors. You should have a pair of wire cutters reserved for that job alone. Wire cutters, often known as 'diagonal cutters' or 'side cutters', are designed for that task and are a good investment. Cutting wires with scissors or knives will result in an inferior cut and will blunt or chip these tools more quickly as a result. The added effort in using these tools also makes their use more dangerous than the tool designed for the job.
Rail cutters These are designed to produce a clean flush cut of the rails of 00, HO and N gauge track. The sides of the cut ends are smooth and free from burrs and any rounded edges. The results are quicker and superior to using a razor saw or a Dremel cutting disc. Again, these cutters should only be used on track. Cutting wires with rail cutters can damage the cutting edges of the tool.
Wire strippers Removing the insulation from the end of a piece of wire to expose the copper is a regular task for modellers. Some users cut round the insulation with a knife and prise the unwanted insulation free. Others use wire cutters to 'nip' the insulation before pulling the unwanted section away. The danger is that the copper wire is nicked in the process making it vulnerable to breaking in the future. The images show two tools that do an efficient job of removing the unwanted insulation without damaging the copper wire inside. The blue handled strippers are adjusted with a screw to the desired setting before stripping. The red handled version has preset blades of different gauges along its length. Assembling a toolkit 76
Return to Contents Page 4
Screwdrivers / nut drivers You probably have some of these already and it is useful to have different sizes of each type. The three most common types of screw and bolt are shown in the illustration and it is best to use the correct screwdriver for each type, to avoid chewing the head of the screw or bolt. The most common type is known as the 'Standard', 'Flathead' or 'Slotted'. You may come across other types such as the hex, Torx, square, tri-wing and a range of tamper-free screws intended to keep the amateur from opening devices and equipment cases. The picture shows a set of these screwdriver bits that is used for handling these more unusual types. The advantage of having separate bits is that you can use them with a ratcheting handle for quicker insertion/removal or for use in confined space where there is little room to manoeuvre. Electric screwdrivers are available and are useful where there is a lot of screws to be fitted, such as constructing a baseboard. Another possible purchase is a set of jeweller's screwdrivers. These miniature screwdrivers are useful for handling small screws, adjusting trimmers and working on locomotives. They are sometimes also known as watchmaker's screwdrivers Nut driver You will use nuts and bolts to connect things together, such as constructing a case or panel, securing switches to panels, bolting voltage regulators to heatsinks and so on. Do not be tempted to use pliers to tighten the nuts, as the effort is likely to result in slippage and the edges of the nuts being rounded off. Nut drivers, also known as a nut spinners are designed for the safe tightening and loosening of nuts. They are available as sets, as shown in the image, or as a single handle with a set of interchangeable sockets. The smaller ones can also be used with a loco's crank-pin nuts.
Pliers Completing the trio of indispensable items is one or more pairs of pliers. They are used for holding small objects, bending wires, holding wires during soldering, straightening pins, tightening rail joiners, inserting/removing track pins and a host of other tasks. The images show two pairs of needle-nose pliers, also known as long nose pliers. They are available in both straight and bent angle versions and the ones shown are fitted with springs which open the jaws when pressure on the handles are released. Electricians and other tradesmen often use combination pliers to bend and cut wire and cable. They are larger and have flat edges on the nose and often incorporate cutting blades. They should NOT be used to tighten larger nuts – that's what a spanner is for! Assembling a toolkit 77
Return to Contents Page 4
Seeing what you are doing Electronics makes use of small components and cramped tracks on printed circuit boards and stripboard. A well lit work area is important, as is the ability to inspect your work at close quarters. Sometimes, these two features are combined, with illuminated desk magnifiers. These are available with a heavy stand (as shown) or with a clamp to secure it to the desk. The one shown is particularly useful as it has a smaller lens built into the main lens. The main lens is used while doing general soldering and construction, allowing hands-free operation. The smaller lens has greater magnification for close inspection of the completed job, looking for dry joints, solder blobs, etc. While a normal eyeglass like the one shown on the left is useful for close inspection it has one problem – the closer you get to the work, the more you obstruct light getting to the circuit being examined. This can be overcome by using an illuminated 'Jeweller's Loupe'. A small internal battery powers a bright LED that shines on the circuit. Combined with its magnification properties, it is a very useful inspection tool. If you find working under a magnifier stand too restrictive, you may want to consider a headband with built-in magnifiers. This allows you to work hands-free over a larger area, if you don't mind wearing the headgear. The image shows the popular Optivisor which is available with a range of lenses of varying magnification, from 1.5X to 3.5X. The Optivisor can also be worn over a user's prescription glasses. If you have good eyesight but want to work in the dark area under a baseboard, you can buy a headband with built in LED lamp. These are cheap and are powered from a built-in battery. These are better than a normal torch which requires to be held or strapped to a surface during your activity. If you want to work in a darkened space, but have poorer eyesight or need to work with small parts, then you can buy a headband that combines a light with a magnification lens. Finally, you may consider buying a small dental mirror or a mirror that it attached to a telescopic handle. This allows you inspect awkward areas tight spaces, round corners, behind objects, etc.
Assembling a toolkit 78
Return to Contents Page 4
Holding the work Sometimes construction can be a really fiddly business. Trying to hold the soldering iron and solder, along with the items to be soldered makes you feel that you could benefit from having extra hands. Thankfully, a range of tools is available to help out. They are designed to hold the items to be soldered, leaving you with only the soldering iron and solder to handle. The most common aid is the 'Third Hand' shown in the image. The alligator clips are attached to a heavy base and are adjustable. They hold the work in place, leaving you free to solder. Some, like the one shown, also provide a magnifying glass while others may include a solder mop and/or storage tray for the parts you are working with. Modellers also tend to use the clips to hold items that are being painted or glued.
Tweezers The tips of most tweezers are normally open and are closed together by squeezing on their sides. This is handy for picking up and laying objects. A variation on these are the 'cross action' or 'reverse action' tweezers. Their sides are normally held closed and need to be squeezed to open them. This reverse action allows wires and components to be held securely while you solder them. The type with the flat grippers on the tips, as shown, can also be used while soldering LEDs to boards. If the leads between the LED and the board are gripped by the tweezers, it prevents excess heat from the soldering iron being conducted up into the LED and causing damage if soldering takes too long. A similar tool is the 'Hemostat'. It looks similar to a pair of scissors. The blades are replaced by the holding tips and you will notice that there are two projections close to the finger holes. When you close the jaws over, the friction between these projections locks the tips onto your wire or component. The above tools are for holding items during soldering and construction. There are another couple of tools that are useful. The upper one in this image is a 'prong holder', sometimes called a 'part picker'. When the cap on the top of the holder is pressed by your thumb, prongs pop out from the other end. The prongs are placed round an object and when you release your thumb, the jaws retract and hold the object. It is able to pick up small parts that you would find difficult to fetch with your fingers. It is also useful to place small screws in their wanted locations. The other tool is a telescopic magnetic retriever. As the name suggests, it is ideal for recovering small screws or bolts that you have dropped into areas that are difficult to access. It is simply a telescopic rod with a magnet on one end, although some also have a light to help locate a dropped part. Assembling a toolkit 79
Return to Contents Page 4
Soldering tools These tools are so important that they can be found in the chapter on soldering.
Other useful items There are a number of other tools and aids that can make construction easier.
Test leads There are many occasions when you want to make temporary connections, without the fuss of soldering and unsoldering components or wires. The set of low voltage jumper leads shown on the left is cheap and is supplied with leads of different colours to aid recognition when a number are used on a project. They have croc clips on the ends of each lead and they clip on to component leads, tag strips, etc. If you are working with smaller components or have less room to work in, the leads on the right use mini grabber probes to make the connections.
IC Insertion/Extraction tools Many projects make use of integrated circuits and these have rows of pins that are pushed into an IC socket. Trying to get both rows of pins lined up to insert without bending the pins can be tricky. The more pins on the chip, the trickier it becomes. It is also difficult to remove a chip from its socket. Levering it out with a screwdriver, for example, will often bend or break the pins. The upper tool in the image is used to extract a chip from its holder. The prongs are clipped under the top and bottom of the chip and then the chip is pulled out vertically with a very slight rocking motion, avoiding bending the pins. The lower tool can also be used to remove a chip from its socket by clipping it under the sides of the chip and pulling vertically. It is also used to insert a chip into a socket as the pins are held in place by the tool during insertion.
Crimping Tool A number of modules that you will come across use 'crimp terminal' plugs and sockets to connect the module to power or to other devices. These plugs and sockets are 'keyed' so that they cannot be inserted the wrong way round and are available in a number of sizes; the image shows a 5-way connection. Assembling a toolkit 80
Return to Contents Page 4
The plugs are soldered to the module's board while the sockets use a terminal housing and a set of crimp terminals (see the image). The crimp terminals have to be connected to the wires before inserting into the terminal housing, where they click into place. With a little practice, wires can be soldered to the crimp terminals but the professionals use a crimping tool to do the job. The bare end of a wire is inserted into the terminal and placed in the jaws of the crimping tool. Squeezing the handle results in a strong mechanical joint.
Rolling road A rolling road is a replacement for a length of test track. If you need the loco to run for some time, the test track has to be formed as a circle. This largish board is often inconvenient, as it has to be kept close to where you are working, or you end up carrying the loco between the workbench and the test track. The rolling road is simply a set of rotatable metal discs on which the loco's wheels sit. The discs are powered by your supply and the loco remains stationary while its wheels spin on the discs. Rolling roads are ideal for:
Running in a loco Warming up a loco before using it at an exhibition Setting a DCC decoder's CV settings Testing radio controlled locos
Rolling roads are available for scales from N through to gauge 1. The upper image shows the Hornby rolling road, where the rolling discs are adjustable along slides. The lower image shows one that sits on any existing piece of track, getting its power from that track. These would be used in sets, depending on the loco's wheel configuration.
Test tools If everything we built or designed, everything we ever wired up or connected, always worked first time, we would not need any test equipment to help us locate the faults. Since we are never that lucky, we need tools to help us. This is covered in detail in the chapter on 'Using test equipment'.
Cleaning tools Dirt is the enemy of model railway electronics. It interferes with successful soldering, it affects the performance of motors, it affects the efficiency of trackwork, and more. Keeping the work area free from dust and debris is a simple task, requiring no more than a brush and/or small vacuum cleaner For each of the other tasks, a range of cleaning tools is available.
Assembling a toolkit 81
Return to Contents Page 4
Cleaning the board If you are building a module you ought to clean the printed circuit board, or strip board, twice – once before soldering and once after soldering. As explained in the chapter on soldering, surfaces to be soldered must be free from oxidation, grease, dirt, etc. The surfaces can be cleaned using either steel wool, fine grit sandpaper, or an ultra-fine abrasive pad. A cleaning block can be used but ensure that it is not also used for cleaning track, as you can easily transfer dirt from the track on to the soldering surfaces. Maintain separate cleaning blocks. Another tool is the fibreglass pen (supplied with refills). This cleans with little surface damage. However, take a little care in use as small strands of fibre can break loose and these can irritate or damage your skin. When the soldering on a circuit board is complete you may have some yellowish gunge on the surface. This is flux residue that needs to be removed. The build up covers work areas making it difficult to check for dry joints, solder blobs, etc. Since fluxes can contain acid, it can erode part of the copper tracks over time. An old toothbrush is a handy tool for brushing away loose debris, while a wooden toothpick or careful prising with the tip of a screwdriver can break away stubborn buildup. Servisol sell a cleaning solvent known as De-Flux 160 which produces a clean finish when sprayed on the affected areas. Or, use IPA (see later).
Cleaning the track Problems of keeping the tracks clean are well known to all modellers. The build up of surface dirt, grease or oxidisation results in poor running and the stalling of locomotives. There are two approaches to cleaning track – abrasive blocks and liquid solvents. There are cleaning blocks, such as the PECO Rail Cleaner, designed for this purpose. Do not use sandpaper, as this will scratch the rails and worsen future running. If you can afford it, the Hornby R296 Track Cleaning Coach uses spring loaded abrasive pads to clean the track as it goes round your layout. This takes some of the effort out of keeping the track clean as the loco can be set to make multiple runs round the main loops in the layout – while you do something more interesting. A similar choice is available with solvents. You can either clean the track manually, using a bottle of cleaner, such as Rail-Zip2 or LocoLube, and applying with a lint-free cloth (i.e. one that does does give off fluff when used). A number of cleaning wagons are available that use solvent soaked pads to clean the track. The Tomix 6421 Track Cleaning Wagon is a N gauge wagon that uses pads and cleaning fluid. The image shows the CMX Track Cleaning Machine, an OO gauge wagon that offers both abrasive and solvent pads. The Dapol B800 OO Track Cleaner is a solvent based system that has motorised cleaning heads and even a vaccuum. For those areas that a track cleaning wagon cannot easily be used, there is always the track cleaning rubber and IPA (Isopropyl Alcohol) rubbed with a cloth.
Assembling a toolkit 82
Return to Contents Page 4
Cleaning loco wheels Smooth running depends not only on clean trackwork, but also on clean loco wheels and clean pickups. There are a number of methods for keeping wheels clean. The simplest is to use a cotton bud dipped in cleaning fluid such as IPA. Turn the loco upside down (or in a loco servicing cradle if you have one), apply power to the wheels and hold the bud against the wheel to be cleaned. If there is particularly stubborn gunge on the wheel, you can use a fibreglass brushes to clean the wheel. Take care that no stray threads break from the brush and get into the loco mechanism. Also, do not use this brush to also clean PCBs or stripboard, to avoid transferring contamination from the wheels to the copper tracks of the module you are building. Only use sand paper or grit paper in extreme circumstances, when the gunge is caked and immovable by other means. Take care, as overuse will scratch the surface of the wheels leading to more problems later. Avoid using steel wool to clean wheels as strands are likely to break off. Wire brushes use steel wire bristles and and are also to be avoided. You can use a brass brush or brass pencil to clean the wheels. This approach is adopted by the Trix HO Locomotive Wheel Cleaning Brush and by the Conrad model shown in the image. Two rows of brass bristles are powered up and the loco is held against the rows. As the loco motor rotates, it cleans all the wheels at the same time. It also has an added advantage, in that the loco is never turned upside down thereby reducing the risk of material falling into the loco mechanism. It is best to maintain wheels in good condition. Regular cleaning saves time in the long run, compared to having to tackling hardened deposits. If you prefer not to use abrasive materials, you may consider this simple but effective way to keep wheels clean. A piece of J cloth or paper towel is placed over the track and drops of cleaning fluid such as IPA are sprinkled on the areas that are over the tracks. One set of wheels is placed on the cleaning area while the other wheels are held on the powered track. As the motor spins, the wheels are cleaned. Then, reverse the loco and clean the other wheels. This, like the cleaning brush above, has the advantage that the loco is not turned upside down. There are a couple of videos on YouTube that illustrate this process: www.youtube.com/watch?v=R3GzV0i_wW8 www.youtube.com/watch?v=NOvoejG9F3A
Assembling a toolkit 83
Return to Contents Page 4
Consumables Apart from tools, there are items that you will use either regularly or occasionally. Your list of consumables might include:
Hook-up wire in various colours. 7/0.2 is a popular general-purpose wire made up of seven strands of 0.2mm copper wires. Ideal for interconnecting modules, making temporary connections, or even for low current layouts (it can handle a maximum of 1.4A). Alternative, use 10/0.1 wire (ten strands of 0.1mm wire). This type can only handle a maximum of 0.5A but is thinner (0.9mm compared to 1.2mm for 7/0.2) and suitable for most low current connections. Kynar wire. A very thin (usually 30AWG) wire with excellent heat resistant insulation (i.e. the insulation does not instantly melt when soldering). Ideal for wiring where normal hookup wire would be too obtrusive or space-consuming. A selection of heat-shrink shrink tubes of different diameters. As the name suggests, the diameter of these plastic tubes shrink when heat is applied. The image shows the result. Pieces of the tubing are cut off and slipped over a wires prior to soldering. The tubes are then slipped over the soldered joints and when the soldering iron is held close (not touching), the tubes shrink over the joints. This prevents any possibility of shorts between the pins. It also provides a level of protection from contamination and mechanical movement. Choc block terminal strips. Rolls of electrical tape in various colours. These are used for general purposes and for the temporary insulation of joints (there are better methods for the permanent connection of wires). Also useful for colour coding wires by wrapping a small strip of a particular colour round a wire (for example you could use red for +12V, orange for +5V, black for 0V, and so on). Cable ties. Use for the temporarily securing modules or for holding bunches of wire neatly. A selection of nuts, bolts and washers. Include some of the very small sizes as these are the ones you most often lose. A selection of screws. Many modules have mounting holes on them so that you can screw them to a board. Sometimes, these holes are small and and cannot be enlarged as it might break the nearby copper tracks. For these situations, keeping small screws in your collection pays off. Double Sided VHB Gel Tape. This double-sided tape has very strong bonding properties compared to some other products and is widely used in industry as a quick and permanent replacement for conventional fixings such as bolts, screws and rivets. It can bond together a variety of materials such as metal, plastic, glass, etc. Its foam layer also allows for some degree of gap filling. For those jobs that can't be achieved with double-sided tape, there are epoxy resins. It is supplied as two separate components and these are mixed to produce a fast acting permanent fixing. Isopropyl Alcohol (IPA) for those many cleaning jobs. Cotton buds for use with IPA. Solder, either 60/40 or lead-free, depending on your preference. Flux remover Solder tip cleaner. Containers to hold small parts.
Assembling a toolkit 84
Return to Contents Page 4
Control panels One of the most common construction tasks for railway modellers is the building of a layout control panel to house the switches, buttons, lights and some of the electronic modules needed for controlling your layout. The following tools help with creating a control panel. Although not strictly electronic tools, they are included because they contribute to creating panels in addition to general layout construction. The main tasks for these tools are sawing, cutting, drilling and fixing. Of course, many of these tools will used in other tasks such as baseboard and scenic construction.
Sawing and cutting There is quite a range of tools for cutting and shaping materials such as wood, plastic and metal. Although you can muddle through with a simple £2 hacksaw, you might want to look at the features of the various other types of saws as they are designed for specific purposes and produce superior results. Panel saw The first task is to cut a sheet of material (usually wood) to the specific dimensions of your planned control panel. The panel saw, often referred to as a handsaw, is designed to make straight cuts in large sheets of wood. Its tempered steel blade blade, shown in the upper image, has a fine toothed crosscut and can handle plywood and other wood sheet material. Tenon saw The tenon, or mitre, saw is useful for making the battens that often support a panel's box construction. As the lower image shows, the back of the saw has a steel stiffener and this prevents any flexing of the blade. The result is an accurate straight cut, making it popular for general modelling. Hack saw Although the hacksaw can be used to cut wood, it is mostly used for cutting plastic and metals. The blades are replaceable and are held in tension by adjusting screws. Like other saws, whether their blades are coarse or fine cutting is determined by the number of cutting teeth per inch (tpi) along the blade.
Assembling a toolkit 85
Return to Contents Page 4
The options are:
14tpi is coarse and is used for sawing soft metals such as aluminium. 18tpi is used for general jobs 24tpi is used for cutting thin steel plate (up to 5mm). 32tpi is a very fine blade and is used for sawing tubes and other hollows sections.
A cheap miniature version, the Junior hacksaw, is a common tool on the workbench and is mostly 32 tpi. Razor saw The razor saw often comes as a handle with interchangeable blades. A saw normally cuts a slightly larger width than the width of its blade; this is known as its 'kerf' and makes the blade less likely to jam while cutting. The razor saw, as the name may suggest, has a very thin blade (i.e. a low kerf) and produces a very fine cut compared even to a fine hack saw. Blades are available from 32tpi to 52tpi and are used to cut wood, plastic and soft metals. The Ultra Thin (Superfine) and Fine blades saw through wood and plastic without any splits or ragged edges, great for balsa and thin ply. The Medium is often used for metal cutting (e.g. an alternative to rail cutters for cutting flexi-track or cutting track breaks) while the Heavy blades are used for heavier wood cutting jobs. Like the tenon saw, the blades have steel stiffeners to ensure a straight cut. Improving the cut Unless you are experienced in woodworking, you could probably benefit from having tools that help produce a clean straight cut. The humble vice is a useful tool as it holds the work while it is being sawed, preventing it from moving and allowing both hands to be free. It can also be used for filing, bending and soldering tasks. However, if you need cuts to be sawn at precise angles, you can use a mitre box, as shown in the image. It is made from wood, plastic or aluminium and has slots into which the saw blade sits, thus ensuring perfect square or angled cuts. A mitre box is very useful for structure work and for cutting track. Finer cuts There are occasions when you need a more precise cut in situations where the above saws are not practical. For example, cutting rectangular holes in control panels for mounting switches and meters, or cutting rectangular holes for windows in buildings. For these jobs, the coping saw, fret saw and jeweller's saw can be used. They all have a saw blade that is stretched across a C-shaped frame. The work to be cut has a small hole drilled within the area to be removed. The blade is then disconnected at one end and the blade is passed through the hole before being reconnected to the frame. The
Assembling a toolkit 86
Return to Contents Page 4
saw is then able to cut any shape, subject only to the depth of the saw's frame (the throat depth). When the area is cut out, the blade is disconnected again and extracted from the piece being cut. The differences between the types are mostly about construction and blade abilities. A 'Coping Saw' uses blades that are generally of set length with pins at each end that are held by the saw frame. Since the blades are smaller than hacksaw blades, they are better at sawing shapes and curves. These saws are mostly used to saw plastic and wood. A 'Fret saw' is like a coping saw with a deeper throat, perhaps 10" or 12" Their blades are not pinned but are clamped at each end of the saw with thumb screws. They use thinner saw blades, allowing them to cut tighter curves than a coping saw and produce more intricate results. The finer blades make them more vulnerable to snapping than coping blades. Also, many users find the larger frame more awkward to work with. A 'Jewellers Saw' also has its blades clamped by thumscrews but its 'C' frame is adjustable. With the other saws, a snapped blade means a discarded blade. With the jeweller's saw, you can still use the remains of a broken blade by adjusting the frame width. Their blades are generally even thinner than those used by fret saws, resulting in even more intricate cuts and a smaller kerf. Although capable of cutting plastic and wood, they are ideal for detailed cutting of metal (hence its name). Jigsaw If you are building an oddly shaped control panel, or are just needing to cut curved rising trackbed as shown in the image, the jigsaw power tool is the answer. With a little care (watch out for the exposed blade) and a little experience, curves and custom shapes are quickly cut. Blades are available for sawing wood, laminates, metal and plastics, Don't expect too fine a cut as some blades can be as low as 10tpi or even 5tpi. If you already own a Dremel multitool, you can buy the 'Mini Saw Attachment' that converts it into a rip saw.
Other shaping tools While the main shaping work is carried out by saws, there is often a need to give a final trim or shape to a job. For these, a selection of knives and files is useful. General craft knifes, such as the X-Acto or Swann Morton ranges, have handles with removable and interchangeable blades. These include blades that designed for special tasks such as scoring, chiselling, whittling, deburring, stripping, etc. Assembling a toolkit 87
Return to Contents Page 4
A popular knife for the larger, although less accurate, jobs is the Stanley Knife with the retractable blade for safety when not in use. For high precision, Swann Morton sell surgical scalpels. They are very effective but have to be handled extremely carefully as they are not called scalpels for nothing! A useful addition for cutting panel labels, decals, etc., is a self healing cutting mat. This supports the work and provides a clean cut. Don't forget to replace blades if they show any signs of wear or chipping, or are leaving jagged edges on the cut material. Apart from doing a bad job, they can lead to accidents. Finally, there is always a place for the humble pair of scissors.
Files The final step is often a final smoothing of edges and surfaces. Rasp files, such as the 'Bastard File', are too coarse for finishing work and files with finer teeth are required. Small sets of files, known as 'Needle Files' are ideal for smoothing small areas of wood, plastic, metal and even glass. As the image shows, they are available in various shapes, such as round, half round, flat or pillar file, square, and triangle. This provides flexibility for the user to achieve the wanted effect for a particular job. The surface of the file is usually coated with fine tungsten or diamond grit, to provide the smaller abrasive effect required for finishing work. They may come with handles already attached (as shown), or are expected to be used with a separate handle. It is best to keep a separate set of files for metal and plastic/wood. And, if you really want a superior finish, you can always carry out a bit of hand sanding with very fine grade sandpaper.
Drilling Apart from the general uses of a drill while model making, there are specific tasks where drilling tools are useful. Drilling pilot holes for screws, to prevent the splitting of wood. Drilling holes in control panels and project boxes for switches and lights. Drilling holes in baseboard battens to pass wires through. A hand drill is relatively cheap and is more controllable when extra care has to be taken to prevent damage (e.g. drilling beyond the work piece to areas underneath). A mains-powered or cordless drill is much faster and is safe to use if handled with care. Some rotary tools, such as the Dremel Multitool, offer extra facilities such as flexible shaft between the drill and the drill bit to allow drilling in otherwise inaccessible areas. There are many types of drill bit, including specialist bits for drilling masonry, glass and tile. For modellers, drill bits for wood and metal are the ones to add to the toolkit.
Assembling a toolkit 88
Return to Contents Page 4
Twist Bits This is the most common bit in use, for both hand drills and powered drills. They are general purpose bits for use on wood, plastic and light metal. There are three main categories of twist bits: Carbon Steel The cheapest but not suitable for metal or even hardwoods. High Speed Steel (HSS) Can be used to drill wood or plastic but are best used with metals, as
they can handle the higher tip temperatures that are generated. These bits usually are black in colour. Titanium Nitride (TiN) The TiN coating makes the bit particularly suitable for drilling metal; do not use on wood. The bit has a golden colour.
Making a point The cutting edges of a drill bit has an angle (usually 118º) and the tip of the bit is where you start drilling the hole. In practice, it can sometimes be difficult to get the bit to stay in place, specially when you start drilling into metal. The bit can skid along the metal, scoring the surface, or you might drill a hole that is slightly off where you intended. A centre punch tool can prevent any movement of the drill. It has a pointed end that is held at the centre of the intended hole position. The top of the punch is then tapped with a hammer and this makes a recessed dimple in the metal. This indentation helps keep the bit in place during the initial drilling. If a large hole has to be drilled, a smaller pilot hole can be drilled first. This gives extra protection against the larger bit from wandering along the metal surface. A similar technique can be used when drilling wood, specially hardwood. Again, a smaller pilot hole can be useful to mark the exact centre point for the hole. With softwood, the danger is that forcing a large screw into the wood might result in the wood splitting along its grain. This danger can be minimised by making a pilot hole to break up or remove some of the wood fibre. A pilot hole can be made with a drill bit smaller than the final bit size, or with a bradawl. A bradawl look similar to a screwdriver and is inserted into the wood and twisted to break up the fibres.
Brad Point Bits Sometimes called spur point bits, these are for drilling through wood and some plastics The tip of the bit has a sharp point that holds the bit in place when starting to drill the wood. This makes positioning and drilling more accurate. It also has two spurs at the tip and these ensure straight, parallel, clean-sided holes. Apart from general use, they are ideal when for drilling holes for dowelling work (they are sometimes called dowel bits).
Assembling a toolkit 89
Return to Contents Page 4
The Bullet Pilot Point bit. Is the version for drilling metal; it can also be used with wood and plastics.
Flat Wood Bits Sometimes called Spade Bits or Paddle Bits, these are designed for drilling out large diameter holes in wood and some plastics. They can be used for drilling holes in baseboard battens (to pass wires and cables through) or in panels (to mount some instruments). These bits are for use with power drills that are run at high speed to prevent the bit from jamming in the wood. The sharp tip keeps the bit on the centre of the intended hole, while the flat blades cut away the excess wood.
Countersink Bits When using screws you want to ensure that the head does not sit above the surface of the material, otherwise it may scrape other surfaces. If the surface part of the drilled hole is enlarged, the head of the screw can sit flush, or below, the surface of the material. You could simply uses a drill bit of larger size than the hole to create this recessed area. However, there are drill bits specially made for this job. The countersink bit shown in the image can be used with either a hand drill or a power drill. When used with a powered drill, care has to be taken to avoid accidentally drilling down to deeply. You have more control with a hand drill and you can buy a countersink bit with its own fitted handle. A combination bit is available that both drills and countersinks in the one operation. As the image shows, it also has a limiter to prevent you countersinking too deeply. Unless you work a lot with the same screw size, this can be an expensive option as you would require a countersink/clearance drill for every hole size that you use. Although commonly used with wood, countersink bits are available for metal too.
Pin Vices When you work with very fine, small diameter, drill bits, they are very fragile and snap easily. When used with large hand or electric drills, the size and weight of the drill threatens the stability of the drilling process, tilting the drill and snapping the bit. To provide better control over drilling small holes, you can use a pin vice. This is basically a small hand
Assembling a toolkit 90
Return to Contents Page 4
drill. You locate the drill bit in the chuck (collet) and rotate the pin vice barrel between your fingers, while holding the top of the barrel steady with your other hand. Some provide a rotating knob at the top of the barrel so that the vice can be used more comfortably and perhaps single handedly. As the image shows, you can buy pin vices that cover a range of bit sizes. An alternative is to buy a pin vice with replaceable collets, so that you only need a single tool that covers a range of bit sizes. If you are using an electric drill and find it difficult to hold small bits centrally in the chuck, you can hold the small drill bit in a pin vice and place the pin vice in the electric drill. Finally, avoid using drill bits that have been blunted with wear. They will take forever to drill the work, will overheat and may char the wood being drilled. A sharp bit always drills faster and results in a cleaner hole.
Final fixing After cutting and drilling the material, you will want to secure the pieces together. Nails are not recommended, apart from using panel pins to hold a job while the glue dries. A light to medium weight hammer is all that is required to drive home panel pins. The most common way to secure wood sections to each other is with screws and screwdrivers were covered earlier. This method allows the construction to be disassembled at any time by removing the screws (unless you have also used glue). An alternative approach, that used in many items of office and home furniture, is to use dowels. The two pieces of wood are drilled and wooden dowels are glued into the holes. The large surface area of the dowel rods provides a substantial contact area for the glue and this makes the joint stronger than using screws, particularly with composite materials such as plywood. When two pieces of wood are screwed together, they are pulled tightly together when the screw is driven home. This does not happen with dowels, so you have to ensure that they are in close contact. Often, a tap with a hammer suffices. Even better, use clamps to hold the pieces tight while the glue dries. The downside with dowels is that construction takes longer than screwing, as you have to wait for the glue to dry. The upside is a stronger joint and the joint is hidden (there are no screw heads showing). You can buy a small starter kit as shown in the image to practice this technique. If you are happy you can then buy a bag of dowels and use your own glue.
Assembling a toolkit 91
Return to Contents Page 4
Glue gun These are relatively cheap tools and you will find many uses for it once you own one. You can use the glue to secure LEDs inside buildings, hold wires in awkward places, and anywhere you want a quick fixing. Beware though, that the glue is very hot and very sticky.
Some last words This chapter covers more tools than you might need but does still not cover all that are available. What you buy depends on your particluar needs and preferences. Also,the chapter has not covered the use or care of tools. That is a whole other subject. Always read the instructions for each tool you intend to use.
Assembling a toolkit 92
Return to Contents Page 4
Chapter 19 Soldering
Soldering 93
Return to Contents Page 4
Soldering Soldering is defined as the joining of two metals using a low melting temperature alloy (solder) as the filler metal. Solder has three functions:
It wets the metal surfaces that make up the joint. It flows to fill the spaces between the two parts. It metallurgically bonds the surfaces when it solidifies.
Although solder is a poorer conductor than the metals it connects, its very short conducting path means that it has little impact on the overall resistance of the joint. Soldering requires three resources:
A soldering iron (sometimes called a soldering bolt) to generate the heat required. Solder to bond the joint. A selection of tools and accessories to aid the soldering process.
Soldering Irons Types of soldering iron A range of soldering irons are available, with differing characteristics and advantages/ disadvantages. Wired Most soldering irons work at 240v and plug directly into a mains supply socket. This ensures a constant supply current and allows for high-wattage irons to be constructed. Another mains-powered bolt is the hot air iron. This blows out a clean source of heat and is very useful for other tasks such as drying glue, fault-finding, working with SM (surface mount) components, heat-shrinking and desoldering. A very expensive option. Another wired iron works from a 12v supply. This is useful when working under a baseboard, attaching the iron's cable to any 12v connection that runs along under the baseboard. Also handy for working on car repairs. They are fixed wattage irons, with no facility to vary temperature. Portable There are two types of portable (i.e. non-wired) irons. These have the advantage that they can be used anywhere without needing to find a source of power. The illustration shows a typical battery-powered iron. It produces 6W and runs off three AAA batteries. The Weller BP860CEU is an 8W model that can carry out 180 solder joints on a set of four AA batteries. They are often described as “cold soldering” as the tip heats to working temperature in only a few seconds and, when switched off, the tip is safe to touch within only a few seconds. A 'ColdHeat' version has a tip made up of two prods that are shorted by the joint/solder and the high resulting current produces an almost instant heat. When removed from the joint, the tip cools very quickly. This iron is NOT suitable for kit building as the voltage it produces may damage electronic components. Soldering 94
Return to Contents Page 4
The other form of portable iron is gas powered, as shown in the illustration, and uses normal cigarette lighter fuel. A typical gas iron will run for about 20 minutes on a butane fill. With portable irons, you gain convenience of use at the cost of regular replacement of batteries/gas and less control over temperature.
Wattage and temperature These are different characteristics but they are closely linked. The temperature specifies how hot the iron's tip can become, while the wattage determines how long this temperature can be maintained when applied to a joint (i.e. the heat capacity). Soldering is all about applying heat at the correct temperature and for the correct amount of time, for any given job.
So, using a higher wattage iron does not necessarily providing greater heat; it means it may provide heat for a longer period. In some situations, a sustained heat is necessary - e.g. when soldering brass items together or when soldering an earth wire to a metal chassis. A low wattage iron would not be capable of maintaining a constant high temperature, as the heat would be shunted away by the large area of the job being soldered. On the other hand, high sustained heat applied to small joints could easily result in burnt/lifted PCB tracks and burnt components. Modellers may, therefore, have two soldering irons - a lowish wattage iron for working on circuit boards and a higher wattage iron for soldering track droppers, brass kits, etc. Soldering irons rated at 12W / 15W /17W / 18w are generally used for assembling kits, with 25W irons used for general layout work (e.g. brass kits, track droppers, baseboard wiring). Higher wattage irons range from 40W / 50W / 80W / 100W and are used for larger soldering jobs, such as connections to metal chassis, large terminals, earthing tags, stained glass windows.
Variable temperature irons Different types of solder melt at different temperatures (see later). Also, desoldering 60/40 solder is normally carried out at a higher temperature than soldering. To provide this flexibility, you can buy a 'soldering station'. This is a soldering iron that can have its bit temperature set by a rotatory knob or by push-buttons (as in the illustration). A cheaper alternative is the soldering iron whose temperature is controlled via a miniature setting dial, set into the handle which is continuously variable from 200 to 450°C . Typical operating temperatures are: 60/40 (leaded) solder - 280°C to 320°C Lead-free solder - 350°C to 400°C Solder for white metal - 80°C Desoldering - 320°C to 360°C Sleep - 220°C Soldering 95
Return to Contents Page 4
Bits The tip of the soldering iron's bit is usually made from copper or copper alloy, to achieve the best heat transfer to the joint being soldered. As the illustration shows, a wide range of bit sizes is available, even for average soldering irons. The size of the tip determines the heat transference capability, while the shape of the tip determines how well the heat is transferred to the joint. The trick is to match the tip size/shape to the nature of the work. The smallest bit shown is ideal for working with tiny components, or in awkward places to reach. The largest, chisel-shaped, bit is best used to transfer large amounts of heat to large surface areas.
Solder For many years, solder was made from an alloy of tin and lead, usually in the proportions of 60% tin and 40% lead (therefore known as '60/40 solder'). However, on July 1, 2006 the European Union Waste Electrical and Electronic Equipment Directive (WEEE) and Restriction of Hazardous Substances Directive (RoHS) banned using lead in most consumer electronics products manufactured in the EU. 60/40 solder is still OK for home/hobby use and is still manufactured. It is widely regarded as easier to work with than lead-free solder. The melting points of different solders are: 60/40 solder – 188°C LMP (Low Melting Point) for SM – 179°C/188°C Low Melt (for white castings) – 70°C Lead-free solder - 217°C to 227oC Lead-free can have a matt finish, whereas leaded solder is shiny. Solder is available in different thickness. 18swg is used for for larger joints, while 22swg is used for kit building. Low melt solder, for use in constructing white metal loco kits, is supplied in sticks or as solid blocks.
Flux A successful soldered joint requires that the surfaces to be soldered be perfectly clean, both before and during the soldering process. Unfortunately, metals such as copper and tin oxidise rapidly when exposed to air, moisture or heat. It forms a nonconductive, therefore non-solderable, surface on the metal. For example, copper's normally bright shiny colour turns to a dull, orange colour. Flux is a chemical cleaner with three jobs; It removes any existing oxide layer from the joint's surfaces. It prevents the joint's surface from oxidizing under the extreme heat of the bolt – until the solder makes the joint. It encourages the flow of solder into the recesses of the joint. Soldering 96
Return to Contents Page 4
Most solder has several cores of flux embedded in the solder (maybe 3 or 5 cores). When heat is applied, the flux flows out over the surfaces to be soldered, thus removing any oxides and preventing re-oxidation during the soldering process. It is possible to buy a flux pen, shown in the illustration. It has a 'felt' tip, similar to that used in marker pens. When pressed, it dispenses flux and the pen can be used to apply addition flux to a particular spot. This is sometimes used when soldering thin lead-free solder, where the joint may not be getting sufficient flux. Its use has been controversial, mainly due to constructors using water soluble flux pens which can cause long-term damage to the joint and its surrounding metal. The “No Clean” flux pen is not water soluble and is commonly used as a safe aid for soldering with thin lead-free solder. Note
Soldering brass kits and white metal kits use different materials and different techniques from assembling electronic modules. A Google search will result in websites that explain theses processes. In both cases, cored solder is not used. Instead joining surfaces have flux applied to them and the solder is applied before the flux is burnt away. For example, ROX150 Liquid flux is used for white metal soldering and Rox145 solder is used for brass and nickel silver joints.
Soldering Successful soldering is about how heat is transferred to the joint and how solder is applied to the joint. Below is a suggested guide to the steps. Clean the joint
The surfaces to be soldered must be free from oxidation, grease, dirt, etc. While flux is great at removing oxides from the surfaces, it will not clean dirt, oil, grease, etch resist, etc. For that you must use one of a number of cleaning methods. The PCB connecting pads can be cleaned using either steel wool , fine grit sandpaper, a cleaning block, a fibreglass pen (supplied with refills) or an ultrafine abrasive pad. Prepare wire/components
When you purchase a kit it is likely that the components have been purchased relatively recently and will only show minor amounts of surface deterioration. Nevertheless, the leads of the components should be cleaned before insertion into the PCB. Strip off a little of the insulation on any wires that are to connect to the PCB and tin their ends (especially with multi-stranded wire) before soldering on to board. Support the work
Holding components in place and rotating the board to the best angle for soldering, while holding the soldering iron and applying solder can be a frustrating experience. Ever wished you had three hands? Soldering 97
Return to Contents Page 4
A number of devices can be used to support the board and hold it at the correct angle, freeing your two hands for the iron and the solder. For professional work an expensive PCB holding frame is available. , Hobbyists usually employ a small vice or a ' helping hand' as shown in the illustration. This model has a clamps to hold the work, as well as a magnifying glass, a soldering iron holder and a pad for cleaning the iron's tip. Best mechanical joint
Where possible, it is best to obtain a good mechanical connection between components. The illustration shows a wire being wrapped round a pin or a tag. This provides improved mechanical strength as well as improved electrical conductivity. This is not always possible e.g. poking a resistor's leads through holes in a PCB. In such cases, it is best to insert the component's leads through their holes and then bend the wires to an angle. This has the double benefit of allowing the lead to touch the side of the copper pad on the PCB, as well as preventing the component from dropping out when the board is turned over for soldering. Wet/tin the iron's tip
The first step in soldering is to heat the joint to be soldered. The iron's job is to transfer heat to the joint. To promote the the transference of heat, the iron's bit is 'tinned' or 'wetted' – a small amount of solder is applied to the tip. This allows the tip to have a greater contact with the surfaces of the joint and prevents oxidisation of the tip. Apply heat to joint
Use the iron's tip to apply heat to both surfaces of the job. Try not to rely on heat applied to one surface being transferred to the other surface. This could result in a 'dry joint' (see later). The process is – the iron heats the surfaces – the surfaces melt the solder that is placed on them. Apply solder to heated joint
With the joint at working temperature, apply the solder to the joint. The heat from the joint melts the solder and its flux cores. Capillary action ensures that the molten flux covers the surfaces to be joined and also penetrates between the surfaces. Apart from keeping the joint clean, the flux encourages the flow of the molten solder into every part of the joint. As soon as the joint is covered by the solder, the soldering iron should be removed from the joint. The act of soldering a joint should only take about two seconds to complete. If it takes a lot longer, the iron may not be up to the job, the joint may be dirty, or you may be doing it wrong. Enough is enough - applying heat for longer than necessary risks heat damage to sensitive components or copper tracks lifting away from the PCB. It may also change the physical properties (strength and hardness) of the metals being soldered in a process known as 'annealing' leading to failed joints at a later time. Some dont's
Don't apply extra heat or extend the soldering time in an attempt to 'force' the solder to adhere to a dirty surface. Don't drip solder on to to joint, or create a large blob of solder on the end of the tip, to carry over to the joint. That way, the flux that was designed to protect the joint Soldering 98
Return to Contents Page 4
from oxidisation during soldering is burnt off prior to the solder touching the joint. Let the joint melt the solder. Don't use 60/40 on lead-free joints. The lead will degrade the lead-free material. Support joint until it cools
When the soldering iron is removed from the job, the solder on the joint takes time to solidify. If the connection is disturbed during this time, it can lead to dry joints. Resist the temptation to immediately move the board and wait until the solder has cooled before snipping off the excess wires on component leads. Some other soldering issues
Soldering track droppers Soldering wires to track can be difficult, as the large amount of metal in the track can quickly shunt away the heat from the area to be soldered. Contrary to possible expectations, a high wattage iron should be used. Although this may be thought to melt the plastic, the shorter time required to make the soldered connection results in a lesser risk of melting the track. A large amount of heat for a short time is the preferred way to solder track droppers. Tack soldering Here, a small temporary solder joint is used to hold component in position (e.g. one pin of an IC socket) with the joint being remade later. Seam soldering Used in the building of brass kits, a continuous bond is made along a seam or joint, by slowly moving the iron along the seam, heating up the soldered area as it progresses.
Health and Safety A hot soldering iron is a dangerous implement when not given sufficient respect. It is not unknown for hobbyists to burn tables, lamps – and themselves – while carelessly holding an iron (usually while engrossed in examining a joint, etc.). Switch the iron off when not being used for a period, keep the iron in its holder when not in use, and keep the iron away from any flammables. Remember too that the joint remains very hot for some time after the soldering is removed. Try to avoid inhaling the fumes that are produced during soldering. Professional workshops have extractor fans, but you can use a small desk fan to push the fumes away from you. If possible, work in a well-ventilated area. Phosphoric acid fumes can be highly irritating to the nose and lungs, while inhaling Cadmium fumes (silver soldering) can cause serious lung conditions.
Tip maintenance Although the soldering iron tip may be clean and wetted at the start of a session, it can soon end up with a tip that is dry and is dirty. Eventually, flux residue and oxidized lead from the solder coat the tip. This gunge is often referred to as ‘clag’ and can contaminate joints. A black oxide scale results from using 60/40 solder. Since only a tip that is clean, shiny and wetted successfully transfers heat, it follows that the tip needs periodic cleaning during soldering. Different methods are compared next.
Soldering 99
Return to Contents Page 4
Tip cleaner The illustration shows an example of a tip cleaner that is supplied in a small tin. The tin contains a solid disc of solder powder and some chemicals. For badly affected irons, the tip of the iron is pushed into the cleaner and results in large quantities of smoke being produced (use in a wellventilated room). For general use, a single wipe of the bit across the block is sufficient to clean an re-wet the tip. Moist sponge A very popular method is to clean the tip with a moist (not wet) sponge. The tip is wiped across the sponge to remove any oxide layer. Most soldering iron stands and soldering stations have a built-in area for storing the sponge. This is the cheapest method but it has its drawbacks. It is often suggested that the sponge should be used after every soldered joint but this can lead to early tip failure. Repeated frequent wiping during a session creates large swings in tip temperature and the metal layers that make up the tip expand and contract at different rates, leading to metal fatigue. The sponge is also often used to remove excess solder from the tip. The tip of the iron is drawn across the damp sponge and this cools the solder at a different rate from the irons' tip, helping to remove debris. However, this dumps the excess solder, burned flux residue, and other contaminants onto the sponge. Eventually, the next time you clean the tip, you may pick up as much gunge as you deposit. To overcome this, some sponges have a circle or an arc cut out of them so that the gunge can be wiped on their edges. This depositing the gunge in the hole rather than on the sponge. Brass wool A very useful option is the brass wool pad into which the tip is inserted and withdrawn, or wiped across a few times. Brass is abrasive enough to remove the gunge without damaging the tip's coating, as brass is a softer metal than that of the tip. Unlike the sponge, it does not cool down the iron's tip significantly, so soldering can carry on without waiting for the tip's temperature returning to its operating point. Great for 60/40 solder, or a badly coated lead-free tip. Abrasives It is possible, although not advisable, to scrape the gunge off using a file, sandpaper or steel wire brush. While they may be used in cases of extreme contamination, they should generally be avoided. An iron's tip is generally made from a copper core with an outer iron cladding and a nickel or chrome plating. If the protective outer plating is breached, flux is able to penetrate into the copper area. Combined with the heat, this will rapidly eat away the copper core, leading to pitting and holes in the bit's surface. If you really must use extreme measures, use extra fine grade sandpaper (between 220 and 600 grit) and be careful not to rub excessively. You may find that a fine-bristle, brass grill-brush will be sufficient and safer. Keep tip tinned
The tip should be kept clean and shiny during the soldering session, for the reasons already explained. Soldering 100
Return to Contents Page 4
It helps if you match the diameter of the solder to the tip. Using small diameter solders may not keep the tip flooded with solder while in use and cause the tip oxidize and wear faster. If, on the other hand, there is excess solder on the tip, remove the iron from the job, take it to an used section of the workbench (one with a protective cover) and give the iron a gentle tap or whip-like shake to remove the excess solder. At the end of a soldering session, the iron should be left in a tinned state, to protect it from oxidation and corrosion when lying unused. Other issues
Do not use the iron's tip to push a component or use it as a lever (e.g. to prise out a component lead). Do not push solder against the tip, to force it to melt; wait until the tip is sufficiently hot to melt the solder naturally. Do not use pressure or rubbing of the bit on the joint, in an attempt to improve heat transfer. Excessive force on the tip will cause the iron plating to crack, with reduced tip life as previously explained. Use only the temperature that you need. Higher tip temperatures result in faster oxidation. Soldering at temperatures over 470º C will make the tip to oxidize twice as fast as soldering at 370ºC.
Desoldering There are many occasions when you might want to desolder a wire or a component.
A component has become faulty. You have wired a component in the wrong place. To remake a joint that you think may be suspect. You want to lift one lead off a component to aid in fault-finding. You want to recover components from a module that you no longer use.
Trying to remove the solder with only the use of the iron is often not successful, with the remaining solder running back into the joint whenever the iron is removed. To remove large solder blobs, a desoldering pump, often called a 'solder sucker' can be used. It is a spring-loaded device that puts the spring into tension when the knob is pushed down. The iron is placed on the soldered joint to melt the solder before being quickly withdrawn and replaced by the sucker. A quick press on the button releases the spring and the solder is sucked into the body of the pump. A very effective method for most joints is the use of a 'solder wick' or 'desoldering braid'.
The wick is made from a ribbon of braided copper wire that is impregnated with flux. The braid is placed over the soldered joint Soldering 101
Return to Contents Page 4
and the soldering iron's tip is then held against the braid. The heated braid melts the solder which wicks (seeps) into the braid. Removing the braid lifts away the excess solder. The impregnated section of the braid is then cut off and discarded. A typical desoldering may use up less than 1” of the braid and, since the braid comes in 5' rolls, it will last for some.
Shopping List If you are just about to start experimenting with soldering, the following is a list of the tools and accessories you might find useful.
Must haves
Soldering Iron Soldering Iron Stand (if not supplied with the soldering iron) Solder Cutters (to trim off component leads, cut wires and wire links to length) Pliers Magnifying glass / eyeglass Good lighting Protective surface (to avoid burning the dining room table!) Cleaner sponge (if not supplied with the soldering iron stand) Brass wool
Useful accessories
Third 'Hand' / small vice Wire strippers (strips insulation from wires without risking damaging the wire) Solder wick / desoldering braid Solder sucker Earthing strap / anti-static wrist strap with cord (if handling static-sensitive devices) Brass wire brush Tweezers Tip cleaner Flux pen Heatsink (to clip on to a lead if it is being soldered close to a heat-sensitive component)
Further information on some of these tools can be found in the chapter on “Assembling a Toolkit”
Soldering 102
Return to Contents Page 4
Surface Mount components For a long time, electronic components were of the 'through-hole' type. They have wire leads that poke through holes in circuit boards and are soldered to the copper pads underneath. These are still in widespread use but have been joined by 'surface mount' equivalents. These are tiny devices that allow the miniaturisation of mobile phones, etc. They also make the production of commercial boards quicker and simpler to produce, being designed for robotic pick-and-place assembly of boards, rather than the manual assembly. All the common electronic components, such as ICs, resistors, capacitors, regulators, LEDs, etc. available in both through-hole and SMD types. Surface mount devices are so small that they are measured in thousands of an inch. The most common size is the 0805, which means that it is 8 thou long by 5 thou wide (i.e. 2mm x 1.3mm). Most resistors and capacitors are supplied in this size. Other sizes are larger (1206 – 3mm x 1.5mm, 1210, 2010 and 2512) or smaller (0603 and even smaller). The image shows some of the most common shapes for SMD components. Passive components (i.e. resistors and capacitors) are found in the 0805 or 1206 outlines. General-purpose transistors use the SOT-23, with power transistors using the SOT223 outline. The 8-SOIC and 14-SOIC are the 'Small Outline Integrated Circuit' outlines for many integrated circuits. SMD components are so small that it is difficult to print conventional markings on them. Often, they will have no markings and have to be kept in separate plastic bags with labels. They are usually supplied on a bandolier (a 'film strip' with many sealed pockets) and should be kept there until they are ready to be mounted on your modules. If any components have markings, they will not be ones you are accustomed to but you can look up their details at: http://www.marsport.org.uk/smd/codeintro.htm For example, a resistor marked as 273 is a value of 27k, while one marked as 2702 is a 27k resistor with a 1% tolerance.
Soldering methods As SMD components are intended for industrial and professional use, it poses extra challenges to hobbyists who have to work with much smaller components and increased risks of shorts, dry joints, burnt-out components, etc. Having said that, many hobbyists have adapted to working with surface mount technology. They have different (sometimes contradictory) experiences, use slightly different methods and offer differing advice. There are three main methods, depending on what you are prepared to spend.
Hand soldering Hot air Reflow oven
Soldering 103
Return to Contents Page 4
Hand soldering Like conventional soldering, it uses a soldering iron and solder, with the possible addition of other aids and materials.
Soldering iron You might think that you would use a soldering bit with a fine point but it will not transfer heat as effectively as a bit with a flat edge. A flat or chisel tip of at least 1mm should be used, with some users reporting great results with a tip as large as 3mm. While a 15W iron will handle a few components, it may struggle to maintain its temperature when soldering many components, or working with large surface areas. If you have a temperature controlled station, you will benefit from the constant heat output it provides. The temperature can be set to 315ºC to 370ºC for tin-lead solder, and 370ºC to 426ºC for lead-free solder. A different tip is better for handling ICs and this is covered later.
Solder/Flux/Solder paste Efficient solder flow is even more important when soldering SMD components, as prolonged application of heat from the soldering iron can damage components. Solder that contains a small amount of silver aids the flow and shortens the time needed for soldering. From earlier, we know that flux prevents oxides from forming on surfaces, aids the distribution of heat and makes the solder flow more easily. Normal solder has flux cores embedded in it and the flux flows when the soldering iron melts the solder. We can use this method to solder SMD components but normal solder is far too thick for the job. Instead, we use a fine gauge solder (26 SWG) that still manages to have cores of flux. Since the solder is so fine, there is not a lot of flux in the cores. If necessary, the user can apply extra flux to a solder pad using a flux pen or brushing on from a jar of liquid flux. There are three types of flux in common use - water soluble flux, rosin-based flux and noclean flux. Water-based flux is more 'active' (better at combatting oxides) but is mildly corrosive and also conductive, so excess flux has to be cleaned off with water. Rosin-based flux is less active, less corrosive and the residue is cleaned off using a cleaning solvent. No-clean flux has a low activation level, making it harder to achieve good results. However, its residue is non-corrosive and non-conductive, so does not require to cleaned away except to improve appearance. Solder paste is something completely different and should not be confused with solder flux. Flux can be used along with your solder, as in normal soldering. Solder paste is used instead of separate solder and flux. It has tiny particles of solder suspended in a flux gel. The paste is grey in colour and sticky to help hold components in place during soldering. The two hand soldering techniques are looked at next.
Soldering 104
Return to Contents Page 4
Getting started The components you are working with are tiny and the board on which they will be soldered is likely to be small too. These pose extra challenges for us. SMD components can easily slide off the board, or even 'ping' off in any direction and get lost forever. It helps, therefore, to work on a flat surface that has plenty of visibility. If you place the board on a flat work area that is covered by a large sheet of white paper (A3 or even lining paper) you improve your chances of successful construction. Professionals use precision board holders that clamp the board to prevent movement during soldering. A budget equivalent is to stick your small board on to a larger piece of board using double-side tape or even Blu-Tack. This larger board provides stability and can be easily rotated to provide optimum access when soldering. Other items to gather together include:
A source of adequate light A magnifier (or combined lamp plus magnifier) A soldering iron The appropriate soldering bit for the method being adopted. Brass wool or other cleaner to maintain a clean bit. Tweezers Desolder braid Solder, flux or solder paste and a cocktail stick IPA, to clean the board before starting, during the construction where required and after completion of soldering where required.
As a rule, it is best to work with a single SMD component at a time to minimise the risks of lost components. The protective film strip should only be peeled back as far as required to uncover each component. The component can then be removed by tipping it on to the board, where it can be moved into place.
Using cored solder The pads on the printed circuit board may or may not be pre-tinned. If the pads are tinned, ensure that they are only a thin film; any blobs should be removed with desolder braid. If the pads are not tinned, tin one pad only.
Pick up the component using tweezers. Place the component across the pads. Hold the component in place. Quickly tack one side of the component to its pad, with as little solder as possible. Check that the component has not moved; melt the solder and adjust if necessary. Maintaining light pressure on the component, solder the other end properly. Return to the first end of the component and solder it properly.
Solder as quickly as possible with as little solder as possible, consistent with making a good joint. You can watch this video on YouTube: http://www.youtube.com/watch?v=Jpj3tilIaik Soldering 105
Return to Contents Page 4
You do not need a lot of solder to make a good joint. If a pad is pre-tinned, you may only need apply a little solder to the iron's tip and apply it to the joint, specially if you apply flux to the pads. This is the opposite of conventional soldering where you heat the joint and then apply the solder to the heated joint. You can still manage this with fine gauge solder. Alternatively, you can melt the solder on the iron and apply it to the joint. This way, the flux will boil off before the iron reaches the joint, hence the need for additional liquid flux. When all the components are soldered, clean off the flux residue.
Using solder paste This method is a little simpler.
Ensure that both pads are tinned with a thin layer; use desolder braid to remove any excess solder. Apply solder paste to each pad, using a cocktail stick or similar thin pointed object. Pick up the component using tweezers. Place the component across the pads. Hold the component in place. Place the iron's tip on one end of the component, until the paste melts and flows. Check that the component has not moved; melt the solder and adjust if necessary. After a few seconds, the joint will be cool enough to solder the other end of the component.
If your iron is too hot, the paste will sputter and minute solder balls will be sprayed out from the paste. That, and any unfused paste must be cleaned from the board. This method can also be seen on the above YouTube video.
Soldering ICs This can appear a very task as you have to solder multiple tags that are spaced very close to each other, with all the possible shorts that could be caused. A number of techniques are used and they all share some basic rules:
Before starting, make sure that all pads are tinned with a thin layer of solder. Check that there are no solder bridges between adjacent pads. When placing the IC on the pads; make sure the pins are centred on the pads and it is fitted the correct way round! Solder two pins on diagonally opposite sides of the IC. This holds the IC securely in place while soldering the remaining pins. Check and reposition if necessary before proceeding.
Some hobbyists apply flux to the pads. This method is:
Apply flux to the pads. There is no need to dab each pad individually, just apply to the local area. Place the IC on the pads, soldering diagonally opposite pins. Solder each remaining IC pin, one at a time, using a fine gauge solder and a very fine tipped soldering iron. Pause from time to time to prevent the IC from overheating. OR Using a soldering iron with a flat tip, rub the flat tip along the pins whilst feeding solder. Pause between each row to prevent the IC from overheating.
Some hobbyists use the 'drag soldering' method. It is similar to the above method but uses a soldering iron with a special tip with a concave cup at the end. These are available as gullwing tips, bucket tips, spoon tips, or NTGW conical tips.
Soldering 106
Return to Contents Page 4
This acts as a reservoir or bowl for some molten solder. This method is:
Apply flux to the pads. There is no need to dab each pad individually, just apply to the local area. Place the IC on the pads, soldering diagonally opposite pins. Load up the reservoir pool with solder. Slowly run the tip across a row of pins with its solder pool facing the pins. The solder will be drawn to the joints and, with practice, there will be little or no shorts between pins.
This method can also be seen on this YouTube video; http://www.youtube.com/watch?v=t06malVew40
Some hobbyists apply solder paste to each pad. This method is:
Apply solder paste to the pads. There is no need to dab each pad individually, just run a strip of the paste along each row of pins. Place the IC on the pads, soldering diagonally opposite pins.. Solder each remaining IC pin, one at a time, using a very fine tipped soldering iron. OR Using a soldering iron with a flat tip, rub the flat tip along the pins.
Hot air rework station This method does not use a soldering iron to melt the solder. Instead it directs a stream of very hot air at the joint. This method is:
Before starting, make sure that all pads are tinned with a layer of solder. Check that there are no solder bridges between adjacent pads. Apply solder paste to the pads. Place the component on, or close to, the pads. Heat the air gun to its working temperature and set the air flow to a constant gentle stream (you don't want to blow the component off the board!). Hold the gun over the work until the solder melts. Move the component into its final position.
Some users replace the solder paste with flux and rely on having sufficient solder on the pad to melt and complete the joint. As the image shows, you can fit specially-shaped nozzles on the end of the hot air gun. A range of shapes and sizes is available, covering round shapes, DIP 8-pin upwards and QFP (Quad Flat Package) outlines. These nozzles direct the heat more efficiently at the work area, allowing an IC to be soldered in a single operation. They also prevent any unintended unsoldering of nearby components. Unlike soldering iron tips, the nozzles have a very long working life. Note You cannot use a normal hot air gun (the kind used for stripping paint, thawing pipes, etc.). for soldering as you cannot sufficiently control its temperature.
Soldering 107
Return to Contents Page 4
You can see this method near the end of this video on YouTube: http://www.youtube.com/watch?v=Jpj3tilIaik
Reflow oven All the above methods solder one component at a time. This method solders all the components at the same time, in a single operation. It uses an oven with infrared heating elements. Large versions are used industrially and the one shown in the image is smaller and used by developers and hobbyists who are willing to pay out around £200. This method is:
Before starting, make sure that all pads are tinned with a layer of solder. Check that there are no solder bridges between adjacent pads. Degrease the board, using a cleaner such as IPA. Apply solder paste to the pads . Place the components on the pads. Check that all components are seated correctly. Place the board in the oven. Set the timer. Sit back and relax while the heat melts the solder.
This is a much simpler and less stressful process than soldering one component at a time. The drawback is the price for someone who only builds boards occasionally. If you are really adventurous and are confident in your abilities, you can always consider building your own reflow oven, usually from a toaster oven. Just do a Google search for 'DIY reflow oven'.
In all cases … Whichever method you use to solder components to boards, you should make the same final steps. Examine board with magnifier, looking for any problems with joints, solder bridges, components that have moved, etc. Remake any bad joints. Remove any solder bridges with desolder braid. Remove any flux or other residue, using a cleaner such as IPA.
Soldering 108
Return to Contents Page 4
Chapter 20 Test procedures
Test procedures 109
Return to Contents Page 4
Test procedures You build a module … You apply the power … It doesn't work … What's wrong? Where do you start? What do you need? What can you do? Firstly, don't panic! You are certainly not alone. No-one gets every project to work first time. However, we can minimise the risk by having a logical approach to fault-finding and testing. This chapter can't cover all possible faults for all kits and home-built projects found in magazines or on the Internet.. Some use ICs or PICs, some don't; some are supplied as kits with carefully selected components, others are supplied as circuit boards with members sourcing their own components; some need computer software, some don't. This chapter should provide useful pointers, looking at the most common problems users encounter. It also looks at some equipment that should help you test your modules. Let's start with the good news … Its not always us If a module won't work, it might not be our fault, as there are other possible factors, such as: Faulty components. Rare, but does happen. Incorrect instructions. Happens occasionally; watch out for updates and amendments. Ambiguous instructions. The author knows what is meant but has taken too much for granted. Ambiguous components. Chip with markings rubbed off or difficult to determine. One of these resistors has a red band while the other has an orange band- which is which? Bugs in the software
Now the bad news.... Its usually us Not as bad as it sounds, as in the great majority of cases the problem can be identified with a visual inspection (aided by a decent magnifier).
Getting started Many modellers initially make little distinction between construction and testing. They build their kits and are keen to see if they work. While understandable, it is best to take the time to carry out simple checks before plugging in the chips and switching on the power. Although there are a variety of approaches, one of the best is: “Fault-finding starts before you insert the PICs and/or ICs”
This is for two reasons:
Faults that might damage your components can be detected before they destroy your circuits. For example, its best to spot that you've mistakenly use a 15v regulator instead of a 5v regulator, or connected a 12v supply to a 5v connection – before your PICs or ICs are fried. Checking for shorts or breaks in a circuit and resistance values are not complicated by the internal resistances between pins on PICs and/or ICs, giving 'wrong' readings.
Test procedures 110
Return to Contents Page 4
Once all the checks listed below are completed satisfactorily, any transistors can be soldered on to the PCB and ICs and/or PICs can be inserted into their holders
Keep an open mind It's easy to jump to the conclusion that the chip must be faulty, or the program is wrong – only to find that you have soldered a component the wrong way round or forgot to wire an essential link on a board. Rule nothing out; start with the premise that anything and everything is possible. The chip or component might be faulty (it has happened, although rarely) or the program may have errors (this has happened too) but the vast majority of mistakes are caused by the constructor. Fortunately, most problems are easily detected and corrected.
Knowing the symptoms “It doesn't work” is a first observation but it pays to use all your senses to fully appreciate the problem. Can you: See: Screen contents, error messages, motion, lights, even smoke! Hear: Points operating, motors spinning, warning beeps. Feel: Vibration from rotating parts, temperature of chips. Smell: Components overheating, dust, odour from spillages.
In addition, you can deduce: Times: Start-up times, shutdown times, delays in running tasks. Sequences: Noting the order of events (e.g. does the computer application hang before or after a particular device is used). Differences: Noting the performance comparisons between two identical modules running the same application or connected to the same system.
If you ask for help, others will probably ask you to describe the symptoms and saying “it doesn't work” is not really an answer.
Visual checks Let's start with the obvious; the problems we can spot just by looking. Don't skip over this section, assuming that you built the project correctly and the fault must be somewhere else. After all, if you build the project correctly, there is a good chance that it would work. Many faults are found solely through visual inspection. Here are some self-checks to try. Are all the components fitted to the board? Compare your board to the layout in the printed instructions or the circuit diagram. A quick first check is to look at the diagram and note the component quantities. If, for example, the resistors are numbered from R1 to R8 and the capacitors are numbered from C1 to C7, there should be 8 resistors and 7 capacitors on your project board. Are all components the correct values? For example, have you swapped a 10k and a 100k resistor? If you are unsure of the coding system for resistors, you can find them on many websites, such as: www.doctronics.co.uk/resistor.htm www.csgnetwork.com/resistcolcalc.html To identify capacitor values from their markings: www.csgnetwork.com/capcccalc.html www.csgnetwork.com/capcodeinfo.html
Are all components wired the correct way round? More on this later. Test procedures 111
Return to Contents Page 4
Are all wire links and/or jumper links in place, where they are included? These are easily overlooked. Bear in mind that some are optional links while others are essential; read the instructions. Are all components soldered to the PCB pads? Are there any components whose wires protrude through the holes in the circuit board but have not been soldered to the track pads of the PCB? Are there any dry joints? Poorly soldered joints are a major source of problems. They prevent circuits from working, or cause them to function badly or intermittently. The wire leads on the components and the copper pads on the printed circuit board should be clean and bright (free from any oxidisation) prior to soldering. The wire should be in full contact with the pad; the solder should not be used to bridge a gap. This illustration shows the effects of dirty or oxidised joints. On the left, the solder has formed a blob on the component lead but has not made a connection with the copper pad. On the right, the solder has formed a mound on the pad but has not made a connection with the component lead. Consider the image on the left. It shows that the left-most pin is not making a solid connection to the track pad. The solder had adhered to the component wire but not to the pad.
Poor connections are also formed when a component is disturbed before the molten solder has been allowed to fully harden (e.g. by prematurely cutting the excess wire from a component). These are visible as the solder surface is not smooth but crystalline. Both of these image show disturbed joints Most dry and disturbed joints are easy to spot on visual inspections. In some other cases, jiggling a component results in one end moving or even lifting from the PCB. You could also use a multimeter to confirm whether there is any break or unwanted resistance across a joint. A suspect joint can be remade by removing as much of the solder from the joint as possible. If required, the component lead or track pad should be cleaned, before applying fresh solder. The soldering iron tip should be cleaned and wetted (a small amount of solder on the tip to aid the heating of the joint). Never apply the solder to the soldering iron tip and then transfer it to the joint. That way, the flux that was designed to protect the joint from oxidisation during soldering is burnt off prior to the solder touching the joint. Instead, apply the heat to the joint surface and apply the solder to the heated surface. Test procedures 112
Return to Contents Page 4
Are there any unwanted shorts between the tracks of the PCB? This is another very common problem and is usually caused by:
Applying excessive solder to a joint to the point that the blob flows across to a neighbouring copper track on the circuit board. A fine stray wisp of wire.
Use of a magnifier is helpful here, even if you have good eyesight. An eyeglass magnifier or an illuminated magnifier on a stand is a worthwhile investment if you plan to construct a number of projects. Are all the PCB tracks solid? If you etch your own boards, 'holes' in tracks from over-exposure/over-etching a thin copper track and can lead to minute breaks in the track, or tracks that split when a board is flexed when screwed down. Similar problems can be caused by overheating a connection during soldering, to the stage where the copper track separates from the board. The floating thin copper track is vulnerable to cracking and breaking. Here is an extreme example, where the excessive heat has lifted and broken many of the board's pads.
Are switches set correctly? Applies to modules where DIP switches are used for configuring its settings. Are all ICs correctly fitted? Check that all ICs are pressed fully home into their holders. Check that none of the IC's pins have been bent under instead of being inserted into the IC holder. Are all module connections sound? The module board may check out OK, but what about the connections to attached components – e.g. potentiometers, switches, buttons, lights, plugs, sockets, etc. Are heatsinks fitted? Heatsinks are commonly used on components that might overheat due to high current handling. These include voltage regulators, power transistors and some dropper resistors. These can easily be overlooked as they are not mentioned on some schematic diagrams or even in the assembly instructions.
Polarities The next step is checking that the components are fitted to the board “the right way round”. Resistors and smaller value capacitors can be fitted either way round but higher value capacitors and all semiconductors have polarities that have to observed. Fitting a semiconductor component in reverse stops the module from working correctly, and may destroy the component. Here, as a reminder, are details of the polarities of commonly-used components.
Test procedures 113
Return to Contents Page 4
Diode The band round a diode denotes the cathode and this is shown compared to its symbol on a schematic diagram. Fitting a diode in reverse may not destroy it, depending on how it is used in a circuit, but may destroy another component by allowing excessive current to flow. For example, it is common to connect a diode across a relay that is being switched by a transistor. Fitted the correct way round, it prevents back emf (high reverse voltages caused by the collapsing magnetic field in the relay coil) from destroying the transistor. However, if fitted the wrong way round, it effectively puts the full supply voltage across the transistor. With no load to limit it, the current through the transistor will rise from tens of milliamps to hundreds of milliamps. Not only will the relay fail to operate, but the circuits components may be damaged by the excess current flow. LED The LED symbol, as shown on a wiring schematic, is displayed on the left, while the drawing on the right shows that the longest lead a LED is commonly the anode. If you have LED with its leads cut (e.g. been removed from a board), you can't use this identification but you can use other methods. In some round LEDs, there is a flat edge on the LED bezel and this is always next to the cathode. If you don't have a flat edge, look inside the LED; the cathode is usually, but not always, the larger electrode. If all else fails, just connect a 1k resistor to the positive terminal of a power supply (say 5V) and a wire to the negative terminal. The LED will illuminate when the LED's anode is connected to the resistor. High-value capacitors Electrolytic and tantalum are 'polarised' – they have to connected the correct way round or they risk being destroyed. The polarities are marked on their bodies; the examples show a + symbol on one leg of a tantalum capacitor and a negative symbol on a black stripe on an electrolytic capacitor.
ICs and PICs At one end of the body there is an arc cut into the moulding and often a 'dimple on the body. These indicate where the pin numbering begins and ends, with pin 1 of the chip being next to the dimple, to the left of the arc. Most I.C. holders have similar markings to indicate the 'top' and should be soldered to the PCB the right way round. Then, when the chip is due for insertion, it is pushed into the holder with the orientation markings aligned.
Test procedures 114
Return to Contents Page 4
I/O pins Many modules use a ribbon cable or multiple wires to connect it to external components, or to another module. The wires could be soldered directly to the module circuit board but is is more convenient to use plugs and sockets, as they allow easy removal and refitting. The pins may be plain or may be the 'Molex' type that have a plastic body that ensures that the plug can only be inserted one way round. This prevents, for example, a power plug being inserted in reverse. Of course, this assumes that you have correctly wired the plug in the first place. Similarly, check that wires to the interconnect plugs have their wiring in the correct order and are plugged in with the correct orientation. Using ribbon cables or a colour coding system minimises wiring errors.
Ratings Electronic components have ratings that denote their maximum operating conditions – e.g. the amount of current that a diode can pass, or the amount of power that a PIC output pin can handle, beyond which they are likely to be destroyed. In some cases, their specifications list both a continuous rating and a maximum rating. For example, a 0.25W resistor could dissipate 0.5W for a limited time. On the other hand, an integrated circuit may be instantly destroyed if it is operated beyond its maximum rating. If you are building a project, the wattage value of power (e.g. dropper) resistors is calculated by P=VxI or P = I2 x R or P = V2 / R where P is the power value, V is the voltage across the resistor and R is the resistor value. Consider a 10mA LED connected to a PIC pin via a 270 ohm resistor. The 5V from the PIC is reduced to 2.5V at the LED. The minimum wattage rating for the dropper resistor is only 2.5v x 0.01A = 0.025W. Now consider connecting a 6V 1 Amp relay to a 12v supply via a 6 ohm resistor. Dropping 6V at 1A would dissipate a full 6 Watts in the resistor, requiring a high wattage resistor mounted on a substantial heat sink and situated away from the module's other components. As can be seen, a resistor's wattage rating has to cope with its maximum working conditions. In practice, a wattage rating higher than that calculated is used, to provide a margin of safety. Linked to maximum wattages, transistors and ICs also have maximum operating temperature ratings, beyond which destruction is likely. Exceeding safe temperatures drastically reduces component life and can lead to 'thermal runaway' – increased temperature results in increased current flow, which leads to even greater temperatures, and so on, until the point of destruction is reached. This can be avoided by ensuring that transistors and ICs:
are never run beyond their operating parameters. are not close to, or touching, any heat sources. Are fitted with their own heat sinks where appropriate.
You can use components with higher ratings than those specified; it just means that their size may be larger. For example, you can use 1N4002 (2 Amp) diodes instead of 1N4001 (1 Amp) diodes, or a 2A power supply instead of a 1A supply. The exception is fuse ratings; never fit a fuse with a higher rating than recommended. Don't use components that have lower ratings than specified – they were given the higher rating for a purpose. Test procedures 115
Return to Contents Page 4
Tolerances A component's tolerance is the degree to which its value may vary from its stated value. So, for example, a 100k resistor with a 10% tolerance may be found to be as low as 90k or as high as 110k. You can buy resistors and capacitors with very narrow tolerances but these are rarely required in our projects; they are most used where very accurate results are required, such in timing circuits or in measuring equipment. Note If you are building from a kit, all the tolerance and rating values have been selected and tested and should pose no problem to constructors.
External problems Sometimes the problem is not in the module but in the way that the module is connected and/or used. Are you using a suitable power supply? Does it have the required voltage and the required current rating? The power supply should provide a stable output, one whose voltage remains constant under a variety of current requirements. Cheaper power supplies are unregulated. This means that their voltage output without a load may be higher than its quoted output, while their voltage output may drop below their quoted output when they have to supply current. Many modules fit voltage regulators and these expect to fed by a voltage that is over 2V greater than the required voltage. So, for example, feeding a 9v supply to a 5v regulator is OK, while feeding the same regulator with a 6v power supply will produce an output that is less than 5v – often low enough to reset a PIC or alter a circuit's switching levels What is the effect of a lower supply voltage level than that given in a schematic? In the best case, little or nothing. However, in many cases the module's performance suffers; amplifiers produce lower voltage swings, relays fail to operate, switching levels are not reached, and so on. If a module uses a PIC, its brownout level will be reached, causing the PIC to reset. Many PICs include a built-in Brown-Out Reset (BOR) feature that resets the PIC when its supply voltage drops below an acceptable level for correct operation. Bear in mind that a PIC's supply voltage may only occasionally drop when it has to supply a burst of heavy current (e.g. when activating servo motors). This might explain how a module seems to misbehave intermittently. What is the effect of a higher supply voltage level than that given in a schematic? Firstly, there is the danger that semiconductor devices may be destroyed, Then there are the problems of heat, component life and thermal runaway mentioned earlier. Also, the triggering point for switching devices may be altered. How can a power supply be tested? The simplest way is to test the power supply when not connected to a circuit but with a dropper resistor across its terminals. The resistor value is chosen to draw the maximum current that the supply says it can provide. The value is determined by R= V/I, where V is declared voltage of the power supply and I is its declared current rating (bearing in mind that the nearest available value may have to used). For example, if a module requires 100mA, a 5v power supply can be tested by placing a 47 ohm 1W resistor across it output leads. The current should be 5/47 = approx 106mA and a satisfactory power supply's voltage should still be 5V.
Test procedures 116
Return to Contents Page 4
Any other power supply problems? SMPS (switched-mode power supply) supplies only provide their stipulated output voltages when a sufficient current is drawn from the supply. If the minimum load current is not drawn (e.g. when testing the supply before connecting it to a module) the supply regulation does not function properly. In the case of PC power supplies, a source of high-wattage that is readily available from discarded computers and often found at car boot sales, the supply simply cuts off it there is no load. Test a stand-alone SMPS supply by connecting a 100 ohm resistor across the terminals before taking a voltage reading. A word of caution. The power dissipation in the resistor = 12 x 12 / 100 = 1.2W If testing a laptop 18v supply, P = 18 x 18 /100 = 3.24W. So, beware of the considerable heat from the resistor. Handle with care; watch your fingers ! Some users have a variable supply when building a module on the workbench. Some of these supplies may initially output a higher than the desired voltage, until regulation takes over. This poses the possibility of blowing semiconductors and/or PICs. In general, it is best to switch on a power supply before connecting it a module that has no power regulator fitted. Fully-built modules with 5v regulators fitted are safe, as the regulators prevent any initial voltage surges. Are you using the correct software/firmware? Some projects are “works in progress”, continually being developed and improved, removing bugs and adding features. There may be hardware changes (e.g. the selection of a better component or a different component value), firmware changes (e.g. a new version of the code to be used to program a PIC) or software (e.g. updated versions of control programs or test utilities). Maybe a feature you think you ought to have is unavailable because you are using a previous version of the software or the PIC code. Check their websites and use the latest versions. Also, some modules only work when their device driver software is installed (see their documentation). Are you using the software correctly? Make sure you understand how to use the software, how to set it up, what it is supposed to do, what steps you need to take (and in what order), and what any error messages may mean. Some software is pretty obvious (e.g. an on-screen throttle) while others benefit from reading the manual (e.g. JMRI) or an understanding of the background technology (e.g. CBUS traffic monitors or RS232/USB sniffers). Do you have the correct COM port setting? Some modules may be designed to plug straight into your computers USB port. Others may only have a serial port interface, in which case a serial to USB adaptors has to be used. In this case, the software is fooled into thinking it is communicating with a specific serial port given by its COM port number. The software will prompt for which port number to use. Providing the wrong port number will either result in the program not working, or the program producing an error message. This can be complicated by different computers allocating different COM port numbers to your device. So, for example, it may attach as COM5 on your desktop but as COM3 on your laptop – and as a different port number on your friend's computer.
Test procedures 117
Return to Contents Page 4
Is there unwanted electromagnetic interference? These fields are caused by all mains, radio frequency and oscillatory electrical circuits. They can act at a distance and can induce unwanted voltages in anything that contains a length or coil of wire. Sources of magnetic fields include SMPS power supplies, thermostats (e.g. fridges, central heating), car ignition circuits, fluorescent lights, radio masts and amateur radio, mobile phones, cordless phones, wireless LANS, video senders, etc. In addition, model railway sources include electric motors, solenoids and DCC signals. Of course, railway tracks act as great aerials! The spurious voltages can result in unwanted operating conditions in a module and can explain why a module works on the workbench but not on layout. Some interference sources are obvious; the layout works OK on another SMPS power supply, the problems start when the fluorescent lights are switched on, or when a cordless/mobile phone is used, etc. Others are evident with a little observation; glitches coincide with the central heating switching off or when a particular servo or solenoid is activated. Some interference problems are solved at source (e.g. changing a fluorescent tube or starter, fitting a suppressor or replacing a thermostat). Other problems may be solved at layout level (e.g. re-routing cables, fitting additional RF bypass capacitors or filters, replacing a noisy servo). Does your layout suffer thermal problems? With many layouts sited in sheds, garages and lofts, they are subjected to extremes of temperature. Excessive heat, and changes in temperature, can cause a great many faults. Excessive heat, as explained earlier, can cause excessive currents in modules, and causes component lifetimes to be shortened. Extreme heat warps plastic, causes LCDs to lose their contrast, and causes mayhem with semiconductors. Temperature changes also produce problems. The differing thermal coefficients (the amount of expansion and contraction) of PCB track, wire and solder can loosen the solder bond of a module's connections over time. Temperature variations can also lead to 'thermal creep'. IC chips move a tiny fraction of a millimetre each time the module heats up and cools down and eventually 'creep' out of their sockets. Temperature variations also cause the layout's metal tracks to expand and contract and can lead to poor connections at track junctions The application of heat (by a hair dryer or similar) to an area of the module board will expand any metal and hopefully expose any poor or intermittent connection. Conversely, if the problem is already present, the application of a freeze spray (available from electronic component suppliers) to selected areas will cool the area and hopefully restore normal operations, thereby showing up the problem connection. Do you have static problems? Static electricity discharge is really a construction issue but it might also explain a 'faulty' IC. Static energy is most commonly generated when humidity is low and we walk across a carpet, wear nylon clothing, rub against certain materials and furnishings, etc. The static charge remains on the body remains it gradually bleeds away – or we touch an object that allows the static to be rapidly discharged as a spark. If that object is a module board and its components then there is a danger of damage, particularly to CMOS chips. Test procedures 118
Return to Contents Page 4
These dangers can be minimised by the avoidance of static buildup and proper handling of devices. Attention can be paid to the working environment, by having an antistatic floor mat or bench mat, applying antistatic agents to suspected materials, increasing the room's moisture level using a humidifier (or those little water containers than hang from your radiators), or even sometimes by opening the room's window. Attention should also be paid to handling sensitive components, or boards on which they are mounted. Fully-populated boards should be held by their edges, avoid touching the components, the PCB tracks or the board's edge connections. Components that are sensitive to static damage should be kept in their packaging until they are about to be fitted to a module. The antistatic bags or conductive foam protect them until ready for use. Lastly, make sure that you are not a carrier of static charge before handling sensitive components. Some people rely on touching the radiator or a screw on a computer case, as both of these should be earthed. A more reliable technique is ground yourself with a conductive antistatic wrist strap. These are readily available and consist of a wrist band that makes contact with your skin and connects to the ground via a 1 MegOhm resistor, and a length of wire with a crocodile clip on the end. This ensures that any high voltage charge is safely leaked away to ground. The resistor is fitted as a safety measure, to greatly limit the current should the croc clip accidentally come into contact with live mains. Note These measures won't repair a blown chip, but may stop you from also blowing the replacement chip.
Fault-finding equipment If none of the above tests find the fault, test equipment can help you locate a fault. Project designers employ a range of test and development tools. For most hobbyists, a simple multimeter is a good investment and a worthwhile tool that will be used again and again. They are available very cheaply and are accurate enough for most purposes. A few other aids are also covered but lets start with the most commonly used tester.
The multimeter As the name suggests, it is a meter that can make a range of measurements that help detect problems in components, in project boards and also in track wiring. It can expose problems not found by visual inspection. Even the most basic model will measure:
Resistance Voltage Current
Each of these will be available in a number of ranges, as this aids reading accuracy. For example, the voltage ranges might include 0 to 200mV, 0 to 2V, 0 to 20V and 0 to 200V. You choose the range that you expect best cover the voltage being read. Not also, that the meter will have both AC and DC voltage and current ranges. There are two types of multimeter: The analogue meter, with a needle that moves across a calibrated scale. The digital meter, with the readings being read off a digital display. Test procedures 119
Return to Contents Page 4
They both have different benefits. The digital readout provides a reading with no ambiguity, subject only to the tolerances of the meter's own electronics. If you are asking for help on a Forum, you can guarantee that you will asked for the voltage levels at various points on your circuit. The analogue meter has advantages when reading varying levels. The digital meter takes readings periodically and presents them to the user. It is not easy to spot if there is a sudden quick dip in a value (e.g. a drop in voltage as a loco creates a momentary short going over a point). With an analogue meter, this would be readily detected as a quick dip in the meter reading. Just be careful with analogue meters as you can damage the needle if you try to read a high value with the range set to a low value; the needle will shoot up to the end of its range and could be bent. Always work from higher ranges downwards, if there is any doubt. More expensive multimeters may also test diodes and transistors. Apart from fault-finding on electronic modules, multimeters are used for a host of tests on model railways. For example, on trackwork, it can detect broken wires, shorts at points, poor (i.e. high resistance) connections. On locos, they can detect whether all wheel pickups are working and whether there are any problems with the motor. On controllers, they can detect whether there is the expected voltage output, whether a fuse has blown, etc. The illustrations show typical multimeters. The sockets along the bottom are for plugging in test leads that are used to make the measurements. The black lead connects to the COM (Common) terminal and the red lead to the red terminal. The large knob chooses whether voltage, current or resistance is being measured, with each allowing a range of measurements. This simple circuit has a battery powering an LED. There is a dropper resistor in series with the LED to limit the current through the LED.
The illustration shows how to measure the voltage across the LED and also the current flowing through the LED. Connecting the meter across the LED tells you what voltage the LED is working on. Connecting the meter in series with the LED tells you what current is flowing through the LED. Test procedures 120
Return to Contents Page 4
Measuring voltage With these settings, the meter measures the voltage across a component, or between two particular points in a circuit. So, for example, if you are told that there should be a 2v drop across a resistor, the leads are touched against each side of the resistor wires, or to the parts of the copper track to which the resistor is soldered. Bear in mind that one end of the resistor will be 2v higher than the other end (e.g. it may be 5v at one end and 3v at the other end). The measurement is reading the difference between both ends. In most cases, measurements are taken with respect to ground potential. So, if you are simply told that the reading at a point in the circuit should be 4v, it means with respect to ground. In these cases, the black lead is connected to ground, with the red lead touching the point to be read. In most other circuits, the ground potential is the common 0v point. Example
Consider these possible voltage tests on a SERVO4 module.
Test point
Likely voltage reading
Purpose of test
12v DC or 9v AC
Confirms that the external power supply is working and is making a satisfactory connection to the module.
11.3v
Confirms that D1 is wired the correct way round and is working.
5v
Confirms that U2 is wired the correct way round and is working. Confirms that there is no abnormal load (e.g. a short circuit) across the regulator.
D
4.53v
Confirms that D2 is wired the correct way round and is working.
E
4.5v
Confirms that R1 is correctly connected.
F
Switches between Confirms that the incoming switching signal (e.g. from a switch on a control panel or 0v and 5v from the output of another module such as a CBUS board) is working and is reaching the SERVO module input.
G
Between approx 0.17v and 0.33v
A B C
H
Test procedures 121
See notes See notes
Return to Contents Page 4
Notes The difference in readings between A and B ( and between C and D) is caused by the voltage drop across the diodes. Test points G are the outputs from the PIC to the servos. If the PIC is working properly, it sends out a stream of pulses whose pulse width varies depending on the programmed servo rotation position. The voltmeter averages out the voltage pulses, producing an average voltage that is significantly lower than the supply voltage. Test point H is the input to the PIC from the serial input socket and is only active when a PC is programming the servo module, otherwise the voltage reading is zero. A voltage reading at point H can confirm that the PC's serial port output is arriving at the PIC, proving that the computer, the serial cable and the servo setting program are all functioning. The voltage reading at point H should be approx 3v, dipping while the application's setting slider is moved. Ground / Earth / 0v The above diagram measures readings against the 0v level. You may find some magazines or articles refer to this as 'GND' or 'ETH' level, GND being the American term for ground and ETH being the UK term for earth. Strictly speaking these terms should only be used when that connection is taken to the actual physical ground (e.g. to a metal water pipe or a metal spike sunk into the ground. However, the term is sometimes used for 0v level. Most circuit diagrams refer to 0v. Other voltage readings Multimeters are useful for detecting voltage drops with long cable runs. If 12v is fed into a cable but only 10v arrives at the other end, the cable may be too thin or the drop may be caused by badly soldered joints, poor plug and socket connections, poor relay contacts, etc. The meter will expose the source of the problem. DCC signals can be measured using the AC settings of a multimeter, with enough accuracy to determine the presence/non presence of the signal and an approximate reading of DCC signal level. This image shows a quick and easy way to test for the presence of DCC at various points on the track. Two studs are soldered to a piece of stripboard. Two LEDs (with their resistors) are wired in different directions across the studs. The tester is held against the rails. If one LED lights, you have power. If the other LED lights, you have power in the opposite direction. If both LEDs light, your track is receiving DCC power. The tester can be moved around to test various sections of track easily and is less fuss to use than a multimeter (e.g. it can be used one-handed).
Note While multimeters are capable of testing mains voltage, beginners should never poke around inside mains power supplies, or any other device where live mains voltages are exposed. Dont carry out high voltage tests, specially mains voltages, unless you are fully competent. Mains voltages can be lethal. Test procedures 122
Return to Contents Page 4
Logic probe Many of the voltage readings you make will be analogue (e.g. The voltage might be any level between 0V and 12V). However, when you work with digital modules, you only want to know if an input or output is high or low, usually 0V or +5V. Examples uses of a logic probe are to:
Check the supply pins of a chip. Is it getting both the +5v and the 0v? Check the output from a track detector – is it changing when a loco passes? Check the input to a circuit that is coming from a switch – is it going from +5v to 0v, or 0v to 5v, when the switch is operated? Check whether the inputs and outputs of digital modules are producing the expected results.
The internal circuits in lots of electronic modules work on 5v, even when the they are connected to a 12v or other voltage supply. This project is for a very useful tool that tells you whether a point in the circuit is at +5v or at 0v. You could ask why not just use a multimeter? You could connect the -ve lead of your meter to the 0v line of your module. Then you could tap various parts of the circuit with the other lead. If you have +5v on that point, you will get a reading. But – and here is the catch – if you do not get a reading, it does not mean that you have 0v at that point. You might just have a broken wire that is not connected to anything. To check for connections to 0v, you would have to connect the meter's +ve lead to the 5v line and then test with the other lead's probe. You would have to reverse your meter connections every time you wanted to check for +5v or 0v. That is where a logic tester is handy. It connects to the +5v and 0v of the module you are checking. Then you touch any point in the circuit. If +5v is on that point, a green LED lights up. If there is 0v at that point, the red LED lights up. All other voltages, or points not connected to anything, either keep the LEDs unlit or dimly lit. The image shows a commercial logic probe but it is not too difficult to build your own.
Measuring current With these settings, the meter is placed in series with the part of the circuit being measured, so that the normal circuit current also flows through the meter. This might necessitate breaking into the circuit, probably by unsoldering one end of a component and lifting that end clear of the board. The diagram shows a very basic test used to measure the current flowing through an LED. Most often you will be checking the current drawn by an entire module. Here, the multimeter is placed in series with the power lead to the module. Again, observe polarity – i.e. the red lead to the more positive side of the circuit. Most modules consume approximately 20mA to 60mA. This does not include the current drawn by any devices (e.g. motors, solenoids, servos, etc.) connected to the module. For example, a servo control module draws about 20mA but each individual servo could draw many hundreds of milliamps. If no current is read make some basic checks (meter switched on/set to current range/wired Test procedures 123
Return to Contents Page 4
in correctly, power supply switched on) before checking the module's components. If an excessive current is read, switch off immediately, before any components are destroyed. Then make the checks outlined earlier (e.g. shorts across tracks, wrong component values, components connected incorrectly, etc.). Other uses for current readings are Heatsink decisions Read the voltage across and the current through a component (e.g. a voltage regulator or a dropper resistor), calculate the power dissipated in the component and select the heatsink necessary to handle it. LED droppers LEDs are rated to work at certain currents, with most rated at a maximum of around 25mA or 30mA. Low current LEDS can operate as low as 2mA and a 20W power LED works at over 1A. You can use an online calculator to determine the dropper resistor value. If you are not connected to the Internet, you can use the multimeter to check the resultant current from using a number of different series resistors (remember to use the highest value first).
Reading fluctuating values Some circuit produce temporary changes in voltage/current, either intentionally or as the result of some problem. These cannot be accurately examined or measured with a digital multimeter, which is intended to read fixed values. If the value changes slowly, as in the case of gradually increasing current caused by overheating, then a digital meter can display the changes. However, short duration spikes or voltage dips are unwanted and cause problems. For example, a burst of heavy current being drawn by a servo may drop the supply voltage and cause a PIC to reset. The duration of the voltage change may be too short to be detected by a digital multimeter. In many cases, such changes are observable on an analogue multimeter. Instead of a digital readout, they move a pointer across a marked scale. Hence many short-lasting changes are displayed as a flick of the pointer, where it would not be likely to be detected on a digital readout. Analogue multimeters are slightly more expensive than digital versions. Rapidly changing values, such as DCC or CANBUS signals, can only be accurately examined with the use of an oscilloscope (an expensive piece of equipment and not required for general use – see later).
Measuring resistance With these settings, the meter measures the resistance across a component, or between two particular points in a circuit. Note that the readings must be made with the power switched off. Like voltage readings, accurate measurements are simple when a component is tested before it is soldered to a PCB. Measurements of components once soldered are often complicated by other components that are on the board. In extreme cases, you may have to disconnect one end of the component from the PCB, to ensure that you are only reading the component on its own. Also, remember to read the resistance with the meter's probe connected both ways round, to ensure against unexpected results (e.g. an initial suggestion of a short circuit might simply be that you are reading a diode or a transistor in its low resistance direction).
Test procedures 124
Return to Contents Page 4
Typical problems detected by resistance measurement are: Open circuit No reading means no resistance to measure, indicating a break in the circuit (assuming you have switched on the meter, set it to the correct range and connected it across the correct points). Short circuit A very low resistance reading indicates a short inside the component or a short across the modules PCB tracks or connections. Of course, there are occasions when you hope to see a short circuit - when testing for the continuity of a stretch of wiring, or confirming that wires have been connected to the correct pins/connectors. High resistance A higher reading than expected usually indicates a poor connection. Check for a dry joint in the soldering, or poor switch and relay contacts. It could also mean that the wrong value of component has been fitted. Intermittent connection Fluctuating readings indicate a connection that only makes proper contact intermittently. It may be caused by badly soldered joints, poor plug and socket connections, poor relay contacts, or even a wire that is broken inside the plastic outer sheath. As explained previously, an intermittent connection may only exhibit itself in times of extreme heat or cold.
Using an oscilloscope This is definitely not the first test tool that you will buy. In fact, you may never need or use one, although it is widely used by professional developers and service technicians. In the hobby area, it is a valuable tool for examining signals where there is a suspected problem. An oscilloscope creates a twodimensional scaled graph on the screen showing how the signal voltage being monitored changes over time, as shown in this image. It can display both AC and pulsating DC waveforms. Time is displayed along the X (horizontal) axis, from left to right, and the voltage level of the signal read at each point in time is shown on the Y (vertical) axis. The display is usually calibrated in 10 horizontal divisions and 8 vertical divisions. Oscilloscopes are very useful in examining and checking signals that are 'cyclic' – i.e. signals that repeats themselves. This can commonly be found in model railway electronics. Examples are pulse width DC controllers, servos, DCC, CBUS, etc. Older oscilloscopes used cathode ray tubes,similar to those used in old television sets. Most models now use an LCD screen to display their readings. The model shown above is a professional product and these can cost thousands of pounds. They are really bench tools.
Test procedures 125
Return to Contents Page 4
If you need to test on the move, you can buy a handheld version as shown. Another approach is to place the electronics in a separate box and connect it to a PC or laptop. That allows the monitor to be used as a large display screen. It also reduces the cost considerably. This image shows a PicoScope unit converting a laptop into a temporary oscilloscope. One lead from the scope is connected to 0V and the probe is touched against the point in the circuit to be tested. Likely tests using the oscilloscope include:
The voltage level of the signal The frequency of a signal The repeat rate of pulses The time delay between events. Whether the signal is being distorted Whether the signal is suffering from interference or noise Whether the waveform is clean (a fast rise and fall time, no ringing)
The illustration shows a square wave output being examined. The top display shows what a clean waveform should look like. The middle display shows the effect of 'ringing', with the value overshooting as it rises and falls. The bottom display shows that the waveform is being rounded off. These imperfections would produce no visible effect on a simple pulse device such as a flashing LED on a vehicle. However, on systems that rely on efficient communications, such as DCC and CBUS, these distortions can create a significant problem. The oscilloscope can be used to reveal any such signal problems. Some signals are entirely cyclic, such as a servo's signal stream or the PWM output from a controller. The exact same waveform is constantly transmitted for any one setting. Change the setting (e.g. increase or decrease the controller's speed) and you get another constantly repeating waveform. Other signals contain data and these contain 0s and 1s in particular patterns to encapsulate the information being sent. Since they don't contain continual repeating ons and offs, their data rate is measured in bps (bits per second) and its multiples (Kbps, Mbps).
Test procedures 126
Return to Contents Page 4
Some examples: Servo repeat rate is 50Hz PWM repeat rate can be as low as a few hundred Hz. DCC is approx 7KHz A computer's serial port operates at 115200 bps CBUS is 125kbps The oscilloscope has to calibrate the X axis in units of time appropriate to the speeds being examined, otherwise you would not be able to adequately see the waveform. The 'Horizontal Sweep' is the control that alters the speed at which the trace moves across the screen and is usually measured in seconds per division (s/div), milliseconds per division (ms/div), microseconds per division (s/div), or nanoseconds per division (ns/div). Example The scope's horizontal scale has 10 divisions. Say you want to look at the signal being sent to a servo. The pulse is sent out every 20mS, so setting the sweep speed to 10mS/div would result in the display showing what happens over a 100mS time slot. This would let you see five servo pulses on the display.
If the sweep speed was set to 1mS/div, you would see 50 pulses on the display but the pulse widths would be so narrow that you would not be able to see the pulse width changing when the servo settings were altered. Its a matter of matching the sweep width to the signal being examined. Oscilloscopes typically handle waveforms from as low as 1Hz up to several MHz, or if you pay a lot more they can cover several hundred GHz. The chapter on loco controllers explained how PWM (pulse width modulation) improves the running of your loco, specially at low speeds. The repeat rate of the waveform may be a few hundred Hz but can be lower or even many Khz. The common feature is that the pulse width varies from being non-existent (the same as 0V) to being constantly high.
Some DC controllers have a PWM output but don't mention it in their advertisements. You can easily check with an oscilloscope by placing its leads across the controller output and adjusting the horizontal sweep until you see waveforms like those above.
Test procedures 127
Return to Contents Page 4
Voltage levels In the same way as you match the horizontal scale to the waveform, the vertical axis must also be set to have the waveform fill most of the vertical screen space. The vertical scale is measured in volts per division (V/div), millivolts per division (mV/div), etc. If the signal being measured peaks at only 10mV, you wont see much if you have the vertical scale set to 1V/division. Similarly, if you try to view a 5V signal with the scale set to 10mV/div, the waveform shoots off the vertical edges of the screen and you won't see the waveform details, such as ringing and rounding. AC readings The above examples show pulsed DC signals being examined. The oscilloscope is also able to read AC waveforms, such as the output from a mains transformer (you can also read the mains itself if you are experienced enough and take safety precautions – if in any doubt, leave well alone!). The illustration shows a typical display of an AC voltage. The horizontal line along the middle of the display indicates 0V and the waveform swings above and below this value as it alternates between positive and negative peaks. In the UK and most of the world, the mains supply is at 50Hz (mostly around 230V), with the Americas and some other countries using 60Hz (mostly around 120V). So, if the oscilloscope was set to 10mS/div, you would see two complete cycles of 50Hz AC on the display. If the scope was set to 50V/div, we would mostly fill the screen vertically with a standard UK mains supply waveform (from the first chapter we noted that a 240V RMS is the same as 680V peak-to-peak which is what the scope will see). Digital storage All the above waveforms were cyclic: you could rely on the pattern continually repeating itself. However, there are other signals that don't repeat so conveniently. For these, a 'digital storage oscilloscope' is used. Instead of simply reading the input and displaying the results on the screen, a DSO saves the values of each sample it reads into memory This lets you view the results your convenience. The results can also be stored as a file or be printed out. So, events that happen only once or only occasionally, known as 'transients' can be detected where they would otherwise happen too quickly to be spotted. This is handy for detecting 'brown outs', sudden short drops in the supply voltage that may reset PICs or provide false triggering. You also check whether a change of output somewhere is unexpectedly triggering an unwanted input somewhere else. DSOs are also used to examine digital signals that are not cyclic. These signals contain data that may be constantly changing. Examples are communication systems, DCC and CBUS. The image shows the display of a DCC signal. Although the pattern looks random, the sequence of ONs and OFFs, contain the data that will be used by the DCC decoder.
Test procedures 128
Return to Contents Page 4
It is possible to examine this waveform and determine the exact content of the message. It can also be used to check the integrity of the waveform, for example to see whether there is excessive ringing on the DCC bus.
Logic analyser Most oscilloscope have two separate independent inputs, allowing you to monitor two different signals at the same time. The more expensive models can handle four channels. As explained earlier, oscilloscopes can examine both analogue and DC pulsed inputs and so can display voltage levels, rise and fall times, noise, distortion, etc. However, with their limited number of inputs, they cannot readily be used where there are many different digital readings to be taken simultaneously and compared. Developers, or those faultfinding on modules with multiple input and outputs, use a 'logic analyser' to display the status of all the inputs/outputs on a single screen simultaneously. As the name suggests, it is not designed for looking at analogue signals. It captures and displays the logical state (i.e. either high of low) of digital signals. It has the big advantage over oscilloscopes in that it can handle a large numbers of different signals, the exact number depending on how big your budget is. The most-powerful laboratory models can have a large display area and show up to hundreds of channels. The picture shows a 'Saleae' analyser with 8 channel capability. It has 9 test hook clips, one for the common point and one for each point to be monitored. To reduce costs, it connects to your computer via USB and uses the computer and its large monitor. Of course, you do not have to use all eight channels if you do not need them all. This image shows eight different points on a circuit being monitored. An analyser's display shows the sequence of events and the timing between events (e.g. whether the output from one part of the circuit triggered an input in another part of the circuit and, if so, if there was a delay).
Test procedures 129
Return to Contents Page 4
Since you can look at many outputs lines in parallel, you can see the output from 8-bit or 16-bit buses, which is why this tool is popular with computer engineers. Some models can look at a group of inputs and display their combined values in decimal or hex notation, or even in assembly code mnemonics. Some models understand communications protocols such as RS232, I2C, SPI, CAN, etc.
Final observations This chapter is not the definitive text on fault-finding. There are many variations, different approaches, and much that can be added from others' experiences. Remember, tests and their results will depend on the circuit being tested and your ability to use your equipment (you have read the manuals, haven't you?) Hopefully, this chapter provides some useful tips for those starting off in the hobby and gives an overview of some test equipment.
Test procedures 130
Return to Contents Page 4
Chapter 21 Pocket Money Projects
Pocket Money Projects 131
Return to Contents Page 4
Pocket Money Projects This chapter presents at a series of mini-projects that first appeared in issues of the MERG Journal. They are designed as 'getting started' kits for beginners, although they are also useful to all enthusiasts. PMPs aim to meet the following requirements: Cheap
Projects must be inexpensive, so that you can 'have a go' without any great outlay (or any great loss if they make a mess of things!) Easy Kits must be simple to build. They must use the minimum number of components and avoid fiddly parts such as surface mount devices. They should require no specialist tools or computers to build and test. The components should be mounted on a piece of stripboard, as stripboard has wide copper tracks and wide gaps between tracks. This avoids producing costly printed circuit boards and makes soldering easier, minimising shorts between tracks, etc. Useful Kits must provide useful extensions to layouts, including some features not otherwise available. Educative The notes must include a section on 'How it works' that is not too technical but helps you learn a little bit more about electronics. Alterable Kits will not be at the cutting edge of technology, providing every possible facility. They are fun projects with a useful item at the end. They should be capable of modification as you learn more. Easily available The parts should be available from all major electronics suppliers and use no specialist components, apart from the pre-programmed PIC chips that some projects use. All the projects that follow are available as complete kits of parts to MERG members.
Why stripboard Once you have got past the stage of buying an using ready-built equipment, you might consider tackling building a kit that for your layout. A careful read of the instructions, an evening's soldering and the kit is complete and can be tested and connected. You don't need to worry about how it works; only what it can do for you. These kits usually come with a printed circuit board similar to the one shown here. Eventually, you might think of trying to build a circuit you saw in a magazine or on the Internet – or even a simple idea that you want to try. For the great majority of projects, getting the components is easy; they can be purchased from suppliers such as Rapid, Radiospares, CPC, Bitsbox, etc, or even cheaper on eBay. But, since they are not complete kits, there will not be a printed circuit board available. PCBs are great; they tell you where to put your components and make life simpler for the constructor.
Pocket Money Projects 132
Return to Contents Page 4
Without an available PCB for your, you have a number of options. Solder them all hanging in mid air, as in this photograph. This will work for a very small temporary test circuit but is useless for large or permanent builds. Design your own PCB and have it made for you. This involves learning how to use a design package. Even worse, manufacturing one board is very expensive. Design your own board and etch the PCB yourself. This still involves learning the design software. It also requires working with chemicals. None of these are of much use to a beginner That is where stripboard comes in. Stripboard (originally called 'Veroboard') is designed as a prototyping board for building a one-off project. The finished project, if proven to be successful, can be put into long-term use or – if it becomes popular - PCBs might be produced for wider use. Most stripboards use a thin sheet made from SRBP (synthetic resin-bonded paper - a paper based laminate). Higher quality versions are made from FR- 4 (a fibreglass-reinforced epoxy laminate). As the picture shows, one side has copper tracks bonded to it. The whole board is then drilled through with holes that are spaced 0.1” (2.54mm) apart. This is designed to have the same spacing as ICs, their holders, etc..
Sizes The most commonly used sizes by hobbyists are 25mm x 64mm - This board has 9 tracks, each track with 25 holes 64mm x 95mm - This board has 24 tracks, each track with 37 holes The 25mm x 64mm version are used in all the Pocket Money Projects. Vero Technologies make a large range of other sizes and details are on their website at: www.verotl.com/veroboard
If required, the boards can easily be cut to size with a small hacksaw. All the circuit's components are laid on the opposite side to the copper tracks, as shown in the picture. The wires from the components are bent, then inserted through the holes and soldered on to the copper tracks on the other side. The copper tracks are used to make the connections between the various components. If you see a picture of a project on a stripboard, it usually has the strips underneath running horizontally.
Cutting the tracks To use the copper tracks to maximum efficiency, the lengths are often cut, to create smaller runs of connecting track. Pocket Money Projects 133
Return to Contents Page 4
In the case of the chip shown in the above picture, the track between the rows of chip pins would have to be cut; otherwise the pins would be shorted together. You could cut the track with a sharp knife but that can be a messy – and dangerous – task. If you are considering making a number of projects on stripboard, it might be worth investing in a stripboard spot face cutter, which quickly does a nice clean job of removing the unwanted copper. The cutter is placed in the desired hole in the copper track and rotated back and forth until a circular area of copper is removed. Check as you go, otherwise you might drive the cutter right through the board! An alternative to a spot face cutter is a drill bit (3mm or 5mm). Turn the bit it by hand; an electric drill would rip a large hole in the stripboard in two seconds flat! In either case, before moving on, check that there no remaining tiny strips of copper still bridging any of the track sections. Next, clean the copper strips prior to soldering the components.
Making links The copper tracks are not always sufficient to connect all the components. In those cases, and it can happen often, you fit wire links between the points you want connected. You can see copper wire links in the above picture. They nearly always run vertically, bridging two section of track by jumping over the tracks in between. Any wire will do, as long it can handle the current it is expected to carry.
Positioning Getting the components into the correct positions and through the correct holes is a tricky business, as it is very easy to make mistakes. After all, even the smallest board has 225 holes (9 rows of 25). Unfortunately, you can't look at both sides of the board at the same time. To help, some diagrams show the components and the track at the same time, as in this example. It is really showing where the components should go. It shows the tracks underneath, as if the board was transparent, to help you cut the tracks in the correct places and position the components correctly.
Designing a layout This is not often an issue for beginners, as printed layouts are usually provided. However, if you become ambitious, you would have to consider how to convert your circuit into an efficient stripboard layout. Paper, pencil and rubber could be used but a number of software applications are available to help you. These range from StripMagic (free) to LochMaster (commercial). A number of possible packages are reviewed on this website. www.printedcircuitsboards.com/software/88/veroboard-stripboard-software.html
Pocket Money Projects 134
Return to Contents Page 4
Track power indicator There are many occasions when you may need to check if a particular section of track is receiving power. Maybe the power to a track section is switched by relays or switches. Maybe the wiring or connections to a piece of track is suspect. Maybe you want to check if you have wired a new piece of track with the polarity the correct way round. You could always check with a multimeter but these are inconvenient, bulky and awkward to use in tight situations. With our little board, you simply touch the module's studs on to the rails. If one LED lights, you have power. If the other LED lights, you have power in the opposite direction. If both LEDs light, your track is receiving DCC power. Fancier commercial versions are available, some even with digital readouts - but they are 20 times to 100 times more expensive.
How it works The circuit diagram is very simple. Two LEDs (light emitting diodes) are connected across the track when the board's studs touch the rails. The 1k resistors (known as 'dropper resistors') are there to make sure that the high track voltage does not result in excessive current that would destroy the LEDs. A LED only lights when it is connected across a voltage in the correct direction. If wired the other way round, it won't do any damage, but it won't light up. You will notice that the two LEDs are wired in different directions from each other. So, if the track voltage is one polarity, one LED lights up. If the track voltage wired in the opposite polarity, the other LED lights up. That way, you can still test for track power regardless of whether the controller is set to forward or reverse. Pocket Money Projects 135
Return to Contents Page 4
If you have a DCC system, your track voltage is constantly switching polarity at a very fast rate, so both LEDs will light up if DCC power is detected.
Parts list
One piece of stripboard 25mm x 64mm 34-0500 One RED LED 55-0150 One Green LED 55-0105 Two 1k resistors 62-0370 (sold in packs of 100) Two brass dome upholstery studs – or two short leads with clips on the end.
If you are a MERG member, this is available as a kit - PMP1 Part No: 801. If you are in an Area Group/club, why not place a joint order and share the postage costs? The part numbers listed are for Rapid Electronics (www.rapidonline.com). Alternatively, check out www.bitsbox.co.uk or eBay for competitive prices.
Construction With so few components, this project does not need any cutting of the copper tracks. First clean the copper strips and the wire leads on all components. This minimises problems from dirty or oxidised surfaces during soldering. The studs are soldered directly to the copper tracks and their position allows them to touch across either 'N' gauge and '00' gauge rails. The resistors can be fitted either way round but the LEDs must be inserted as shown in the illustration. LEDS are manufactured with one of the two wires longer than the other. Don't forget to fit the two wire links (they are pointed to by the arrows) You may want to have the module connected to a stretch of track while you check the layout wiring, switches, connectors, etc. An alternative to studs is to solder two short lengths of wire where the studs are connected. The two wire leads should have clips soldered to their ends. The module can then be clipped across the track while tests are carried out. In fact, since the above project only uses half of the stripboard, why not cut the board in half and build both versions – it will only cost you £1.
Pocket Money Projects 136
Return to Contents Page 4
Train detector This is basically a circuit for detecting changes in light levels and it is has many uses in model railways. A light sensor is positioned between track sleepers and the light to it is blocked when a train goes over the sensor. This triggers an output from the module (in our case lighting a LED). Possible uses include:
A train stops in a marshalling yard and yard lights come on. A light comes on in the control panel when a train reaches a required point on an obscured section of track. Control panel lights indicate which hidden sidings are occupied. Triggering events in other modules such as the CANAC8c.
The project uses just six (or 7) components.
How it works If you are curious about how it works, read this section; otherwise skip to the next section (you can always come back and read this later). Here is the circuit diagram for the light detector. It is powered from a 12v supply since that is a common voltage on model railways. However, it can also be operated by a 5v supply. It uses a transistor to light the LED. A transistor is a small 3-wire semiconductor device that was originally mainly used as an audio or radio frequency amplifier, like those in an old transistor radio. Depending on the voltage fed to them, they can also act like a switch, as in this project. The main flow of electrical current in a transistor is through its collector and emitter wires. That current is used to light the LED. The 1k resistor that is wired in series with the LED protects the LED by limiting the current flowing through it. The amount of current through the transistor depends on what happens at its 'base' connection. It acts like a tap, controlling the amount of current flow. The light sensor used in this project is called a light dependent resistor (LDR) because its resistance varies with the amount of light shining Pocket Money Projects 137
Return to Contents Page 4
on it. The one shown has a resistance of between 8kohms and 24kohms when exposed to light (at 10 lux), rising to 1Mohm when in darkness. It will have resistance values between those two extremes, as the light value alters. There is an LDR, a 1k resistor and a 10k preset potentiometer (a small variable resistor) all in series across the 12v supply. The base of the transistor is connected to the junction of the LDR and the 1k resistor. The voltage at the transistor base will vary depending on the resistance of the LDR (which, in turn, varies with the amount of light shining on). When exposed to light, the LDR has a low resistance and the voltage at the transistor base will be high. This will turn the transistor off and the LED will be unlit. When in darkness, the LDR has a very high resistance and this lowers the voltage at the transistor’s base. This switches on the transistor and the LED lights.
Parts List One piece of stripboard 25mm x 64mm 34-0500 One LED (your choice of colour) 55-0150 for example One 1k resistor (it has brown-black-red bands) 62-0370 (sold in packs of 100) One 10k resistor 62-0394 (sold in packs of 100) One 10k preset potentiometer 67-0466 One BC557 transistor 81-0474 One LDR light detector 58-0134 One 100nF ceramic capacitor – optional (see text) 08-0235
If you are a MERG member, this is available as a kit - PMP2 Part No: 802. If you are in an Area Group/club, why not place a joint order and share the postage costs? The part numbers listed are for Rapid Electronics (www.rapidonline.com). Alternatively, check out www.bitsbox.co.uk or eBay for competitive prices.
Construction This project is built on a piece of stripboard that has nine strips of copper on one side. It is important to note that all the components are mounted on the other side of the board (see the picture) and their leads are poked through the holes for soldering on the copper side. This illustration show the components and the tracks at the same time. It is really showing where the components should go. It shows the tracks underneath, as if the board was transparent, to help you cut the tracks in the correct places and position the components correctly. The first step is to cut a break in the track at the point shown in the illustration. Tip: If you are not too sure, count along the rows and columns on the component side, then poke a wire through the hole where the track is to be cut. Then turn the board over and cut where the wire pokes through.
I use a stripboard spot face cutter, but you could use a hand-turned 3mm or 5mm drill bit – or even a sharp knife if you must. Next, check that there no remaining tiny strips of copper still bridging any of the track
Pocket Money Projects 138
Return to Contents Page 4
sections. Then clean the copper strips prior to soldering the components. When inserting and soldering the components, follow these guidelines: The resistors can be fitted either way round. The preset pot has three legs. Only two are used in this circuit. The LED has to be fitted the right way round, with the cathode end nearest the transistor. The cathode lead of an LED is the shortest lead (see the illustration). The transistor has to be fitted the right way round, with its flat end facing rightwards, as shown in the layout illustration.
Setting up Before connecting power to the circuit, do a close visual inspection of the board, ensuring that you have no short circuits, dry joints, unsoldered connections, etc. If you have a multimeter, you can check how much current the circuit is taking. In darkness, the module takes a tiny 0.03mA , rising to 10mA when exposed to a bright light. The variable resistor can be adjusted with a small screwdriver, to set the point at which you module switches the LED on and off with changes in light level. This setting will be depend on the ambient light in your railway room and where the LDR is located. When the correct setting is found, it is possible to remove the preset, read its value and replace it in the circuit with an ordinary resistor of the same value. Usually, however, it is best to leave the preset on the board, as it allows for any future alterations. In situations of very bright lighting, you may need to partially shield the LDR by placing it in a small length of tubing, although this is not normally needed. If the LDR is placed in a particularly gloomy area of the layout (e.g. in a tunnel or behind tall buildings), you may have to use an auxiliary source of lighting, such as a lamp suspended above the track.
Modifications The LDR can be mounted on the stripboard if necessary, although most operators prefer it to be connected to the board by a a length of wire to allow easier placement. Similarly, the LED can be fitted to the board, or can be fitted to a remote place (e.g. the operator's control panel, on top of a yard lamp) using wires from the board to the LED. The circuit shows a 100nF capacitor wired across the LDR. This is only required where the circuit is feeding into a CBUS or computerised system, to prevent any possible stray pulses from the loco's motor or the DCC signal on the track from generating unwanted pulses. Lastly, the LED and its 1k resistor can be replaced by a 12v relay, if required. You can connect the relay's coil either way round, although the diode (a 1N4001 type is sufficient) has to be wired the correct way round, as in these diagrams.
Pocket Money Projects 139
Return to Contents Page 4
Servo controller / tester Servos have become very popular in model railways in the last few years. They are used for operating points, signals, crossing gates and barriers, cranes, and a variety of lineside animations. The MERG Servo4 kit is mostly used to control servos, with one kit being able to handle four separate servos. It is designed to move a servo's arm between two fixed points and at fixed speeds set by the user. Of course, a servo arm can be rotated to many different positions, and at different speeds each time - if a manual control is used. That is what this project is for.
Turning the spindle of the variable resistor (called a 'potentiometer' or 'pot') rotates the servo arm. You can turn the pot really slowly, or as fast as you want; the servo will respond accordingly. For more details on how servos work read my Journal article of Autumn 2008. The project uses nine electronic components. Its uses include:
A cheap introduction to playing with servos. A module to test servos before fitting them on a layout. Manual control of aerials, radar heads, guns (great for kids). When you need to move to intermediate positions (e.g. a flag at half mast) Mounting a cam on the arm, so you can scan a hidden area of the layout. An asymmetric turntable for smaller gauges (the pivot point is near one end rather than the centre). Any manual control for occasional use.
Pocket Money Projects 140
Return to Contents Page 4
How it works This project uses a tried and tested circuit. The 555 chip is a timer IC which is just what we need for this project. Servos expect to receive regular pulses on their 'Signal' wire (the other two wires on the servo are for our 5v power). The width of the pulse decides what position a servo arm will move to.
If a pulse is 1mS long, the arm will move fully in one direction, while a 2mS pulse duration rotates the arm fully in the opposite direction, Any pulse width between 1mS and 2mS results in an intermediate position (e.g. a 1.5mS pulse will move the servo arm to mid position). The 180k resistor and the 100nf and 47nf capacitors are used to control the time between pulses, while these same capacitors are used in conjunction with the two resistors and 10k pot to control the length of the pulses. So, varying the resistance of the pot controls the servo arm's rotation. For more details on 555 timers, read John Matthew's article in the Winter 2006/7 Journal. The module is designed to work from a standard 12v DC supply and uses a 7805 voltage regulator to bring the voltage down to 5v for the chip and the servo.
Parts List One piece of stripboard 25mm x 64mm One 555 timer integrated circuit One 7805 voltage regulator One 180k resistor One 10k resistor One 10k potentiometer One 1N4148 diode One 100uF electrolytic capacitor One 100nF One 47nF ceramic capacitor One length of 0.1” pitch single row header strip One 8-pin DIL socket (the IC holder)
34-0500 82-0338 47-3313 62-0424 62-0394 65-0715 47-3416 11-0245
If you are a MERG member, this is available as a kit - PMP3 Part No: 803. If you are in an Area Group/club, why not place a joint order and share the postage costs? The part numbers listed are for Rapid Electronics (www.rapidonline.com). Alternatively, check out www.bitsbox.co.uk or eBay for competitive prices.
Pocket Money Projects 141
Return to Contents Page 4
Construction This project uses a piece of stripboard that has nine strips of copper on one side. It is important to note that all the components are mounted on the other side of the board (see the picture) and their leads are poked through the holes for soldering on the copper side. This illustration show the components and the tracks at the same time. It is really showing where the components should go. It shows the tracks underneath, as if the board was transparent, to help you cut the tracks in the correct places and position the components correctly.
The first step is to cut breaks in the track at the points shown in the illustration. Tip: If you are not too sure, count along the rows and columns on the component side, then poke a wire through the hole where the track is to be cut. Then turn the board over and cut where the wire pokes through.
I use a stripboard spot face cutter, but you could use a hand-turned 3mm or 5mm drill bit – or even a sharp knife if you must. Next, check that there no remaining tiny strips of copper still bridging any of the track sections. Then clean the copper strips and the wire leads on all components. This minimises problems from dirty or oxidised surfaces during soldering. When inserting and soldering the components, follow these guidelines: Fit the six wire links. The resistors and the 100nF and the 47nF capacitors can be fitted either way round. The electrolytic capacitor must be fitted the correct way round (see the illustration). The 10k pot has three legs. Only two are used in this circuit. The diode has to be fitted the right way round, with the cathode end to pin 6 of the 555 chip. The cathode end has a band round it, as shown here. The 7805 regulator must be fitted with the metal surface pointing inwards. It helps if the IC holder is fitted to the board with its notch facing bottom right, as shown in the layout illustration. This reminds you to also fit the 555 chip correctly (i.e. with its notch also facing bottom right). The header strip is usually sold as a long row. Break or cut off a strip of three and insert the shorter ends into the stripboard.
Pocket Money Projects 142
Return to Contents Page 4
If the module is to be used for more than occasional use, fit a heatsink to the voltage regulator (or bolt it to a piece of metal) to prevent it overheating. If you feel like really splashing out, buy a knob for the potentiometer.
Setting up Before connecting power to the circuit, do a close visual inspection of the board, ensuring that you have no short circuits, dry joints, unsoldered connections, etc. Connect the power to the board and check that you get a 5V reading between pins 1 and 8 on the IC holder. If that checks out, remove the power, insert the chip (notch to the bottom) into its holder and reconnect the power. When you connect the power, the servo arm will twitch; thereafter, it will move in sympathy with the rotation of potentiometer spindle.
Pocket Money Projects 143
Return to Contents Page 4
Simple shuttle The definition of a shuttle is “a form of transportation that travels regularly between two places”. On our layouts, that could be a loco or maybe a tramcar. The loco runs to the end of the track and stops for a set time. It then reverses to the other end of the track before stopping once more. This cycle repeats indefinitely. The uses for a shuttle include:
Emulating a tramcar service. Emulating a country line, with tunnels at both ends (using longish waiting times at both ends). Emulating an industrial shuttle – e.g. ferrying material from mines to the docks or loading bays. Maintaining visitor interest at exhibitions, during back operations. People have something to watch while trains are assembled behind the scenes. Running in or warming up a motor, using short waiting times. The loco is constantly being exercised. Testing a loco before placing on a layout.
Ready-built commercial modules are available, such as the Gaugemaster SS-1, or the Just for Electronics Shuttle. These are fine for a basic shuttle, although our project carries out the same functions at a fraction of the cost. More complex modules provide acceleration and deceleration, such as the Heathcote SA1 (although this module needs loco detectors) or the MERG Automatic Train Controller kit. As you would expect, you pay more to get these features. Most shuttle modules are for DC working, as DCC operations require more than just reversing the voltage on the track. Our project uses nine electronic components.
How it works The project uses a 555 timer chip in a tried and tested circuit. It is used in 'astable' mode which means that its output constantly switches between a high and low voltage. The rate at which it changes depends on the values of the resistors and the large capacitor. If there is a short time between switching, the output stream would be audible (you would have built an audio oscillator). For our project, there are long on periods and long off periods.
Pocket Money Projects 144
Return to Contents Page 4
The 555's output (pin 3) makes a relay switch on and off at regular intervals and the relay's contacts reverse the voltage on the track.
The diagram shows that the track is split into three sections, with a long middle section and a shorter section at each end. The cuts in the track isolate the three sections from each other. One rail is continuous the entire length of the track. The centre section of track is constantly powered from a DC source, while the other sections have a diode wired across the gaps. Being diodes, they only allow current to pass in one direction. The operating sequence is as follows: When pin 3 is high, the relay is not energised (it has a high voltage at each end of its coil). The relay contacts are as shown in the illustration, connecting the loco supply's positive to the upper rail and 0v to the lower middle section of rail. The loco moves leftwards and enters the left section until its rear wheels leave the middle section and power is lost. The train remains in the left section until pin3 of the 555 eventually switches low. The relay switches (it has a high voltage at one end and a low voltage at the other end). The relay contacts switch such that the positive supply is connected to the lower middle rail with 0V on the upper rail. The loco runs in reverse (because the diode allows the current to flow into the isolated left rail). It reverses into the middle section and then enters the right isolated section. When the loco wheels leave the middle section, it stops as it has no power. When pin 3 eventually switches high again, the relay drops out and its contacts return to the state shown in the illustration. The loco moves forward again out of the right section and into the middle section to start the cycle all over again . The 555 chip can operate on a voltage range of around 4.5V to 14V and the time delays are independent of the voltage used. The timer circuit can be powered from a 12V DC source, in which case, the relay should a 12V type. Alternatively, the circuit could be fed from a 5V supply, using a 5V relay. The loco supply voltage should match that required by the loco being used. Pocket Money Projects 145
Return to Contents Page 4
For more details on 555 timers, read John Matthew's article in the Winter 2006/7 Journal, or look at http://talkingelectronics.com/projects/50%20-%20555%20Circuits/50%20-%20555%20Circuits.html
Setting the timings The circuit does not know how fast the loco is moving or how long the track section is. It is up to you to use components that provide the delays that you need. As a minimum, the delay before switching should be long enough to allow the loco to get from one end of the track to the other. The values shown in the illustration provide a delay of just over 30 seconds. Replacing the 470k resistor with a 820k resistor gives a delay of about 1 minute, while a 2M7 resistor gives a delay of around 3 minutes. Changing the other resistor or the capacitor also has an effect on the on and off pulse widths. There are formulae to work out the delays but you can use a simple calculator like the one at http://web.udl.es/usuaris/p7806757/555-calculadora/555%20Calculator.htm
Parts List One piece of stripboard 25mm x 64mm 34-0500 One 555 timer integrated circuit 82-0338 One 470k resistor 62-0434 (sold in packs of 100) One 1k resistor 62-0370 (sold in packs of 100) Three 1N4001 diodes 47-3420 or from the MERG Kit Locker These diodes work up to 1A; for more power hungry locos, replace the diodes bridging the gaps with 3A diodes such as the 1N5401 (part 47-0818) or from the MERG Kit Locker. One 100uF electrolytic capacitor 11-0245 One 100nF ceramic capacitor 08-0235 One 8-pin DIL socket (the IC holder) 22-0107 (sold in tube of 60) One 12v relay (the OKO type 47W from the MERG Kit Locker is the cheapest I could find and switches up to 2A. For more power hungry locos, use the 5A relay from Rapid Electronics (part number 60-4610).
If you are a MERG member, this is available as a kit - PMP4 Part No: 804. If you are in an Area Group/club, why not place a joint order and share the postage costs? The part numbers listed are for Rapid Electronics (www.rapidonline.com). Alternatively, check out www.bitsbox.co.uk or eBay for competitive prices.
Construction This project uses a piece of stripboard that has nine strips of copper on one side. It is important to note that all the components are mounted on the other side of the board (see the picture) and their leads are poked through the holes for soldering on the copper side. The illustration show the components and the tracks at the same time. It is really showing where the components should go. It shows the tracks underneath, as if the board was transparent, to help you cut the tracks in the correct places and position the components correctly. The first step is to cut breaks in the track at the points shown in the illustration. Tip: If you are not too sure, count along the rows and columns on the component side, then poke a wire through the hole where the track is to be cut. Then turn the board over and cut where the wire pokes through. Pocket Money Projects 146
Return to Contents Page 4
I use a stripboard spot face cutter, but you could use a hand-turned 3mm or 5mm drill bit – or even a sharp knife if you must. Next, check that there no remaining tiny strips of copper still bridging any of the track sections. Then clean the copper strips and the wire leads on all components. This minimises problems from dirty or oxidised surfaces during soldering.
When inserting and soldering the components, follow these guidelines: Fit the twelve wire links. The resistors and the 100nF capacitor can be fitted either way round. The electrolytic capacitor must be fitted the correct way round, with the positive lead connecting to the track of pin 6 of the chip (see the illustration). The diodes have to be fitted the right way round. The anode end of one diode goes to pin 3 of the 555 chip. The diodes bridging the rail track gaps should be fitted as in the illustration. The diode's cathode end has a band round it, as shown here. It helps if the IC holder is fitted to the board with its notch facing top left, as shown in the layout illustration. This reminds you to also fit the 555 chip correctly (i.e. with its notch also facing top left).
Setting up Before connecting power to the circuit, carry out a close visual inspection of the board, ensuring that you have no short circuits, dry joints, unsoldered connections, etc. Then connect the power to the stripboard. If it is working correctly, you will hear the relay click on and off. You can expect a slightly longer delay the first time it is powered up, as it charges up the large capacitor. Thereafter, the circuit should provide the correct timings. You can then connect the wires to the track and the lead from the loco controller's supply. If you wish, to avoid tying up a separate loco controller, you could use the same 12v supply for supplying both the timer circuit and the loco. At 12V, the loco would run too fast, unless you wired a dropper resistor in series with one of the leads the leads to the track.
Pocket Money Projects 147
Return to Contents Page 4
A logic probe Many enthusiasts own multimeters, which are extremely useful tools for testing and faultfinding on layouts and on electronic modules. The ability to read different voltage levels helps trace bad joints, etc. But, when dealing with modules that work on digital inputs and outputs, you only want to know whether a particular point in your circuit is at +5v or at 0v. These circuits act like electric switches where much of the operation only works with ONs and OFFs, sometimes also called HIGHs and LOWs. Examples uses of a logic probe are to: Check the supply pins of a chip. Is it getting both the +5v and the 0v? Check the output from a track detector – is it changing when a loco passes? Check the input to a circuit that is coming from a switch – is it going from +5v to 0v, or 0v to 5v, when the switch is operated? Check whether the inputs and outputs of CBUS and other digital modules are producing the expected results. The internal circuits in lots of electronic modules work on 5v, even when the they are connected to a 12v or other voltage supply. This project is for a very useful tool that tells you whether a point in the circuit is at +5v or at 0v. You could ask why not just use a multimeter? You could connect the -ve lead of your meter to the 0v line of your module. Then you could tap various parts of the circuit with the other lead. If you have +5v on that point, you will get a reading. But – and here is the catch – if you do not get a reading, it does not mean that you have 0v at that point. You might just have a broken wire that is not connected to anything. To check for connections to 0v, you would have to connect the meter's +ve lead to the 5v line and then test with the other lead's probe. You would have to reverse your meter connections every time you wanted to check for +5v or 0v. That is where a logic tester is handy. This, project, like the commercial versions, works by connecting the unit to the +5v and 0v of the module you are checking. Then you touch any point in the circuit. If +5v is on that point, a green LED lights up. If there is 0v at that point, the red LED lights up. All other voltages, or points not connected to anything, either keep the LEDs unlit or dimly lit. Fancier commercial versions of our little tester are available - but they are about 20 times more expensive.
Pocket Money Projects 148
Return to Contents Page 4
How it works Here is the circuit diagram for the logic tester. It uses just eight components. It is really just two almost identical sections; one to light the red LED and one to light the green LED. It uses a transistor to light each LED. A transistor is a small semiconductor device that was originally mainly used as an amplifier, like those used in an old transistor radio. Depending on the voltage fed to them, they can also act like a switch, as in this project. In normal operation, a small increase in current through the transistor's base results in a larger current through its collector. The total resistance of the LED and resistor means that there is a maximum current that can flow through the emitter/collector. When this point is reached, increasing the base current has no further effect. The transistor is said to be in 'saturation'. The 10k resistors limit the base current to be sufficient to switch the transistor fully saturated. The two transistors use different semiconductor layers in their construction. This means that the BC547 allows current to flow from its collector to emitter when its base is at a higher voltage than its emitter. The BC557 allows current to flow from its emitter to collector when its base is at a lower voltage than its emitter. That's why the red LED lights on 0V while the green LED lights on 5V. For more details on how transistors work as switches, look at: www.rason.org/Projects/transwit/transwit.htm www.electronics-tutorials.ws/transistor/tran_4.html
Parts List
One piece of stripboard 25mm x 64mm One RED LED One Green LED Two 560 ohm resistors Two 10k resistors One BC547 transistor One BC557 transistor
34-0500 55-0150 55-0105 62-0364 (sold in packs of 100) 62-0394 (sold in packs of 100) 81-0468 81-0474
If you are a MERG member, this is available as a kit - PMP5 Part No: 805. If you are in an Area Group/club, why not place a joint order and share the postage costs? The part numbers listed are for Rapid Electronics (www.rapidonline.com). Alternatively, check out www.bitsbox.co.uk or eBay for competitive prices.
Pocket Money Projects 149
Return to Contents Page 4
Construction This project is built on a piece of stripboard that has nine strips of copper on one side. It is important to note that all the components are mounted on the other side of the board and their leads are poked through the holes for soldering on the copper side. This illustration show the components and the tracks at the same time. It is really showing where the components should go. It shows the tracks underneath, as if the board was transparent, to help you cut the tracks in the correct places and position the components correctly. The first step is to cut four breaks in the track at the points shown in the illustration. Tip: If you are not too sure, count along the rows and columns on the component side, then poke a wire through the hole where the track is to be cut. Then turn the board over and cut where the wire pokes through.
I use a stripboard spot face cutter, but you could use a hand-turned 3mm or 5mm drill bit – or even a sharp knife if you must. Next, check that there no remaining tiny strips of copper still bridging any of the track sections. Then clean the copper strips and the wire leads on all components. This minimises problems from dirty or oxidised surfaces during soldering. When inserting and soldering the components, follow these guidelines:
The 560 ohm resistors have green,blue and brown bands round them, while the 10K resistors have brown, black and orange bands round them. The resistors can be fitted either way round.
The transistors have to be fitted the right way round, with their flat ends facing outwards, as shown in the layout illustration. They look identical apart from their markings, so make sure you fit them as shown.
The LEDs have to be fitted the right way round, with the anode end nearest the top of the board. The anode lead of an LED is the longest lead (see the illustration).
Before connecting power to the circuit, do a close visual inspection of the board, ensuring that you have no short circuits, dry joints, unsoldered connections, etc. Connect the 5V supply to the board. The LEDs may remain unlit or be dimly lit. Touch the probe to the +5V of the supply and the green LED should illuminate brightly. Touch the probe to the 0v of the supply and the red LED should illuminate brightly.
Pocket Money Projects 150
Return to Contents Page 4
A 12V output from a 15V AC supply Many of the Pocket Money Projects are designed to work from a 12V DC supply. However, a number of loco controllers provide an auxiliary 15V AC output. This little module converts the 15V AC into a constant regulated 12V DC output.
How it works Here is the circuit diagram of the 12V regulator.
An AC voltage is called an alternating current because its polarity is constantly changing. The voltage rises from zero to a maximum value in the positive direction, before falling back to zero again. It then rises to a maximum value in the negative direction, before returning to zero. It does this 50 times every second (50Hz). The bridge rectifier ensures that its output is always positive-going. The 100uF capacitor is used as a reservoir, to keep the voltage that feeds the 7812 at a fairly constant level. More information is available from: www.kpsec.freeuk.com/acdc.htm The circuit can handle a maximum output current of 1.5A, although in that case you ought to fit a heat sink to the 7812 to prevent it overheating. The circuit does not use fuses or cutouts, but the 7812 has built-in overload protection. The 7812 has an internal voltage loss of 2.5V, so needs a minimum of 14.5V DC input to ensure a smooth regulated output.
Parts List
One piece of stripboard 25mm x 64mm 34-0500 One bridge rectifier W005, available from the Kit Locker. 47-3190 One 7812 voltage regulator, available from the Kit Locker. 47-3315 One 100uF electrolytic capacitor 11-0245 One 100nF ceramic capacitor 08-0235
Pocket Money Projects 151
Return to Contents Page 4
If you are a MERG member, this is available as a kit - PMP6 Part No: 806. If you are in an Area Group/club, why not place a joint order and share the postage costs? The part numbers listed are for Rapid Electronics (www.rapidonline.com). Alternatively, check out www.bitsbox.co.uk or eBay for competitive prices.
Construction This project is built on a piece of stripboard that has nine strips of copper on one side. It is important to note that all the components are mounted on the other side of the board and their leads are poked through the holes for soldering on the copper side.
This illustration show the components and the tracks at the same time. It is really showing where the components should go. It shows the tracks underneath, as if the board was transparent, to help you cut the tracks in the correct places and position the components correctly. The first step is to cut two breaks in the track under the bridge rectifier, at the points shown in red in the illustration. Tip: If you are not too sure, count along the rows and columns on the component side, then poke a wire through the hole where the track is to be cut. Then turn the board over and cut where the wire pokes through.
I use a stripboard spot face cutter, but you could use a hand-turned 3mm or 5mm drill bit – or even a sharp knife if you must. Next, check that there no remaining tiny strips of copper still bridging any of the track sections. Then clean the copper strips and the wire leads on all components. This minimises problems from dirty or oxidised surfaces during soldering. When inserting and soldering the components, follow these guidelines: Fit the four wire links. The bridge rectifier must be fitted as shown in the illustration, with its + marking in the top left corner. The 100nF capacitor can be fitted either way round. The 100uF capacitor has to have its negative lead soldered to the outer copper track. The negative end of the capacitor case usually is marked with a negative sign and/or a black stripe down its side. The 7812 regulator also has to be fitted the correct way round, with its metal tab facing outwards.
Pocket Money Projects 152
Return to Contents Page 4
A DCC train detector Part 2 of the series looked at a train detector that reacted to changes in light levels when a train passed over a point in the track. It could be used on both DC and DCC layouts but it only produced a change of output while the train blocked the light. This circuit is only for DCC systems but it will maintain a changed output as long as the train remains in a section of track. Its output is normally at a high resistance but this changes to low resistance when a train sits anywhere on that track section – either moving or stationary. Possible uses include: A train enters a marshalling yard and the yard lights come on. Control panel lights indicate which hidden sidings, or obscured sections of track, are occupied. Triggering events in other modules such as the Servo4 or CANACE8C. The track section to be detected has to be isolated from the rest of the layout track, probably by using plastic rail joiners at each end. The DCC power is fed to this track section as shown in the illustration. Both leads from the command station are taken to the train detector board, with one of the leads passing through the circuit on the board before being wired to the track. This allows the circuit on the board to detect any current flowing between the command station and a train on the track. Being part 7 in the series, the circuit is a little more bit more of a challenge, but still easily fits on a piece of stripboard (see the above image). It needs no separate power supply as its gets its power from the DCC supply. The project uses fifteen electronic components.
Pocket Money Projects 153
Return to Contents Page 4
How it works Here is the circuit diagram of the DCC train detector, as designed by MERG member Trevor Stockill. The KB814 is the more easily available alternative to the TLP521, as is the Sharp EL817 and others.
The voltage from a DCC command station alternately swings positive then negative, in what is described as 'bipolar DC'. The 1N4001 diode only passes the positive-going pulses which are then smoothed out by the 2.2uF (2u2F) capacitor. The voltage across this capacitor provides the DC supply for rest of the circuit. The LM393 is a 'dual comparator' chip. This means that it contains two separate comparator circuits inside the chip. This illustration shows one of the comparators. Current is able to flow through the OUT pin when the voltage on the IN- pin is higher than the voltage on the IN+ pin. As you can see from the above circuit diagram, the supply from the command station passes through the diodes on its way to the track. A stationary loco on that track will draw a tiny current to power its decoder, while a moving loco will draw even greater current. In both cases, the current produces a stream of voltage pulses across the diodes. These pulses are fed to pin 2 and result in the output pin 1 having a pulsed output. The pulses are routed via the 1N4148 diode and increase the charge on the 10nF capacitor until it reaches approximately half the supply voltage. At this point the second comparator turns on and switches on the opto-isolator. When the train leaves the track, there are no further pulses to maintain the charge on the capacitor. It then slowly discharges through the 100k resistor and its potential eventually drops below the comparator level and switches off the LED in the opto-isolator. The values of the 10nF capacitor and the 100k resistor across it determine the switching delay. For more details on comparators, look at: http://home.cogeco.ca/~rpaisley4/Comparators.html When output pin 7 goes low, current flows through the LED in the KB814. The light from the LED falls on a photo-transistor and its resistance drops. The change in resistance across pins 3 and 4 is then available to switch other circuits (see later). The KB814 isolates the train detector from other circuits, preventing potential problems from interference or voltage differences.
Pocket Money Projects 154
Return to Contents Page 4
Parts List
One piece of stripboard 25mm x 64mm One LM393AN chip One KB814 opto-isolator One 1N4001 diode One 1N4148 diode Two 1N5819 diodes Three 1k resistors Four 100k resistors One 2u2F electrolytic capacitor One 10nF ceramic capacitor One 8-pin IC holder
34-0500 QU057 from bitsbox.co.uk 58-0920 or Kit Locker 47-3420 or Kit Locker or Kit Locker or Kit Locker 62-0370 (sold in packs of 100) 62-0418 (sold in packs of 100) 11-0210 08-0230 22-0107 (sold in tube of 60)
If you are a MERG member, this is available as a kit - PMP7 Part No: 807. If you are in an Area Group/club, why not place a joint order and share the postage costs? The part numbers listed are for Rapid Electronics (www.rapidonline.com). Alternatively, check out www.bitsbox.co.uk or eBay for competitive prices.
Construction This project is built on a piece of stripboard that has nine strips of copper on one side. It is important to note that all the components are mounted on the other side of the board and their leads are poked through the holes for soldering on the copper side.
This illustration show the components and the tracks at the same time. It is really showing where the components should go. It shows the tracks underneath, as if the board was transparent, to help you cut the tracks in the correct places and position the components correctly. The first step is to cut three breaks in the track at the points shown in the illustration. Also cut track breaks between the pins on either side of the IC chip (i.e. between pins 1 and 8, between pins 2 and 7, etc.). Lastly, cut the tracks between the pins of the KB814. Tip: If you are not too sure, count along the rows and columns on the component side, then poke a wire through the hole where the track is to be cut. Then turn the board over and cut where the wire pokes through.
I use a stripboard spot face cutter, but you could use a hand-turned 3mm or 5mm drill bit – or even a sharp knife if you must. Next, check that there no remaining tiny strips of copper still bridging any of the track sections. Then clean the copper strips prior to soldering the components. When inserting and soldering the components, follow these guidelines:
The 100k ohm resistors have brown, black and yellow bands round them, while the 1K resistors have brown, black and red bands. The resistors can be fitted either way round.
Pocket Money Projects 155
Return to Contents Page 4
The diodes must be fitted the correct way round (follow the illustration). The 10nF capacitor can be fitted either way round but the 2u2F capacitor has to have its negative lead soldered to the outer copper track; the negative end of the capacitor case usually is marked with a negative sign and/or a black stripe down its side. The LM393 chip also has to be fitted the correct way round. Pin 1 is on the upper left-hand side of the chip, often marked by an indentation as shown in the illustration. The TLP521/KB814 also has an indentation at one corner indicating where pin 1 is.
Examples of use Here are some typical examples of how you could use the project to improve your layout.
Lighting a LED A simple but useful facility. The output wires could be taken back to a control panel and used to illuminate a LED when a train occupied the track section. No need to guess whether track sections that are out of sight, or a hidden sidings in a tunnel, are occupied.
Since the KB814 output is isolated from the rest of the circuit, a separate power supply is needed to provide the 12v that lights the LED. A 12v supply is shown above since most layouts already use a 12v power supply. If you are using a 5v supply, you could reduce the value of the resistor to around 560 ohms. This circuit is not suitable for handling for high-power LEDs since it – not enough current without a separate driver circuit. The LED need not be placed in your control panel. How about a factory's loading bay light coming on when the train pulls in; or station lights, or yard lamps.
Switching a relay The maximum current that the KB814 can pass is 50mA. If you want the train detector board to switch a high-current device such as a motor, solenoid or high wattage lamp, you can use a relay to switch the higher currents. A simple circuit is shown here using
easily-obtained components (the relay and the transistor are available from the Kit Locker). With a bit of repositioning, you could fit most of the parts on the stripboard.
Pocket Money Projects 156
Return to Contents Page 4
The transistor can pass a maximum of 100mA which is more than sufficient for most relays, including the ones in the Kit Locker.
Operating a Servo4 channel If the output from the train detector is fed into a Servo4, you can have activities that happen automatically as soon as a train enters the track section. Examples might include automatic crossing gates, barrier gates, semaphore signal arms, cranes, etc.
The image shows how the detector's output connects across the Servo4's 0v terminal and the input that you choose to switch (in this case input 1). As simple as that. When the track section is entered, the loco is detected, the TPL521's resistance drops and the servo moves to the new pre-set position. When the loco leaves the section, the resistance increase once more and the servo returns to its previous pre-set position.
Switching a CANACE8C channel A very similar approach can be adopted by members who are using the CBUS system. The CANACE8C is designed to detect changes of voltage at its inputs and send appropriate messages on to its bus.
The image shows the detector's output across the CANACE8C's 0v line and input 6. The CANACE8C will send out a message when the train enters the track section and another message when the train leaves. The messages might be picked up by a computer for automating operations, or may be picked up by another CBUS module (e.g. a CANACC8) for local action without the need for a computer.
Further enhancements Why stop at a single detector. The circuit uses a single LM393 and a single KB814 to create one train detector module. However the KB844 is a 16-pin device that is four different optoisolators in the one package. Likewise, the LM339 is a 16-pin chip that is essentially four LM393's in the one package. Why not design a board with these devices and have two detectors on the one board.
Pocket Money Projects 157
Return to Contents Page 4
Multi-purpose flasher This easy to build project has four possible uses: To simulate a welding machine. Every 15 seconds, there is a burst of flashes from a LED to give the impression of a welding operation. With a large LED, it could be situated inside an engine shed or machine shop. With a small surface mount LED, it could be used 'outdoors' on a construction site or at trackside repairs. A red or orange LED can also be connected to this module. The LED illuminates during the flashing period then slowly dims, providing an 'afterglow' effect. You simply position the additional LED for optimum visual effect. To simulate the arcing from a tram's trolley pole or an electric loco's pantograph pickup. Every 5 seconds, there is a random number of flashes from an SMD LED placed on top of the trolley pole or pantograph close to the catenary wire. To simulate the flickering of a fluorescent tube on startup. To simulate the pulsing aircraft warning lights that are fitted on tall structures (buildings, TV masts, power pylons, bridges, etc.) Two wire links are used to select the mode of operation.
Pocket Money Projects 158
Return to Contents Page 4
How it works Here is the circuit diagram for the simulator.
It uses just 11 components. All the timing, decision making, etc. are pre-programmed into the 12F675 PIC chip. The 78L05 is a voltage regulator. It reduces the 12V supply to the 5V used by the PIC and the LED. The 10k resistors connected between pins 5 and 7 and +5V keeps these pins at supply voltage. Fitting link1 brings pin 7 down to 0V, while link2 brings pin 5 down to 0V. The PIC chip senses the voltages on these pins and decides the mode in which to operate. The options are: No links fitted – welder simulation Only link 1 fitted – pickup arcing Only link 2 fitted – fluorescent tube startup Both links fitted – pulsing warning light When in fluorescent tube mode, pin 3 is held high by a 10K resistor and the LED does not light. When the 'trigger' input on pin 3 is brought down to 0V, the LED sputters before remaining fully lit. Removing the 0V from pin 3 extinguishes the LED once more. The trigger input could come from a switch, relay contacts, CANACC8 outputs, etc.
Parts List
One piece of stripboard 25mm x 64mm One 8-pin IC holder One white LED or red LED (see text) One red LED One 560 ohm resistor One 1k resistor Four 10k resistors One 100nF ceramic capacitor One 78L05 voltage regulator One pre-programmed 12F675 PIC chip
If you are a MERG member, this is available as a kit - PMP8 Part No: 808. The output pin of the PIC can pass a maximum current of 25mA. The 560 ohm resistor works with many LEDs, both standard and surface mount types. Pocket Money Projects 159
Return to Contents Page 4
Before starting, it would be useful to read the article on using stripboard that appeared in the Autumn 2012 Journal.
Construction This project is built on a piece of stripboard that has nine strips of copper on one side. It is important to note that all the components are mounted on the other side of the board and their leads are poked through the holes for soldering on the copper side. This illustration show the components and the tracks at the same time. It is really showing where the components should go. It shows the tracks underneath, as if the board was transparent, to help you cut the tracks in the correct places and position the components correctly. The first step is to cut five breaks in the track at the points shown in the illustration. Tip: If you are not too sure, count along the rows and columns on the component side, then poke a wire through the hole where the track is to be cut. Then turn the board over and cut where the wire pokes through.
It is best to use a stripboard spot face cutter, but you could use a hand-turned 3mm or 5mm drill bit – or even a sharp knife if you must. Next, check that there no remaining tiny strips of copper still bridging any of the track sections. Then clean the copper strips and the wire leads of the components prior to soldering the components.
When inserting and soldering the components, you may want to follow these guidelines: Solder the two wire links in place (not the ones shown as purple dotted lines). Fit the six resistors. The 560 ohm resistor has green,blue and brown bands round it, the 10K resistors have brown, black and orange bands round them and the 1k has brown, black and red bands. The resistors can be fitted either way round. The capacitor can be fitted either way round. The LEDs have to be fitted the right way round, with the anodes (the longer leads) connected as shown in the illustration. The 78L05 regulator must be fitted with its flat surface pointing inwards.
Pocket Money Projects 160
Return to Contents Page 4
It helps if the IC holder is fitted to the board with its notch facing top left, as shown in the layout illustration. This reminds you to also fit the PIC chip correctly (i.e. with its notch also facing top left). Fit link1 and/or link2 if required, depending on which mode of operation you want.
Before connecting power to the circuit, do a close visual inspection of the board, ensuring that you have no short circuits, dry joints, unsoldered connections, etc. Connect the power and check that you read 5V between pins 1 and 8 of the chip. Using as a welder Fit the white LED and the red LED. Do not fit link 1 or link 2. The output pin of the PIC can pass a maximum current of 25mA and this is sufficient for fairly bright LEDs. Using as pickup arcing Fit link 1 only. Only fit the white LED. The LED used should be a tiny surface mount type, about the size of a grain of rice. It should be glued to the overhead pickup and wired down to the loco body (Kynar wire is specially thin). Since the module has to fitted inside a loco or tram body, it has to find a source of power. For large scale, you might consider running the module from a PP3 9V battery. This is the easiest to wire but results in the LEDs arcing even when the motor is stationary. Another option is to take power from the track. The easiest way is to connect to the motor's pickups. The diagram shows the extra two parts required. It uses a 'bridge rectifier' and this produces a DC from its output, regardless of whether the motor is running forward or backwards. The capacitor is of a large capacity, to store energy from the track and supply it to the module when there is small glitches in picking up track power. The PIC chip expects around 5V to operate correctly, so the LED will not flash at slower speeds. Of course, if you are using DCC, there is continual power to the track pickups and the LED will flash even at slow speeds. Unfortunately, it will also flash when the motor is stationary. However, if you have an unused output from the DCC decoder, such as a headlamp connection, this could provide a switched supply to the flasher module. Using as a fluorescent tube startup Only fit the white LED. Fit link 2. Connect the trigger pin (the yellow wire in the picture) to a switch, or other circuit, that can take the pin down to 0V. When the module is first connected to power, nothing happens until the trigger is brought to 0V. At that point, the LED will splutter before settling to being permanently illuminated. When the 0V is removed from the trigger pin, the LED extinguishes again. Using as a pulsing warning light Fit both link 1 and link 2. Fit a red LED in place of the white LED. When the module is first connected to power, the LED will slowly increase and decrease in brightness. Pocket Money Projects 161
Return to Contents Page 4
4-way traffic lights This little project simulates UK road traffic lights, producing the correct switching sequence. It can handle four sets of lights for a full junction, or just a single set if required. You insert or remove the links across the board's copper tracks to set the speed at which the lights change. The eight speeds are: Link 1
Link 2
Link 3
Speed
IN
IN
IN
5 secs
IN
IN
OUT
15 secs
IN
OUT
IN
30 secs
IN
OUT
OUT
60 secs
OUT
IN
IN
90 secs
OUT
IN
OUT
120 secs
OUT
OUT
IN
150 secs
OUT
OUT
OUT
180 secs
The fastest speed is really to test the module after it is built. Once you know it works, you can use the links to set the speed that best suits you.
How it works You don't need to know how it all works to build and use it, but this brief explanation helps you understand what each component is for. Below is the circuit diagram for the module. All the fancy timing and switching takes place inside the 16F676 PIC chip, which is pre-programmed for you. The module is intended to work from a 12v DC supply which powers both the ULN2803 and a 7L805 voltage regulator. The voltage regulator reduces the 12v down to 5v which is the required voltage for the 16F676 PIC chip. In fact, the traffic light module will work over a range of supply voltages from 9v to 35v but you would have to choose the resistors for the LEDs to match any higher voltages beyond 12v.
Pocket Money Projects 162
Return to Contents Page 4
R1, R2 and R3 ensure that pins 5, 6, and 7 on the PIC chip are kept at a high voltage, unless links are wired across to 0V. When a wire link is inserted, it pulls that pin down to 0v. The PIC knows which timing sequence to use, based on which links are made (see table above). R4 makes sure that the PIC's pin 4 is kept high at all times. Pin 1 and 14 on the PIC are taken to the +5v and 0v lines respectively. These pins connect the PIC to the 5v power supply and the capacitor is used to prevent any stray voltages from upsetting the operation of the PIC. When the module is first powered up, it looks at which links are inserted and runs the appropriate lights timing sequence. The PIC's pins 8, 9 and 10 are used to switch a set of green, amber and red LEDs, while pins 11, 12 and 13 switch another set of red, amber and green LEDs – but in the opposite lights phase (e.g. when one set has its green LED lit, the other will have its red LED lit). As described so far, that would be enough to run a single set of lights, or even two sets if low current LEDs were used. Each output pin of the PIC can handle a maximum current of 25mA and the total for all output pins is limited to 200mA. With a 4-way lighting system, lots of LEDs will be illuminated at the same time and this can be a problem, particularly if want to use high current lamps for larger scales. So, the circuits use a ULN2003 chip, known as a 'Darlington array'. It has seven separate amplifier circuits, although we only use six for this project. Its job is boost the current handling levels of the PIC. For example, pin 13 of the PIC connects to pin 2 of the ULN2003. When the PIC's pin 13 switches high, it switches pin 2 of the ULN2003 chip and this lowers the voltage on its pin 15. The ULN2003 can handle 500mA from each output. Suggestions for connecting LEDs are discussed later.
Pocket Money Projects 163
Return to Contents Page 4
Parts list
One piece of stripboard 25mm x 64mm One pre-programmed 16F676 PIC chip One ULN2003 integrated circuit One 78L05 voltage regulator One 14-pin IC socket One 16-pin IC socket Four 10k resistors One 100nF ceramic capacitor Red, amber and green LEDs (see text) Six 560 ohm resistors
34-0500 82-5036 47-3612 22-0108 22-0109 62-0394 08-0235 62-0364
If you are a MERG member, this is available as a kit - PMP9 Part No: 809.
Preparing the stripboard This project is built on a piece of stripboard (originally called Veroboard) that has nine strips of copper on one side. It is important to note that all the components are mounted on the other side of the board (see the picture) and their leads are poked through the holes for soldering on the copper side. The first step is to read the various lighting options, before cutting the breaks in the track at the points shown in the illustration below. If you think you will be making other projects on stripboard, it might be worth investing in a stripboard track cutter, which does a nice clean job of removing the unwanted copper. Otherwise, use a drill bit - but turn it by hand or you will rip a large hole in the strip board in two seconds flat! Make sure that you cut tracks between the two rows of legs of the chips. After you are sure that there no remaining tiny strips of copper bridging any of the cuts, clean the copper strips and the leads of the components prior to soldering.
Construction This following illustration shows where the components are situated on the stripboard. It shows the tracks underneath, as if the board was transparent. That helps to align components with their correct mounting holes. If in doubt, have another look at the photograph on the first page.
It is a smallish project but you might still prefer to follow the construction in this order.
Pocket Money Projects 164
Return to Contents Page 4
For both versions: Cut all the breaks in the tracks, apart from those that would be under the ULN2003 IC socket. Solder the five wire links that are shown in black in the illustration. Solder all four 10k resistors. They can be fitted either way round. Solder all six 560 ohm resistors. They can be fitted either way round. Solder the 14-pin IC socket with its notch or indent towards the top as shown in the component layout. Solder the 10nF capacitor. It can be fitted either way round. Solder the 78L05 regulator in place, with the flat surface pointing inwards. Solder leads to the board edges, to connect to a 12v supply.
A single, traffic light If you only want to have a single traffic light on a layout:
Don’t fit the ULN2003 or its IC socket. Don’t fit the link marked in blue in the illustration. Wire the outputs to the LEDs as shown, with their shortest leads being connected together and making a common connection to 0v.
4-way traffic lights If you want a full 4-way set of lights:
Solder the 16-pin IC socket with its notch or indent towards the top as shown in the component layout. Cut the tracks between its pins. Fit the wire link marked in blue in the illustration. Wire each sets of coloured LEDs in series with each other – the short leads connected to the next LED's long lead (see the illustration). The LEDs are then connected together and the common connection is wired to the 12V positive supply. Note that this is different from the single light, which is taken 0V. This is because the ULN2003 outputs are 'inverted' (if one of its inputs is high its output is taken low – and vice versa).
Next Before inserting the chip(s), check that all track cuts have been made and all required links are in place, check for shorts between adjacent tracks, check for dry joints and check that you have put all the components in the correct place and the correct way round. If everything is OK, connect the board to a 12v DC supply. Using a meter, you should read 5v DC between pin 1 and pin 14 of the 16F676 IC socket (and 12V DC between pins 8 and 9 of the ULN2003 IC socket). This proves that the 5v regulator is working. Now, disconnect the power and insert the chip(s) – make sure they are the correct way up. They have a notch or indent at one end, indicating where pin 1 is (see the example in the illustration). Reconnect the power and the lights should start sequencing. Try different combinations of the links and the time sequences should alter. For smaller gauges, you may consider using tiny surface mount LEDs. Pocket Money Projects 165
Return to Contents Page 4
A speed controller This easy to build project has two uses: To provide a basic motor speed controller. (e.g. for a loco, cooling fan, etc.). To provide a basic variable voltage power supply for use on your workbench.
The image shows a variable resistor fitted. This allows easy control over the output voltage, using a knob. For use with the unattended shuttle module (PMP4), the potentiometer can be replaced by a 4k7 preset The preset is adjusted to match the speed requirements of the loco being used and the loco is then left to run by itself. This setup can also be used if you require a fixed voltage for any other layout feature (e.g. setting the speed for a windmill or watermill).
Pocket Money Projects 166
Return to Contents Page 4
How it works Here is the circuit diagram for the controller. It uses just six components.
The LM317 is a 3-pin device that can have its output set to provide output voltages from 1.2V upwards (it does not go down to 0V). The output depends on the input fed into it and the combination of the resistor and potentiometer values that provide a voltage feedback to the chip's adjustment pin. The chip needs to maintain a 1.25V difference between its output pin and feedback pin, which explains why a 12V input produces an output range of around 1.2V to 10.7V. The 100uF capacitor acts as a reservoir to smooth out any small changes caused by current variations. The diode is used to prevent possible damage to the chip that would be caused by a fully charged 100uF capacitor trying to push current back through the LM317 in the event that its input became shorted (unlikely but, for the sake of a few extra pence, worth the trouble).
Parts List
One piece of stripboard 25mm x 64mm 34-0500 One LM317 47-3318 or from the Kit Locker One 470 ohm resistor 62-0362 One 4k7 linear potentiometer 65-0710 (avoid logarithmic pots as they are for audio use) OR One 4k7 preset potentiometer 67-0464 One 100nF ceramic capacitor 08-0235 One 100uF electrolytic capacitor 11-0245 One 1N4001 diode 47-3420 or from the Kit Locker
If you are a MERG member, this is available as a kit - PMP10 Part No: 810. If you are in an Area Group/club, why not place a joint order and share the postage costs? The part numbers listed are for Rapid Electronics (www.rapidonline.com). Alternatively, check out www.bitsbox.co.uk or eBay for competitive prices. Pocket Money Projects 167
Return to Contents Page 4
Construction This project is built on a piece of stripboard that has nine strips of copper on one side. It is important to note that all the components are mounted on the other side of the board and their leads are poked through the holes for soldering on the copper side. This illustration show the components and the tracks at the same time. It is really showing where the components should go. It shows the tracks underneath, as if the board was transparent, to help you position the components correctly. The first step is to clean the copper strips and the leads of the components prior to soldering.
When inserting and soldering the components, follow these guidelines:
Fit the wire link. The 470 ohm resistor has yellow, violet and brown bands round it and can be fitted either way round. The 100nF capacitor can be fitted either way round. The 100uF electrolytic capacitor has to be fitted as shown in the illustration, with the negative lead (indicated by a band and/or negative symbols) nearest the bottom of the board. The diode has to be fitted the right way round, with the striped end furthest from the top of the board. The LM317 regulator must be fitted with its flat metal surface pointing to the right.
Using as a bench supply
Wire a 4k7 potentiometer to the stripboard as shown by the blue wires. One of the leads connects to the potentiometer's middle pin. Wire the output connections to a couple of terminals on your bench (on a board or fit everything inside a case). Connect your multimeter (on the DC voltage range) to the terminals and rotate the potentiometer until the desired voltage is read.
Using with the shuttle module
Fit a 4k7 preset resistor as shown in the illustration. Wire the output of the supply to the 'Loco supply' inputs of the shuttle module. Adjust the preset value until the desired operating speed for the loco is reached.
Pocket Money Projects 168
Return to Contents Page 4
Using to control motors
Wire the 4k7 potentiometer to the stripboard as shown by the blue wires. One of the leads connects to the potentiometer's middle pin. Wire the output connections to the track.
This way, the module controls a DC motor – as long as it is going in the one direction. That is fine for a fan, windmill, etc., but If using with a railway loco, some means of reversing the direction is required. This achieved by adding a changeover switch at the output. This requires a double pole double throw switch to reverse the polarity and its wiring is shown in this illustration. The LM317 is capable of handling currents up to 1.5A. When such high currents are being taken, a heatsink should be bolted to the LM317 on its plain metal side. This should not be required when running a small N gauge loco. Remember, though, that the voltage cannot be reduced to zero; there is always at least 1.2V on the output. While it does not have the sophisticated features of other loco controllers (acceleration, deceleration, etc.) it is a good starter project that provides basic control at a great price. Also, if you can't afford an expensive variable voltage supply, this will prove a low-cost alternative.
Pocket Money Projects 169
Return to Contents Page 4
LED dimmer Many layouts now incorporate LED lighting inside buildings, in lamposts, yard lights, etc. It is also increasingly being used as a means of illuminating a layout, usually with long LED strips hidden behind pelmets. LEDs are usually illuminated using a fixed voltage supply and a fixed value of dropper resistor (the dropper resistor prevents excessive current through the LED). LED strips have built-in dropper resistors and are intended to be run at 12V. These work fine but always produces the same level of illumination. Ideally, you want to be able to handle these situations: On a bright day, you may want to have maximum brightness. Used at night, in a dark, room, you may want to lower the brightness, otherwise the lights become too overwhelming and unrealistic. At different public exhibitions, your layout may be situated in areas where the LED light level needs to be adjusted to match the ambient light in the room. Illuminating LED strips to different levels to simulate different times of day (morning, dusk, etc.) or different weather conditions (sunny, sunsets, overcast, etc.). This effect is increased if a number of coloured LED strips are used (bright white, warm white, amber, blue). That’s where a LED dimmer is useful, as it opens up ways to bring interesting effects to a layout.
This project can be used to dim a 12V LED strip, as shown in the picture, or dim one or more individual LEDs, using a dropper resistor.
How it works You don't need to read this section before building the circuit. You can always come back and read it later. It's up to you. A normal incandescent bulb works by supplying sufficient current to heat the filament to the point where it glows brightly. If the voltage to the bulb is reduced the lamp shines less brightly. Increasing the voltage results in a greater current and more light – until it eventually overheats and burns out the filament. Pocket Money Projects 170
Return to Contents Page 4
LEDs work differently. If you slowly increase the voltage across a LED, nothing would happen for some time. Eventually the LED will produce light and again will be destroyed if too much current is passed through it. Unlike the incandescent bulb, the range over which it illuminates is small and, once it start to illuminate, current flows at an ever increasing rate for very small voltage increases. This makes altering LED brightnesses very difficult simply by using voltage changes. So, for example, you could not easily dim a LED by placing it in series with a variable resistor. Some loco controllers use 'pulse width modulation' as a means of controlling the current through a motor. The same principle can be used to control LED brightness. Firstly, the value of the series resistor is calculated for the required maximum brightness. Then power to a LED, or a string of LEDs in series, is delivered as a succession of on/off pulses. If the pulse period is long, with hardly any off time, the lamp illuminates brightly. Conversely, if the on period is short, with long periods off, the LED will be dim. In other words, altering the pulse width changes the LED brightness. The rate at which the pulses repeat has to be fast enough to prevent the LED simply flashing on and off. So, the voltage never changes; it's the duration of the pulses that determine the average current flowing through the LED. Here is the circuit diagram for the dimmer.
It uses a 555 timer chip which runs at a fixed frequency of a few hundred Herz (i.e. the number of times its output switches between low voltage and high voltage every second). The output from the 555 chip (pin 3) is a square wave that has a variable 'duty cycle' (the time that the voltage is high compared to the time it is zero). The duty cycle can vary from 0% (never on) to 100% (always on) and is determined by the setting of the 47k potentiometer The output of the 555 is taken to a TIP122 power transistor. This transistor is able to switch higher currents than the output of the 555, allowing it to control a long string of LEDs if required. The TIP122 is rated for a maximum of 5A. When using high currents, a heatsink is advisable.
Pocket Money Projects 171
Return to Contents Page 4
Parts List
One piece of stripboard 25mm x 64mm 34-0500 One TIP122 power transistor available from bitsbox One 555 timer integrated circuit 82-0338 Two 1k resistors 64-0370 One 47k linear potentiometer 65-0710 (avoid logarithmic pots as they are for audio use) One 100nF ceramic capacitor 08-0235 One 10nF ceramic capacitor 08-0230 One 8-pin DIL socket (the IC holder) 22-0107 (sold in tube of 60) Two 1N4148 diodes 47-3416 or from the Kit Locker
If you are a MERG member, this is available as a kit - PMP11 Part No: 811. If you are in an Area Group/club, why not place a joint order and share the postage costs? The part numbers listed are for Rapid Electronics (www.rapidonline.com). Alternatively, check out www.bitsbox.co.uk or eBay for competitive prices.
Construction This project is built on a piece of stripboard that has nine strips of copper on one side. It is important to note that all the components are mounted on the other side of the board and their leads are poked through the holes for soldering on the copper side. This illustration show the components and the tracks at the same time. It is really showing where the components should go. It shows the tracks underneath, as if the board was transparent, to help you position the components correctly. Make sure that you cut tracks where indicated in the above illustration. Check that all eight are cut and that there no remaining tiny strips of copper bridging any of the cuts. The next step is to clean the copper strips and the leads of the components prior to soldering. When inserting and soldering the components, follow these guidelines: Fit the five wire links. The 1k resistors have brown, black and red bands round them and can be fitted either way round. The 100nF and the 10nF capacitor can be fitted either way round. The diodes have to be fitted the right way round, with their striped ends as shown in the picture and the illustration. It helps if the IC holder is fitted to the board with its notch facing bottom right, as shown in the layout illustration. This reminds you to also fit the PIC chip correctly (i.e. with its notch also facing bottom right). Pocket Money Projects 172
Return to Contents Page 4
The TIP122 transistor must be fitted with its flat metal surface facing to the right. If you are using a 12V LED strip, connect using the 'A' lead and the red lead. The LED strip will have points along its length where wires can be soldered. These points will be marked with plus or minus signs. Connect the red lead to any point on the strip marked with a positive symbol (it need not be at the end of the strip). The 'A' lead should be connected to any point on the strip marked with a minus sign. If you are using one or more individual LEDs, use the 'B' and red leads The value of the resistor 'R' will depend on which LEDs you use and how many LEDs you wire in series.
Before connecting power, carry out a close visual inspection of the board, ensuring that you have no short circuits, dry joints, unsoldered connections, etc. Attach 12v to the module and check that your meter reads 12V between pins 1 and 4 of the IC holder. Disconnect the power and fit the 555 chip with its notch facing downwards, placing its pin 1 to the bottom right in the holder. Reconnect the power. Rotating the spindle of the potentiometer should make the LED(s) brighten or darken.
Pocket Money Projects 173
Return to Contents Page 4
Random lights Some railway layouts have no scenic lights whatsoever. Every building is in darkness. Other layouts have lamps inside the buildings. The buildings are constantly lit. While constant lighting is better than no lighting, permanently-lit buildings are not ideal. Of course, you can use switches to manually control building lights, or even have lights that are triggered automatically (e.g. a station light comes on when a train enters the station). This project provides the ability to have 10 lights that come on and off randomly, as in real life. Imagine a block of flats, a row of houses, a factory, an office or a hotel where the lights work without your intervention.
The module has a preset potentiometer that can be adjusted with a small screwdriver. This sets the speed at which lights may be changed. For instance, you may use the shortest delays to test that all the LEDs work. Short delays are also useful at exhibitions, where kids expect things to happen quickly. At other times, you can adjust the delay to your own needs.
How it works You don't need to read this section before building the circuit. You can always come back and read it later. It's up to you. The circuit diagram is on the next page. It is based on a pre-programmed PIC chip that contains all the decision-making and controls. A PIC is a chip that can be programmed using special hardware and software. Don't worry, this has all been done for you. The sequence continually repeats itself and is as follows:
The 10k preset potentiometer sets the delay time. Rotating the screwdriver alters the voltage fed into pin 3 of the PIC. The PIC reads this voltage and uses it to set the delay time. After the delay is over, the PIC chip makes a random choice between 1 and 10. This decides which light may be altered. The PIC chip then randomly decides whether that LED should be lit or unlit. It then makes the output to the chosen LED high or low.
Pocket Money Projects 174
Return to Contents Page 4
This provides a double random system. You don't know which light will be next. You don't even know whether it will change the light, since the chip might decide to light a LED that is already lit (or vice versa). In that situation, nothing happens and the delay before any possible change is doubled.
Each output of the PIC is taken to a 1k resistor and the outputs can be fed directly to a LED. The output on pin 13 is shown wired to a LED, as an example. Each output can handle a maximum current of 25mA, with the chip capable of a total of 200mA. So, 250mA must be the combined total of all LEDs used, as there may be times when all LEDs are lit and drawing current. This should not pose a problem as modern LEDs are very bright at low currents. The 1k resistors limit the current to around 5mA per LED but these can be replaced with lower values if brighter LEDs are required. If you don't want to use all 10 outputs, you can decide which pins you want to use – giving an even more random effect.
Parts List
One piece of stripboard 25mm x 64mm 34-0500 One pre-programmed 16F676 PIC chip Eleven 1k resistors 64-0370 One 100nF ceramic capacitor 08-0235 One 14-pin DIL socket (the IC holder) 22-0108 (sold in tube of 34) One 10k preset potentiometer 67-0466 Ten LEDs (depends on what colour mix you want – e.g. white, yellow, red)
If you are a MERG member, this is available as a kit - PMP12 Part No: 812.
Construction This project is built on a piece of stripboard that has nine strips of copper on one side. It is important to note that all the components are mounted on the other side of the board and their leads are poked through the holes for soldering on the copper side. Pocket Money Projects 175
Return to Contents Page 4
This illustration show the components and the tracks at the same time. It is really showing where the components should go. It shows the tracks underneath, as if the board was transparent, to help you position the components correctly.
Make sure that you cut tracks where indicated in the above illustration. Check that all 22 are cut and that there no remaining tiny strips of copper bridging any of the cuts. The next step is to clean the copper strips and component leads prior to soldering. When inserting and soldering the components, follow these guidelines: Fit the six wire links. The 1k resistors have brown, black and red bands round them and can be fitted either way round. An alternative five-band resistor will have brown, black, black, brown and brown bands. The 100nF capacitor can be fitted either way round. It helps if the IC holder is fitted to the board with its notch facing top left, as shown in the layout illustration. This reminds you to also fit the PIC chip correctly (i.e. with its notch also facing top left).
Setting up Before connecting power, carry out a close visual inspection of the board, ensuring that you have no short circuits, dry joints, unsoldered connections, etc. Then connect the power to the board where shown. If it is working correctly, you will read 5V across pins 1 and 14 of the IC holder. If all is OK, disconnect the power supply and solder connecting leads from the board to the LEDs. Only fit wires to the 1k resistors (the red blobs in the illustration). Connect each LED's short leg to the red blobs. The 10k resistor is used by the PIC and should not be connected to a LED. Lastly, fit the PIC chip (with pin 1 – the notch- top left) and reconnect the power. The LEDs should randomly light and extinguish, at a rate set by the setting of the preset pot.
Modifications If you want a room in a building to be extra bright, you can look for a suitable LED (with a max current of 25mA) and calculate the value of the resistor from this web site; http://led.linear1.org/1led.wiz To use even higher current LEDs, you have to use transistors or a ULN2003 chip to handle the extra current. But, that's for another day.
Pocket Money Projects 176
Return to Contents Page 4
A lighthouse simulator In fact, this project has two uses: To simulate a variety of UK lighthouses. Seven different flashing patterns are provided, covering a total of 32 UK lighthouses. To simulate the aircraft warning lights that are fitted on tall structures (buildings, TV masts, power pylons, bridges, etc.) Three links are used to select which mode of operation is displayed.
How it works Here is the circuit diagram for the simulator. Despite the variety of output patterns, it uses just nine components.
All the timing, decision making, etc. take place within the 12F675 PIC chip. A PIC is a chip that can be programmed using special hardware and software. Don't worry, this has all been done for you. (of course, it means that you can't alter the timings). Pins 6 is unused in this circuit. The 78L05 is a voltage regulator. It reduces the 12V supply to the 5V used by the PIC and the LED. Pins 3, 5 and 7 are normally held to a high voltage as they are taken to +5V via the 10k resistors. If a link is inserted, it brings that particular pin down to 0V. Since there are three possible links, there are 8 possible permutations (see the chart later). The chip senses which links are inserted and pulses the LED on and off in the pattern chosen by the user's selection. Pocket Money Projects 177
Return to Contents Page 4
Parts List
One piece of stripboard 25mm x 64mm One 8-pin IC holder One white LED (see text) One 560 ohm resistor (see text) Four 10k resistors One 100nF ceramic capacitor One pre-programmed 12F675 PIC chip One 78L05 voltage regulator
34-0500 22-0107 (sold in tube of 60) 55-1886 62-0364 62-0394 (sold in pack of 100) 08-0235 47-3612
The output pin of the PIC can pass a maximum current of 25mA. The 560 ohm resistor works with many LEDs, both standard and surface mount types. If you want to calculate the best value for your particular LED, you can use the handy calculator at: http://www.daycounter.com/Calculators/LED-Tutorial-Calculator.phtml http://led.linear1.org/1led.wiz
If you are a MERG member, this is available as a kit - PMP13 Part No: 813.
Construction This project is built on a piece of stripboard that has nine strips of copper on one side. It is important to note that all the components are mounted on the other side of the board and their leads are poked through the holes for soldering on the copper side. This illustration show the components and the tracks at the same time. It is really showing where the components should go. It shows the tracks underneath, as if the board was transparent, to help you cut the tracks in the correct places and position the components correctly. The first step is to cut four breaks in the track at the points shown in the illustration.
Tip: If you are not too sure, count along the rows and columns on the component side, then poke a wire through the hole where the track is to be cut. Then turn the board over and cut where the wire pokes through.
I use a stripboard spot face cutter, but you could use a hand-turned 3mm or 5mm drill bit – or even a sharp knife if you must. Next, check that there no remaining tiny strips of copper still bridging any of the track sections. Then clean the copper strips and the leads of the components prior to soldering.
Pocket Money Projects 178
Return to Contents Page 4
When inserting and soldering the components, you may want to follow these guidelines:
The 560 ohm resistor has green,blue and brown bands round it, while the 10K resistors have brown, black and orange bands round it The resistors can be fitted either way round. The capacitor can be fitted either way round. The LED has to be fitted the right way round, with the anode end nearest the top of the board. The anode lead of an LED is the longest lead (see the illustration). The 78L05 regulator must be fitted with its flat surface pointing inwards. It helps if the IC holder is fitted to the board with its notch facing top left, as shown in the layout illustration. This reminds you to also fit the PIC chip correctly (i.e. with its notch also facing top left). Fit the link wires to control the flashing sequence you require (see the chart below). These are shown as red dotted lines in the layout illustration.
Before connecting power to the circuit, do a close visual inspection of the board, ensuring that you have no short circuits, dry joints, unsoldered connections, etc. Connect a 12V supply to the board. You should read 5V between pins 1 and 8 of the PIC. If all is OK, disconnect the power and insert the PIC chip. Pin 1 of the chip should be at the top left of IC holder (see the illustration). When the power is reconnected, the LED should flash with the pattern that you selected using the wire links. The available patterns are: Link1 Link2 Link3
Pattern
Lighthouses
N
N
N
4 flashes every 5 secs
Flamborough, Lynmouth Foreland, Pendeen, Strumble Head
N
N
Y
2 flashes every 30 secs
Alderney, Casquets, Nab Tower
N
Y
N
2 flashes every 20 secs
Beachy Head, St Bees, Holy Isle
N
Y
Y
1 flash every 20 secs
Longstone, Mull of Galloway, Peninnis, Royal Sovereign
Y
N
N
1 flash every 15 secs
Lowestoft, Lundy North, Sark, Turnberry, Wolf Rock
Y
N
Y
1 flash every 10 secs
Anvil Point, Crammag Head, Dungeness,Point Lynas, Southwold
Y
Y
N
1 flash every 5 Cromer, Little Ross, Lundy South, Monkstone, Orfordness, South secs Bishop, St, Catherines, Trwyn Du
Y
Y
Y
1 flash every sec
Aircraft warning lights
The lighthouse simulations should use a white LED, while a red LED is commonly used for aircraft warning lights.
Pocket Money Projects 179
Return to Contents Page 4
A DCC Test Rig This project is intended for use with DCC decoders that have 8-pin plugs at the end of their connecting leads. The module has two uses:
To test a newlypurchased decoder prior to fitting to a loco. To set up a decoder's CVs.
Commercial test rigs are available but are expensive. This is useful, and much cheaper, alternative.
How it works Here is the circuit diagram for the test rig.
Pocket Money Projects 180
Return to Contents Page 4
The DCC decoder is plugged into the module's 8-pin socket. The module is wired to a command station's output, connecting via the socket to the red and black wires on the decoder. When the command station is switched on, it sends out a continual waveform and that is used to illuminate the 'track power' LED (the LED and its resistor are connected directly across the incoming DCC signal). The command station needs to sense a load on its output to fully function. This would normally be a loco's motor. This is replaced on the module by a high-wattage resistor. If you have an unused motor, this could be used in place of the resistor (see later). The orange and grey connections on the decoder normally connect to the loco's motor. In the module they connect across the 47R power resistor. Across the 47R resistor are two LEDs. These are connected in reverse of each other, then connected across the 47R resistor, with a 1k resistor in series. The output of the orange and grey wires is the PWM output to the motor, so increasing and decreasing the loco speed control on the command station results in one of the LEDs being made brighter and dimmer. In the forward direction, the green LED illuminates, while the red LED illuminates when the controller is being used in the reverse direction.
Parts List
One piece of stripboard 25mm x 64mm Two green LEDs Two red LEDs One white LED One yellow LED One 47R 5W resistor Five 1k resistors One 8-pin connecting block (see last para)
34-0500 55-0105 55-0102 55-1630 55-0076 62-8234 or loco motor 64-0072 (sold in pack of 100) 22-5136
If you are a MERG member, this is available as a kit - PMP14 Part No: 814. If you are in an Area Group/club, why not place a joint order and share the postage costs? The part numbers listed are for Rapid Electronics (www.rapidonline.com). Alternatively, check out www.bitsbox.co.uk or eBay for competitive prices.
Construction This project is built on a piece of stripboard that has nine strips of copper on one side. It is important to note that all the components are mounted on the other side of the board and their leads are poked through the holes for soldering on the copper side.
This illustration show the components and the tracks at the same time. It is really showing where the components should go. It shows the tracks underneath, as if the Pocket Money Projects 181
Return to Contents Page 4
board was transparent, to help you cut the tracks in the correct places and position the components correctly. If in doubt, consult the earlier photograph. The first step is to cut all the breaks in the track at the points shown in the illustration. Tip: If you are not too sure, count along the rows and columns on the component side, then poke a wire through the hole where the track is to be cut. Then turn the board over and cut where the wire pokes through.
I use a stripboard spot face cutter, but you could use a hand-turned 3mm or 5mm drill bit – or even a sharp knife if you must. The trickiest part is cutting gaps between the two rows of connecting block, to prevent the two rows from shorting to each other. This involves careful removal of the track, leaving enough for soldering the connecting block. The dotted lines indicate the cuts under the connecting block.
Next, check that there no remaining tiny strips of copper still bridging any of the track sections. Then clean the copper strips and the leads of the components prior to soldering. When inserting and soldering the components, you may want to follow these guidelines:
Fit the seven link wires. The 47ohm resistor has its value marked on its case, while the 1K resistors have brown, black and red bands round them The resistors can be fitted either way round. If you expect to have long periods of running at maximum speed, it is best to solder the 47R resistor so that is not touching the stripboard. The LEDs have to be fitted the right way round, with the anode end, marked with a plus in the board layout, positioned as shown in the layout. The anode lead of an LED is the longest lead (see the illustration).
Before connecting the DCC controller to the circuit, do a close visual inspection of the board, ensuring that you have no short circuits, dry joints, unsoldered connections, etc.
How to use it The decoder is plugged into the 8-pin socket and must be inserted with the plug's red lead at the top right-hand corner of the socket. Testing The project's two leads are taken to a DCC command station's normal output connection. The leads can be connected either way round. The command station can then be switched on. The project's power indicator LED should illuminate. A newly-purchased decoder is factory set to operate at address 3, so the command station would be set to address 3. Increasing the speed in the forward direction should make the 'Motor Forward' LED light with increasing brightness. Increasing the speed in the reverse direction should make the 'Motor Reverse' LED light with increasing brightness. The three lamp and function LEDs should be switched on and off using the functions keys on the command station. This will depend on the capabilities of the decoder being tested (read the decoder's manual). In this way, all the main functions of the decoder can be testing prior to it being brought into use. If the decoder being checked is not brand-new, it will probably be set to a different address
Pocket Money Projects 182
Return to Contents Page 4
than the default of 3. If you know its address, just change the command station's address to match the decoder's. If you don't know the address, you can try different addresses on the command station until the direction lights illuminate. Note The 47R resistor is large because it has to handle the full voltage that would normally be applied to a loco's motor. Instead of creating movement, as with a loco motor, the power is dissipated in the resistor in the form of heat. This results in a fair amount of heat if the speed control is set to max. Now you know why a high wattage resistor is used. So, handle with care!
Setting up The module is also useful for setting up a DCC decoder's performance, by adjusting the decoder's CV values to set up loco address, acceleration, deceleration, and much more. A decoder's manual provides details on what CVs are supported on the decoder (the basic ones are all identical but the more sophisticated settings are usually only available on the more expensive models – check the manual). The project's two leads are taken to a DCC command station. This may be the command station's programming output connections or the standard output connections if the controller and the decoder support POM (programming on the main). Alternatively, connect the leads to the output of a SPROG. Thereafter, use the hardware and/or software (e.g. Decoder Pro) that you normally use to configure decoders. This article is not intended as a tutorial on configuring decoders; there are plenty of articles available on the Internet, or in user manuals, that describe the process.
Modifications If you have a spare loco motor, you can replace the forward and reverse LEDs with their 1k resistor and the large 47R resistor with the motor. Simply omit fitting these components and wire the motor across the top and bottom tracks of the stripboard on the right-hand side (the side opposite the leads to the controller). Finally, this project was designed for 8-pin decoders. If you use 6-pin decoders, you could redesign the layout to accommodate them instead.
Pocket Money Projects 183
Return to Contents Page 4
Automatic signals This project came about by chance. I was approached by a MERG member from a local model railway club. Their layout has an up line and a down line. Each line has signal lights that are currently operated by switches. He complained that the operators usually forget to throw the switches, resulting in trains running through red lights. He wanted something that would detect the approaching train and automatically turn the lights to green for a period until the train passed. The delay in switching back to red should be adjustable. We already have a train detector – the PMP2. This uses an LDR as a general purpose light detector. It is used to detect trains in hidden sidings, automatically switch on station lights when a train is on a platform, etc. This circuit uses the same detector circuit but blocking the light to the light-dependent resistor (LDR) triggers a timer that is added to the board. This results in a module with a single function but one that is useful and not readily available or at a reasonable price. This illustration shows the setup. The LDR is fitted between sleepers in the track pointing upwards towards the light.
How it works This part is included for interest. It is not essential to read this before building the project but it helps you better understand what is happening.
The detector The LDR and a 10k preset potentiometer (a small variable resistor) are in series across the 12v supply. The voltage at the junction where the LDR and the trimmer join will vary depending on the resistance of the LDR (which, in turn, varies with the amount of light shining on it). When exposed to light, the LDR has a low resistance and the voltage at this junction will be high. Pocket Money Projects 184
Return to Contents Page 4
When the loco passes over the LDR, it blocks the light reaching the LDR. In darkness, the LDR has a very high resistance and this lowers the voltage at the junction. The 10k trimmer is used to adjust the sensitivity of the detector.
The timer A low voltage on pin 2 of the 555 chip triggers the timer into operation. The 555 timer chip is used in 'monostable' mode which means that it has a normal stable state, with its output (pin 3) at 0V. The output pin stays low until there is a negative-going pulse on pin2. This results in the output pin going high for a fixed period, before returning to 0V again. How long the output stays high is determined by the values of the resistors and capacitors connected to pins 6 and 7. This can be calculated with the formula t = 1.1 x R x C where t is time, R is total resistance in Ohms and C is Farads. The other 10K trimmer adjusts the value of the total resistance and in this circuit produces delays between 3 seconds and 26 seconds. If you want different time delays you can use the formula or use this handy online calculator: http://web.udl.es/usuaris/p7806757/555-calculadora/555%20Calculator.htm
The outputs The output of the 555 is used to drive two LEDs, one directly and one via a transistor. The second transistor is used an 'inverter' which means that a high voltage on its base results in a low voltage on its collector – and vice versa. When pin 3 goes high, the green LED illuminates during the time of that pulse. The high voltage on the transistor's base drives its collector low and the red LED extinguishes. The 1n4001 diode ensures that incorrect connection of the 12V power will not damage the circuit. The power has to connected the correct way round for the circuit to function. The 555 chip can operate on a voltage range of around 4.5V to 14V and the time delays are independent of the voltage used. For more details on 555 timers, look at http://talkingelectronics.com/projects/50%20-%20555%20Circuits/50%20-%20555%20Circuits.html
Pocket Money Projects 185
Return to Contents Page 4
Parts List One piece of stripboard 25mm x 64mm One NE555 chip One 8-pin IC holder One BC557 transistor One 1N4001 diode One LDR detector Four 1K resistors One 10K resistor Two 10K trimmers One 100nF capacitor (optional) One 2200uF 25V capacitor One red LED and one green LED
Note: If you are a MERG member, this is available as a kit - PMP17 Part No: 817.
Construction Before starting, it would be useful to read the article on using stripboard that appeared in the Autumn 2012 Journal.
This project is built on a piece of stripboard that has nine strips of copper on one side. First, turn the board over so that the copper strips are uppermost. Now cut all the eleven breaks in the track at the points shown in this illustration.
If you think you will be making other projects on stripboard, it might be worth investing in a stripboard track cutter, which does a nice clean job of removing the unwanted copper. Otherwise, use a 3mm or 5mm drill bit - but turn it by hand or you will rip a large hole in the strip board in two seconds flat! You could cut the tracks with a sharp knife if you must but that is a very risky approach. Make sure that you cut tracks between the two rows of legs of the chip holder. The green circles indicate places that you might want to drill the hole out a little larger, to provide places where the board can be screwed down. Next, check that all the cuts have been made and there no remaining tiny strips of copper still bridging any of the track sections. Then clean the copper strips and the leads of the components prior to soldering. This minimises problems from dirty or oxidised surfaces during soldering. Now turn the board over to fit the components. It is important to note that all the components are mounted on the other side of the board
Pocket Money Projects 186
Return to Contents Page 4
from the copper strips and their leads are poked through the holes for soldering on the copper side. This illustration show the components and the tracks at the same time. It is really showing where the components should go. It shows the tracks underneath, as if the board was transparent, to help you position the components correctly. If in doubt, consult the earlier photograph.
When inserting and soldering the components, you may want to follow these guidelines: Fit the six link wires. Fit the 10K resistor. It has brown, black and orange bands painted round it. It can be fitted either way round. Fit the four 1K resistors. They have brown, black and red bands painted round them, The resistors can be fitted either way round. Fit the 8-pin IC socket, with the indent at the top. Fit the two 10k trimmers. Fit the diode vertically with the end with the white band at the top, connecting to the track that leads away from the input wire. Fit the transistors. Its flat surfaces should face towards the 555 chip. Fit the large capacitor. It has to be fitted the correct way round, with its positive lead facing upwards away from the bottom of the board. Connect the LDR at the points shown in the illustration. Connect the two LEDs as shown in the illustration. The shortest wires of the LEDs should be connected together and taken to the common point on the board. The longer leads are individually wired to the board. Optionally, fit the 100nF capacitor across the LDR. This is only required where the circuit is feeding into a CBUS or computerised system, to prevent any possible stray pulses from the loco's motor or the DCC signal on the track from generating unwanted pulses. Quick checks All the six links in place? No shorts between adjacent tracks? No dry joints or unsoldered connections? All the components in the correct place and the correct way round? Do not install the 555 chip yet. Pocket Money Projects 187
Return to Contents Page 4
Connect a 12V DC supply to the board, at the points shown in the illustration. Check that your meter reads approximately 12V between pins 1 and 8 of the IC holder (there is a small voltage drop across the diode). Place your meter leads across pins 1 and 2 of the IC holder, with the black lead to pin1. The voltage should swing from high to low as you move your hand over the LDR. Disconnect the power and fit the 555 chip with its notch facing upwards, placing its pin 1 to the top left in the holder. It will have a notch or indent at one end, indicating where pin 1 is (see the example in the illustration) Reconnect the power. The red LED should illuminate. Cover the LDR and the red LED should extinguish and the green LED should illuminate. The trimmer at the bottom of the board sets the sensitivity of the detector and can be adjusted with a screwdriver. The other trimmer sets the delay time.
Modifications The project uses two LEDs that can be built into your own signal assembly. The board can also be used with commercial signals that have common cathode LEDs, sometimes describes as common negative lights. Instead of using separate LEDs, the board's output wires are soldered to the commercial unit's wires, subject to any alterations to wiring their dropper resistors.
Pocket Money Projects 188
Return to Contents Page 4
Modification for common anode signals The above circuit was designed for home-built signals or commercial signals that have 'common cathode' connections – i.e. the cathode of each LRD is connected to the 0V line. Examples of this type are produced by Atlas, Train-Tech and Traintronics. Some signals, e.g. the Gaugemaster 2 Aspect signal (GM508) use 'common anode' wiring, with the anode of each LED connected to the positive supply line. The modified circuit for handling common anode signals is shown below.
Circuit for common anode signals
How the modified circuit works When the train passes over the LDR, it blocks the light reaching the LDR and the output of the 555 chip changes from a low voltage to a high voltage. This results in the red LED having a high voltage at both ends, so the red light does not illuminate. The increased voltage at the base of the BC547 transistor causes it to turn on allowing current to flow through the green LED. After the train no longer blocks the light to the LDR, the timer will eventually switch the 555's output (pin 3) back to a low level. This illuminates the red LED and extinguishes the green LED. Modifying the board
For common anode signals, the components on the right hand side of the stripboard remain unchanged, as do the cuts in the track (apart from an extra cut on the bottom track) The changes are Use a BC547 transistor instead of a BC557 transistor (note the flat surface now faces leftwards). There is no link between the transistor's emitter (e) and the top track; the link is between the transistor's emitter and the second bottom track. The 1K resistor between the transistor's collector (c) and the bottom track is moved further left, as in the illustration below. There is no 1K resistor linking the transistor's middle leg (b) to the positive supply. The red and green LED's change positions and have their anodes (the longer leads) connected to the same point on the bottom track.
Transistors, ICs and PICs 189
Return to Contents Page 4
Layout for common anode signals
Transistors, ICs and PICs 190
Return to Contents Page 4
EzyPoints This servo module controls your points and is set up using only a small screwdriver. It is suitable for use on DC, DCC, and CBUS systems and does not require a computer to set it up.
Servos are becoming increasingly popular as a means of operating points. They avoid the thump-thump of solenoid actuators, which require large pulses of current and which can eventually loosen points. Motorised point motors, such as the Tortoise, avoid these problems and produce a slow movement of the point's tie bar. However, they are expensive and require to be manually adjusted. Servos have the advantages of point motors (slow speed and lower current/voltage demands) but have the added advantages of cheapness and the ability to have their positions adjusted electronically. This project controls a single servo, requiring only connections to a 12V DC supply, the servo and a simple on/off switch to operate the point.
How it works You don't need to read this section before building the module. It is only included to explain how the module works. You can always come back and read it later. It's up to you. The circuit uses a preprogrammed PIC chip that contains all the decisionmaking and controls. The 78L05 is a voltage regulator. It reduces the
Transistors, ICs and PICs 191
Return to Contents Page 4
12V supply to the +5V used by the PIC. Another 5V regulator, the 7805, provides a separate +5V line to the servo. There are three trimmers that are adjusted using a small screwdriver. One sets how far the servo rotates when the switch is closed; another sets the servo position when the switch is opened – and the third sets the speed at which the servo arm turns. When the trigger switch is closed, it takes one the PIC's pins (pin 3) down to 0V. The chip then reads the voltage from the 'Endpoint1' trimmer into pin 6. This voltage decides the composition of the control signal that is sent to the servo. When the switch is released, the chip reads the voltage from the 'Endpoint 2' trimmer into pin 5 and this results in a different signal being sent to the servo. The voltage read into pin 7 controls the speed of the servo arm's rotation.
Parts List
One piece of stripboard 25mm x 64mm One pre-programmed 12F675 PIC One 8-pin IC holder One 7805 5V 1A regulator and one 78L05 5V 100mA regulator Two 10k resistors Three 10k trimmers Two 100uF capacitors and one 100nF capacitor
Note: The complete set of parts is available from the Kit Locker (PMP18).
Construction Before starting, it would be useful to read the article on using stripboard that appeared in the Autumn 2012 Journal.
This project is built on a piece of stripboard that has nine strips of copper on one side. First, turn the board over so that the copper strips are uppermost. Now cut all the ten breaks in the track at the points shown in this illustration. I use a stripboard spot face cutter, but you could use a hand-turned 3mm or 5mm drill bit – or even a sharp knife if you must. The green circles indicate places that you might want to drill the hole out a little larger, to provide places where the board can be screwed down. Next, check that there no remaining tiny strips of copper still bridging any of the track sections. Then clean the copper strips and the leads of the components prior to soldering. This minimises problems from dirty or oxidised surfaces during soldering.
Now turn the board over to fit the components. It is important to note that all the components are mounted on the other side of the board from the copper strips and their leads are poked through the holes for soldering on the copper side. Transistors, ICs and PICs 192
Return to Contents Page 4
This illustration show the components and the tracks at the same time. It is really showing where the components should go. It shows the tracks underneath, as if the board was transparent, to help you position the components correctly. If in doubt, consult the earlier photograph. When inserting and soldering the components, you may want to follow these guidelines: Fit the eight link wires. Fit the two 10k resistors. They have brown, black and orange bands painted round them The resistors can be fitted either way round. Fit the 8-pin IC socket. It helps if it is fitted to the board with its notch facing top left, as shown in the layout illustration. This reminds you to also fit the PIC chip correctly (i.e. with its notch also facing top left). Fit the three 10k trimmers. These components have three pins and are available in different shapes and sizes and may look slightly different from the ones shown in the photograph or illustration. Fit the diode vertically with the end with the white band at the top, connecting to the track that leads to the 78L05 and 7805 regulators. Fit the 100nF capacitor, either way round. Fit the 78L05 regulator, the small black device with three leads. Its flat surface should face outwards, as shown in the illustration. Fit the three pin connector for the servo lead. Fit the two 100uF capacitors with the positive leads connecting to the tracks furthest from the top of the board. The capacitors have white stripes down their sides with a minus sign on them, indicating which leads are the negative ones. Fit the 7805 regulator, the one with the large metal tab, with the tab facing inwards (see the photograph). Connect an on/off switch at the points shown in the illustration. Connect a 12V DC supply to the board, at the points shown in the illustration. Connect the servo with signal end being the furthest from the top of the board. A servo's signal wire is usually coloured white,yellow or orange, depending on the manufacturer.
Installing the servo Before fitting the servo to your point, adjust the trimmers so that the servo arm is in midposition when the switch is both open and closed. If necessary, remove the servo horn (the moving arm) and refit for best position. You can then install the servo knowing that it has movement available in both directions. Transistors, ICs and PICs 193
Return to Contents Page 4
Modifications Although the module is called EzyPoints, it can also be used to operate semaphore signals, crossing gates and animated trackside features. Its your choice. It is also capable of being operated by other MERG modules. The circuit diagram shows a switch being thrown/released to operate the module. All the switch does is bring the chip's input pin 3 down from +5V to 0V. So, other modules whose output switches between +5V and 0V could be used to operate EzyPoints. Just make sure that they share the same 0V connection, as all voltages are with respect to this common ground connection. This allows, for example, the remote operation of points/features by connecting the outputs of a DCC Steady State decoder (Kit53) or a CBUS CANACC8 (Kit 88) to the input of the EzyPoints module. Points/features can then be controlled from your control panel or DCC command station. Also, it allows local operation of the module by connecting the outputs of the DTC8 8channel block detector (Kit 56), the DCC Train Detector (PMP Kit 807) or the LDR Train Detector (PMP Kit 802) to the input of the EzyPoints module. Example uses are detecting when a train is in a particular track section and station/yard lights coming on, doors opening, cranes moving, sounds being played, etc.
Transistors, ICs and PICs 194
Return to Contents Page 4
Chapter 22 Acronyms & Abbreviations
Acronyms & Abbreviations 195
Return to Contents Page 4
Acronyms & Abbreviations Beginners are often confused by the abbreviations that they find in books and articles; the author expects the reader to know what is being talked about.
Acronym This is formed from the initial letters of other words and pronounced as a single word. Examples are ASCII, LAN, Laser, Modem. Abbreviation This is a shortened form of a word and when spoken is pronounced as its longer equivalent. Examples are, Hz is pronounced as Hertz, GND as Ground, mV as milliVolts, etc. There are many thousands of acronyms and abbreviations but here are some of the more common ones you will come across: +ve
Positive potential
-ve
Negative potential
1-Scale
1:32 scale, 10mm to the foot, 44.45mm track
A/D
Analogue to Digital
ADC
Analogue to Digital Converter
AC
Alternating Current
ACK
Acknowledge
AMP
Ampere – measure of electrical current
ANSI
American National Standards Institute
ASCII
American Standard Code for Information Interchange
ATC
Automatic Train Control
AUX
Auxiliary
AWG
American Wire Gauge
BEMF
Back EMF
BSI
British Standards Institution
CAD
Computer Aided Design
CAN
Controller Area Network
CCW
Counter-Clockwise
CMOS
Complementary Metal Oxide Semiconductor
CR
Carriage Return
CT
Centre-tapped – e.g. in a transformer
CV
Configuration Variable used in DCC decoders
Acronyms & Abbreviations 196
Return to Contents Page 4
CW
Clockwise
CDU
Capacitive Discharge Unit – usually for operating solenoids
COM
Communication – usually describing a computer's serial port
CPS
Cycles Per Second
CPU
Central Processing Unit – the 'brains' of a computer or PIC
CRO
Cathode Ray Oscilloscope
D-SUB
Series D Sub-miniature Connector
Db
Decibels - a measure of noise level
DC
Direct Current
DCC
Digital Command Control
DEMU
Diesel Electric Multiple Unit
DIL
Dual In-line Package
DIN
Deutsches Institut für Normung – speciciations for some plugs and sockets
DIP
Dual In-line Package
DMU
Diesel Multiple Unit
DPDT
Double Pole Double Throw switch
DPST
Double Pole Single Throw switch
DSO
Digital Storage Oscilloscope
DVM
Digital Voltmeter
ELCB
Earth Leakage Circuit Breaker
EM-Scale
4mm to the foot, 18.2mm track
EMC
Electromagnetic Compatibility
EMF
ElectroMotive Force
ESD
Electro Static Discharge
ETX
End of Transmission
FAQ
Frequently Asked Questions
FAST
Federation Against Software Theft – fights against software piracy
FET
Field Effect Transistor
G-Scale
1:22.5 scale, 45mm track
Gbps
Gigibits per second
GB
GigaBytes
GIF
Graphic Interchange Format – a compressed image format
GIGA
Billion (10˄9)
GND
Ground
Acronyms & Abbreviations 197
Return to Contents Page 4
HO-Scale
3.5mm to the foot, 16.5mm track
Hz
Hertz – measurement of frequency
IC
Integrated Circuit
ICSP
In Circuit Serial Programming – interface for programming PICs.
IEEE
Institute of Electrical and Electronics Engineers
IO
Input / Output
IPA
Isopropyl Alcohol – an electronic cleaning solvent
IR
Infrared
IrDA
Infrared Data Association – specifies the protocols for IR communications
JAL
Just Another Language – used for writing programs for PICs
JPEG
Joint Photographic Experts Group - a compressed image format
HSS
High Speed Steel – as for drill bits
Kbps
Kilobits per second – measure of data transfer speed
KB
KiloByte
KHz
KiloHertz
KILO
Thousand (10˄3)
LAN
Local Area Network
Laser
Light Amplification by Stimulated Emission of Radiation
LCD
Liquid-Crystal Display
LDR
Light Dependent Resistor
LED
Light Emitting Diode
LF
Line Feed
Li-ION
Lithium-ION – rechargeable battery
LMP
Low Melting Point – as with some solders
mA
milliAmp
Mbps
Megabits per second
MB
MegaByte
MCD
MillCandela – measure of luminous intensity
MEGA
Million (10˄6)
Modem
Modulator/Demodulator
MP3
MPEG-1 or MPEG-2 Audio Layer III – compressed audio file
MHz
Mega Hertz
Micro
A millionth (10˄-6)
MILLI
A thousandth (10˄-3)
Acronyms & Abbreviations 198
Return to Contents Page 4
MOSFET
Metal–Oxide–Semiconductor Field-Effect Transistor
MTBF
Mean Time Between Failures – measures reliability of devices
MTTF
Mean Time To Failure
mV
MilliVolt – a thousandth of a Volt
mW
milliWatt– a thousandth of a Watt
n-Gauge
1:160 scale, 2mm to the foot, 9mm track
N/C
Normally Closed – e.g. a push-to-break button
N/O
Normally Open – e.g. a push-to-make button
Nano
A billionth (10˄-9)
NiMH
Nickel-Metal Hydride, used for rechargeable cells
NMRA
National Model Railroad Association
NPN
Type of transistor
O-Scale
1:48, 7mm to the foot, 30mm track
00-Scale
1:76 scale, 4mm to the foot, 16.5mm track
009-Scale
1:76 scale, 4mm to the foot, 9mm narrow gauge track
00n3-Scale
4mm to the foot, 12mm narrow gauge track
OpAmp
Operational Amplifier
P-P
Peak to Peak
PB
Push Button
PCB
Printed Circuit Board
PIC
Peripheral Interface Controller
PICO
(10˄-12)
PNP
Type of transistor
POM
Programming On the Main – technique for programming DCC decoders
POT
Potentiometer – a 3-pin variable resistor
PSU
Power Supply Unit
PVA
PolyVinyl Acetate – wood glue, white glue
PVC
Polyvinyl Chloride
PWM
Pulse width modulation
RCD
Residual Current Device – circuit breaker to prevent shocks
RF
Radio Frequency
RFID
Radio Frequency Identification
RMS
Root Mean Square
RPM
Revolutions Per Minute
Acronyms & Abbreviations 199
Return to Contents Page 4
RS232
Retma Standard 232 – a Serial port
RX
Receiver
S-Scale
1:64 scale, 4.7625mm to the foot, 22.42mm track
SATA
Serial ATA – a bus for computer data transfer
SCART
Syndicat des Constructeurs d'Appareils Radiorécepteurs et Téléviseurs - a 21-pin plug/socket for audio-visual equipment.
SCR
Silicon-Controlled Rectifier
SD
Secure Digital – as used in computer memory sticks
SIL
Single In-Line
SMD
Surface Mount Device
SMPS
Switched-Mode Power Supply
SMT
Surface Mount Technolgy
SPDT
Single Pole Double Throw switch
SPST
Single Pole Single Throw switch
SSR
Solid State Relay
STX
Start of Transmission
SWG
Standard Wire Gauge
TiN
Titanium Nitride – as used in drill bits
TOD
Track Occupancy Detector
TOTI
Train On Track Indicator
TPI
Teeth Per Inch – specification for saw blades
TRIAC
Triode for Alternating Current
TT-Scale
1:120 scale, 3mm to the foot, 12mm track
TTL
Transistor-Transistor Logic
TX
Transmitter
UART
Universal Asynchronous Receiver/Transmitter
USB
Universal Serial Bus
UTP
Unshielded Twisted Pair
Vcc
Positive supply
Vdd
Positive supply
Vss
Negative supply, ground
XTAL
Crystal
Z-Scale
1:200 scale, 1.385mm to the foot, 6.5mm track
ZIF
Zero Insertion Force
Acronyms & Abbreviations 200
Return to Contents Page 4
Appendix The Model Electronic Railway Group
MERG 201
Return to Contents Page 4
The Model Electronic Railway Group This book is not a MERG production; as the author I retain control of its contents. Nevertheless, as an active member of this group, I know that MERG can make a valuable contribution to both club layouts and home layouts. I am very happy to introduce you to what the group has to offer.
Model railway electronics for all gauges and modellers at all stages MERG is the leading international forum for all railway modellers interested in applying electronics to the hobby The Group enables members to exchange ideas and information, and provides kits covering a number of interests including DC operations, DCC, Radio Frequency Identification, computer control and CBUS. Members have a wide range of knowledge and capability, from beginners to those who work in the electronics and railway industries. MERG caters for all-comers:- beginners (which is where we all started from), semi-experienced, and professionals. Have a look at the public area of the website:
www.merg.org.uk
MERG is a friendly and informal ‘first names’ group and new members are encouraged to present their ideas, as well as share those already available . MERG 202
Return to Contents Page 4
Benefits include : Website The members' area provides access to a large range of resources. There is a huge amount of material on the website, that you could spend many interesting hours looking through. The material covers all the subjects that you would come across when working with your layout's electrics and electronics.
A regular Journal This is posted out at least four times a year to all members, containing new ideas and reports on developments. Its contents reflect the range of abilities of its members, including simple but useful circuits, reports on what members are working on and suggestions for new devices.
Kits MERG has a great reputation for developing and making a comprehensive range of low cost, self assembly kits available to members.
This includes kits for signal operations, operating points, train detection, etc. Its range of DCC kits includes a command station, a district cutout, accessory decoders, etc. These kits, and the range of Pocket Money Project kits described in chapter 21, can be ordered directly from the website or ordered through the post. MERG 203
Return to Contents Page 4
Assistance MERG is renowned for the help that it gives to its members. Its has members throughout the world and they are all able to access help and advice through the MERG internet Forum …..
….. and also through the MERG Yahoo Group.
These are used extensively by members to get help while building kits, recommendations for components and equipment, advice on wiring, and much more. MERG 204
Return to Contents Page 4
Meetings and Local Area Groups There are national meetings of MERG members at least four times a year in London. In addition, there is an increasing number of local groups being set up to bring members together in regional areas. Currently, there are Local Area Groups in; Aberdeen, Bristol, Cardiff, East Anglia, East Midlands, East of Scotland, Essex, Exeter, Hants & Dorset, Highlands, Kent, North East, North West, Northern Ireland, Shanghai, Somerset, South East Queensland, Thames Valley, Three Counties, West Midlands, West of Scotland, and Yorkshire.
Training Apart from bringing members together, Local Area Groups play an important role in training and educating members. Members get a chance to find out how things work, see modules in action and pick up new skills such as soldering. MERG also provides tutors for the weekend courses run at Missenden Abbey, Bucks.
Technical Bulletins The MERG website provides access to over 250 Technical Bulletins. These documents provide background reading on a large range of subjects, as shown.
Making savings Bulk buying means that the kits and other items are sold at cost price – and much cheaper than ordering you own components. In addition, MERG offers discounts on selected commercial products and some model railway electronics publications.
How MERG operates MERG is entirely run by volunteers - no member receives any financial remuneration for the time and expertise that they contribute. This applies to those who provide the administrative support, those who design and assemble the kits and those who write Technical Bulletins and provide advice on the Forum.
How to join There is a variety of ways to join and get involved with MERG. Exhibitions
MERG has a stand at several major shows each year, as well as a number of local shows ones, usually attended by members from the Local Area Groups. Online
The home page of the MEG website has a link to join MERG, payment being made by credit/debit card, or through your PayPal account. By mail
You can also complete an application form and post it off with a cheque.
MERG 205
Return to Contents Page 4
MERG membership application To join MERG and take advantage of all that the group has to offer, please read the following and then print the form on the next page, fill it in and post it to the Membership Secretary. I agree to abide by the Rules of the Group and I confirm that I am 18 years of age or over. By applying for membership of MERG I consent to the data supplied on the application form being used for the promotion of MERG’s aims and for membership administration purposes. I understand that the data will be included in a Membership List that is provided to other members. Once a year the list may also be viewed on the password protected members only area of the MERG website. I understand that the Membership Secretary will hold my details on a computer. I also understand and accept that my data and that of other members may not be used for any commercial purpose. Should I not renew my subscription, my full name and membership number will be retained, for the purpose of allowing the re-allocation of the same number if I rejoin at a later date, other membership data will be deleted 24 months after last renewal. Members are responsible for advising the Membership Secretary of any changes in their data. I also agree to indemnify MERG, its Officers and Members against any claim arising from any use or misuse of any publication, kit or other goods supplied to me by MERG.
Current Membership Rates : The basic subscription runs for a year from the date of joining.. For new joiners, there is a one-off joining fee of £5. For countries in the UK it is £16. New members pay £21 in their first year only. For countries in the Royal Mail European area it is £18. New members pay £23 in their first year only. The rest of the world pays £20. New members pay £25 in their first year only. The higher subscription rates outside the UK are to offset a proportion of the higher postage cost. Cheques should be drawn on a UK Bank and made payable to “MERG” If you have any queries, please do not hesitate to contact the membership secretary at
[email protected] for details before sending in the form. Unfortunately, at present, we are unable to accept payment by credit card ( except via PayPal ) or to handle direct debits.
MERG 206
Return to Contents Page 4
MERG 207
Return to Contents Page 4