ADC

The Analog-to-Digital (ADC) convertion pins allows you to read input voltages as integers with Analog Pins on the pin-out diagram.

Please note the following before using the analog pins on LinkIt 7697:

  1. The ADC input voltage ranges from 0 to 2.5V - not 3.3V.

  2. The ADC has 12-bit resolution, so the output value of analogRead() ranges from 0 to 4095.

  3. The input impedance of ADC pins is 10k Ohm.

  4. In Arduino IDE, A0 maps to ADC_IN0 on the pin-out diagram. Check the table below for quick reference:

Silkscreen printing Pin #

Arduino Symbol

MT7697

P14

A0

ADC_IN0

P15

A1

ADC_IN1

P16

A2

ADC_IN2

P17

A3

ADC_IN3

To demonstrate this, upload and run the IDE example sketch File > Examples > 03. Analog > AnalogInput. You need to modify the sketch to make it fit the specs of LinkIt 7697.

  1. change LED from 13 to 7 - because the built-in USR LED maps to P7:

    int ledPin = 7; // select the pin for the LED
  2. The original sketch logic maps the output value of analogRead to delay milliseconds between LED blinks. Since the output ranges from 0 to 4096, the delay might be too long to observe. To solve this problem you can divide the output values by 4, for example:

    sensorValue = analogRead(sensorPin) / 4; // maps 4096 back to 1024
  3. The input voltage accepts 2.5V, but the board only provides 5V and 3V3 sources. You can map 5V to 2.5V easily with a voltage-divider circuit, shown below:

Last updated