Digital Pocket Odometer (Under $15, Fully Parametric)
by Soumil Goyal in Circuits > Arduino
972 Views, 3 Favorites, 0 Comments
Digital Pocket Odometer (Under $15, Fully Parametric)
Ever wanted to measure a 3D curve, a winding path on a map, an irregular perimeter, or any other physical geometry? The only solutions are almost always rulers or tape measures; however, both are awkward.
Rulers are inconveniently un-portable, their shape being awkward to carry and structure demanding sensitive conditions. Rulers can also only measure straight lines (1D), and require inaccurate, tedious end-to-end repositioning if measuring anything long.
Measuring tapes may try to solve portability and length limits, but retractable (steel blade) measuring tapes still don't properly conform to curves. Furthermore, the flexible cloth/vinyl tapes used by tailors only negotiate 2D curves, but become helpless at any distance or angle where the tape cant be held taught without help.
Additionally, both rulers and measuring tapes suffer from a finite length limitation, imprecise human-error-prone readings and limited unit conversion.
Meet the Digital Pocket Odometer: a battery-powered, palm sized gadget able to roll across any 1D, 2D, or 3D geometry to deliver precise length results. Immensely portable and continuously useful, the digital pocket odometer may become the handiest few dollars you'll ever spend!
It's more portable than both rules and measuring tapes.
It has practically unlimited measuring length.
It's easy to read the exact measurement directly from the screen.
It automatically converts between units.
It easily conquers 1D, 2D, or 3D curves.
Supplies
Design
- Autodesk Fusion
- Parametric & Intent-Driven Workflow: Fusion’s intuitive timeline, user parameters, and intent-driven design tools allowed me to dial in the exact geometry required to pack the electronics into an ultra-compact, pocket-sized footprint. Because the entire model is parametrically linked—from the OLED screen cutouts and battery terminals to the wheel dimensions—anyone can download my .f3d file and effortlessly tweak the parameters to customize the odometer for their own hardware or 3D printer tolerances.
- Top-Down Assembly Hierarchy: Utilizing Fusion’s intent-driven modeling methodology allowed me to design the cover, internal chamber, and lid from a single cohesive master body. This workflow ensured that all modular sub-components shared the same underlying reference geometry, resulting in perfect mechanical alignment, zero interference, and an exceptionally clean CAD structure.
- Configurations & Rapid Iteration: Fusion’s Configurations and non-destructive timeline history gave me the freedom to rapidly iterate on complex geometries—such as measuring wheel clearances and enclosure tolerances—without breaking downstream design features. It allowed me to systematically test and refine the model until a perfect, print-ready fit was achieved.
Hardware
- Generic PLA Filament (or any other material suitable for 3D printing)
- Small rubber bands, o-rings, grip tape, etc.
Electronics
- Seeeduino Xiao - $5.4 (https://www.seeedstudio.com/Seeeduino-XIAO-Arduino-Microcontroller-SAMD21-Cortex-M0+-p-4426.html)
- EC11 Rotary Encoder - $1.5 (https://www.amazon.com/DIYhz-Rotary-Encoder-Digital-Potentiometer/dp/B07D3DF8TK/ref=sr_1_6)
- 128x64 4 pin OLED Display - $6.99 (https://www.amazon.com/UCTRONICS-SSD1306-Self-Luminous-Display-Raspberry/dp/B072Q2X2LL)
- Wire (preferably solid core)
- Perfboard (optional)
- 2x AAA Batteries
Tools
- 3D Printer
- Soldering Equipment
- Desktop Computer (for programming the microcontroller)
WARNING: I am not affiliated with any merchants linked here, nor have I purchased any parts from them. All links are for reference/information only.
CAD - Design Philosophy & Parametric Setup
To keep this project cohesive and easy to modify, we are utilizing a Top-Down Design methodology. Because many physical features are shared across multiple parts of the assembly, starting with a single "master" body and splitting it into individual components ensures flawless mechanical alignment.
- Shared Features: Any geometry that affects multiple pieces (like the overall external curve or main parting lines) is created at the top-level parent component.
- Isolated Features: Detail work specific to only one piece (like screen cutouts or mounting bosses) is created only after Activating that specific child component.
Complete Parametric Control
To make the model easily scalable, I used the Change Parameters menu to define all critical dimensions before drawing a single line. This means, you can download the fusion file, just change the relevant parameters, and have a polished product too!
Pro-Tip: You can ask the built-in Autodesk Assistant AI to create these user parameters for you! Simply copy and paste the text block below directly into the assistant asking it to create user parameters!
After handling that setup, let's begin the CAD.
- Create Sketch: Draw the overall outer profile of the device on the origin plane using our defined dimensional parameters.
- Extrude: Pull the sketch out to the total combined depth of the device (coverdepth + chamberdepth + lidthickness).
- Fillet: Round the external edges of the master body to create a comfortable, pocket-friendly ergonomic shape.
- Offset Plane: Create construction planes at the exact transition boundaries separating the cover, chamber, and back lid. (Tip: You only need to create one offset plane if you strategically use your default origin plane as the second dividing line!)
- Split Body: Use the construction planes as cutting tools to slice the master shape into three distinct solid bodies.
- Create Components from Bodies: Convert each of those three bodies into independent, named components: Cover, Chamber, and Lid.
CAD - Front Cover
Let's begin detailed modeling by Activating the Cover component. My aesthetic vision for this tool prioritized symmetry, placing the OLED display squarely in the center of the front face.
The most exciting engineering feature of this cover is the Seamless Integrated Button. Instead of a loose, rattling plastic cap, we will print an ultra-thin flexible membrane directly into the front faceplate that bends inward to click the rotary encoder!
- Create Sketch: On the front outward face, sketch the rectangular bounding box for the OLED screen cutout and a clearance slot for the screen’s header pins, perfectly centered on the origin.
- Extrude (Cut): Remove material to create the recessed viewing window for the OLED display.
- Extrude (Cut): Perform a second cut to clear a path through the back wall for the display's header pins and wiring.
- Offset Plane: Create a reference plane stepped inward from the front face by exactly one 3D printing layer height (using the flexdepth parameter, typically 0.2 mm).
- Create Sketch: On the front outward face, draw the outer boundary line defining where the flexible plastic membrane will begin to deform.
- Create Sketch: On the inside face of the cover, draw a circle dimensioned to loosely clear the rotary encoder’s rotating shaft.
- Loft: Bridge the geometry between the sketches from Step 5 and Step 6. This generates a smooth, tapered transition from the rigid front face down to the interior encoder opening. Be sure to tweak the Continuity options in the dialogue box so the slope respects your specific 3D printer's overhang capabilities without needing support material!
CAD - Chamber
Next, Activate the Chamber component. This section acts as the primary structural frame, housing our electronics and supporting the axle of the measuring wheel. Once the main cavity is hollowed out, we will jump back to finalize the internal contact mechanism for our seamless cover button.
- Create Sketch: On the face mating against the cover, sketch three circles representing the outer diameter of the measuring wheel, the required mechanical clearance tolerance, and the mounting hole for the EC11 rotary encoder.
- Extrude (Cut): Remove material through the outer wall of the chamber to create the open wheel well where the roller will make contact with surfaces.
- Shell: Hollow out the interior of the chamber by selecting the cover-side face. Set the wall thickness to the chamberthickness parameter (1.5 mm). Important: Do not select the back lid-side face during this operation! Shelling across complex external Fillets simultaneously can cause geometry calculation errors.
- Extrude (Cut): Remove the back wall (lid-side) completely to open up the rear of the chamber, finishing the hollowing process cleanly.
- Extrude (Cut): Push the encoder mounting hole from Step 1 all the way through the internal support bulkhead.
- Activate Parent Component: Jump back up to the top-level assembly so you can see both parts at once. Create Sketch on the ZY Plane and draw a small semi-circular profile directly behind the thin cover membrane. Dimension it so the tip of the dome sits just a hair away from the encoder shaft's push-button switch in its resting state.
- Activate Cover: Return to the Cover component and use the Revolve tool to turn that semi-circle into a solid contact bump, Joining it directly to the backside of the flexible membrane. Your compliant mechanical button is now complete!
CAD - Snap Fit Architecture
The snap-fit mechanism is a vital feature for both the clean aesthetic and the daily functionality of the device. I needed this connection to be robust enough to hold the odometer together in a pocket, yet accessible enough to disassemble without specialized tools. Additionally, the design had to be completely 3D-printable without support material to avoid surface inconsistencies that could ruin the tight tolerances.
Good News: Once you dial in the exact snap-fit profile and tolerances for your specific 3D printer, you can save and reuse this exact geometric configuration everywhere else—both on this model and on future projects!
- Activate Parent Component: Return to the top-level assembly. Create Sketch on the ZY Origin Plane to draw the cross-sectional profile of the snap-fit cantilever and catch. Follow the angled geometries shown in the reference image, ensuring you fully constrain the sketch with dimensions for easy parametric tweaking later.
- Mirror: Once the male and female profile shapes are drawn on one side of the device wall, use the Mirror sketch tool to duplicate them across the center axis to the opposite wall.
- Sweep: You will now perform four separate Sweep operations to generate the 3D fastening features, routing the profiles along the inner perimeter Path of the chamber:
- Sweep 1: Create the male lip on the Cover.
- Sweep 2: Create the male lip on the Lid.
- Sweeps 3 & 4: Create the receiving female grooves inside both ends of the Chamber. (Note: Using the chamber's perimeter path ensures the snap-fit features seamlessly contour around the curved wheel well!)
- Section Analysis: To verify your tolerances and ensure the parts won't fuse together during printing, turn on Section Analysis from the Inspect menu using the ZY Plane as your cutting tool. Check that there is a slight visual gap between the interlocking faces.
- Fillet: Apply a small Fillet or Chamfer to the outer mating edges of the chamber and back lid. This creates a subtle ergonomic fingernail groove, making the device easy to pry open by hand.
CAD - Wheel
The measuring wheel is a relatively straightforward component, but its dimensions require careful tuning depending on your desired measuring precision and whatever traction accessories (like rubber o-rings or silicone bands) you have on hand.
- Extrude: Select the outer wheel profile from our original Chamber sketch (Step 1) and Extrude it to create the solid cylindrical blank of the wheel.
- Offset Plane: Create an Offset Plane stepped inward from the interior wall of the chamber's wheel well. The distance of this offset dictates the depth of the internal recess needed so the rotary encoder’s mounting nut and threaded bushing do not rub against the spinning wheel.
- Create Sketch & Extrude (Cut): On this new offset plane, sketch a clearance circle slightly larger than your encoder nut (nutdiameter parameter), then Extrude a cut into the back of the wheel to remove that material.
- Revolve (Cut): To give the wheel anti-slip traction against smooth walls or paper, Create Sketch on the ZY Plane drawing a small semi-circular or rectangular profile where the rubber o-ring will sit, making sure to include the wheel's central axis of rotation in the sketch. Use the Revolve command to cut this retention groove out of both the outer wheel rim and the surrounding chamber lip.
- Extrude (Cut): To make the physical rotation visible to the user, sketch a series of radial tick marks or geometric indicators on the outward face of the wheel, then Extrude them slightly inward to emboss the pattern into the face.
- Midplane & Mirror: To keep the design perfectly symmetrical, construct a Midplane directly through the center thickness of the wheel. Use the Mirror feature command to duplicate the embossed rotation markers from Step 5 onto the opposite side of the wheel.
CAD - Frame
The screen frame is a quick, lightweight component designed to keep the OLED display securely and elegantly clamped in place without using glue or screws. It relies on the same proven snap-fit architecture we designed in Step 4.
- Activate Component: Make the Cover active. Create Sketch on the inner face to extend the left and right boundary walls of the screen cavity outwards by about 1 mm. This clearance is required because our snap-fit clips will add thickness to the inside walls, which would block the screen from sliding in during assembly. In this same sketch, draw an inner rectangle matching the active OLED display area to act as the viewing window cutout.
- Extrude (Cut): Use Extrude to clear out that extra insertion room from Step 1. To get a perfect depth, set the Extent Type to To Object, select the flat shelf where the PCB of the display will rest, and apply an Offset of 2.1 mm. (This guarantees the screen sits snugly beneath the frame; on my build, this cut extruded to exactly 5.9 mm).
- New Component: Use New Component from the Create menu and name this part Frame, then make sure it is activated.
- Extrude: Select the frame boundary profile from your earlier sketch and Extrude it inward into the cover cavity by 1.7 mm to form the body of the frame bezel.
- Create Sketch: On the XY Origin Plane, draw the cross-section of your snap-fit clip. You can reuse the exact same geometric profile and dimensions from our previous designing! I also added a sloped line that would reduce my need for supports on the cover due to the changes made in Step 2.
- Sweep: Use the Sweep tool to route the male snap lip along the outer edge path of the new frame.
- Sweep: Perform a second Sweep to cut the mating female retaining groove along the internal side wall of the cover.
- Mirror: Select both the male and female sweep features from Steps 6 and 7, then use the Mirror feature command across the ZY Origin Plane to duplicate an identical fastening set on the opposite side of the screen assembly.
- Create Sketch & Extrude (Cut): To prevent the parts from binding due to 3D printing over-extrusion, draw a quick offset outline on the outer face of the frame border, then Extrude a cut to shave off a tiny fraction of clearance tolerance around the edges.
CAD: Back Lid
The back lid is already structurally functional thanks to our master body split and snap-fit rails. To finish it up, we just need to add an access cutout for plugging a USB-C cable into the Seeeduino XIAO and carve a tiny alignment pocket into the front cover to cradle the microcontroller's opposite end.
- Activate Component: Make the Cover active again. Create Sketch on the inside back wall of the cover, drawing a rectangular profile that matches the cross-sectional dimensions of the Seeeduino XIAO's front edge.
- Extrude (Cut): Use Extrude to push that profile slightly into the inside wall of the cover, creating a shallow alignment indent that will prevent the microcontroller from rattling around.
- Activate Component: Make the Lid active. Create Sketch on either of the lid's flat faces, then use the Project tool (Shortcut: P) to grab the exact positional alignment coordinates from the Seeeduino pocket we just made in Step 1. Modify this projected outline so it matches the smaller dimensions of a standard USB-C cable plug rather than the full board footprint.
- Extrude (Cut): Select the USB-C outline from Step 3 and Extrude a cut completely through the lid wall, leaving a perfectly aligned access port for programming your odometer!
CAD - Battery Terminals
I initially designed this battery holder as a separate standalone prototype just as a proof of concept, but the mechanical fit worked so perfectly from the get-go that it became the final part! It is a straightforward, reliable design that holds a standard AAA battery snugly in place while allowing stripped wires to maintain constant physical contact with the battery terminals without needing specialized nickel spring clips.
- First, I used the Change Parameters menu to define the following dimensions:
- Create Sketch: On the XY Origin Plane, draw a center rectangle representing the outer footprint of the holder. Set the total width to BatteryDiameter + (2 * WidthThickness) and the total height to BatteryHeight + (2 * HeightThickness).
- Extrude: Select the rectangular profile from Step 1 and Extrude it upward by 6 mm to create the main solid block.
- Create Sketch: On the perpendicular XZ Origin Plane, draw a circle dimensioned to BatteryDiameter + 0.4 mm (adding a slight tolerance so the battery can snap in and out easily). Position the circle so that only the bottom hemisphere intersects the solid block we extruded in Step 2.
- Extrude (Cut): Select the intersecting semi-circle and perform a Symmetric Extrude cut to carve out the curved resting well for the battery. Be sure to set the extrusion distance so it stops short of the outer walls, leaving exactly the HeightThickness amount of solid material on both ends to act as terminal stops.
- Extrude: To prevent the battery from popping out during movement, select the topmost flat faces along the sides of the well and Extrude them upward by an additional 3 mm, creating deeper retention walls.
- Create Sketch: On one of the outer end faces of the battery holder, draw a small Slot sized slightly larger than your WireGauge parameter where the contact wire will thread through. In this same sketch, draw a horizontal construction centerline directly below the slot.
- Extrude (Cut): Select the slot profile and use Extrude with the Extent Type set to All. This cuts the wire routing hole completely through the block, creating identical slots on both ends of the holder simultaneously.
- Offset Plane: Create an Offset Plane parallel to the XY plane and make it coincident to the horizontal construction centerline you drew in Step 6.
- Mirror: Use the Mirror feature command, selecting the offset construction plane from Step 8 as your mirror plane, to duplicate the wire routing slot from Step 7. This creates the second, lower wiring slot needed to loop your stripped terminal wires securely against the ends of the battery!
Manufacturing/Assembly - Hardware
All the structural parts here easily snap together. Just put them together like the CAD, no tools required. The wheel will only attach once you have also mounted the encoder.
Manufacturing/Assembly - Electronics
Assembling the electronics requires precision and careful spatial planning. Because of the tight physical envelope inside the chamber, clean soldering, disciplined wire management, and component accuracy are critical for a successful build.
Electrical Architecture Overview
Before soldering, familiarize yourself with how the system routes power and data across the device:
- Power Distribution: Two AAA batteries wired in series supply approximately 3V directly to the Seeeduino Xiao via the 3V3 and GND pins. The OLED display runs in parallel off this same 3V power rail.
- OLED Display (I²C): The screen uses standard I²C communication. Route the SCK line to pin A5 and the SDA line to pin A4 on the microcontroller.
- Rotary Encoder: The encoder utilizes five terminals. The two GND pins (one for the push-button switch and one for rotational tracking) should be bridged together. The three remaining signal lines connect to pins A8, A9, and A10, leveraging the Seeeduino's native hardware interrupt capabilities.
- Prepare the Microcontroller (Optional): Solder header pins onto the Seeeduino Xiao for prototyping convenience.
- Prepare the battery terminals: Strip about 5cm of solid core wire, then, loop the exposed wire through the battery terminal loops 1-2 times. Insert a battery to ensure a tight fit. The added thickness from the looped wire should hold the battery firmly in contact at all times. You may refer to the image here as an example.
- Pre-Wire the Rotary Encoder: Solder leads to the encoder's terminals. To reduce wiring clutter inside the chamber, bridge the two GND terminals directly at the component so only a single common ground wire needs to be routed back to the board.
- Pre-Wire the OLED Display: Solder and secure leads to the four header pins of the display screen.
- Measure and Cut for Spatial Constraints: Before making your final connections to the Seeeduino, dry-fit all sub-components inside the physical chamber. Trim your wires to length—they must be short enough to prevent bunching and pinching when the enclosure is sealed, but long enough to provide adequate strain relief and comfortable soldering access.
- Integrate the System: Follow the wiring diagram here to complete the circuit. To optimize space and keep the harness clean, daisy-chain the common GND line from the battery negative terminal across the screen and rotary encoder before terminating it at the microcontroller.
WARNING: Power Isolation Hazard Never supply power to the Seeeduino Xiao from dual sources simultaneously. Doing so can cause voltage backfeeding, which may permanently damage the microcontroller or your computer's USB port.
- If programming or debugging via the USB port, physically disconnect the batteries first.
- If operating on battery power, ensure the USB cable is completely unplugged before powering the system on.
Programming
Copy-paste the below code into a fresh Arduino IDE Sketch. You may need to configure your IDE by adding the Seeeduino Board and downloading the dependency libraries of this code.
If you may have used different parts, or dimensions than my exact build, you may need to modify the value of these variables:
Testing - Straight Line Accuracy
Once your Digital Pocket Odometer is ready, you can perform some tests to see its performance!
First is a basic straight-line accuracy test. You can see that our odometer matches up exactly with the ruler's measurement for the floor tile!
Testing - Curve Accuracy
Now that we've established that the Digital Pocket Odometer can work like a ruler, lets see if it can also do the work of a flexible tape measure.
The most common use case is measuring one's waist. As shown in the video above, the gadget successfuly matches with the measuring tape's measurement!
Testing - Consistency
Here's a new task: What if I wanted to know the radius, circumference, or diameter of this eater bottle? Conventional tools would force us to procure a set of large enough calipers or try measurement-by-proxy by wrapping a string around the bottle before measuring the string itself.
The Digital Pocket Odometer makes this much simpler. Just roll it around the bottle do determine its circumference. The two videos above demonstrate the incredible consistency of the device, ensuring results are accurate with each run. The small deviation in their values here are based on the difference of 1 encoder detent, an artifact of human inconsistency rather than the device's shortcoming.
Summary
Congratulations on creating your own Digital Pocket Odometer. Here's what you can now achieve:
- Universal Geometric Profiling: The precision rolling wheel dynamically traces straight lines, sweeping curves, and irregular 3D contours, effortlessly measuring complex surfaces and organic geometries that rigid rulers or standard tape measures cannot accommodate.
- High-Contrast OLED Interface: A low-power digital display provides crisp, real-time visual feedback, ensuring immediate readability of measurements and system status across varying ambient lighting conditions.
- On-the-Fly Unit Conversion: A single actuation of the encoder button seamlessly toggles between measurement systems (e.g., millimeters, centimeters, inches), streamlining workflow and eliminating the need for manual mathematical conversions.
- Instant Tare & Zero-Reset: A rapid double-click instantly resets the current measurement to zero, allowing for quick differential path tracking or consecutive measurements without requiring a system power-cycle.
- Intelligent Power Management: To maximize efficiency, the firmware incorporates an automated sleep timeout that powers down the display and puts the microcontroller into deep sleep after 15 seconds of inactivity.
- Extended 11-Month Battery Life: By leveraging a low-overhead electrical architecture and the Seeeduino’s low-power modes, the dual-AAA battery configuration delivers up to 11 months of reliable operational and standby time.
- Bi-Directional Error Correction: Because the rotary encoder natively tracks quadrature phase shifts, the system senses both forward and reverse motion. Rolling the wheel backward automatically subtracts distance, allowing for effortless real-time error correction if you overshoot your target end-point.
- Non-Volatile State Memory: The system utilizes the microcontroller's onboard flash memory to save your last-used unit preference before entering sleep mode, ensuring it wakes up exactly as you left it without requiring recalibration.
- Ergonomic One-Handed Form Factor: Engineered within a tightly constrained physical envelope, the compact, pocket-sized chassis allows for complete one-handed operation—from rolling measurements to UI navigation—leaving your other hand free to hold materials or take notes.
- Instant-Wake Actuation: The hardware interrupt pins (A8–A10) allow the device to wake from deep sleep instantly the moment the wheel is rolled or the button is depressed, ensuring zero startup lag when you need to take a quick measurement.
- Parametric Customization: Download the Fusion files to easily change any dimensions or specifications to your needs!
You now have a portable, precise, price-conscious 3D measuring Digital Pocket Odometer.