The Raspberry Pi 4 stack of HATs, Bonnets and custom boards starts with the Raspberry Pi 4 and Rainbow Pibow Coupé 4 case.

Not shown are:

  • A DSI cable connected to the ribbon connector on the left center (left of the raspberry icon.)
  • A 3-pin header connected just below the raspberry icon. a 2-wire cable bring out a ground and GLOBAL_EN to start the Raspberry Pi from a total shut down. (See Traffic Monitor section below.)

Raspberry Pi 4 and case

The fan and custom board, version 2, sets on top of the case, against the 2x20 header and held in place by the screw in the lower left corner. The lose connector is plugged into the 16-channel PWM/Servo HAT that goes on next. Version 2 of the fan board makes room for the DSI ribbon cable on the left.

Raspberry Pi 4 with fan added

The 16-Channel PWM/Servo HAT is mounted above the fan board. In the middle of the HAT are 6 addressing pads used to distinguish this board from other boards using the I2C interface on the Raspberry Pi. None of the pads are soldered/shorted here therefore, address X40.

16 3-pin connectors across the front of the PWM/Servo HAT are the 16 PWM outputs and 5vdc. The control and 5vdc on the first connector on the left are used to control the fan (the brown/black/white cable). The others control servos to drive semaphores. 

On the right edge of the (blue) board are connectors for 1) 4 traffic monitor LEDs, 2) 4 tri-color LED signals and 3) a push-button to control the fan. For details see 16-Channel PWM/Servo HAT.

On the left edge are two black connectors for 5vdc to drive the servos connected to the system. This 5vdc is separate from the 5vdc used by the Raspberry Pi and on the 2x20 pin header. The plug is used to input 5vdc and the terminal block is used to daisy-chain the voltage to the IO Pi Plus HAT and PWM/Servo Bonnets that are next in the stack (red & black wires).

Raspberry Pi 4 with Servo/PWM HAT on top

The IO Pi Plus HAT is next receiving external 5vdc from the PWM/Servo HAT below. The external 5vdc provides power for the 32 IO pins added to the Raspberry Pi system by this HAT. The 32 IO pins are connected to two connectors each with a I2C buss address, in this case x24 and x25 as determined by the two sets of addressing pads on the upper right of the board.

Each 20 pin connector makes 5vdc, ground, 16 IO pins and 2 interrupts available. Each interrupt can monitor 8 of the IO pins on the plug for status changes. We will connect the interrupts to the Unicorn board on top of the stack connecting to Raspberry Pi pins to alert software to process changes in the input pins.

The IOPi Plus HAT was added to the Raspberry Pi 4 (3) stack to provide inputs for the status of the turnouts and it eliminates the need for the second Raspberry Pi (3A).

IO Pi Plus adds 32 IO pins to the Pi

The first of three 16-Channel PWM / Servo Bonnets is connected to the raspberry Pi 2x20 header next. The Bonnets have the same functionality as the 16-channel PWM/Servo HAT, capable of controlling 16 servos. The bonnets do not have the modification area on the right side as does the HAT. Notice the 6 addressing pads middle right of the bonnet. In this case the low order bit, A0, is shorted for address x41 on the I2C bus. 5vdc is linked up from the IO Pi HAT by the red/black wires on the left. 

Raspberry Pi 4 stack with first Servo Bonnet added

Next in the stack are the second and third Servo Bonnets. They are addressed x42 and x43 using the 6 addressing pads. That provides control for a total of 64 (16x4) PWM/servos, 61 we were going to use. That is 1 for the fan and 60 for the semaphores (now just 56). Again the red & black wires on the left connect the external 5vdc to drive the attached servos. 

Raspberry Pi 4 stack with second Servo Bonnet addedRaspberry Pi 4 stack with third Servo Bonnet added

Finely an interface board is on top of the stack to connect to the two Unicorn displays. The 12-pin header brings out 3v3dc(1), 5vdc(2), grounds(3) and SPI interface(5) pins. 

Four 5vdc interrupt lines from the IO Pi HAT are brought up and connected to four 3v3dc Raspberry Pi GPIO pins through voltage dividers. This make the IO Pi interrupts accessible as interrupts to the software running on the Raspberry Pi.Boaed to connect Unicorns and IO Pi interrups

The full Raspberry Pi (3) stack with all input sensors and output controls connected.

  • Each of the 56 numbered three-wire rainbow cables in the front connect a PWM output to a servo, controlling semaphore aspect.
  • The 10-wire rainbow cable looping off the top controls the two unicorn HD HAT LED matrix.
  • On the left end of the top board is a 4-wire connector for the interrupts from the IO Pi HAT deeper in the stack.
  • Under the interrupt cable are two gray cables connecting status of some turnouts from Wabbits. (Another gray cable is hidden under the rainbow cables in the front connecting the remaining Wabbits.)
  • Under these cables is a 5v0dc connector powering the 56 servos. A DSI ribbon cable, installed for future use, is seen as the wide black shadow to the left. (Don't know how this will be used. But it plugs directly into the Raspberry Pi on the bottom of the stack, so install it now or never.)
  • Hidden under the rainbow cables is a 4-wire cable controlling the 4 traffic monitoring LEDs on the Traffic Monitor bracket.
  • On the right side are four 3-wire cable (red wires). These control the four dwarf tri-color LED signals in the staging yard.
  • On the right is a green/yellow cable for the run LED and the run/boot switch on the Traffic Monitor bracket.
  • On the right is a cable (purple wire) to the fan control switch on the Traffic Monitor bracket.
  • Under the cables on the right are the Raspberry Pi USB connections to the Arduino (2) base station and a memory stick.