For this project, the basic design was pretty simple. But now comes some details. This is where the design really needs to be broken into parts… inputs, outputs, extra features… and a power supply – the whole 9 yards.

As far as a power supply – this won’t be a major challenge. 12V in, with a secondary 5V rail for logic, and possibly the Arduino. A 7805 with proper bypass filtering will handle it.

The output circuitry is pretty straightforward, though, as I alluded earlier, I want this design to have a little flair – primarily, I want the buttons to be lit up separately from relay operation. I decided that upon power-up, I wanted the lights to cycle through without firing the relays. , just to show everything’s working. There’s also some possibility of adding additional diagnostic features this way. For this reason, i needed double the number of circuits for output lines. Since only the larger Arduinos have this many I/O pins, and that’s a waste of computing power, multiplexing is the way to go… in this case, the TI chips I mentioned.

Additionally, since the S2P circuit has one input and 8 outputs, and is addressable, I can use a single digital I/O pin (bit-banging the serial data manually) to control the 16 I/Os I have planned currently – not to mention the possibility of 6 other sets of 8 outputs with additional chips.

For safety reasons, all of the S2P chip I/O pins are buffered using open collector 2N3904 INPN) transistors – to avoid potential over-current conditions. Moreover, this opens up possibility of other output circuit configurations in the future.

Now – the outputs were fairly simple. The inputs, on the other end, will present a challenge. Again, I want to do what I can to allow for future expansion. Additionally, I had to figure out how to simplify code, and still have the system continuously watch for inputs – there aren’t enough interrupt pins for each button to get an input.

with a little work, I found several multiplexer ICs that could be enabled – so i would need one “Read” pin to check data, address lines for the multiplexers, and individual “enable” pins for each multiplexer – so for 8 possible inputs, I would need 3 address lines, 1 data line, and the enable line wouldn’t matter (so a total of 4 lines – i could tie the enable line always high). for 16 inputs, I would need to add 2 enable lines (pin total 6), 24 inputs – 7 total pins, 32 inputs – 8 total pins, and so on. The polling is going to be pretty fast probably faster than the user could release a button, so that’s easy.

To make the system work without the user needing to hold the button until the system decides to poll, using logic-high (+5V) to indicate a button was pushed will also allow the button outputs to be diode-ORed, with the output connecting to a pin with an interrupt. This interrupt can then be used to trigger an input poll, and initiate output switching.