DIY Digital Calipers
Hardware- 3 Devlogs
- 9 Total hours
As the teeth of a through-hole 74HC595 would block the sliding action of the stator, I took some time to redesign the PCB with a surface mount component instead.
I also spent some time designing the casing that would hold everything together. It’s a little bulky, but I think it’ll work for now. I will be adding finishing touches (including mounting holes) later.
I redesigned my PCB several times to achieve the optimal layout for all the components. I ran into several issues along the way.
The Rx electrode and Tx transmitter array are sensitive capacitive devices. When positioned close to other electrical components, parasitic capacitance can be introduced, which can disrupt our weak signal and create crosstalk. It may also affect the integrity of our 8-phase signal, causing phase delays and shifts.
Wiring the Tx array pads (under the Rx electrode) in a way so that every 8th pad was connected was a nightmare. I couldn’t directly draw traces over the copper pads as that would disrupt the ground plane, which is crucial for blocking noise from other components and external sources. For example, the human body is essentially a giant capacitor, and a human placing their hand over an unshielded Tx array would completely ruin our delicate signal. Therefore, it is crucial that the copper traces avoid cutting up as much of the ground plane as possible.
Thus, I ended up reducing the width of both the Rx electrode and Tx array to make extra room for running the copper traces to the side. I also added a small grounded copper pad between the traces and the Rx electrode just to shield it from any parasitic capacitance.
I realized just now after looking at the PCBs I ordered that I made a tiny mistake with my op-amp circuit. To the left of my Seeed MCU, I have an op-amp functioning as an ultra-high input impedance buffer. I’ve also attached an image of the schematic.
An op-amp normally takes a weak voltage signal, compares its two inputs, and multiplies the difference to create a much stronger output voltage. On my circuit, Pin 4 and Pin 1 (VOUT) of my circuit are connected to create a 1:1 voltage ratio, creating a unity-gain buffer feedback loop, so no amplification is actually happening. What DOES happen is that we’ve exposed the op-amp’s high input impedance, meaning it draws incredibly little current from our incredibly weak Rx electrode capacitor. This prevents our Rx electrode from just straight discharging our AC signal our circuit - preserving its original timing and phases. We feed the signal into pin 3 of the op-amp, allowing it to ride the 1.65 V (introducing micro-fluctuations, e.g. 1.64V-1.66V), and our op-amp outputs this signal directly to our MCU pin.
My mistake was that I connected the Rx electrode straight to pin 4 instead of pin 3.
I will see if I can fix it with some quick mods. Fingers crossed.
I’ve completed a schematic and an initial PCB layout for my own DIY capacitive sensor calipers, although I will definitely redo the layout to ensure a more efficient trace design.
Calipers are fundamentally capacitive sensors, and so I will recreate these precise sensors with carefully placed copper pads on the PCB. The Xiao Seeeduino RP2040 in my design will control the copper pads, and an LCD screen. I’m also using an 74HC595 to convert 3 pin outputs into eight (for the Tx transmitter array discussed later).
All the MCU and electrical components will be placed on the slider (head of the calipers). The stator (ruler body) will be a separate, long PCB “stick” that doesn’t contain any electrical components, consisting of only floating copper islands.
The capacitive pads: How is the signal received?
I will be placing several copper islands to form an Receiver (Rx) electrode and a Transmitter (Tx) array on the bottomside of the slider head. The copper islands on the stator will be 2.5mm wide, and placed 2.5mm apart (forming one 5mm cycle). The Tx array on the stator head will consist of a repeating pattern of 8 copper pads spaced apart evenly within every 5 mm cycle.
We take two samples (I and Q) at specific phases in the 100 kHz cycle to find the output voltage of the Rx array. Samples that return a strong signal (high output voltage) are samples whose phase aligns strongly with the copper pads of the stator. If the stator is shifted slightly and thus misaligned, the returned signal will be weaker. We can use two samples and some math to easily determine position.
All ICs are to be fitted with decoupling capacitors placed very close by to ensure the voltage supply (VCC) is not overwhelmed by the 100 kHz frequency and that a stable voltage supply is maintained at all times.