This is a project you will
want to add to your layout.
POINT MOTOR CONTROLLER for SOLENOID
The diagram above shows where the two sets
of IR detectors are located on the layout. |
A train coming from left to right will trip the first detector and the points will change.
The circuit is designed to alternatively allow the train to travel ahead or divert to the siding.
If the train is diverted to the siding, it may have to be shunted out and the detector must be distant from the point to prevent the train operating the point.
You will then need to shunt the train down the track to operate the point to "straight ahead."
The second detector will not operate the point due to a 10 second delay in the program. The second detector will not operate the point due to a 10 second delay in the program.
A train coming from right to left will operate the point to allow the train to pass over the point.
But the interesting feature of the IR Point Motor Controller project is the pulsed Infrared LED of the IR beam.
The transmitter LED is activated at a frequency of 30kHz and the receiving transistor is "looked at" for a period of 1 millisecond. This will result in 30 "counts"
. turned ON for 10 milliseconds and this is done 4 times a second. During this time the receiving LED detects a pulse of IR light and it compares the high illumination with the low illumination from the surrounding conditions. xxxxx(or maybe 10kHz pulses)
In this way the circuit eliminates any background light and only reacts when the beam is broken.
The circuit accepts AC or DC from your "controller" transformer or from a plug-pack (wall wort) and converts it to DC via an on-board diode rectifier and 100u electrolytic. The smoothing does not have to be perfect as the 5v regulator converts the DC (can be from 12v DC to 18v DC) to 5v DC for the microcontroller and the poorly rectified DC is used to charge the two 1,000u electrolytics.
The electrolytics are used to create a LOW-IMPEDANCE POWER SUPPLY, capable of delivering a high current to the point motor via a transistor "switch." There are two transistor switches to do this. One transistor switches the point "to the left" and the other switches the point "straight-ahead." Point motors have 3 connections, with a common as the centre wire.
Only the energy from the two electrolytics is passed to the point motor and this activates one of the coils for a short period of time.
The point-motor cannot be re-activated for 5 seconds (due to a delay produced by the micro) after the train has passed so it is important to keep two trains some distance apart so the point can be re-activated.
If you don't want the second train to take the "siding rail" simply bring the train up to the sensor and this will activate the point. Reverse the train and wait. The point will be activated again and the second time the point will be "straight-ahead."
CAPACITOR DISCHARGE UNIT
The project contains a CAPACITOR DISCHARGE UNIT, made up of two 1,000u electrolytics. This creates a separate low-impedance power supply to operate the point motor without putting a heavy load on the plug pack.
The two electrolytics are charged via a 330R resistor and this means they will take a fairly long time to fully charge. But this does not matter as the circuit has a delay of at least 10 seconds before the points can be changed. This is to prevent them changing when the train is over them.
ON-BOARD LED INDICATORS
A red LED on the PC board indicates the points are set for "ahead" and a green LED shows the points are set for "siding." An oncoming train will set the points "ahead."
This project uses an 8-pin microcontroller because it produces the simplest and cheapest design. All the timing and controlling is contained in a program instead of dozens of individual components and anything can be changed by simply going to the program and changing the instructions.
This project would normally need 2 - 4 chips. A micro is cheaper and takes up less board space.
It is also quicker to write the program than build a discrete circuit because many of the sub-routines are already available on Talking Electronics website as "cut and paste."
DETECTING THE TRAIN
The secret to detecting the train is INFRA-RED PULSES.
The micro can really on perform one task at a time and the train detection circuit consists of an IR LED and receiving transistor.
The circuit must be able to automatically be able to detect the presence of a train over a range of lighting conditions so the detecting circuit doesn't have to be adjusted for different lighting levels. To do this the IR LED is pulsed and these pulses are picked by the IR receiving transistor.
When a train is NOT present, the reflected IR pulses are not picked up by the receiver, but if they are, the ambient light does not allow the receiver to produce a HIGH/LOW output. It simply produces a LOW then an extra-low output.
However when a train passes over the detection-pair, the surrounding ambient light is removed and the pulses for the LED are reflected on the underside of the engine and passed to the receiver to produce a definite High-LOW output.
The program is designed to go to a "counting loop" for a short period of time and if it detects 20 pulses, the program has detected the train.
The program alternately selects one IR pair then the other and this takes up most of the processing-time when the project is waiting to detect a train. The Spectral Response for the IR transistor is shown in the following diagram.
There are two different types of Infra red receivers. One type is quite
dark and has a coating to reduce room light. The other is clear and has
a higher gain at about 900nm, but as you can see from the graph above,
it will still detect light in the visible spectrum.
These features are contained in our simple design and can be built in an evening on Matrix Board. A kit of components is available from Talking Electronics as well as a pre-programmed microcontroller.