I am making a machine which, from the curve of the top of a violin, cuts the feet of a bridge.

I thought that a sensor attached to a motorized rail could take precise measurements of the distance from the top of the rail to the top of the violin, which would be translated to a curve (from the distance measurements in the X and Y directions) used to cut the feet of a bridge on a CNC machine. This sensor wouldn't need to have a high range (the rail could be as low as needed for the sensor) but a high precision would be required. Since the tolerance of my CNC machine is +/- 0.005 in, I would like a sensor which could measure somewhere in the range of that precision.

However, I cannot seem to find a sensor that would do the job. I want to use a Raspberry Pi to control the motorized rail system which the sensor would be attached to, which means that the sensor would have to interface in some way with the Raspberry Pi.

After some research, it seems that a linear displacement sensor could work, as would a Triangulation Laser Distance Sensor. However, I searched for products and could not find any. I took a look at laser parts like the Sharp GP2Y0E03 sensor, but the only information about the accuracy I could see was "High Precision Measurement", which isn't exactly helpful.

I would think that a part sensor similar digital caliper but for distance would exist?

Here is (an admittedly bad) drawing of what I am trying to achieve.

Poorly drawn image of the curve and the measuring tool


2 Answers 2


Non-contact sensors are not going to have the precision or spatial resolution that you want.

Basically you want a specific-purpose CMM.

I am going to point you towards the indicators used in machining. Called dial indicators, AGD, test indicators, or various other terms.

There are two types: those with a plunger and those with a lever. Most are mechanical, some are digital and among those some probably have a serial readout. The plunger types give a more direct reading of distance but the lever types are more suited for scanning (i.e. dragging) across a workpiece and the contact force is also lighter. The disadvantage of the lever type here is the cosine error since you are using a rotating lever to measure a linear distance.

For either type, for a violin, you will want to get a probe with a plastic ball such as delrin or teflon, and not the carbide that usually come with either type of indicator.

A plunger indicator also has the potential option for you to rig up a digital measurement device to the knob at the top of the indicator which is the opposite end of the stem where the probe is mounted. That way you could more more easily adapt a computerized digital measurement even if you can't get an appropriate digital indicator. Something like a drag-wire sensor, for example.

It is also possible to rig up a lever to drive the plunger. This will introduce the potential for cosine error again though but give you more flexibility. It's difficult to modify the lever indicators beyond what they already are.

Re-reading your post, you have a CNC machine. You should be aware of these indicators already.

  • $\begingroup$ I think I discounted dial indicators because in my experience they lack an easy way to interface with raspberry pi's. I found this article which talks about interfacing digital micrometers to arduinos, but doesn't really solve my specific use-case. $\endgroup$ Commented May 30, 2023 at 1:26
  • $\begingroup$ @divinelemon You can try doing what I said: connect the top knob of a dial indicator to a draw-wire sensor or a linear encoder or potentiometer, or something like that. It's probably less work to rely on the guide rails, springs, and gears of the indicator than to build your own around a draw wire sensor, linear encoder, or potentiometer and you get the calibration for free. $\endgroup$
    – DKNguyen
    Commented May 30, 2023 at 1:27
  • $\begingroup$ Oh, I see. Thanks for the answer! $\endgroup$ Commented May 30, 2023 at 1:30
  • $\begingroup$ @divinelemon You could potentially remove the crystal (off a disposable cheap indicator first to test and practice!) and see if you can't hook something up to the spindle. Then you get the mechanical amplification as well. A diametrically polarized magnet with rotary sensor IC is what I would try since minimally invasive and works through the crystal. The magnet might disrupt the indicator though If you really know indicators you could probably do something much more direct such as a pot to the spindle. But I think the knob should work fine with a good linear pot or encoder for 0.005" $\endgroup$
    – DKNguyen
    Commented May 30, 2023 at 14:20

If your CNC machine is a CNC router and not a CNC lathe nor a CNC Machine Center, you may have what you require, short of a dial indicator.

Consider to secure the curved portion to the bed of the machine. Attach a dial indicator to the gantry with the contact at the highest (closest) point of the curve. Your CNC readout should provide a reference point. Jog the gantry left and right to ensure you are at the closest point and note the y-axis coordinate.

As you jog in the x-direction a specific amount, say five millimeters, the dial indicator will change specific to the curved portion. This provides the y-direction/distance required to plot a curve to match.

You can reduce the x-axis distance as needed if you require greater than five millimeter resolution or increase it if you don't need such resolution.

  • $\begingroup$ Hi! Thanks for the comment. I do have a CNC router, and was planning on attaching the sensor to the gantry, but, as I commented to DKNguyen, couldn't find a dial indicator/sensor to make the measurements. $\endgroup$ Commented May 30, 2023 at 1:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.