I've been trying to build a touchpad that appears to be different than those I see online. I have a piece of resistive material, I'm toggling voltage at the corners with arduino data pins, and reading voltage of a probe placed on the surface with an analog pin. It "works", but I have some physical and mathematical problems...
My setup:
My code flips the X and Y pins shown above high and low to measure X and Y coordinates:
Here's a pic of the values I get when I trace the grid drawn on the board, graphed with a Processing program:
So it "works", sort of, but I have two problems:
-
Messed up coordinates: I get 2D values that correlate to where the probe is, but they aren't nice rectangular coordinates -- I need help on the math to turn these readings into real XY coordinates. I know the basics (resistors in parallel, voltage divider basics), but the solution involves solving a system of equations, and I get stuck. Help?
-
My "resisitive surface" sucks. My first prototype was a damn tortilla, and it only worked until it dried out. Now I'm using wet particleboard, which is very inconsistent (~30kOhm on the bottom X axis, ~50kOhm on the top X axis, etc.). It also constantly needs to be rewatered to stay conductive. What's a good, cheap resistive surface I can get? I need it to be between 500?-1M? end-to-end.
I'm excited to get this working, because it's incredibly cheap and made of just one simple material instead of layers. If I can find a resistive paint, I could make whole walls into touch pads.