What rotary encoder should I use?

Hi,

I'm working on a project where i need to measure the distance a robotic car travels every 10m. Ill be carrying out this project on grass (sports field). This is my first project for arduino and I would like some guidance. I did some research and I determined that the rotary encoders should do this job fine. I was thinking about using optical encoders instead of magnetic encoders since they are available at my local jaycar shop. My question is will there be any disadvantages as to using optical encoders for this project. These are the parts that will be purchasing:

Using a wheel having good contact, good friction, to the grass would make a rotary encoder work. The choice of encoder sender on the wheel is wide open.

That looks like a sensible encoder to use. You can make the wheel out of paper or cardboard with as many slots as you want.

I don't understand the second link. Comparator?

Maybe nothing but, you might want to consider all the flora and fauna on a field of grass mucking up an optical slot encoder - unless it's enclosed. Think grass clippings and seeds and spiders and such.

A magnetically operated encoder should be mostly immune to that sort of thing.

YMMV

What accuracy do You need?

Thanks for the replies.

I initially thought about the magnetic encoder, however, I'm not too sure how Id fit the magnetic disc onto the shaft of the wheel. The accuracy doesn't have to be exactly 10m even 9.5m would do. I have attached a picture of the motor I'm using. The type of magnetic disc that I could probably use is:

https://www.robotgear.com.au/Product.aspx/Details/4411-Magnetic-Encoder-Disc-for-Micro-Metal-Gearmotors-12-CPR-Bulk

I would go with one or multiple magnets glued to the axle and a hall sensor.

Immune to dirt (unless the dirt is ferromagnetic) and easy to install.

How many magnets you need depends on the circumference of your wheels and the distance resolution you need.

just a couple of other thoughts,
what about a spool of fishing line on the rotary encoder on the back of the car, and you pin the end of the line to the ground, then as the car travels, the line pays out behind the car, and you have a "no slip" distance, just work out the circumference of your spool.

ultrasonic ranging?
lidar?

I like the fishing line + spool idea

Ultrasonic will not be able to cover the distance.

Lidar is possible, but expensive and not very reliable if you're not SUPER careful when taking the measurement.

Can you please elabroate on the spool method?

If I attach the magnetic encoder discs to the wheels they become very close to each other. So I was thinking would it matter of I attach the disc to the white shaft?

And, will buying this do the job?

NoName12221:
If I attach the magnetic encoder discs to the wheels they become very close to each other. So I was thinking would it matter of I attach the disc to the white shaft?

? ? ? Maybe I missed something, but are you aware we have no idea what your robotic car looks like?

Edit: Found the picture. Please see Simple guide for inserting images in a post

NoName12221:
Can you please elabroate on the spool method?

Instead of measuring the rotation of the wheels, you measure the rotation of a spool of fishing line that unwinds while driving forward.

That's easier to build mechanically, because you can choose both the encoder and the spool yourself and - unlike the wheels - you have 0 slip.

NoName12221:
And, will buying this do the job?
https://core-electronics.com.au/added/?product=42074/

Link doesn't work for me.

So this is what the car looks like so far. Im going to attach the compass on top of the shaft to later do 90 degree turns unless there is another way of doing it using the rotary encoder.

Sorry this is the link that I was referring to:

OPs pics:


NoName12221:
https://core-electronics.com.au/magnetic-encoder-pair-kit-for-micro-metal-gearmotors-12-cpr-2-7-18v-hpcb-compatible.html

Sure, if you can manage to firmly attach the magnets to your axle...

Mechanically I don't think this kit is a good choice.

I would just buy a digital hall sensor and 2 small magnets for each axle I want to keep track of and glue the magnets on where the axle is flattened.s

Can you please post a link of the modules that you think I can purchase

I don't think there is a ready-to-buy encoder module for the motors you are using, but even if there is, you have to use Google yourself, thanks.

Instead of purchasing:

I was just thinking about buying the magnetic discs and hall effect sensors separately as it would be cheaper:

https://www.robotgear.com.au/Product.aspx/Details/4411-Magnetic-Encoder-Disc-for-Micro-Metal-Gearmotors-12-CPR-Bulk

NoName12221:
I was just thinking about buying the magnetic discs and hall effect sensors separately as it would be cheaper:

I suggested that 9 posts ago in reply #6, but yes.

NoName12221:
Magnetic Encoder Disc for Micro Metal Gearmotors, 12 CPR (Bulk)

How are you going to mount that?

NoName12221:
https://www.auselectronicsdirect.com.au/hall-effect-sensor-module-for-arduino-projects?gclid=EAIaIQobChMIl7mLy7nu3wIV1jUrCh2t_QuuEAYYCSABEgKcwPD_BwE

Will work fine, although I see no good reason to buy a <$1 part (OH44E) for 3$.