Build a CNC Tracer Based on Simple Arduino
This guide is for engineers and makers who want to build a CNC tracer based on an Arduino board and use it to copy a profile or a flat pattern. It covers probe choice, X-Y-Z wiring, scanning passes, the limits of sensorless tracing, and when the traced profile is better sent to a machining shop.

What an Arduino tracer actually does
A tracer is not a CNC machine and it is not a cutting tool. It is a measuring device that follows an existing edge and turns that motion into coordinates. You can build a CNC tracer based on simple Arduino hardware because the job needs only three stepper axes, one sensor input, and a way to log numbers. No spindle, no coolant, no tool wear.
The cheap way to do this is sensorless tracing. You drive the probe into the surface in small steps, watch for a digital signal that says contact has been made, then step back. The controller records the point and moves on. With a normally open contact probe, the whole interface is one pin with an internal pull-up.
The trade-off is speed. A touch probe at 0.1 mm resolution on a 200 mm part means roughly 2,000 probe cycles per pass. At 10 mm/s approach speed, one pass over the profile takes several minutes, and you still need a finishing pass at finer stepover. That is fine for a one-off template. It is painful for a batch of 50 parts.
Tracing gives you a point cloud or a polyline, not a CAD model. Expect to clean the data before it is useful. Fit lines and arcs where the part has them, delete the noise from backlash, and check the closure of the loop before you trust any dimension.
Parts list and wiring for a 3-axis tracer
You need three stepper motors with drivers, a rigid frame, a probe with a repeatable contact point, and an Arduino that can keep up with step generation. An Uno is enough for slow tracing. A Mega or a 32-bit board gives you more headroom if you add a display or an SD card for logging.
The probe choice drives everything else. A mechanical touch probe with a spring-loaded stylus and a simple switch output is the easiest to wire and the easiest to debug. An optical or inductive sensor works for non-contact tracing of soft or painted surfaces, but its standoff distance drifts with target material and temperature, so you must re-zero often.
Wiring is straightforward: step and direction pins from the Arduino to each driver, one input pin for the probe, and a shared ground. Keep the probe cable short and shielded. A long unshielded run next to stepper cables will pick up noise and trigger false contacts, which shows up as spikes in the logged points.
Power the steppers from a separate supply, not from the Arduino 5 V rail. Add a 100 µF capacitor across each driver's supply pins. If the board resets when an axis starts moving, that is a supply problem, not a firmware problem.
- 1Arduino Uno or MegaUno for slow single-pass tracing, Mega if you log to SD
- 23 stepper driversOne per axis, with step and direction inputs
- 3Contact probeSpring stylus with a switch output, one input pin
- 4Separate 24 V supplyKeeps motor current off the logic rail
Firmware logic: probe, record, retract
The scan loop is short. Move the probe toward the surface in steps of 0.05 to 0.2 mm. Poll the input pin after each step. On contact, record the current position, reverse the approach by a small clearance, and move to the next scan line. Between lines, index the part or the head by the stepover you chose.
Use a debounce window. Mechanical probes bounce for a few milliseconds on contact, and without a delay or a confirmed second reading you will log the first bounce instead of the true touch point. Two consecutive readings 5 ms apart is usually enough.
Backlash is the biggest error source on a hobby frame. Always approach the surface from the same direction. If your scan pattern requires a reversal, add a compensation value in firmware that you measured with a dial indicator on that axis.
Log with fixed decimal places and a clear unit. A line like X12.345 Y4.201 Z0.000 in millimeters is easy to parse later. Mixed units and variable decimals are the main reason scanned data becomes unusable.
From probe points to G-code and a real part
Most Arduino tracer builds end at a CSV or a text file of points. To cut anything, those points must become toolpaths. For a 2D profile, a simple script that offsets the polyline by the tool radius and emits G01 moves is enough. For a 3D surface, you need a mesh and a CAM step, which is a different project.
Check the traced loop before you cut metal. Overlay the points on a drawing, measure two known features with calipers, and compare. A tracer with 0.1 mm step resolution and unmeasured backlash can easily be 0.3 mm out on a 200 mm profile. That is fine for a plywood template and not fine for a mating bore.
The classic use case is reverse engineering a worn or undocumented part. Trace the good half, mirror it, and you have a usable profile. The classic failure is tracing a part that was never accurate to begin with, then cutting a batch from bad data.
When the traced profile has to hold a real tolerance, the scan is only the first step. A shop with simultaneous 5-axis machining centers and a Ø400 mm rotary table can take your point data or a rebuilt model and cut the part in aluminium, stainless, or titanium. GreatLight runs 127 high-precision CNC machines and holds ±0.005 mm on turned and milled features, so the traced shape gets a machined surface instead of a hand-finished one.
Which tracing method fits your job
Pick the row that matches your surface and your accuracy target.
| Method | Best for | Watch out for |
|---|---|---|
| Contact probe, 0.1 mm step | Hard edges, templates, one-off copies | Slow; backlash shows as ripple |
| Contact probe, 0.02 mm step | Small features, tight profiles | Very slow; noise triggers false hits |
| Optical edge sensor | Soft or painted surfaces | Standoff drifts with material color |
| Inductive proximity | Ferrous surfaces, rough checking | Large spot size, poor fine detail |
| Manual height gauge + CAD | Short profiles, few points | Human error, slow data entry |
When not to build a tracer
A tracer cannot measure what it cannot reach. Deep pockets, undercuts, and internal bores are out of range for a simple 3-axis probe. If the feature needs a stylus to enter and turn, you are into a different machine class.
Thin walls and flexible parts are also a bad fit. The probe force deflects the part, so you measure the deflected shape. Measure those parts on a CMM with a low-force head, or support them from behind.
If you only need one or two parts and you already have a drawing, skip the tracer. Modeling the part and cutting it directly is faster and more accurate. The tracer earns its place when the geometry exists only as a physical object.
For parts that need to hold ±0.005 mm, a hobby tracer will not get you there. Use it to capture the shape, then have the profile machined, ground, or inspected on proper equipment. The tracer is a data capture tool, not a metrology instrument.
Tracing and Arduino questions
Can an Arduino Uno run a 3-axis tracer?
Yes, at slow feed rates. The Uno has enough pins for three step and direction pairs plus one probe input.
If you add an SD card, a display, or finer step resolution, move to a Mega or a 32-bit board. Step timing gets tight when all three axes move at once.
How accurate is a DIY Arduino tracer?
With a good contact probe and 0.05 mm steps, expect roughly 0.1 mm on a rigid frame after backlash compensation.
On a hobby frame with belt drive, 0.2 to 0.3 mm over a 200 mm profile is realistic. Measure with a dial indicator before you trust any number.
Do I need limit switches on a tracer?
Yes. Homing gives you a repeatable origin, and the switches stop the carriage if the probe misses the part and the axis runs to the end.
Wire them as normally closed so a broken wire reads as a fault instead of a clear signal.
What file format should the scan output use?
A plain CSV or space-delimited text file with X, Y, and Z in millimeters and three decimal places is the easiest to process.
Keep one point per line. Avoid mixing units or writing headers into the middle of the data.
Can a traced profile be machined to a tolerance?
Yes, if the scan is cleaned up and the model is rebuilt with proper arcs and flat faces. Raw point clouds cut poorly.
Send the point data plus a drawing of the mating part. A shop can rebuild the model, add the tolerances, and cut it from the material you specify.
What materials can the traced part be cut from?
Aluminium 6061 and 7075, stainless 303 and 316L, 4140 and 4340 steel, and titanium Ti-6Al-4V are all common for reverse-engineered parts.
For low-volume copies, aluminium and engineering plastics keep the cost down. Steel and titanium are for wear or strength.
Traced a profile and need it machined?
Send your point data or rebuilt model. We return a quotation and a free DFM review within 12 hours.
12-hour quote±0.005 mm100% inspection