4 Replies Latest reply on Nov 4, 2017 11:43 AM by beacon_dave

# Arduino concept help

I am new to using Arduino and am planning my first project.  I would like some feedback to determine if my thoughts are possible.  I would like to use a rotary encoder to measure the length distance of a rotating object (using a wheel on the encoder).  My question is if there is a way for the Arduino to input that recorded length measurement within the sketch as a "calibration value" of sorts to then make further calculations?

Thanks for the help

• ###### Re: Arduino concept help

If I understand the question, that is exactly what the encoder reading gives you. You may need a start/stop button input as well. The arduino could record the encoder reading (distance) between the start and stop signals and store it for further calculations.

1 of 1 people found this helpful
• ###### Re: Arduino concept help

Thanks for the reply. That is exactly what I was thinking, to use a start/stop button to record an exact distance that is stored by the arduino. My question is if I'm able to have that stored distance used in a mathematical equation that is based off of other sensor readings. I know that I can input the mathematical equation beforehand but the distance of objects will vary that will be measured that will have an influence on the output commands that I want.

Sent from my iPhone

• ###### Re: Arduino concept help

Sure, that is no problem. The extra calculations using other or all sensor data can be continuous or triggered by the stop button or triggered by other sensor readings

• ###### Re: Arduino concept help

Perhaps keep in mind that your measurement accuracy will depend on the type of encoder used and the diameter of the wheel attached to it.

An incremental encoder will typically give you a number of pulses per revolution. Some low cost ones will only give you  around 12 - 24 pulses per 360degrees of rotation  (30 - 15 degrees between pulses) which may not be accurate enough for your application. They are designed more for inc/dec type control input e.g.:

You can increase the number of pluses per revolution by inserting a gearbox on the input but perhaps also keep in mind there will be a limit to the speed that you can reliably read the pulses at.

Depending upon your application you may be able to use a potentiometer attached to an analogue input on the Arduino to improve accuracy at a lower cost, although this will typically limit you to around 270 degrees of rotation without using mechanical linkages to reverse the direction of the pot every 180 degrees.

As for calibration aspect - you just need to record the number of pulses from the encoder for a known rotation distance of the wheel and as Doug says, a start/stop button could be used.

There is some information on using encoders with Arduino here which may be worth a read:

https://playground.arduino.cc/Main/RotaryEncoders

1 of 1 people found this helpful