We’re rewarding the question askers & reputations are being recalculated! Read more.

New answers tagged


You have two issues going on - noise pickup, and a potentiometer with imprecise stops at one or both ends. The pot is the easiest to fix: What are the lowest low reading and highest high reading you can reliably get when you turn it to its stops? Use those in place of '0' and '1023' in your map() function. Improving the noise is only slightly more involved....


There are many ways to remove noise, below are some ways: Only change the value when it differs enough. Assume the range is 0-1023. Than only change the value if the input value differs more than a constant value (like 5 or 10, experiment with this to find a good value for your pot meter). Another way is to use the average of the last x readings, You can ...

Top 50 recent answers are included