Capacitive Touch Screen Control using Coins and Arduino

I have this robotic car that I can control using 4 buttons on my phone:

This is the interface on my phone with 4 buttons that I can press to control this car:

I am now trying to control this car using Arduino, and it somewhat works for pressing 1 button, but when I add 2 button control or more then it doesn't really work (the circuit behaves in a strange way because it initially presses button 1 and then button 2 and then it just holds button 1 down and never presses button 2 again)

The method I found to press a button using Arduino is to tie a wire to a 1 cent coin and tape it to the screen where the button is, and then plug the other end of that wire to Arduino pin 7. Do the same thing for Arduino pin 8. It should allow me to press button 1 and 2 on the interface, but it presses button 1 and then button 2 and then keeps holding down button 1 without ever pressing button 2 again.

Below is the code I am using. I suspect my circuitry is the component to blame, but I am not sure. This is what I have:

The black wire coin presses button 1, and yellow wire coin presses button 2. This is the code:

void setup() {
  
  Serial.begin(9600);
  digitalWrite(7,LOW);
  digitalWrite(8,LOW);
}

void loop() {
  
  pinMode(7, INPUT);
  Serial.print("Pin 7 Input");
  delay(5000);
  
  pinMode(7, OUTPUT);
  delay(5000);

    pinMode(8, INPUT);
  Serial.print("Pin 8 Input");
  delay(5000);

    pinMode(8, OUTPUT);
  delay(5000);
}

Not sure what you're trying to do but your code seems wrong.
You're switching pins between INPUT and OUTPUT. I suspect you want the pin to be OUTPUT so you can toggle between HIGH and LOW states.

wvmarle:
Not sure what you're trying to do but your code seems wrong.
You're switching pins between INPUT and OUTPUT. I suspect you want the pin to be OUTPUT so you can toggle between HIGH and LOW states.

I don't think that switching between HIGH and LOW is going to work. These displays measure the difference in capacitance, not difference in potential.
The capacitance between two Arduino pins might cause it to fail when using more than one coin.

The easiest way could be to just get a Bluetooth or WiFi module and reverse-engineer the protocol that is used by the app, to control the car directly.

Pieter

Is there any alternative to bluetooth sniffing? It seems like a really tedious and long process, so if I could make this work with hardware instead then I'd really prefer that.

PieterP:
I don't think that switching between HIGH and LOW is going to work. These displays measure the difference in capacitance, not difference in potential.

You're right. Still the code as posted doesn't make much sense to me :slight_smile:

Maybe OP should build a robotic hand to do the touching.

I found a circuit the works (minus the phototransister, which I don't need):

It says I still need to touch my hand at some point, so is there no bypassing that? Why does this person need a resistor? Why are the diodes and resisters/transistors needed in this circuit? I only have relays at the moment, so would that not suffice? It would be great if someone could explain what's going on in this circuit...seems confusing..

Video of it working:

For help figuring out how this works, please post circuit diagram.

Best guess for keeping it connected with your hand: provide some form of grounding.

You could run that ground wire to the back of the touch screen.