Project Arduino with 16bit optical encoder and WiFi/Ethernet shield

Hi!

I am not very experienced with Arduino (yet), but I am hoping to change that!

The project I have is to get rotation data from an 16bit (probably incremental) optical encoder, and sent that data to my computer using UDP over WiFi or ethernet. I would like to use Arduino for this purpose.

However, I have some questions on how to approach this project: 1. What Arduino should I use? Uno, Mega, or Due? Since I need precise data on the rotation of the encoder, I am going to use a 16bit encoder. Is the Mega fast enough to yield reliable data and fast enough to read the encoder and send data to the WiFi/ethernet shield? Should I be worried that the Arduino might 'miss' some steps in the encoder (since it has such a high resolution)? Or should I use the Due?

  1. I read that the Due has a lower voltage. Does this affect the type of encoder I can use? Also, I tried to find if the Due is compatible with the Arduino WiFi/Ethernet shield, but could find a definite answer.

  2. Some encoders use the SPI interface. However, the WiFi shield also uses SPI. Should I avoid using two SPI devices on one Arduino board to avoid problems in interference with the shield and the encoder? In other words, is it wise to let the WiFi shield use the SPI, and use an encoder with a digital inputs?

Any advice on the design would be greatly appreciated!

Thanks,

Niek

Hi Niek,

Main question: How fast (often) does the encoder change value?

It’s possible to have multiple SPI devices at once. You need to have separate chip/device select lines and manage that.

See THIS: for details.

(fixed)

Hi Terry,

Thanks for your reply.

The encoder is used to measure the angle of a joystick that I will use measure how people track a random signal. The signal has a frequency bandwidth of about 0.1Hz to a maximum of 10Hz.

The following estimates are very rough, but are in the ballpark. I think the encoder will be rotated with a rotational speed of maximally 180 degrees per second. Since a 16bit encoder has a revolution count of 2^16 = 65536. If I understand correctly, then the encoder changes value approximately ((2^16)/2) = 32768 times in one second (if rotating at 180deg per second). I hope this makes sense! I am thinking of using an incremental encoder, so I need to integrate the revolution count to get position, right? If the change in revolution count is too large for the Arduino to handle, could this lead to integration errors?

Regarding the SPI: so if I understand correctly, I can select the encoder first, read the value, switch to the wifi shield, and send the data, all in one loop() call?

Thanks!