Arduino detects false HIGH inputs

I am trying to make a touch sensitive lock with ttp223 touch sensors and an Arduino pro mini 3.3V.
When pressed in the correct order an indicator led for that the password is correct will light up. I am using digital pins 11,12 and 13 for my test runs. I power-up touch sensors from an external source, but both arduino and sensors share the same ground. The problem is, when ı activate (touch) on the sensor attached to the 13th pin, I see only 13 on the screen (I use a sketch to detect which pins are high and print them to the screen for test purposes) but when I touch on the sensor on the 11th pin, I see 10,11 and 12 on the screen as like they are shorted. I checked and they are not. I switched the sensors, same thing happens. I dont know whats happening. Below you can find my poorly done schematic. Couldnt change the connections so imagine the sensors are connected to the pins 13 and 11.

below is the code:

void setup() {
  pinMode(2, OUTPUT);
  digitalWrite(2, LOW);
  pinMode(10, INPUT);
  pinMode(11, INPUT);
  pinMode(12, INPUT);
  pinMode(13, INPUT);
  digitalWrite(13, LOW);
  digitalWrite(12, LOW);
  digitalWrite(11, LOW);
  digitalWrite(10, LOW);
  Serial.begin(9600);
}

void loop() {
  Serial.println("");
  if(digitalRead(13) == 1)
    Serial.println("13");
  if(digitalRead(10) == 1)
    Serial.println("10");
  if(digitalRead(11) == 1)
    Serial.println("11");
  if(digitalRead(12) == 1)
    Serial.println("12");
  Serial.println("");
}

Show us a good schematic of your circuit.
Show us a good image of your ‘actual’ wiring.
Give links to components.


Not sure but the o/p maybe open drain.
try:
pinMode(10, INPUT_PULLUP);
pinMode(11, INPUT_PULLUP);
pinMode(12, INPUT_PULLUP);
pinMode(13, INPUT_PULLUP);


If the pin is configured as an INPUT, digitalWrite() will enable (HIGH) or disable (LOW) the internal pullup on the input pin. It is recommended to set the pinMode() to INPUT_PULLUP to enable the internal pull-up resistor.

Feeding 5v into the pro mini Raw pin does not work.

Well the actual wiring is much, much more complicated since it involves a battery management system, BJTs as switches, two servos, a voltage regulator and some terminals so I cant share it. There isnt much about the schematic tho, the signal pins are connected and power pins are connected to an external source. I even tried powering the all system from usb, result is still the same. I have no idea the arduino detects false triggers from false pins.

Why? As far as I know Raw pin includes a power regulator. My pro mini is a 3.3V so the 5V should be regulated to 3.3 am I right?

If the pro mini is 3.3v, 5v should work then.

“BJTs as switches“

Did you try INPUT_PULLUP ?

If the pin is configured as an INPUT, digitalWrite() will enable (HIGH) or disable (LOW) the internal pullup on the input pin. It is recommended to set the pinMode() to INPUT_PULLUP to enable the internal pull-up resistor.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.