Hi all,
I'm currently working on a project where I will be using a large number of sensors to detect the presence of an object.
The sensors go Low when triggered, else are HIGH 5V when not triggered.
As these sensors are arranged in a 16x32 grid, and to avoid having 512 Inputs, I wanted to set these up as an input matrix with diodes and hence only require 48 pins in total. Therefore, I want to setup an input matrix with sensor inputs rather than button switches.
In my current setup i tried using a P Channel MOSFET, but without any success. My idea was that if the Sensor goes Low, this would allow the 5V High from the Row Line to pass through the MOSFET to the Column Line. If the Sensor is High 5V, the Voltage at the Column Line end would be 0V.
When connecting an Arduino Input pin to COL to read if this is HIGH or LOW, I can see that COL never goes 0V but in fact is between 1.5V and 5V depending on the Sensor Input. The Arduino keeps reading the pin as HIGH no matter what.

Does anybody have an idea what is wrong here?
Should I be using an optocoupler instead?
Thanks!
I'm currently working on a project where I will be using a large number of sensors to detect the presence of an object.
The sensors go Low when triggered, else are HIGH 5V when not triggered.
As these sensors are arranged in a 16x32 grid, and to avoid having 512 Inputs, I wanted to set these up as an input matrix with diodes and hence only require 48 pins in total. Therefore, I want to setup an input matrix with sensor inputs rather than button switches.
In my current setup i tried using a P Channel MOSFET, but without any success. My idea was that if the Sensor goes Low, this would allow the 5V High from the Row Line to pass through the MOSFET to the Column Line. If the Sensor is High 5V, the Voltage at the Column Line end would be 0V.
When connecting an Arduino Input pin to COL to read if this is HIGH or LOW, I can see that COL never goes 0V but in fact is between 1.5V and 5V depending on the Sensor Input. The Arduino keeps reading the pin as HIGH no matter what.

Does anybody have an idea what is wrong here?
Should I be using an optocoupler instead?
Thanks!