LED as a touch sensor

Posted: March 23, 2014 in Uncategorized

LED is a PN junction diode. And a PN junction diode when inverted acts as a small capacitance.  This property can be used to make LED also behave as a touch sensor – sensitive to human touch. All you need to do is invert the led – charge the capacitance – and measure how long does it take for the capacitance to discharge. Ordinarily it would take some time for the capacitance to discharge – but when you touch the negative lead (+ve end of the led as capacitor) of the LED, our body acts a charge sink and the capacitance discharges quickly. Here is the algorithm: Image //Discharge any capacitance remaining on the LED Set LeadA Output HIGH Set LeadB Ouptut LOW wait 1ms //Reverse Bias and charge Set LeadA Output LOW Set LeadB Output HIGH wait 1ms //Discharge the capacitance Set Lead B Input LOW Count how long it takes for the LeadB to read low

Attached is the arduino Code for this:
ledAsTouchSensor.ino

Leave a comment