Difference between revisions of "Rotary Potentiometer Module"

From LinkSprite Playgound
Jump to: navigation, search
(Created page with "<syntaxhighlight lang="c"> /* Analog input, analog output, serial output Reads an analog input pin, and T000140 Rotary Potetiometer Analog Sensor connected to I0, maps th...")
 
(Introduction)
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<syntaxhighlight lang="c">
+
==Introduction==
 +
The Linker Rotary Potentiometer Module produces analog output between 0 and Vcc (5V DC with Arduino) on its D1 connector. The D2 connector is not used. The angular range is 300 degrees with a linear change in value. The resistance value is 10kΩ, perfect for Arduino use.
 +
 
 +
 
 +
 
 +
[[File:Rotary 118101010-1.jpg| 640px]]
 +
 
 +
[[File:Rotary 118101010-2.jpg| 640px]]
 +
 
 +
[[File:Rotary 118101010-3.jpg| 640px]]
 +
 
 +
[[File:N26DM PACKAGED FRONT.jpg|640px]]
  
/*
+
[[File:N26DM PACKAGED BACK.jpg|640px]]
  Analog input, analog output, serial output
 
  
Reads an analog input pin, and T000140 Rotary Potetiometer Analog Sensor connected to I0, maps the result to a range from 0 to 255
+
== Features ==
and uses the result to set the pulsewidth modulation (PWM) on a T010111 LED Module connected on O0.
 
Also prints the results to the serial monitor.
 
  
created 29 Dec. 2008
+
Dimensions: 25.0×25.0×18.8mm
Modified 4 Sep 2010
 
by Tom Igoe
 
modified 7 dec 2010
 
by Davide Gomba
 
  
This example code is in the public domain.
+
Net weight: 4.5g
  
*/
+
== Dimension ==
  
#define O0 11
+
[[File:rotary potentiometer dimension.jpg]]
#define O1 10
 
#define O2 9
 
#define O3 6
 
#define O4 5
 
#define O5 3
 
#define I0 A0
 
#define I1 A1
 
#define I2 A2
 
#define I3 A3
 
#define I4 A4
 
#define I5 A5
 
  
// These constants won't change. They're used to give names
+
== Schematics ==
// to the pins used:
+
*[https://s3.amazonaws.com/linksprite/LinkerKit/Rotary+potentiometer.pdf Schematics]
const int analogInPin = I0;  // Analog input pin that the Pot is attached to
 
const int analogOutPin= O0; // Analog output pin that the LED is attached to
 
  
int sensorValue = 0;        // value read from the pot
+
==Application Ideas==
int outputValue = 0;        // value output to the PWM (analog out)
 
  
 +
'''test'''
 +
<syntaxhighlight lang="c">
 +
int adcPin = A0;    // select the input pin for the potentiometer
 +
int ledPin = 5;      // select the pin for the LED
 +
int adcIn  = 0;  // variable to store the value coming from the sensor
 +
 
void setup() {
 
void setup() {
   // initialize serial communications at 9600 bps:
+
   Serial.begin(9600);        // init serial to 9600b/s
   Serial.begin(9600);  
+
  pinMode(ledPin, OUTPUT);    // set ledPin to OUTPUT
 +
   Serial.println("Rotary Potentiometer Test Code!!");
 
}
 
}
 
+
 
void loop() {
 
void loop() {
   // read the analog in value:
+
   // read the value from the sensor:
   sensorValue = analogRead(analogInPin);          
+
   adcIn = analogRead(adcPin);
   // map it to the range of the analog out:
+
   if(adcIn >= 500)  digitalWrite(ledPin,HIGH);  // if adc in > 500, led light
   outputValue = map(sensorValue, 0, 1023, 0, 255);
+
   else digitalWrite(ledPin, LOW);
   // change the analog out value:
+
   Serial.println(adcIn);
   analogWrite(analogOutPin, outputValue);          
+
   delay(100);
 +
}
 +
</syntaxhighlight>
  
  // print the results to the serial monitor:
+
[[File:Rotary link.jpg]]
  Serial.print("sensor = " );                     
 
  Serial.print(sensorValue);     
 
  Serial.print("\t output = ");     
 
  Serial.println(outputValue); 
 
 
 
  // wait 10 milliseconds before the next loop
 
  // for the analog-to-digital converter to settle
 
  // after the last reading:
 
  delay(10);                   
 
}
 
  
<syntaxhighlight>
+
==How to buy==
 +
Here to buy Rotary Potentiometer Module on [http://store.linksprite.com/rotary-potentiometer-module-of-linker-kit-for-pcduino-arduino/ store]

Latest revision as of 10:44, 14 August 2016

Introduction

The Linker Rotary Potentiometer Module produces analog output between 0 and Vcc (5V DC with Arduino) on its D1 connector. The D2 connector is not used. The angular range is 300 degrees with a linear change in value. The resistance value is 10kΩ, perfect for Arduino use.


Rotary 118101010-1.jpg

Rotary 118101010-2.jpg

Rotary 118101010-3.jpg

N26DM PACKAGED FRONT.jpg

N26DM PACKAGED BACK.jpg

Features

Dimensions: 25.0×25.0×18.8mm

Net weight: 4.5g

Dimension

Rotary potentiometer dimension.jpg

Schematics

Application Ideas

test <syntaxhighlight lang="c"> int adcPin = A0; // select the input pin for the potentiometer int ledPin = 5; // 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("Rotary 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);

} </syntaxhighlight>

Rotary link.jpg

How to buy

Here to buy Rotary Potentiometer Module on store