This project controls the points/turnouts of a model train layout. There are 6 control panels where the user can request one of the various track options.
A block diagram is shown below. The six control panels are given names corresponding to where they are located on the model train layout
On each panel there will be 4 buttons to request possible routes. Note due to the physical payout of the track, specifically the "wye" connection there are only 4 possible options on each panel and the 4 options on each board will be different.
On each panel there are four buttons to select the required routes
This project develops a class/library that reads the 4 buttons on each panel and returns the requested route.
The basic circuit of the controller and one control panel is shown. The 164 device drives the 4 LEDs to indicate the chosen point selection and is the subject of another page
The 165 device is wired to pin D4 (load), D8 (clock) and A0 (data in) The remaining boards use the same load and clock signals but the data is wired to pins A1 through A5.
The above trace shows the signals to/from the buttons. The first channel gives the load signal that transfers the button state into the parallel to serial shift converter or shift register.
This is followed by 8 clock pulses to ripple the data from the shift register into the microcontroller (Serial In)
For the final trace a microcontroller pin was set high before reading the buttons and low when the operation was complete. By setting the cursors this may be read as 367 uSec.
Note the waveforms have captured a number of glitches. These appear to be related to the Serial In line going high and could possibly be eliminated by adding a small capacitance to the line.