TOP

Grove - Slide Potentiometer

From Wiki 来自痴汉的爱
(Redirected from Sliding Potentiometer)
Jump to: navigation, search

Contents

Introduction

This slide potentiometer is a linear variable resistor with a total resistance of 10k. When you move the lever from one side to the other, its output voltage will range from 0 V to the VCC you apply. It has four Grove pins, 3 of which are connected to VCC, GND and the ADC IN on the slide, while the remaining pin is connected to a green indicator LED. You can use the indicator LED to visually display the change on the potentiometer.
Model: COM05231P
Sliding1.JPG

Features

  • 30 mm long slide length
  • Linear resistance taper
  • Grove compatible

Application Ideas

  • Voltage divider: a linear circuit that produces an output voltage as a fraction of its input voltage
  • HID for controlling panels

Specification

Item Min Typical Max Uint
Voltage 3.3 5.0 30 VDC
Current -- -- 30 mA
Dimension 24x60 mm
Net Weight 8.6 g
Rotational life >15,000 cycles
Total resistance 10
Stroke length 30 mm
Total resistance tolerance +/- 20 %

Usage

This slide potentiometer is a linear variable resistor with a total resistance of 10k. When you move the lever from one side to the other, its output voltage will range between 0 V to VCC you apply.

1. Connect the module to the Analog port 0 of Grove - Basic Shield using the 4-pin grove cable.
2. Plug the Grove - Basic Shield into Arduino.
3. Plug the Grove - Slide potentiometer onto the Arduino/Seeeduino; Connect the board to PC using USB cable.


Sliding2.JPG
4. Connect Arduino to PC by using a USB cable.

Application 1: As A Voltage Divider

Copy and paste code below to a new Arduino sketch. Then upload the code to Arduino. Please click here if you do not know how to upload.

int adcPin = A0; // select the input pin for the potentiometer
  int ledPin = A1; // select the pin for the LED
  int adcIn = 0;   // variable to store the value coming from the sensor

void setup() 
{
  Serial.begin(9600); // init serial to 9600b/s
  pinMode(ledPin, OUTPUT); // set ledPin to OUTPUT
  Serial.println("Sliding Potentiometer Test Code!!");
}


void loop() 
{
  // read the value from the sensor:
  adcIn = analogRead(adcPin);
  if(adcIn >= 500) digitalWrite(ledPin,HIGH);  // if adc in > 500, led light
  else digitalWrite(ledPin, LOW);
  Serial.println(adcIn);
  delay(100);
}

Open the serial monitor,you can see some data from ADC.
Sliding com.jpg
Move the lever back and forth, the serial data will change correspondingly. When the output resistance exceeds a preset value, the indicator LED will light up.

Application 2: As An Adjustable Resistor

As shown below, the Grove - Slide Potentiometer can be used as a simple slide potentiometer.

Sliding justr.JPG


Application 3: As A HID Device

Slide Potentiometer can be a nice HID device as we used on the following RC toy car. We added two Slide Potentiometers on the control panel to control the speeds of the left and right wheels of the toy car respectively. For example, when the right wheels spin slower than the left, the car will turn right.

Car.JPG

Resources

Support

If you have questions or other better design ideas, you can go to our forum or wish to discuss.

Personal tools
Namespaces

Variants
Actions
Navigation
Support
Navigation
Collections
Toolbox