Extremely unstable analogRead() on Arduino Nano when powered from an external source I'm doing a really simple project with an Arduino Nano and found a problem.
The circuit is a simple temperature sensor and a tension read from an analog pin everything showed on a Nokia 5110 LCD.
When the Nano is connected to the USB everything works and the reads are perfect.
When I install the circuit on my car taking the 12V to the Vin and the GND from the centraline everything goes bad: I certainly know that the 12V is obviously not stable and oscillates a lot (between 12V and 14V).
What can be the solution? Should I add some ref or should I regulate the input tension to maintain it stable to a certain quantity?
You can use a branded 5 V charger made for cars. You can directly connect this to 5 V pin of the Arduino.
By doing this:

you are protecting the Arduino from the noise as well as high voltage spikes coming from the car 12 V supply
protecting yourself and others coming in contact with the Arduino or the sensors connected to the Arduino.

You can also

consider filtering the analog data read
protection circuits such as surge protection diodes or a 5.7 V Zener across 5 V and Ground of Arduino