Analog_Slide_Position_Sensor__SKU__DFR0053_-DFRobot

Introduction

Analog Slide Position Sensor (SKU: DFR0053)

The DFRobot Slide Position Sensor is based on straight-slip potentiometer position sensor and can be combined easily with the Arduino sensor expansion board. The sensor includes two outputs to allow the user to average the values and minimize random sensor fluctuations.

Specification

Pin Definition

Analog_Slide_Position_Sensor.png

Connection Diagram

Analog sensor connection diagram

Sample Code


// # Editor     : Lauren from DFRobot
// # Date       : 30.12.2011

// #
// # Editor     : Lauren from DFRobot
// # Date       : 17.01.2012

// # Product name: Rotation Sensor v1/v2 or Analog Slide Position Sensor
// # Product SKU : DFR0054/DFR0058/DFR0053
// # Version     : 1.0

// # Description:
// # the sample to drive some analog sensors

// # Connection:
// #        Signal output pin  -> Analog pin 0
// #


void setup()
{
  Serial.begin(9600);     //Set serial baud rate to 9600 bps
}
void loop()
{
  int val;
  val=analogRead(0);      //Read slider value from analog 0
  Serial.println(val,DEC);//Print the value to serial port
  delay(100);
}

More Documents