Using pins as input and output

oracacle

Senior Member
Working on my latest project and bread boarding was been going well until I realised the 20x2 doesn't have enough pins to get the job done. I had a little think and while a 28x2 sound like the only solution I got to wondering if there is any reason I cant use the tri state logic multiplexed type idea. this would involve one pins going high after the inputs are finished to drive a couple of opto isolators with another 2 pins then sinking current to switch them on and off.

optos will be 4n25, all other pins on the 20x2 are occupied. Thoughts
 

Attachments

geoff07

Senior Member
And better for power consumption, as the current circuit puts a huge drain on the power when a button is pressed. The resistors have to sink enough current to light the opto led, and each button has to carry that current plus a similar resistor straight to ground. Given that leds are polarised, it isn't clear that it would work anyway. The way it is drawn, the top button lights both leds and the others none. The analogue approach frees two pins for use with the optos.
 
Top