Arduino 5v regulator

Please can somebody put me straight with respect to the 5v pin on my arduino?

It is my understanding that…

if I connect my arduino to my PC via USB and then run a temperature sensor from the 5v pin of my arduino then I will only get approximately 5v. Therefore if I use this 5v value in my calculation to determine the temperature then it may be inaccurate. The VCC value will provide the most accurate reading…

Can somebody explain to me what the VCC is? and how unreliable the 5v regulator on the arduino can be?

thanks

In my experience, the USB 5V is less reliable (Uno). In terms of how close to 5V The Vcc will be. If I measure Vcc with USB plugged in it can be as low as 4.8V. And it depends on which USB port that I connect (powered on non-powered hub). If The regulator is powered externally (7.5 to 12 V to Vin) it will be much closer to 5V.

USB = 5V +/- 5%

If you want more accuracy, use the 3.3 volt pin. It is better regulated.

68tjs: USB = 5V +/- 5%

Ha, only in theory, plenty of devices put out shabby USB power, or use pathetical thin wires in the cable leading to voltage droop. And computer USB ports put out tonnes of noise too - not good for analog sensing. My laptop USB power varies by about 50mV more or less at random over all timescales (that's 10 LSBs of the ADC).

Running an Arduino from Vin and letting the on-board regulator provide the 5V is wiser for getting good analogRead repeatability and less noise (you can measure the 5V rail and plug that value into your code). With USB power you could calibrate like this too, but change the power supply and you need to recalibrate.

If it worries you, supply 5v via linear regulator (7805 and a voltage divider (using a potentiometer and a resistor) then you can dial in 5v exactly...