Skip to content

Ti FDC2112, FDC2114, FDC2212 and FDC2214 capacitative sensor library for Arduino

License

Notifications You must be signed in to change notification settings

zharijs/FDC2214

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FDC2214 Arduino Library

Library for Texas Instruments FDC2xxx family capacitative sensor front-ends.

Supported devices

  • FDC2112
  • FDC2114
  • FDC2212
  • FDC2214

Revision

  • 1.0 - 1 - Initial release
  • 1.1 - 1 - Fixed channel 2 and 3 support.
  • 1.1 - 2 - Added support for internal oscillator. Not reccomended for any fairly precise aplication.
  • 1.2 - 1 - RJH - Removed redundent code and applied one recommended update

Usage

Include header, Make instance, Init and acquire data.

#include "FDC2214.h"
FDC2214 capsense(FDC2214_I2C_ADDR_0); // Use FDC2214_I2C_ADDR_1 for ADDR = VCC
...
void setup() {
    ...
    Wire.begin();
    bool capOk = capsense.begin(0x3, 0x4, 0x5, false); //setup first two channels, autoscan with 2 channels, deglitch at 10MHz, use external oscillator 
    ...
}
void loop(){
    ...
        unsigned long capa[i] = capsense.getReading28(i);  
    ...
}

Hardware

FDC2xxx family is 3.3V powered, unlike most of Arduinos, that are powered form 5V. To use this chip with Arduino, you will have to either:

  1. use 3.3V version of Arduino, like Arduino Pro Mini 8MHz 3.3V
  2. use I2C level shifter to interface the FDC chip with arduino.

To run examples, connect FDC with arduino as follows:

  • ARDUINO <--> FDC
  • A4 <-------> SDA
  • A5 --------> SCL
  • GND -------> ADR
  • GND -------> SD

Tools

To view nice real-time graph of the sensor output, it is highly recommended to use tool like SerialPlot. https://github.com/hyOzd/serialplot

Setting up port: Port

Setting up data format: Data Format

Proximity sensing waveform: Signal

Noise waveform: Noise

#Have Fun

About

Ti FDC2112, FDC2114, FDC2212 and FDC2214 capacitative sensor library for Arduino

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages