Difference between revisions of "Touch Sensor Module"

From LinkSprite Playgound
Jump to: navigation, search
(Created page with " This module normally outputs 0v, but when touched, sends 5v. When connected to an input on the Arduino using the TinkerKit Shield, you will see 0 when there is no touch, and ...")
 
(Introduction)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
==Introduction==
 +
Touch Sensor enables you to replace press with touch.
  
This module normally outputs 0v, but when touched, sends 5v. When connected to an input on the Arduino using the TinkerKit Shield, you will see 0 when there is no touch, and 1023 when touched.
 
  
<syntaxhighlight lang="c">
+
[[File:Touch Sensor 118101007-1.jpg| 640px]]
  
/*
+
[[File:Touch Sensor 118101007-2.jpg| 640px]]
  Analog input, analog output, serial output
 
  
Reads an analog input pin; a T000220 Touch Sensor connected to I0, maps the result to a range from 0 to 255
+
[[File:Touch Sensor 118101007-3.jpg| 640px]]
and uses the result to set the pulsewidth modulation (PWM) on a T010111 LED Module connected on O0.
 
Also prints the results to the serial monitor.
 
  
 +
== Features ==
  
created 29 Dec. 2008
+
Dimensions: 20.0×24.2×10.6mm
Modified 4 Sep 2010
 
by Tom Igoe
 
modified 7 dec 2010
 
by Davide Gomba
 
  
This example code is in the public domain.
+
Net weight: 1.6g
  
*/
+
== Dimension ==
  
#define O0 11
+
[[File:touch sensor dimension.jpg]]
#define O1 10
 
#define O2 9
 
#define O3 6
 
#define O4 5
 
#define O5 3
 
#define I0 A0
 
#define I1 A1
 
#define I2 A2
 
#define I3 A3
 
#define I4 A4
 
#define I5 A5
 
  
// These constants won't change. They're used to give names
+
== Schematics ==
// to the pins used:
+
*[https://s3.amazonaws.com/linksprite/LinkerKit/Touch+Sensor.pdf Schematics]
const int analogInPin = I0;  // Analog input pin that the Touch Sensor is attached to
 
const int analogOutPin= O0; // Analog output pin that the LED is attached to
 
  
int sensorValue = 0;        // value read from the Touch Sensor
+
==Application Ideas==
int outputValue = 0;        // value output to the PWM (analog out)
 
  
 +
'''test'''
 +
<syntaxhighlight lang="c">
 +
int TouchPin=9;
 +
int ledPin=11;
 
void setup() {
 
void setup() {
  // initialize serial communications at 9600 bps:
+
pinMode(TouchPin, INPUT);
  Serial.begin(9600);  
+
pinMode(ledPin,OUTPUT);
 +
}
 +
 +
void loop() {
 +
int sensorValue = digitalRead(TouchPin);
 +
if(sensorValue==1)
 +
{
 +
digitalWrite(ledPin,HIGH);
 +
}
 +
else
 +
{
 +
digitalWrite(ledPin,LOW);
 +
}
 
}
 
}
 +
</syntaxhighlight>
  
void loop() {
+
[[File:Touch link.jpg]]
  // read the analog in value:
 
  sensorValue = analogRead(analogInPin);           
 
  // map it to the range of the analog out:
 
  outputValue = map(sensorValue, 0, 1023, 0, 255); 
 
  // change the analog out value:
 
  analogWrite(analogOutPin, outputValue);         
 
 
 
  // print the results to the serial monitor:
 
  Serial.print("sensor = " );                     
 
  Serial.print(sensorValue);     
 
  Serial.print("\t output = ");     
 
  Serial.println(outputValue); 
 
  
  // wait 10 milliseconds before the next loop
+
==How to buy==
  // for the analog-to-digital converter to settle
+
Here to buy Touch Sensor Module on [http://store.linksprite.com/touch-sensor-module-of-linker-kit-for-pcduino-arduino/ store]
  // after the last reading:
 
  delay(10);                   
 
}
 
 
 
<syntaxhighlight lang="c">
 

Latest revision as of 10:02, 14 August 2016

Introduction

Touch Sensor enables you to replace press with touch.


Touch Sensor 118101007-1.jpg

Touch Sensor 118101007-2.jpg

Touch Sensor 118101007-3.jpg

Features

Dimensions: 20.0×24.2×10.6mm

Net weight: 1.6g

Dimension

Touch sensor dimension.jpg

Schematics

Application Ideas

test <syntaxhighlight lang="c"> int TouchPin=9; int ledPin=11; void setup() { pinMode(TouchPin, INPUT); pinMode(ledPin,OUTPUT); }

void loop() { int sensorValue = digitalRead(TouchPin); if(sensorValue==1) { digitalWrite(ledPin,HIGH); } else { digitalWrite(ledPin,LOW); } } </syntaxhighlight>

Touch link.jpg

How to buy

Here to buy Touch Sensor Module on store