Ttp223 and nodeMCU Issue

Hi,

I want to use a ttp223 with a NodeMCU, but I'm running into some issues I can't figure out.

First, if I connect the ttp223 data pin straight to the D3 pin of the nodeMCU, the sensor stays On and acts like a switch rather than a button even if I have no bridge between the A/B jumpers.

If I put a resistor between the data pin of the ttp223 and the D3 pin of the nodeMCU, the sensor works as expected, but the nodeMCU is kinda crashed, program is not running and I get nothing in the Serial Monitor.

If I start the nodeMCU with the sensor data pin disconnected and connect it after it works normally (even without resistor).

What's going on here??


#define BTN_PIN D3

void setup()
{
  Serial.begin(9600);
  pinMode(BTN_PIN, INPUT);
}

void loop()
{
  int _TouchState = digitalRead(BTN_PIN);
  Serial.println(_TouchState);
  delay(50);
}

Thanks!

ahh I think I found the issue, turns out pin D3 on the nodeMCU is connected to FLASH button, boot fails if pulled LOW.
https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/

I connected to pin D8 instead and seems to be working

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