Circuit
Have a look at the circuit as a PDF.
Serial Interface

There is not much to say about the serial interface, the RS232 driver is directly connected to UART5. For debugging purposes, the TTL signals are available at J6. If you want to connect a different UART, you may cut the connections between J6 and J2 and reconnect at will. Besides TxD and RxD, also RTS and CTS is used. There is a 9 pin Sub-D connector to the rest of the World.
Oddly, all serial extension boards I know have a socket here and not a plug like on a standard PC.
A word about the capacitors: I chose them for a variable supply from 3.3 to 5 V. As we have guaranteed 3.3 V here, 4×100 nF would also be sufficient. But bigger capacitors won't do any harm.
The bulk capacitor CX3 is optional. In my experience, it may be advantageous together with the RS232 driver.
Relay Drivers
The relay drivers are not witchcraft anyways. The base resistor has been calculated for 2 mA and thus guarantees a driving current of 200 mA. The 10 kΩ pull down avoids flattering of the relays until the pins are set as an output.
The turn off spikes are fed to a 33 V zener diode via four diodes. Due to the high zener voltage, the energy of the coils is quickly dissipated and additionally, a signal Tpulse is generated.
There you could measure the pulse time and you can create measure pulses (that are too short to change the state of the relay) to detect the actual state. How?
The snubbers (10 kΩ+100 nF) are not really important but they ensure a soft and EMI compliant decline of the energy of the coils.
The relay drivers are open collector so you may connect different relays up to 24 V if you have a suitable supply. It's ground has to be connected to the Pi ground, of course. Note that the pulse time measurement for state detection may not be possible at higher coil voltages.
The zener protects the transistors against high voltages but they are not short circuit proof, though.
Relay Supply
If you use 5 V relais, the supply is available at J4.
The pin assignment of J4 is reverse polarity tolerant, i.e. if J4 is plugged in the wrong way, the relays will not switch as intended, but nothing will be damaged.
For not to stress the Pi itself, supplied by a wall wart, a storage capacitor C2 (2200 µF) has been introduced. This is charged by a 330 Ω resistor. The energy stored is sufficient to provide a switching pulse but it needs two seconds to recharge thereafter. If you use monostable relays, this trick will not work. R14 has to be replaced by a bridge then and you may omit C2.
The supply has to cope then with the addidional load.
EEPROM
To comply with the HAT specification, an EEPROM 27C32 has been added. So you can configure the I/O pins at boot time.
There seems to be some confusion about which types to use. I've used the Microchip 24LC32A which worked well.