DIY Digital Calipers
Hardware- 1 Devlogs
- 2 Total hours
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.
How the design works
The Xiao Seeeduino RP2040 acts as the MCU controller of the calipers. It will control the copper pads of the capacitive sensors, and an LCD screen. I’m using an 74HC595 to convert 3 pin outputs into eight.
All the MCU and electrical components will be placed on the slider (head of the calipers). The stator (ruler body) will be a separate component that doesn’t contain any electrical components, consisting of only floating copper pads.
The capacitive pads: How is the signal received?
Although not currently placed, I will be placing several copper islands to form an Receiver (Rx) electrode and a Transmitter (Tx) array on the bottomside of the stator head. The bottom of the stator head directly faces the top of the stator, which will contain alternating 2.5mm wide floating copper pads spaced 2.5mm apart. This essentially forms a capacitor - two conductors separated by a layer of insulating material (a thin sheet of air).
The Tx array will be a periodic pattern of copper pads: 8 in total per every 5 mm cycle. To bridge the air gap between the slider and the stator, I need to generate an AC signal (which radiates electromagnetic radiation much better than DC by creating a displacement current). The Tx and Rx electrodes are fundamentally a capacitor, after all. The 8 copper pads perform marvelously for simulating an AC signal without actually using digital-to-analog converters. I use the 8-pad Tx array to generate an 8-phase signal (driving half of them HIGH and half of them LOW, and then rapidly shifting the square wave right, going from 0deg phase shift to 360deg in 45deg increments). Using the RP2040, I can generate the 8-phase signal at very high speeds (e.g. 100 kHz) with the PIO state machines. A high frequency is needed to limit capacitive reactance (resistance to AC current), whose formula is given by Xc = 1/2πfC. Our homemade capacitor has an extremely low capacitance (C) value (picofarads), and thus my frequency (f) must be high for me to get any usable signal.
How do I tell position?
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.