The Arduino input board
The Arduino input board – up to 128 inputs for Arduino with MCP23016 chip on I2C bus
The first version of the input card provided several integrated 74hc165 in cascade, for detecting the inputs. The data transmission to main CPU was done in serial (one bit at a time) and therefore the transmission of results to Arduino was very slow.
To this slow, it added the delay of the cycle of software debouncing to filter the received data and received data often transients were distorted by electrical impulses (or electrical noise).
These include lightning and much more frequent spikes of the relays controlled by the same circuit. It was less than one event per day, but still too frequent for a reliable system.
So I made the version with integrated MCP23016. These send the status of their inputs via I2C all’arduino. Since its pin can be instructed as an input or output, initially thought to use this also for built output cards.
But of these chips on an I2C bus I could put only 8 and, therefore, I had a limited number of inputs or outputs. Specifically choosing 6 Integrated for input and 2 for output I got 6 * 16 = 96 inputs and 2 * 16 = 32 output. A sufficient number of input pins without opportunity to expand output and a number of completely below the minimum required for the project.
Hence the idea of relegating all ICs MCP23016 as input and find other solution for the output card.
So the input card is a repetition of a module that uses an integrated MCP23016 as the main component.
Each MCP23016 handles 16 inputs and then, the two cards visible in the photo, thanks to 6 integrated MCP23016 can manage as many as 96 inputs.
As mentioned the built MCP23016 can manage its both as an input pin or as output.
In the project described in this site, all pins of these integrated circuits are input. Since you can put up to 8 built MCP23016 on the same bus you can get 8 * 16 = 128-pin input totals. Each has its own built address I2C, settable by connecting to ground or VCC three pin (hence the maximum number of combinations is 8).
I rebuilt in the output card, through software, the ability to addressing, the I2C of each Arduino, via three-pin (analog) in the same way of the MCP23016.
Looking at the card you can notice that each MCP23016 has 16 inputs and to set the I2C address has 3 pins to connected to 0 or 1.
Each entrance is protected by 2 diodes and maintained at 0 or 1 depending on how you connect the 22k resistor and finally limited by the 1k resistor and, if inserted also filtered by the capacitor (simple debouncing). However, in practice I found that this capacitor was not necessary.
Finally the filter feeding from the group consisting of three capacitors and the inevitable 10,000 pf capacitor is the most can close to the integrated circuit against possible self oscillate.
The circuit is in the *. pcb. Who would like to do can download, and reproduce the circuitry using a matrix board, or do produce directly to the company, which developed the software ExpressPCB.
The circuit is well tested, while I write it is in operation for several months and always worked even under extreme conditions such as those represented by strong thunderstorms with near lightning.
Two input card, a output card and a Arduino Diecimila, fixed on a Plexiglass panel.