IoT Touch Sensor Using ESP8266 and KiwisIoT
by prakatheeshwaranR in Circuits > Arduino
187 Views, 0 Favorites, 0 Comments
IoT Touch Sensor Using ESP8266 and KiwisIoT
In this project, I wanted to try a simple way of detecting touch and viewing the result online using an IoT platform.
For this, I used a NodeMCU ESP8266, a TTP223 touch sensor, and the KiwisIoT platform.
The TTP223 is a simple capacitive touch sensor. When I touch the sensor, its output becomes HIGH, and when I remove my finger, the output becomes LOW.
The NodeMCU reads this value and sends it to KiwisIoT through Wi-Fi. This allows me to monitor the touch status directly from the KiwisIoT dashboard.
The complete working flow is:
Touch Sensor → NodeMCU ESP8266 → Wi-Fi → KiwisIoT → Dashboard
Supplies
- NodeMCU ESP8266
- TTP223 Touch Sensor
- Jumper Wires
- USB Cable
- Wi-Fi Connection
- Arduino IDE
- KiwisIoT Platform
Connect the Touch Sensor
First, I connected the TTP223 touch sensor to the NodeMCU ESP8266.
The sensor only needs three connections:
TTP223 → NodeMCU
- VCC → 3.3V
- GND → GND
- OUT → D2 (GPIO4)
After connecting the sensor, I connected the NodeMCU to my computer using a USB cable.
Set Up KiwisIoT
Next, I created a dashboard on the KiwisIoT platform.
For this project, I used Channel 1 to display the touch sensor value.
The NodeMCU sends either 0 or 1 to this channel depending on the current state of the touch sensor.
Program the NodeMCU
Read the Touch Sensor
The NodeMCU continuously checks the output of the TTP223 sensor.
When I touch the sensor:
Touch → HIGH → 1
When I remove my finger:
No Touch → LOW → 0
This makes it very easy to identify whether the sensor is currently being touched.
Send the Value to KiwisIoT
After reading the touch sensor, the NodeMCU sends the value to Channel 1 on KiwisIoT through Wi-Fi.
The complete data flow is:
TTP223 Touch Sensor → NodeMCU ESP8266 → Wi-Fi → KiwisIoT → Channel 1
The NodeMCU keeps checking the sensor and updating the value on the dashboard.
Test Using Serial Monitor
After uploading the program, I opened the Arduino Serial Monitor to check whether the sensor was working correctly.
When I touched the TTP223 sensor, the Serial Monitor displayed:
Touch Value: 1
When I removed my finger, it changed back to:
Touch Value: 0
This confirmed that the NodeMCU was correctly reading the sensor.
Final Result
The project worked successfully. The TTP223 sensor detected when I touched it, and the NodeMCU sent the sensor value to the KiwisIoT dashboard through Wi-Fi.
I was able to see 1 when the sensor was touched and 0 when it was not touched.
This is a simple project, but it helped me understand how a digital sensor can be connected to the NodeMCU and monitored remotely using an IoT platform.
In the future, this project can be improved by connecting a relay, LED, buzzer, or other device. For example, the touch sensor could be used to control a light or trigger an alarm through the NodeMCU.
It can also be expanded into a touch-based IoT control system where devices can be monitored and controlled using KiwisIoT.