Hello,
I have a raspberry pi with few GPIO headers to add several buttons to. The project is a raspberry pi monitoring liquid flow out of containers with flow meters. The buttons will be pressed signalling that the container is replaced or refilled. I do not have enough GPIO headers so I am currently using 5 pins for 16 buttons using the posted schematic.
My current approach uses a PCB with a normally open button, when pressed feeds a set of 4 dip switches, and an interrupt signal with diodes in between each output and the button. Each output is pulled low with resistors to ground. The dip switches act as a four bit address for each switch, when the Pi get's the interrupt signal it reads the 4- bit address in parallel, and polls the inputs for 2 seconds, or until the interrupt goes low, if interrupt stays high and the address remains the same for two seconds it performs an action to signal the container is refilled.
This has worked for a while now, but now I want to add a 7 segment display next to each button and therefor i need more GPIO pins. My plan to feed each of these displays is to signal an address to a SIPO shift register from the Pi. The outputs of the shift register will feed AND gates that will use the 4 bit address to close a pair of mosfets corresponding to that address to forward both the clock and the serial data to a SIPO register attached to the display. I have tested this with a couple displays and a smaller version of my gate tree and it works, but i need a couple of pins back from my button bus.
My problem is that the Pi is set to only acknowledge the button press if it holds state for 2 seconds, and I can not figure out how to get a PISO to loop the input. I also tried using a UNIVERSAL shift register or PIPO by making Qa work as a serial output to the Pi and Qd feeding back to S1 to try and loop the data through the register while the Interrupt Output of my button circuit was feed to Vcc on the register and the register receives a clock signal from a 555 circuit. But this doesn't work because S1-S4 are still receiving signal from the button press. I have also considered using a RC circuit to only pulse the signal of S1-S4 but that doesn't seem to be working either.
I'm sure i am greatly overthinking this and there will be a simpler more cost efficient way of handling this problem and any input will be greatly appreciated.
I have a raspberry pi with few GPIO headers to add several buttons to. The project is a raspberry pi monitoring liquid flow out of containers with flow meters. The buttons will be pressed signalling that the container is replaced or refilled. I do not have enough GPIO headers so I am currently using 5 pins for 16 buttons using the posted schematic.
My current approach uses a PCB with a normally open button, when pressed feeds a set of 4 dip switches, and an interrupt signal with diodes in between each output and the button. Each output is pulled low with resistors to ground. The dip switches act as a four bit address for each switch, when the Pi get's the interrupt signal it reads the 4- bit address in parallel, and polls the inputs for 2 seconds, or until the interrupt goes low, if interrupt stays high and the address remains the same for two seconds it performs an action to signal the container is refilled.
This has worked for a while now, but now I want to add a 7 segment display next to each button and therefor i need more GPIO pins. My plan to feed each of these displays is to signal an address to a SIPO shift register from the Pi. The outputs of the shift register will feed AND gates that will use the 4 bit address to close a pair of mosfets corresponding to that address to forward both the clock and the serial data to a SIPO register attached to the display. I have tested this with a couple displays and a smaller version of my gate tree and it works, but i need a couple of pins back from my button bus.
My problem is that the Pi is set to only acknowledge the button press if it holds state for 2 seconds, and I can not figure out how to get a PISO to loop the input. I also tried using a UNIVERSAL shift register or PIPO by making Qa work as a serial output to the Pi and Qd feeding back to S1 to try and loop the data through the register while the Interrupt Output of my button circuit was feed to Vcc on the register and the register receives a clock signal from a 555 circuit. But this doesn't work because S1-S4 are still receiving signal from the button press. I have also considered using a RC circuit to only pulse the signal of S1-S4 but that doesn't seem to be working either.
I'm sure i am greatly overthinking this and there will be a simpler more cost efficient way of handling this problem and any input will be greatly appreciated.