# Penetration distance measurement

Hello, I hope you can help me :).

I am working in a device that requires to measure the deep of an object when is inserted through a hole. Imagine you have a solid cube (7x7x7 cm) and in the center there is a hollow channel where a solid rod (Diameter 0.5 cm) passes. Initially I attached a wheel on the axis of a rotary encoder so that when the rod is inserted through cube, the rotary encoder registers the direction of the movement and the angle (according to the number of steps), but I am having troubles since the wheel and the rod are not always good couple and some times the rotary encoder does not register the movement besides that the rotary encoder is not very precise.

I am considering to change the way of how I am measuring the penetration distance but I don't know what other sensor I can use.

Could you please suggest me a sensor? I am avoiding to attach the sensor to the rod, so it's required only to attach the sensor to the cube.

Riccardo26:
Hello, I hope you can help me :).

I am working in a device that requires to measure the deep of an object when is inserted through a hole. Imagine you have a solid cube (7x7x7 cm) and in the center there is a hollow channel where a solid rod (Diameter 0.5 cm) passes. Initially I attached a wheel on the axis of a rotary encoder so that when the rod is inserted through cube, the rotary encoder registers the direction of the movement and the angle (according to the number of steps), but I am having troubles since the wheel and the rod are not always good couple and some times the rotary encoder does not register the movement besides that the rotary encoder is not very precise.

I am considering to change the way of how I am measuring the penetration distance but I don't know what other sensor I can use.

Could you please suggest me a sensor? I am avoiding to attach the sensor to the rod, so it's required only to attach the sensor to the cube.

Your description seems to leave out a lot of important information. What is the cube made of? What is the rod made of? Does the hole go completely through the cube?

IF the cube and rod are made of metal and the hole does not go completely through the cube and you only want to measure the depth of the hole, then you can set up the device to look for an electrical contact between the rod and the cube.

Paul

Hello Paul,

The cube is made of plastic (3d printing), I can change the internal section of the cube in order to reach one solution and re-print it, the rod is made of plastic coated stainless steel and the hole goes completely through the cube. The objective is to measure the the distance that protrudes from the cube, I mean, the length of the rod from the base of the cube to the tip of rod.

The cheap digital calipers are easy to interface to an Arduino. You can find tutorials on how to do it. Here’s one that happened to come to hand (there might be better ones out there):

Can you also change the rod?
If it is possible to make black and white strips on the rod you can use an optical encoder?
Or you could place magnets inside the rod?

How is the rod driven?

Hello all :).

I decided to be more flexible with the requirements and I attached to the top of the cube a distance sensor (ultrasonic) and in the top of the rod a disc which will produce the echo to the ultrasonic sensor, In this way, knowing the distance of the cube and the distance from the sensor to the disc I can calculate the penetration distance.

Thank to everyone

Ultrasound sensors have a minimum resolution of a few mm, and an error of up to 1 cm. Hard to believe that's enough for a maximum 70 mm movement (the stated size of the cube, penetration into that cube would be 0-70 mm).

IR distance sensors offer better resolution and precision. Digital callipers are even better, they go down to 0.01 mm.