タッチセンサ Touch sensor with PIC18F2550: capacitive voltage divider (CVD)
An experiment of a touch sensor using an A/D Converter (capacitive voltage divider : CVD)
<< Introduction in Japanese >>
電子回路を指で触ると局所回路の静電容量に変化が生じる。この変化を捉えることによりタッチセンサが実現できる。Microchip Technology 社からは、容量検知モジュール(CSM)(Application Notes: AN1171), 充電時間計測ユニット(CTMU)(Application Notes: AN1250) を実装した製品が販売されているが、今回のタッチセンサ実験は専用モジュールではなく、通常の A/D converter を用いての静電容量方式分圧回路(CVD) (Application Notes: AN1298, AN1478) で行った。
タッチセンサに触れている間は LED を点灯させ、同時にセンサ回路の電位を LCD に表示させる。
While you touch the sensor circuit, the LED is turned on.
The LCD displays real-time voltage of the touch-sensor circuit.
<< Test board >>
The test board is the UBW board of my page on Jan. 16, 2014.
A/D converter : CH1(AN1)(RA1), CH2(AN2)(RA2);
CH1 is used to charge a charge holding capacitor (CHOLD).
CH2 is connected to a touch pad.
Bootloader : RC0 – LED, RC1 – LED, RC2 – switch2 (pull down), MCLR – switch1 (pull down);
LCD (SC1602BBWB-XA-GB-G) : RS – RB2, R/W – GND, E – RB3, Data bus – RB4~RB7;
<< Sample code >>
Touch Sensor
My project with MPLAB X IDE and XC8 has three configurations.
1) Offset_0_including_config:
This HEX file is written into a PIC MCU with a programmer.
TouchSensor including confg.c has a macro set of configuration for my UBW board.
2) Offset_0x800_for_bootloader (for a USB bootloader).
3) Offset_0x1000_for_bootloader (for a USB bootloader).
<< Degree of voltage separation with a 10-bit A/D converter >>
5/1024 [V/bit] = 5000/2024[mV/bit] on the conditions of VREF- of 0-volt and VREF+ of 5-volt.
<< Reference >>
1) Microchip Technology, AN1298: Capacitive Touch Using Only an ADC (“CVD”);
2) BitTradeOne, Ltd ( Download: タッチセンサ );