1 of 1 people found this helpful
If you want only one output high at a time, then the inverters have to be on the output of the '138, not on the input, because there's no entry in the truth table that can allow it based on any input inversion. The red highlighted area shows all rows have more than one output high in the truth table in the '138 data sheet:
A '138 and inverter based solution means only one output can be turned on at a time, which might suit your immediate needs, but isn't very general-purpose for reuse in other projects. There are some other simpler ways. First, it is worth confirming that there really are only three pins available. If your project will never need more than 4 GPIO, then this should be easily possible with the Omega2 board according to the datasheet it has 18 I/O. But maybe you are using the remainder I/O or don't have access via some other board.
As another idea, a more general-purpose solution is to use an . It costs a bit more but it is still sub-$1. According to the Omega2 website, there is a relay board which by coincidence uses the same I/O expander IC. This means you've now potentially got the benefit of their ready-made relay control code if you use the same chip, and probably any tutorials people may have written with the Omega2 board and their relay board can be followed, such as this one: https://docs.onion.io/omega2-docs/using-relay-expansion.html
Here's what the circuit could look like (the INT pin can be left unused) - the I/O expander datasheet has more information, or if you google that part number, there's dozens of projects/tutorials using it due to the popularity:
With such a solution you've got 8 potential relay outputs, or you can use them for other purposes (as inputs, or for flashing LEDs etc), and you can reuse the same circuit for other projects, without running out of GPIO pins or needing inverter chips.