Tuesday, February 14, 2017

Talking Calipers 1

At a recent Sector67 monthly meeting, a member who teaches at a school for the blind and visually impaired mentioned a need for talking calipers. They are hard to find for sale and they typically cost in the realm of $250, though if you have a link to something significantly cheaper please let me know. My overall goal is to design a cheap little add-on that slots on to standard calipers that have a serial output already. This post is about the first step: a quick talking calipers proof of concept. Here's a picture of the working setup. See bottom of post for a video of the setup in action.

Here's what's in the photo. Everything came from either my collection of prototyping stuff, or from the collection of a fellow Sector member who took interest in this project.

If you add up the total cost of the items listed above, it comes out to about $85...so already cheaper than the $250 price point. (I'm aiming to get the total cost down a lot further than that though).

Here's how it all works together. The calipers are bumped up from their usual 1.5 volt voltage from the coin cell, to a 1.9 volt supply from the breadboard power supply. This makes it so that the logic level converter works with the signal from the calipers (because the minimum signal it will support is 1.8 volts, so 1.5 is too low). The signal from the calipers is easy to access; there's a port on the calipers accessible by a removable plastic cover. On the other end of the logic level converter we have the Arduino at 5 volts.

The wave shield comes with it's own example code. The calipers communication protocol has already been reversed engineering by a number of folks online; I got my code snippet from http://nut-bolt.nl/2012/reading-digital-calipers-with-an-arduino/.

The main challenge here is that the Wave shield uses all the external interrupt pins on the Arduino. I needed to use a different kind of interrupt. After a brief read through the forums and the datasheet for the Atmega328P, I decided to use the analog comparator. Comparing against some code snippets made it a fairly easy job to set all the registers I wanted to the values I needed. I used the internal bandgap reference as the positive input to the comparator and my calipers CLOCK signal as the negative input. Then I set the interrupt to trigger on rising output edges. [Noting that the positive input to the comparator, Atmega pin AIN0, refers to Arduino pin D6, and the negative input to the comparator, Atmega pin AIN7, refers to Arduino pin D7.]

The code for this project is available here.

Here's the video:

Next up I'll tackle building a prototype of a cheap and portable version.

No comments:

Post a Comment