Grove - Touch Sensor
Introduction
Grove - Touch Sensor enables you to replace press with touch. It can detect the change in capacitance when a finger is near by. That means no matter your finger directly touches the pad or just stays close to the pad, Grove - Touch Sensor would outputs HIGH also.
Specifications
- Operating Voltage: 2.0 - 5.5V
- Operating Current(Vcc=3V):1.5 - 3.0μA
- Operating Current(VDD=3V):3.5 - 7.0μA
- Output Response Time: 60 - 220mS
- Used Chipset: TTP223-BA6
Tip
More details about Grove modules please refer to Grove System
Platforms Supported
Option features
AHLB | TOG | LPMB | MOTB | SLRFTB | RST | Q | OPDO |
---|---|---|---|---|---|---|---|
Output Active High / Low | Toggle mode | Power Mode | Max. On Time | Sampling length | RESET PIN | CMOS Output | Open Drain Mode |
V | V | 0 | 1 | 1 | X | V | X |
Active High | Disabled | LOW | Infinite | 1.6 msec | N/A | Present | N/A |
Demonstration
With Arduino
This demo is going to show you how to turn on/off an LED.
Demo Code:
const int TouchPin=9;
const int ledPin=12;
void setup() {
pinMode(TouchPin, INPUT);
pinMode(ledPin,OUTPUT);
}
void loop() {
int sensorValue = digitalRead(TouchPin);
if(sensorValue==1)
{
digitalWrite(ledPin,HIGH);
}
else
{
digitalWrite(ledPin,LOW);
}
}
With Raspberry Pi
- You should have a raspberry pi and a grovepi or grovepi+.
- You should have completed configuring the development environment, otherwise follow here.
-
Connection
- Plug the sensor to grovepi socket D4 by using a grove cable.
-
Navigate to the demos’ directory:
cd yourpath/GrovePi/Software/Python/
- To see the code
nano grove_touch_sensor.py # "Ctrl+x" to exit #
import time
import grovepi
# Connect the Grove Touch Sensor to digital port D4
# SIG,NC,VCC,GND
touch_sensor = 4
grovepi.pinMode(touch_sensor,"INPUT")
while True:
try:
print grovepi.digitalRead(touch_sensor)
time.sleep(.5)
except IOError:
print "Error"
5.Run the demo.
sudo python grove_touch_sensor.py
Resources
Arduino | Wio | BeagleBone | Raspberry Pi | LinkIt ONE |
---|---|---|---|---|
Caution
The platforms mentioned above as supported is/are an indication of the module's hardware or theoritical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.
Help us make it better
Welcome to the new documentation system of Seeed Studio. We have made a lot of progress comparing to the old wiki system and will continue to improve it to make it more user friendly and helpful. The improvement can't be done without your kindly feedback. If you have any suggestions or findings, you are most welcome to submit the amended version as our contributor via Github or give us suggestions in the survey below, it would be more appreciated if you could leave your email so that we can reply to you. Happy Hacking!