With the requirements laid out there, I end up with 4 basic subsystems:
- Power
- Input controls
- Timing
- Output
Most HO model railroad layouts have low voltage AC and 12V DC readily available. Most of the common switch machines run with 10V-12V (some accept both AC & DC others DC only). So, the design is around running from 12V DC just to keep things simple. What I'm designing will easily run with 10V-16V DC.
Many hobbyists and layouts though, may not have high quality 12VDC power. the snap style relay switches can often draw 3A while in use. This means that options for how much in the way of capacitors can easily be added is a plus.
Trying to keep in mind other possible uses as well, the Output stage might need to be able to run at higher voltages in certain situations. By laying out the runs carefully and allowing for an extra power connector, we can allow a couple runs to be cut to isolate the main circuits from the output so that we can allow higher voltages. An added plus is if I have room, allow for a 7812 or 78L12 to be added at the cut location so that we can regulate power our elves. This easily allows for 24V DC or greater for the output stage depending on the rest of the components chosen.
Finally, we may have multiple boards near the same area of the layout. Allowing for a power out connecter can simplify wiring. When we don't want that, not installing the connector saves money.
Input controls
Accepting either two wire or three wire input with voltage ranges from digital to +/- 12V DC could risk the circuit getting more complicated then needed. Thankfully, optocouplers are readily available that have a wide range of current & voltage. By using a DC optocoupler and a single 470 ohm resistor per input, gives us a wide range of input from less then 4V to well over 12V.
Using a DC coupler then I add a couple three position jumpers to select between two wire & three wire mode. By moving the jumpers, I can hook one coupler up in reverse with other to trigger on negative voltages for two wire mode. Three wire mode is same polarity, but to the third input.
Lastly, transistor output type optocouplers are vary insensitive to the input voltage. Just select the proper resistor and wiring, and you have either an inverting ot non-inverting circuit. In my case, I'm going with the inverting circuit since the timing stage likes to trigger on the falling edge.
Timing
We need at a minimum to either output a one shot pulse or debounce the input to clean it up. Just running the signal straight through I consider a debounce with a very short timeout. A 556 dual timer is handy for this, being a dual timer means a single chip handles both of the inputs and outputs. It's also forgiving on power requirements running on up to 16V DC.
For adjusting the timing, I'm just going to be using a simple RC without making it adjustable. Someone needing to make it adjustable can modify that easily, but we don't want to worry about calibrating trimpots or them changing in most cases.
For one-shot verses debounce, using a coupling capacitor with the input stage and an optional jumper or installing a wire instead lets me choose either easily.
We also want to make sure that both outputs aren't on at the same, so adding a jumper between the two half's of the 556 timer between the output of one and the reset of the other accomplishes this. By allowing a jumper, this becomes optional, and removing the jumper allows each side to be independent allowing for non-switchout uses, such as lighting control.
Output
As outlined in power, we want the output voltage to default to what's running the entire board or optionally it's own voltage. That's mostly a layout issue.
We also need to run two wire or three wire type output at anywhere between 20mA to 3A from 10V-12V DC. Two wire needs to reverse the outputs to apply negative voltage, while three wire has a common plus two wires that just get the required voltage as needed. Luckily, for a two wire arrangement, we normally only need low current, we don't need to worry about high current and reversing voltages at the same time. This allows us to avoid using an H-Bridge and simplify the design by using a resistor with a MOSFET or transistor.
The high current requirement with a relay does mean we need to worry about power spikes when we shut down the circuit or it's moved by the other half. That's one or two diodes more on each line to add that protection
Additional notes
Connectors! I personally love the euro-style screw connector that clamps down on the wire for things like this. It works easily and gives you a secure connection rated at 10A to 15A for the smaller parts. You have an added bonus that some of the connectors use a slightly larger hole size. If I lay it out for the larger hole and add an extra large pad around it, I also have something that's easy to solder a wire to for people trying to save money on connectors.
For the circuit board size, since more then one turnout is usually together and increasing the size won't greatly increase my board costs, I've decided that having two pairs of circuits on a single board makes a lot of sense. Each pair handles one turnout giving my design the ability to handle up to two turnouts or four separate outputs.
No comments:
Post a Comment