D&B RPi Schematics

The interfacing hardware has significantly changed with the move from Basic Stamps to the Raspberry Pi. The overarching goal was to minimize changes to the layout wiring. This wiring connects to the control electronics using 6 pin cable connectors. These connectors plug into a new motherboard which in turn, has connections to the various RPi hat boards.

Use the following links to view each PDF schematic sheet. Downloaded all schematic sheets in a single file. RpiSchematics.zip.

Keypad Interconnect Circuits PDF
Sensor Interconnect Circuits PDF
Servo Interconnect Circuits PDF
74HC595 Shift Register Signal Circuits PDF
Support Circuits PDF

Servo Driver Hat

Two 16 Channel Servo Driver hats are used to drive the turnout servos. This hat uses the PCA9685 chip which is configured for operation with the SG90 R/C servo by the I2C_InitServoDriver code. Refer to the code and the PCA9685 Document for more information.

The following images show the servo PWM signal. Measurements were taken with the scope probe attached to the signal pin of first servo channel.

Click image to enlarge.
RpiServoOpen.jpg RpiServoMiddle.jpg
RpiServoClose.jpg RpiServoRate.jpg

The layout uses thirty-two SG90 servos that require five volt power. Each servo driver board has an isolated power connector that is feed from a dedicated 5 volt 1.2 amp power source. The RPi supplies 3.3 volt power to the hat electronics via the 40 pin GPIO connector.

74HC595 Shift Register Circuit

A suitable commercial product for driving the track signals using shift register functionality could not be located. I briefly considered using tri-color LEDs and a 16 channel PWM board. In the end, minimum disturbance to the layout and signals won out. Therefore, a breadboard hat was constructed using four 74HC595 shift registers and point-to-point wiring. This also provided a convenient place to locate the variable resistors used to adjust the yellow color purity. Not as pretty, but functional none-the-less.


74HC595 shift register timing measurement. Scope probe A: GPIO27_SCLK, Scope probe B: GPIO17_XLAT.


DCC Block Detectors

The DCC block detector circuit was retained from the original design. This passive circuit is reliable and inexpensive. Six-tenths volt of the DCC track voltage is dropped by the silicon diodes whenever a power drawing locomotive or car is within the electrically isolated block. This portion of the DCC signal is boosted to a useable level by the audio transformer. The right side connections of the transformer form a voltage doubler and DC rectification circuit. The resulting DC voltage is limited to 5.1 volts by the resistor and zener diode to protect the MCP23017 input pin.


The following table summarizes the detector DC output voltage under various loads. The voltage was measured across the two capacitors with the zener diode disconnected. The output voltage depends on train speed, locomotive load and power draw, and car lighting within the block.

Load Description Measured Voltage Stopped Measured Voltage Moving
10,000 ohm resistor across the track 1.3  
Car with two 10,000 ohm resistor wheels (5,000 effective) 2.75  
Single HO scale P2000 GP30 locomotive 3.20 5.65
Two HO scale Bachmann Spectrum series F7 locomotives 4.75 6.10
Single HO scale Athearn Genesis USRA 4-6-2 Light 3.75 5.90
All four locomotives in same block 6.00  

Color Bar

Planning and Construction:   Design Goals   Track Plan   Photos   Scenery Base
Basic Stamp Control Electronics:   Main line   Yard   Grade Crossing   Block Signal   Turntable
Circuit Description:   Main line   Yard   Grade Crossing   Block Signal   Block Detector   Turntable   Power Supply   Schematics
Photos and Video clips:   Photo 1   Photo 2   Photo 3   Photo 4   Photo 5   Photo 6   Video Clips   Ride The D&B
Propeller Control Electronics:   Overview   Flow Charts   Program Code   Schematics   Photos
Raspberry Pi Control Electronics:   Overview   Program Code   Schematics   Photos
Navigation:  D&B Home  Buczynski.com Index

Copyright © 2018 Don Buczynski
San Diego, California