Sunday, April 20, 2014

Digital Calliper Teardown and Repair

I'm waiting for some parts in the mail for my next post, and as you guessed, they haven't turned up yet.  I only had a day or two to come up with an article, so I was happy when my father came to me with his digital callipers that weren't working.  He'd left a battery in them too long and it had leaked, causing so much corrosion that one of the terminals had broken off.  He wanted to know if I could repair them.  While fixing them I thought I'd take the chance to document the tear down and find out how they work.

Callipers
Digital Callipers

As usual, getting to the insides required me to remove a sticker on the back to get at the four screws holding the case together.  What I found inside had me perplexed, there was no mechanical connection between the circuitry and the slide mechanism, I had expected something like a rack and pinion gear and some sort of rotary encoder.  The PCB had a series of tracks on it that indicated some sort of capacitive sensing but I still wasn't sure.

Calliper Parts
Calliper Parts

As I mentioned before, there are a series of parallel tracks on the PCB that indicate a capacitive sensing system.  From the vias it appears that every forth one is connected,  when you see the other side of the PCB it will become clear that every eighth track is connected.  It was still unclear how everything worked though.

PCB
Calliper PCB back

After a bit of Googling I found a description of how this type of digital calliper works.  It's from the Anyi Instrument company in China and I'm going to place a screen capture of it below in case it disappears from their site in the future.

It's simple in concept but complicated in the details.  Underneath the ruler markings is another concealed circuit board.  It's comprised of a series of conductive fingers that interact with the traces on the PCB to form a variable capacitor that changes as the two surface move over each other.  How that's converted to a measurement of length is more complicated.

Calliper explanation
Explanation of capacitive sensing system

Someone has done the hard work of probing the exciters on the main PCB for me.  This site about DROs (Digital Read-Outs) by Nick Müller is an excellent resource.  Below is an image of what was captured.  For all money it looks like a 8 phase PWM signal.  From what I can tell, by measuring how well each of these signals is capacitively coupled to the grounded frame, the ic can then use signal processing to sense its position.  It is not an absolute sensor, it's relative, this means it needs to be zeroed before each use, but can detect small amounts of motion once calibrated.  For those of you more enthusiastic, I've found a patent from the late 80's that describes the system.

Waveforms
Exciter signals

 Anyway onto fixing the thing.  Removing a few more screws freed the PCB from its enclosure.

PCB
Calliper PCB front

Removing the corrosion from the battery contact was easy with small file.  The board was then cleaned with some flux and a cotton bud and the contact re-tinned.

PCB
Corroded battery terminal

The top of the board is relatively bare.  There's a chip on board, a crystal, a battery holder, the exciter traces that connect to the tracks on the other side of the board, there is also the pad where the LCD zebra connector contacts the board.

PCB
Calliper PCB top

Conveniently there's also a port on the side that allows other devices to read the measurement data.  I didn't probe it, but it's well documented and rather easy to read.  The writer of Robocombo has done a great job of documenting the protocol.  I'll paraphase their work.  There's a ground, clock, data, and a 1.5 Volt line.  8 times a second the data is transmitted.  The measurement is transmitted as an integer that is 100 times the measurement in a 24 bit block with data being read on high to low transitions of the clock signal.  The first bit is a start bit,  the 21st bit is a sign bit, and the last three bits appear to be unused.  There is also a description of the protocol on the blog yuriystoys that indicates that the 24th bit is a flag for mm/inch mode.  In the inch mode it appears to send the data as how many 2 thousandths of an inch are in the reading.

Callipers
Calliper data port

After I reassembled the callipers I found the part of the battery holder that had snapped off.  It wasn't too hard to solder it back in place.  It was higher than the original design and wasn't as springy.  This was overcome by using a slightly thinner 1.5 Volt battery of the same diameter and a bit of folded cardboard above it to keep the battery in firm contact with the terminal below.

Battery compartment
Calliper battery compartment

There you have it, a functioning set of callipers again.

Callipers
Fixed Callipers

Wednesday, April 9, 2014

A Platform Agnostic Way To Collect Photos of an Event

My sister's wedding was on the weekend and I wanted a way to collect photos from guests.  There are a lot of ways to do this, but I wanted a way for anyone to contribute photos, no matter what platform they're on or what social network they're a part of.

I had initially settled on using Flickr because people can log on using a Facebook or Google account and pretty much everyone belongs to one of those services.  The less people had to do the better.  If they had to sign up for something they'd run for the hills.  This didn't pan out though.  Once you've logged in via Google or Facebook you still need to set up a Fickr account.  So I needed to find another idea.

Then I came across a service called dbinbox.com .  It allows people to upload files to your Dropbox account without signing up for a service.  Setup is easy.  You select a user name, decide if you want an access passphrase, link it with your dropbox account, and you're ready to go.  People can then upload files and they'll appear in the /Apps/dbinbox folder in your Dropbox account.

Sign up page
Setup dbinbox

The interface to upload files is easy to use.  You can either upload a file or send a message that will appear as a text file.  The page dynamically adjusts and changes depending on screen size.  If your on a computer, files can be dragged and dropped onto the page, but it's just as easy to use on a mobile device by selecting the files manually.

Upload page
dbinbox interface

For example I uploaded a file and sent a message in the image below.  As an improvement I'd like to see a way for people to enter their name and have that somehow associated with the files they upload.  Maybe create a subdirectory with the persons name and put the files in that folder.  That way I could know who sent what.

Another suggestion would be the interface.  Given the layout, how things work is pretty obvious to me, but some less technically oriented people think they need to press the send button at the bottom after they have selected their files.  I know this because I keep getting a few empty text files when people upload images.  Maybe this could be made clearer to users.

Edit: Christian has updated the site.  The "Send" button is now the "Send Text" button.  This should clear up any confusion.

Upload page
Using dbinbox

Because I have Dropbox running on my computer the files are automatically downloaded.  Not entirely necessary, but I don't have a lot of storage on Dropbox so I just wanted get them out of Dropbox quickly.  I know it's gilding the lily a bit but I also installed Folder Monitor to make an audible alert each time a file arrives.

Downloaded Files
Files in my dropbox folder

It's a simple process and it allows me to collect files, supplementing the photos from the photographer. So far I have about 400 images.  If I was better organised I would have used a url shortener and encoded the link in a QR code and put it on the back of the place cards.  People could have been uploading images while the event was fresh in their memory.  Overall dbinbox is a simple and easy to use service that I'd highly recommend.

My sister and I