Hi all,
I'm trying have an arduino read key presses on my calculator. The calculator does it by pressing the keyboard membrane to the PCB and connecting two points, so each key has two of these points. I've soldered wires to two key's contact points(four wires in total), and connected the arduino's GND to the calculator's -ve.
I read the values in analog, then calculate the voltage, so I would see a change in voltage, when a key is pressed, and the key would be identified by which contact point had the v. change happens on.
Now here's what actually happens... Every contact point has a voltage change(to an equal degree, too) when either key is pressed. One and three jumps to 1.4, two and four jumps to 0.0.
There's a chance I somehow damaged the circuit, but other than that, I have no idea what I'm doing wrong...
Here's my code:
int one = A0;
int two = A1;
int three = A2;
int four = A3;
float refVolt = 5.0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int oneR = analogRead(one);
int twoR = analogRead(two);
int threeR = analogRead(three);
int fourR = analogRead(four);
float oneV = (oneR/1023.0)*refVolt;
float twoV = (twoR/1023.0)*refVolt;
float threeV = (threeR/1023.0)*refVolt;
float fourV = (fourR/1023.0)*refVolt;
Serial.println("One: "+(String)oneV+" - Two: "+(String)twoV+" - Three: "+(String)threeV+" - Four: "+(String)fourV);
delay(100);
}
PCB with the wired points marked:
If this is how the whole thing should work, is there any way to read and decide which key was pressed? If my way should work, what am I doing wrong, and how can I fix it?
Please share any thoughts, solutions, ideas! Thanks in advance!