Measuring distance done by an object using arduino

Hello guys!

I already know that there are topics about measuring distance with arduino, i already built something like this http://www.danielealberti.it/2013/07/arduino-vedere-su-display-la-distanza.html but i need something more accurate.

The project should measure the distance from a 0 point of a slow moving object with a max distance of 1 meter from the sensor and the measurement should be in millimeters accuracy and precision.

I copied the project linked above but the sensor is only accurate on a centimeters scale and easely disturbed by the enviroment.

The sensor that i'm using right now is this the HC-SR04.

I think a i just need a bit more accurate sensor with a minor max distance measurement and if possible easy to use and cheap.

Thank you

Alessio

adding new library for the sensor if you have old one, well acctuly if your opject very small or from spesial material will be not that good, but millimeters!! nop not a good sensor for that, HC-SR04 can be great with a good library, you can have from 3CM to 4M with this sensor, more distence mean more noise, you can read the datasheet for more information.

There are projects to run a laser mouse from Arduino through the mouse chip. Laser mouse can track small movements.

ultrasound is dependent of time, so if you make a good interupt routine and microseconds. another way is by using alaser and a photo sensitive device psd resolutions are easy 20000

Sparkfun now has this bad boy: https://www.sparkfun.com/products/13167

Pricy, but, if you want range and accuracy...

Thank you guys for all the reply!

By looking at your comments i think the best option is to use a mouse chip with arduino to track the subject's movement of this project.

The ultrasound sensor, as i learned from datasheet and your posts, is not a reliable sensor when you are talking about millimetrical precision/accuracy also at small distances.

The lidar sensor has and accuracy of 0.025 meters wich is too much low in a millimetrical scale!

Anyway i already searched on the forum and around the net about the mouse chip with arduino but i didn't found a clear ( for me!) project that track only one axis movement with millimetrical precision.

Can you suggest me a good and cheap way to build the mouse chip way?

Thank you

Alessio

It's not clear if you absolutely require non-contact sensing or if you can attach a linear encoder between the moving object and stationary point. A 'direct red-out' (DRO) on a machine tool is typically an optical or magnetic strip mounted on one piece and a read head mounted on another. The Arduino reads a linear quadrature encoder just like a rotary quadrature encoder.

Thank you johnwasser for your good point about my project!

I think a linear encoder with a contact sensing would be the best for it but i want to know if i can do it without spending a lot money or if it should be cheap like a mouse chip- like solution.

Also if a linear encoder with a strip long about 1 meter can be done easiely and what sensor and strip do you suggest for the work? and maybe a similar project about it so i can know how to interface arduino with the output data from the sensor.

Thank you in advance and sorry for my noobiness.

Avago Tech has a large number of transmissive optical linear quadrature sensors: http://www.avagotech.com/pages/en/motion_control_encoder_products/incremental_encoders/transmissive_encoders/

At Mouser.com the optical quadrature encoders generally cost under $10 each. Unfortunately that leaves you needing the matching optical strip. That might take a while to locate, especially in lengths over a meter.

Yeah while i was waiting for your answer yesterday i looked around on the web and i found out that the optical sensor are really easy to find and almost cheap but the strips are really hard to find!

If anyone could share a good link with the couple (sensor+strip over 1m) would be really helpfull.

Thank you again johnwasser for the reply and sorry for my bad bad english! :D

alemane: sorry for my bad bad english! :D

Your english is quite good. I've seen FAR worse here... cases where it looks like someone typed some random thoughts into Google Translate without punctuation or capitalization and then hit the 'translate' button.

Hi, sorry to miss this thread but my Arduino notifications is broken and I only saw this by chance. If I'm not back in days, I've probably lost the link and the forum did too, send me a PM!

This new forum software is the worst so far and I know what that means. We get to keep it.

You can find mouse chips if you keep your mice that quit because the button died or you find cheap mice on sale. But you need to find one with a chip that is covered, there are at least four.

Alemane, start with this link to links: http://playground.arduino.cc/Main/InterfacingWithHardware#mouse

Cutting through dead links on the PS2 mouse reader, it connects to the PS2 connector: http://playground.arduino.cc/ComponentLib/Ps2mouse

Note this direct to the chip article is old, pre- Arduino IDE 1.0, so some minor changes to the library may need to be made. http://www.martijnthe.nl/2009/07/interfacing-an-optical-mouse-sensor-to-your-arduino/

If you can find the datasheet for the chip on a mouse, chances are it can be used.

And if you can work a digital caliper into your project: https://sites.google.com/site/marthalprojects/home/arduino/arduino-reads-digital-caliper

If your movement is along some kind of rails it should be possible to to make an optical sensor that would read a striped scale and count marks either by reflection off lines on paper or by beam interrupt using lines printed on transparency sheet you can have made in an office store... or at least I have done maybe 5 or 10 years ago.

if you have a rack and pinion gear that could be used, sub-mm is possible down to backlash dimension which is small.

Between mechanical and geometric means, 0.1mm or closer may be possible to be sure of using old machinist techniques.

johnwasser: Your english is quite good. I've seen FAR worse here... cases where it looks like someone typed some random thoughts into Google Translate without punctuation or capitalization and then hit the 'translate' button.

I agree. My thought is "what bad English?".

Yeah while i was waiting for your answer yesterday i looked around on the web and i found out that the optical sensor are really easy to find and almost cheap but the strips are really hard to find!

You can print or have printed at an office store. It may take 2 or more tries to get the printing accurate to scale but laser printing at those stores is very fine.

Looks like FedEx/Kinkos can print clear vinyl 'decals' up to 53"x53" (2" minimum). The price is $10/sqft and they have a $25 minimum so you might as well get 360 square inches. At 53" wide that's a little more than 6.75" long. You could print a baker's dozen 1/2" wide scales or 9 3/4" wide scales. Vinyl alone is likely to be too stretchy so you would probably want to mount the decal on something like clear mylar.

Try OfficeMax or Staples. Last time I had transparencies printed it was 25 cents a sheet. That was maybe 10 years ago.

You can print stripes on paper if you have a printer but again office stores charge pages per dollar. Laminate the page or spray it with clear lacquer or enamel or cello tape.

Hello guys!

After a lot of searching i found out few site that can be usefull when you need linear or disk strips for encoders ( or just i think so!)

http://usdigital.com/products/encoders/incremental/linear/LIN

this should be what i'm looking for: a linear strip of about 1m long and a 200 lpi resolution should be ok with the avago encoders that you linked me or one of theirs, the only problem is that i'm in italy and the company is from us so probally the spedition is more expensive than the strip...

http://www.precisionmicro.com/25/applications-/optical-encoder-disks-&-strips

this is the second link and it's more confortable in terms of distance but i'm afraid they are not what i need ...

http://www.laserlab.com/encoders.php

this looks the same as the first link, but they have standard measure in stock, so cost and speed should be better..

Anyway by looking to your answers i should search a shop that can make me a Transparent Polyester (the same material like the last link stripes) film with the pattern described in the avago encoder's datasheet

The problem is that in Italy i don't really know where i can find it because we don't have Fedex or Staples!

Sorry but your post is full of inches and i'm not really used about them.

Thank you