| For train occupancy detection, I’m using both DS54/BD1’s from Digitrax and BD8’s from Digitoys. During tests, I discovered that these two types of detectors have different behaviours. The differences are twofold :
The modification I made changes the BD8 turn-off (“occupied” to “clear”) delay to 2 seconds, just like the DS54/BD1. The turn-on delay is unchanged (immediate) but this is better, since we want to detect a train, as soon as it enters a track section, and even better than the DS54/BD1 which takes some time to detect a train entering a track section.
Shown at right is a BD8 card, with an enlarged portion of it. This is where the modification occurs. The modification is rather simple, since it requires adding 8 resistors (470 ohms – ¼W) and 8 capacitors (47 µF – 25V), one each per BD8 circuit.
Note : 47 µF capacitors will provide a turn-off delay of approximately 2 seconds. If you need another delay, just change the capacitor value proportionnally to the required delay (for example : 22 µF for a one second delay – closest std. capacitor value).
Fortunately, BD8 design provides connection for these new components at locations identified C1, C3, C4, C5, C6, C7, C8, C11 (these locations were originally planned for another purpose). But, unfortunately, the small space provided does not allow for easy installation, so we’ll have to use some tricks to install them.
The diagram at left shows the original circuitry between the LM339 (the chip that perform train occupancy detection) and the microcontroller. There are 8 identical circuits on the BD8. The two pads identified as Cn corresponds to one of the BD8 locations identified C1, C3, C4,… C11.
When the track section is “clear”, the microcontroller input is at high level (output transistor of LM339 non conductive). When the track section is occupied, the microcontroller input is at low level (output transistor of LM339 conductive). The transition from one level to the other is immediate.
Shown at right is the modified circuit, with 470 ohms – ¼W resistor and 47 µF – 25V capacitor added.
When the track section goes from “clear” to “occupied”, the capacitor discharges quickly through the 470 ohm resistor and the LM339 output transistor (the 470 ohm resistor is only there to limit the current in the transistor, according to LM339 specs). When the track section goes from “occupied” to “clear”, the capacitor charges slowly to Vcc through the 470 ohm and 100 kohms resistor, causing the microcontroller input voltage to rise slowly and to delay the output information.
So, we get a fast “clear” to “occupied” transition and a slow “occupied” to “clear” transition.
Since space is very limited, on the BD8 itself, I designed a small Printed Circuit Board, for mounting the added components, which will be installed on top of the BD8 and connected to it.
Caution : The PCB image is not to scale. If you are interested by this board, I can provide a 1:1 scale image file, upon request.
The figure at left shows the assembled PCB (top view/component side). All resistors are 470 ohms – ¼W and all capacitors are 47 µF – 25V, but you may change for another capacitor value, if you need a different delay. Care must be taken to properly orient the capacitors, so that their positive side be as indicated (square pad). In blue are shown the BD8 locations where the PCB will be connected.
After assembly is complete, the small PCB can be installed on top of the BD8 and connected to it.
In order to ease installation, I recommend to first clear all 16 BD8 soldering pads (identified C1, C3, C4… C11) from existing solder by using solder wick (just lay the solder wick on the pad and heat with a soldering iron : the solder wick will soak up excess solder).
Then solder 16 pieces of solid wire (such as leftover resistor leads) about 3/4 inch long in the small PCB pads identified C1, C3, C4,… C11. Each piece of wire should be installed square to the PCB and protruding on the bottom side of the PCB. These pieces of wire will be the connections to the corresponding pads on the BD8.
Install the small PCB on the BD8 by inserting the 16 leads (the pieces of wire we just installed) in the corresponding BD8 locations. The small board can be attached to the top of the microcontroller by using double-sided foam tape (use several layers to avoid any contact between the board and the microcontroller), or just left floating over it. Then solder the 16 leads to the BD8, on the bottom side.
An alternate method is to install the small PDB beside the BD8 an to make the connexions between them using small stranded wire (#24).
That’ all… The BD8 can now be used as usual. Just the turn-off delay will be changed.
|Credits: Jean-Louis Simonet|