Measuring RPM of axle using Teensy 4.1 and an optical mouse sensor

Status
Not open for further replies.

guzu

Well-known member
Hello everybody,

As the title of this thread says, I was wondering if it would be possible to measure the RPM of an axle (and then do the math to find the linear speed) using a optical mouse sensor placed near the axle. The maximum RPM of the axle would be 3000 RPM. Would the mouse sensor be fast enough?
Has anyone done this? I found some old posts/projects (2013, 2016) on other sites that showed how to interact a PS2 optical mouse with an Arduino. I was wondering if it is possible to use the USB port of the Teensy to do the same?

Thank you very much.
 
You certainly can use a USB mouse with the USB host port on Teensy 4.1, or Teensy 3.6.

But whether the electronics inside a consumer mouse meant for slow movement are able to reliably track an axle spinning at 3000 rpm is a good question. If the diameter of the axle is small, so the linear motion at the surface is slower, maybe it could work? But who can really say, other than the people who designed the mouse. It's probably going to take some experimentation.
 
You certainly can use a USB mouse with the USB host port on Teensy 4.1, or Teensy 3.6.

But whether the electronics inside a consumer mouse meant for slow movement are able to reliably track an axle spinning at 3000 rpm is a good question. If the diameter of the axle is small, so the linear motion at the surface is slower, maybe it could work? But who can really say, other than the people who designed the mouse. It's probably going to take some experimentation.

Thank you Paul.
The diameter of the axel is 50mm.
Since I am very new to the Teensy USB software part, is there a way to get the data from the Mouse to be printed on the Serial Monitor?

Thank you.

//edit
I just found out the USBHost_t36 library. Will give it a try. Thank you.
 
No, I very much doubt an optical mouse is anything like fast enough as it has to do computation on the chip
to correlate optical image movement - and the optical image is supposed to be focussed on a flat plane.

Your typical mouse movement across a mat would be around 0.5m/s maximum. For a shaft of radius
25mm at 3000rpm you'd have a curved surface to image travelling at 8m/s. I mean try it, but don't
be surprized if it flakes out well before 3000rpm.

Why not use a standard optical shaft encoder? Old style mice used these. Reluctance/Hall sensors are
also used (less susceptible to dust and vibration).
 
Why not use a standard optical shaft encoder? Old style mice used these. Reluctance/Hall sensors are
also used (less susceptible to dust and vibration).

Hm, at 3000rpm? If you use a 100cpr encoder you'll end up with a count rate of 3000*60*100 = 18MHz :) I'd use a disc with a hole and a (fast) optical switch. Would give 180kHz which seems more feasible.

Edit: If you don't want to mount something on the axis you might try to paint half of it black and use a reflective optical switch.

Edit2: Sorry wrong calculation (see below) would give 5kHz with a 100cpr encoder and 50Hz with the optical switch. Both is of course very feasible....
 
Hm, at 3000rpm? If you use a 100cpr encoder you'll end up with a count rate of 3000*60*100 = 18MHz :) I'd use a disc with a hole and a (fast) optical switch. Would give 180kHz which seems more feasible.

Edit: If you don't want to mount something on the axis you might try to paint half of it black and use a reflective optical switch.

Edit2: Sorry wrong calculation (see below) would give 5kHz with a 100cpr encoder and 50Hz with the optical switch. Both is of course very feasible....

Thank you for this information. I will probably go with the reflective optical switch and the paint on the axle. Do you have a recommendation of a good optical switch that would be fast enough?
I will also give the mouse sensor a go just to see if it works :)
 
Do you have a recommendation of a good optical switch that would be fast enough?
That one https://www.adafruit.com/product/3930 should be good, here is a project description which might give you a head start: https://learn.adafruit.com/spinning-disc-step-sequencer/build-the-sensor-circuit.

You might need some experimenting with distance and the coloring of the axis (some black colors are quite transparent in the IR).

Here a list of other sensors in case you don't like the Adafruit one: https://octopart.com/search?q=refle...D&specs=0&sort=median_price_1000&sort-dir=asc
 
That one https://www.adafruit.com/product/3930 should be good, here is a project description which might give you a head start: https://learn.adafruit.com/spinning-disc-step-sequencer/build-the-sensor-circuit.

You might need some experimenting with distance and the coloring of the axis (some black colors are quite transparent in the IR).

Here a list of other sensors in case you don't like the Adafruit one: https://octopart.com/search?q=refle...D&specs=0&sort=median_price_1000&sort-dir=asc

Thank you very much.
 
Status
Not open for further replies.
Back
Top