Variable resistor

Does anyone know why a variable resistor uses the 5V pins in the Arduino UNO board withought using the vin pin( which has 6V conected).

I’ve tried to figureout an answer but i failed,

it would be a great help if you can help

As a potentiometer (good google search term that)

Does anyone know why a variable resistor uses the 5V pins in the Arduino UNO board withought using the vin pin( which has 6V conected).

Because if it used the Vin pin and it did have 6V on it then the analogue input could be connected to 6V and that would damage the Arduino by putting more than the maximum voltage on an Arduino pin.

Also, Vin is often unregulated.

Grumpy_Mike:
Because if it used the Vin pin and it did have 6V on it then the analogue input could be connected to 6V and that would damage the Arduino by putting more than the maximum voltage on an Arduino pin.

hi thanks for your reply your answer makes alot of sense.
Can i know what is the maximum voltage on an arduino pin .

Josh987:
Can i know what is the maximum voltage on an arduino pin .

Most Arduinos are running on a 5volt supply, made by an onboard regulator.
That supply voltage is also the maximum voltage you can put on a pin.

Vin is the raw supply input pin. Before the onboard 5volt regulator.
You can connect e.g. a 6-9volt battery to Vin.

LDRs, NTCs, potentiometers, pull-up resistors, and most other sensors are connected to the 5volt supply pin and ground, because then the voltage is always within the boundaries of the micro.
Leo..

The maximum voltage on any pin must not exceed the chip's supply voltage plus 0.6V. It is in the data sheet for the processor but in a general rule for practically all electronic chips.

Note that means when a chip is not being powered it must not have any voltage input to any other of its pins.