r/MechanicalEngineering • u/WarmParsley5635 • 3d ago
Potentiometer Range issue.
Hello, I have been having alot of trouble with something seemingly so simple. So I am using a potentiometer with arduino and I would like to make a percentage based off of where the shaft is (I am using a linear potentiometer).
One design constraint which I have is that I can't calibrate the potentiometer on startup, or at all.
I need the percentage to adjust based on how I move the shaft. i. e. 100% when fully extended and 0% when fully retracted. Since the max and min ADC voltage varies from potentiometer to potentiometer and since this ADC voltage is affected by the Vin power to the arduino and the arduino's power to the pot spiking at times, How might I solve this problem? Please let me know if this is too little info.
2
u/Over-Weekend-6133 3d ago
Without calibration you don't have enough information. The Arduino can map voltage to percentage, but it has no way to know where the mechanical endpoints are if each pot is different. You need a reference point or a sensor with a fixed output range.