# Resistors sensorValue

Hello Friends!

I can't understand yet,how to calculate the sensorValue of a potentiometer.I know the converted value is a number between 0 and 1023 but how can I calculate it?For example:what is the sensorValue of a potentiometer that is fixed to 220 ohm?
I Already tried to change the blinking speed of an LED with a 10k potentiometer but it has got 3 pins...
Is this also possible with a resistor?

Thank you!

Hi,

it's not the resistor value what is measured but the voltage drop which is fed back into the measuring pin.
The outer pins of the potentiometer are connected to +5V and GND and the middle pin to the input (=measuring) pin of the Arduino.

I Already tried to change the blinking speed of an LED with a 10k potentiometer but it has got 3 pins...

What about your knowledge in electronics? A potentiometer always comes with 3 pins.
The outer ones have the full resistor, the middle pin is turned between 0 and max resistor value.

I Already tried to change the blinking speed of an LED with a 10k potentiometer but it has got 3 pins...
Is this also possible with a resistor?

YES - if you want to have only one blinking frequency.
NO - if you want to adjust the frequency (that's only possible with a potentiometer.

Sorry,but I can’t express myself.I’m not very good in english(in electronics also )I wanted to know if is possible to convert the voltage drop to sensorValue.

Thank you for the fast answer!

http://www.tigoe.com/pcomp/code/controllers/input-output/analog-input/

Look at this:

``````/*
Reads an analog input on pin 0, converts it to voltage, and prints the result to the serial monitor.
Graphical representation is available using serial plotter (Tools > Serial Plotter menu)
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.

This example code is in the public domain.
*/

// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
float voltage = sensorValue * (5.0 / 1023.0);
// print out the value you read:
Serial.println(voltage);
}
``````

In your case, just use the sensorValue itself, which will be a value between 0 and 1023.
If you need the exact voltage value, use the conversion command line:
float voltage = sensorValue * ...

Hi,
See THIS: with a lot of potentiometer info and Arduino code examples.