22 - 31 Jul
Stuff to lay track arrived. Replacement for NON-DCC trains ordered ~ red train is now black. ("Little black train is coming " is now the theme song. RR modelers seem to give their layouts a name. Given the lack of scenery or even paint, I'm thinking "WoodLand RR" sounds about right.
The Raspberry with the Adafruit 16-Servo/PWM HAT works OK. Need to work on control. With the sample semaphores the control wires move about 1/8". The servos move to fast without stepping the change with little delays. That will tie up the processor. Needs work.
Tested the DCC++ Base Station, Arduino Mega with Arduino Motor Shield, to control relays to reverse signal on track using DCC++ outputs <Z> and checked a modified IR sensor response when 'registered' as a sensor <S> with return of <Q>/<q>. Both extensions work as advertised.
The header at the end of the Arduino Mega is two rows of 18 pins. There are 2 ground pins on one end and 2 +5v pins on the other. In the middle are 32 of the Mega's digital IO pins. In the hardware section is the design of the header to translate the 36 Mega pins into 32 3-pin headers for the sensors, providing +5v, ground and sensor output for each sensor.
In addition to the 32 IR sensors connected directly to the Mega there needs to be four more IR sensors inputs to the DCC++ and two Relay controls outputs to reverse two blocks of track. Using pins that are on the side of the Mega and on the header used by the Motor Shield. In the hardware section is a drawing showing the breakout attached to the Motor Shield and the circuit board holding the two relays that will be mounded under the track, block 7 & 8.
Getting serious about the signals. The semaphores cost about $30/ arm. That time 60 puts that phase in the future. An alternate answer is to use the Raspberry to control the 16-servo/PWM boards (with only some servos - 3 semaphores arms). So, I'm going to include the four 3-LED parking lot signals and a Unicorn HAT. The Unicorn is a 16x16 array of RGB LEDs that I will control along with the servo boards. As a matter of practicality will use one 16-servo HAT and three 16-servo bonnets (same boards just smaller and no work area). The stack will be 1) Raspberry Pi, 2) servo HAT, 3) 3 servo bonnets, 4) Unicorn Hat interface board on top with cables to the Unicorns so they are visible.
The breakout diagram for the 3-LED parking log signals is shown in the hardware section. This HAT pin - to signal header is implemented on the Servo HAT area circled in yellow.
As noted in the hardware section pins 7 - 11 are also labeled. These are the SPI interface pins used by the Unicorn HAT. They are labeled at the left as MOSI, MISO, CLK, CE0 and CE1. I want to make sure I don't overload the pin definitions.
Ordered parts and 3-wire servo cables.