# Best way to measure the sides of an object

Hello,

I'm trying to use an Arduino to measure the sides of an object, and ultimately calculate its surface area. I've come up with a few different ways of doing so, but I'm not sure what the general approach for doing so. Note, I am NOT measuring the distance TO an object, but rather the length of one side of the object (like a brick or textbook).

By the way, this is also being done by a small motorized vehicle with an Arduino mounted to it.

Here's what I got in case you're wondering:

• Line the vehicle up alongside the object, and use an ultrasonic rangefinder to determine if the vehicle is near the object (using some arbitrary distance). Then, back the vehicle up until that distance is no longer maintained (so as to ensure I can start the measurement from the beginning of the object), and then move along the side of the object until that distance is no longer maintained (i.e. reached the end).
• Mount an ultrasonic rangefinder to a servo, and pull the vehicle within a certain range of object. Rotate servo until that distance is no longer maintained (to start at edge), and then rotate servo back the other way until distance is no longer met (to reach other end). Then do some math to find distance based on ∆angle.

I'd like to get some ideas as to whether these ideas might work, or whether there is better way of doing it all together.

Thank you.

In your first example, how are you going to ensure that the vehicle travels in a straight line, parallel to the surface. Any deviation from a parallel straight line will introduce errors.

Henry_Best:
In your first example, how are you going to ensure that the vehicle travels in a straight line, parallel to the surface. Any deviation from a parallel straight line will introduce errors.

Very true. I did not consider this Any suggestions, or other ideas?

"I am NOT measuring the distance TO an object, but rather the length of one side of the object (like a brick or textbook). "

You infer, but I am not sure. Is this object always rectangle, or can it be a circle (coke bottle)?
Is this a school project, or what? Doesn't matter.

It is definitely square shaped.

b3jh24:
It is definitely square shaped.

If it will definitely be a square, then you will only need to measure, how many sides?

One side, but along two axes (vertical, and horizontal).

A device to measure the area inside a polygon or curve is called a "planimeter".

odometer:
A device to measure the area inside a polygon or curve is called a "planimeter".

I don't think that will work for what I'm trying to achieve.

Ok, I am getting the picture now.
How about low tech. Mechanical switches.
Run along side the object with a switch contacting (start, end distance), and a vertical (servo) that touches down to measure the vertical.

If your battery is good enough, do this several times, and get the average readings.

b3jh24:
I don't think that will work for what I'm trying to achieve.

I'm sorry.

I was trying to obliquely suggest that you google "planimeter" for ideas.

Would something like in this diagram work?

That's actually a good idea. However, how can the switches be used to measure distance? Or do you mean to suggest that I use the switches to determine if I'm "touching" the object, and do the math as I had suggested earlier?

odometer:
I'm sorry.

I was trying to obliquely suggest that you google "planimeter" for ideas.

Would something like in this diagram work?

I did look up planimeter, but from what I gathered, it doesn't appear to work with an Arduino. I need a digital reading if that makes any difference.

As far as the diagram you provided, I'm not sure what exactly you're asking regarding the image. If you're asking if those are the sides I need to measure, then no.

Thanks for the help this far, does anyone have any more suggestions?

Bump

b3jh24:
Bump

What does that mean?
Does that mean "thanks for all your help, I have it working now?

b3jh24:
It is definitely square shaped.

If it’s a square, you only need to measure 1 side. Width = Height.
I think you mean that it’s rectangular. Width<>Height.

The OP stated that it is a square. I took that to mean the length was the same as the width. I did not assume that the height was the same as the length.

Maybe the OP can clarify that for us ?