Hi, I am facing a problem of reading analog values in arduino. I have tried to read these values from my project sensors but i get lot of errors away from what I expect. I programmed the attached program just to visualize what is happening to the the analog pins and I found the pins have a fluctuating voltage even if the sensor is unplugged, can someone help me how to go through it please.
I found the pins have a fluctuating voltage even if the sensor is unplugged
Unconnected pins act like an antenna, so the input level may float and read back randomly.
You can use the internal pullup to stabilize those, in setup() add: