Santosh Ambekar
Published © Apache-2.0

IoT - Touch Detection Using Touch Sensor & LED Bar

Build a simple touch detection system using a touch sensor and an LED bar for display.

IntermediateFull instructions provided12 minutes2,121

Things used in this project

Hardware components

MediaTek LinkIt One
×1
Grove - Touch Sensor SKU 101020037
Seeed Studio Grove - Touch Sensor SKU 101020037
×1
Seeed Studio Grove LED Bar
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Touch detection LED bar display

Code

Arduino code for Touch based LED bar indicator

Arduino
/*******************************************************
 * SANTRONIX <info@santronix.in>
 * 
 * This file is part of SANTRONIX Mediatek LinkIt Tutorials Project.
 * 
 * SANTRONIX Mediatek LinkIt Tutorials Project can not be copied and/or distributed without the express
 * permission of SANTRONIX
 *******************************************************/

#include <Grove_LED_Bar.h>


const int touchPin = 2;
Grove_LED_Bar ledBar(5,4,0);

void setup() {
  // put your setup code here, to run once:
  pinMode(touchPin, INPUT);
  ledBar.begin();
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  int sensorValue = digitalRead(touchPin);
  
    if(sensorValue==1)
    {
        ledBar.setLevel(10);
    }
    else
    {
        ledBar.setLevel(0);
    }
}

Credits

Santosh Ambekar

Santosh Ambekar

11 projects • 19 followers
Santosh is an IoT enthusiastic and expert in the field of automation and software development.

Comments