We picked up [M]aris’ Vernier Caliper interface to the Launchpad posted over at the TI Launchpad Google Groups. He picked up a no name $7 Digital Vernier caliper from Ebay. After figuring out how the caliper worked, by measuring varying capacitance as the slider moved, he proceeded to figure out a way to grab digital data from it. The caliper comes with a pin-out for connecting a data cable – but [M]aris decided to tap into it directly. He figured out the power, ground, data and clock lines and with a snapshot of the bit stream managed to reverse engineer the data format.
Clock is being sent out as series of 24 bit pulses and then silence. Silence (steady signal) between 24 bit bursts is about 115 msec long. Thus, we get position update about 8 times per second. Bits form integer that corresponds to number of 100th of mm in case of metric system. And 2000th of inch in case of measurements in inches. That is, if display reads 3.67mm, you get integer 367. The same reading in inches is 0.1445 and this gives us 289 (0.1445 * 2000). So, in case if caliper is switched to inches, for the same reading, it will send now 289 instead of 367.
He uses an interrupt to detect a clock edge and then clocks in 24 data bits. The first bit is stripped and the next 16 bits are stored. The code keeps a check on the 21st bit – if its negative, a 2’s complement is performed on the stored value. Once a measurement has been captured, it is sent out a soft UART port .
Since the digital caliper works at a voltage of 1.5V – [M]aris had to get the Launchpad’s 3V to interface to the caliper’s 1.5V. He solved that using a transistor and the Launchpad’s intenal pull-up resistor as shown in the schematic below.
Code and schematics can be found on his page along with a detailed writeup. Thanks for sharing, [M]aris.
Update – December 13th 2010