Potentiometer reading value never reach 0 or 1023

Hi everyone, I'm trying to use a potentiometer to control Adafruit Neopixel light. But I can't get a stabilize
value from the pot reading. I'm ok if the value change +/- 1 or 2 but the change was by maximum of 30. I also notice the pot value never reach 0 or 1023. So I tried to create a simple circuit to read the pot value to test the pot and the value is stable. The pot value always change, only when I connect Neopixel light into my circuit. Now, I'm thinking my circuit have a problem. Could someone help me figure this out please? I'm a newbie and have no idea if I could use any other component to help the circuit.

You cannot power the neopixel from the 5V pin on the Arduino. Use a separate power supply for the neopixel and don't forget to connect the grounds.

That is a typical indication that your power supply's are unstable and probably do not have a solid ground. You may also have electrical noise coming from the power source, I am guessing it is your computer.

detown Thanks for helping me out. I will definitely try implementing this.

gilshultz
What do you mean by a solid ground? I'm sorry I'm very new to circuit and have very little knowledge on this. I don't have electrical noise from my computer. Is there anything I could add to the circuit to stabilize the power supply? Thank you!!!

The power and ground to the pot need to be run on separate wires to those to the neopixels, otherwise the
voltage drops on the wires due to the heavy currents will affect the pot. Those thin hook-up wires for breadboards are only for small currents and have a lot of resistance compared to stouter wiring.

That is another way of saying are all the grounds good. Single point grounding at the power supply is best. As far as noise, the only computers I have seen without electrical noise are turned off and even then not are all noise free. You probably have a switching supply supplying 5 volts to the USB connection. Put a scope on it and you will see what I am talking about. Remember each piece of wire is a resistor, capacitor and inductor all in one. Granted small in value but there. You are feeding the LEDs with the same wire the pots are connected to. I would suggest you go on line and get some background in basic electronics.

Single point grounding should be at the Arduino since the ADC is ratiometric to the Vcc at the Arduino
and thus the pot wires must run direct from the Arduino, not the power supply.