Automation-Hat use free GPIO as extra digital (5v+ tolerant) inputs


As a happy user of the Automation Hat on my Pi, I find myself short on digital input pins (and already occupied the 3 ADC inputs for just on/off purposes at the moment, so all 6 inputs used).

I have a need for a few more digital inputs that can handle 12v so I am wondering what is the best/easiest way to use the free GPIO pins as additional inputs (Maybe an idea for a new SHIM :) ) ?

Or maybe putting an IO Plus board between the Pi and Automation Hat could be a way to go? It actually uses I2C so not the unused pins :) Looking at the used I2C addresses, it could work?

Biggest ‘issue’ is probably what needs to be done to make the standard Pi GPIO pins, which work at max 3.3v, also 12/24v tolerant? Is there something out there that can be used? Are these Opto-isolator boards an option?

Finally, is there a good way the get access to the unused pins like putting some kind of break-out board/connector in between the Pi and the HAT?


Is the IO Plus board 5v (or 12v) tolerant? I can’t see any indication that it is.

The protection we use on the Automation HAT inputs is fairly crude- an inline current limiting resistor coupled with a clamping diode.

The Opto-isolator you link wont work in your case. It appears to be designed to allow a 3-5v logic signal to switch an external high-voltage system. Think of it as similar to a relay- to put it crudely; signal goes out, but doesn’t come back in.

You could build a circuit using 3V3 zener diodes ( and appropriate resistors to handle your input voltage.

In fact if you’re reasonably confident in the range and characteristics of your input voltage you could simply use a voltage divider. The reason we use a resistor and zener diode is because the input range is unknown from 3.3v to 24v and if we used a resistor divider for 24v it might produce too low a voltage to register as HIGH at 12v.


Hi @gadgetoid, I thought to the same about the IO Plus board. It helps to get extra inputs, but doesn’t seem to provide any input tolerance. Thanks for confirming.

Same goes for the opto-isolator, I did understand how it works for signals going out, but not for incoming signals. Which is does not handle, so not a solution either.

I do know my input level which are all 12v (or 0v when off), so probably creating my own voltage dividers is the way to go. And put the IO plus board in between to get access to pins.

Or any other suggestions for a break out I can put in between?


The IO Plus Board looks pretty good- and AB Electronics have been around from the start! I don’t think you could go far wrong with it. Alas we don’t have an IO SHIM yet ;)