Science Tricorder Mark 1
The Science Tricorder Mark 1 was a wonderful adventure of discovery to develop. It's my pleasure to be able to share it with you.
The first educational discoveries with the Tricorder came only moments after completing it, and walking about the workshop to "see what can't be seen". Upon holding the Tricorder near a power adapter plugged into the wall, you could see the oscillating magnetic fields on the magnetometer visualization. There they were, slowly bouncing back and forth, right in front of you. My father had taught me how transformers work from a young age — two coils are wound together, each having a different number of windings, where an oscillating magnetic field from one coil would induce a voltage in the other coil proportional to the ratio of their number of windings. I know how transformers work — I have known since he explained it to me, I know the equation that determines the output given the input and a certain number of windings — but I had never seen it work until then, until I had this Tricorder in my hands. It grounded my knowledge of the electromagnetic phenomena at work in transformers with something that I could easily watch and see, and use to see inside /any/ transformer, right in front of me. And from that moment on, it seemed like much of the mystery of how they worked I now understood — I could think about what was going on inside them easier and more naturally, now that I had this visual grounding of the science going on inside. This is why I built the Tricorder.
More educational discoveries came quickly — from finding all the heat leaks from different building materials in my graduate student apartment in a century home, to how much humidity is exhaled in a breath. The people I gave it to play with loved it too — I fondly remember characterizing the fields emitted by enormous nuclear magnetic resonance (NMR) spectrometers with researchers in chemistry and physics at McMaster University.
Again, it is my pleasure to be able to share this with you. I'm excited for all the discoveries you can make about the world around you.
The Science Tricorder Mark 1 contains eleven different sensing modalities, organized into three main categories: atmospheric sensors, electromagnetic sensors,
and spatial sensors. These modalities and the specific sensors used on this device, as well as some approximate summary specifications, are as follows:
Atmospheric Temperature and Humidity
-40°C to +120°C, ± 0.5°C accuracy
± 0.1°C repeatability
3-axis Magnetic Field Sensor
±1100 µT range, 0.015µT resolution
up to 2000 samples/second
Atmospheric Temperature and Humidity
0 to 100% RH, ± 3% accuracy
± 0.1% repeatability
Color RGBC light-to-frequency converter
Absolute Pressure Sensor
30kPa to 120kPa, 1.5 Pa resolution
Non-contact IR Thermometer
-70°C to +380°C, 0.02°C resolution
± 0.5°C to ±4°C accuracy over range
Linear polarization filters added
<5m (50%), <8m (90%) accuracy
1 Hz update
320nm to 1050nm responsivity
Ultrasonic distance sensor
0-6m range (approx), 2.5cm resolution
Sparkfun Inertial Measurement Unit breakout (5 degrees of freedom)
±3 g Acceleration
2.1 Design Philosophy
Taking a step back, the central design considerations that I wanted for this Tricorder model were:
- Breadth: To place as many different kinds of sensors as possible into one device
- Tractability: To try and use off-the-shelf components as much as possible, to decrease development time
- Accessibility (comfort): To create a device that was small enough to be easily carried with you in a pocket or bag, and that felt natural, not awkward, to use
- Accessibility (cost): To create something that was as inexpensive as possible, so that people might easily have access to them without having to worry about the cost
- Intuitiveness: To create simple and intuitive methods of visualizing the sensor data, that a high-school student would find easy to understand.
I feel this last point is particularly important. As someone with an interdisciplinary background that includes a broad range of scientific disciplines, something that I have noticed — and wish I listened to when I was a young undergraduate — is that the most experienced professors tend to encourage students to first focus on understanding a new topic at a broad conceptual level before delving into a deeper understanding that may include a complex mathematical description of a problem. This is because a broad conceptual understanding can help serve as a scaffold to organize your knowledge, and makes it easier to fill in the blanks on particular aspects later on, as one learns. The student who jumps into learning details or memorizing equations without first having some general concept of what they're learning tends to have little knowledge to fall back upon when thinking about more general or theoretical questions, or applications to problems that they haven't specifically memorized. In this same spirit, a project goal is that one shouldn't have to have a deep knowledge of electromagnetic theory in order to use the Tricorder to visualize magnetic fields. Visualizations should be intuitive, such that a sense of curiosity and a desire to learn are the central prerequisites to guide ones use.
Breadth and tractability are somewhat interchangeable in this context. While there are an ever-increasing bunch of off-the-shelf sensors that one can purchase for a variety of different measurements today, sensing some kinds of things will inevitably require a more complicated system of sensors and components that are not yet available as a small pre-made assembly. As one example, I remember working on developing a visible range spectrometer using a linear CCD array and a diffraction grating. This spectrometer required a great deal of precise optical alignment, as well rearranging the internal bits of the Tricorder, in order to fit inside. While a visible spectrometer would be a great sensing modality to include, the investment in developing a custom spectrometer that fits inside the Tricorder Mark 1 would have been too much burden for one person to tractably implement in the time span of its development.
More broadly, encompassing all the Tricorder models and the entire Tricorder project, a general design philosophy has been to encourage myself to spend time exploring novel design ideas, with an emphasis on rapid sketching and prototyping in hardware and in code. In as much as possible, sketch out a bunch of different designs and ideas, try out the ones that look promising and see what works well, and what doesn't. The journey of designing and developing the Tricorder shouldn't end with a working Tricorder — it should also include a broad appreciation of the design issues in developing a handheld multimodal sensing device, as well as a path to explore that would allow one to continue to develop the next model of Tricorder.
2.2 Hardware Specifications
In light of the above design considerations, I arrived at a prototype design. The computational specifications of the Science Tricorder Mark 1 are as follows:
- Processor: Microchip dsPIC33FJ256MC710 ( 16-bit / 40MIPS / 30k RAM / 256K FLASH )
- Display: 2.7" Reflective TFT, 240x160 resolution, 9-bit colour depth, backlight (Sony ACX905AKM)
- Display Controller: Epson SED13752 (80k framebuffer)
- Touchpad: Cirque TSM9957
- Sensor Expansion: Programmable Gain Array (Microchip 6S26) for external analog sensors. Main sensor board and motherboard are separate, allowing for
the sensor board to be upgraded.
- SD Card socket: Standard size
- Battery: Six rechargeable AAA batteries (high current recommended)
2.3 Mechanical Design and Case
The case physically resembles a Tricorder from Star Trek (because I'm a bit of a dork), fits wonderfully in ones hand, and snuggly in ones pocket. Physically, the case is constructed out of polystyrene sheets that you can generally find in a model or hobby shop, cut to shape and glued together. The structural parts (including most of the exterior faces) are 2mm thick to give it strength, where most of the interior faces (such as the borders around the screen and touchpad, as well as the curved surfaces) are 1mm thick. There are also several thin clear acrylic windows to use for buttons or LEDs.
Each case takes a few days to put together. Generally, it takes a couple hours to cut out all the pieces, and several evenings to super glue them together and let them bond. From there, the corners and contours are filed and sanded into their final shapes, then screw holes and interior mount blocks are placed before the exterior of the case is primed and painted. Here I've just used automotive paint from the hardware store — I think in this case, Honda or Toyota Metallic Grey.
Electrically, the case has to connect the top and bottom sections — the power supply, and the motherboard — with a flat cable through a working hinge. This was probably the most difficult part of the case to design, and it took a few different tries to get something that works well while using inexpensive, stock components. The final hinge design is made from two polystyrene tubes, one that fits snuggly within another while still turning freely. The outer tube is cut into three sections and statically mounted to the case (two to the top, and one to the bottom), while the inner tube acts as a floating pin. Small slots are cut from both the static tubes and the inner pin to allow two small flat flex cables to pass from the center of the bottom section to the right side of the top, passing both the power and touchpad interface signals. The resulting hinge seamlessly hides both cables, while opening and closing with very little friction.
The Science tricorder Mark 1 was actively developed starting around April 2007 for about six months, largely over the summer of my second year in early graduate school.
Microcontroller and Display: The Tricorder Mark 1 was the most complicated electronics project I'd taken on to date, and I wanted to develop everything from scratch. On the hardware side, the microcontrollers I tend to prefer are Microchip PICs — both for the broad number of configurations they're available in, as well as the very capable MPLAB IDE that Microchip supplies. In terms of displays, while I had made hardware for some simple character-based LCDs, I hadn't yet developed hardware for a colour graphical LCD (though on the software side, I was familiar with low-level hardware graphics routines from some Gameboy Colour and Gameboy Advance development I'd experimented with before). I was actively interested in taking the next step and using a graphical LCD, and was following some newsgroups at the time. I ended up deciding on using the Sony ACX705AKM display — a 2.7" TFT display with a 240x160 resolution. The display is natively 9-bit (three bits each for red, green, and blue), but that doesn't fit neatly within a byte, so one of the lower bits was discarded on the red channel. I decided to use an Epson SED1375 display controller, which serves both as a framebuffer, as well as something to generate the vertical, horizontal, and frame synchronization signals for the display. Microchip had also recently released their new line of 16-bit Digital Signal Processing (DSP) microcontrollers, the dsPICs, and I decided to use the model with the highest RAM, computation speed, and pins — the dsPIC33FJ256MC710. A large number of pins would be needed for interfacing with the LCD controller and with a large number of sensors. A fast processor would be needed to update the graphics framebuffer with reasonable speed for any animations, and, similarly, PICs generally have very little RAM (the most at the time being 30k), and this can quickly get exhausted with any sort of array or image processing, so more is better.
Because this was new territory, much of the initial hardware and software was developed on a prototyping board and tested before designing the printed circuit board (PCB) set. Here, I used Schmartboard adapters to solder an 80-pin surface mount SED1375 QFP, a 100-pin surface mount dsPIC33FJ256MC710, and a 22-pin LCD connector for the ACX705AKM, and wired these all together using a bunch of wire wrap to prototype the critical bits of the system.
I remember believing that surface mount soldering would be difficult before actually trying it, when infact I found it easier than through-hole soldering. There are a variety of techniques that I've since used in that last five years to solder (including the popular toaster oven method), but I still often prefer just using a fine-tipped soldering iron, a bit of solder paste, and some patience. It's genuinely a lot easier than you might think, and Schmartboards are a great way to start before you start designing your own boards — though I'd still recommend using solder paste with them.
Most of the graphics routines and some sensor code was prototyped on this early system, before finally designing the schematics and layout for a motherboard, sensor board, and power board in CadSoft Eagle. I have found one of the joys of working with embedded systems (like the Gameboy Advance) is that sometimes all you're given is a pointer to video memory, and little else — you have to write a font renderer to display text, routines for basic pixel-level drawing with lines and simple shapes, and (in some systems, if you have the memory) routines to show or decompress bitmap images. Here things were even more interesting — you had to design the LCD interface itself using I/O pins and external display controllers, and make sure it all worked perfectly before you could even get to writing a single pixel. It was great fun.
Case, Power, and Touchpad: Because I'm a bit of a dork, the Tricorder is based on the popular folding-case design from the series. This allows the user to unfold the display and touchpad for use, while protecting the display and touchpad surfaces, as well as reducing its space footprint, when not in use. In general the majority of the sensing and processing components are in the main body section, while the touchpad and power supply components were placed in the lower section. I had initially hoped to be able to use much of the lower section for additional sensors that didn't require an exterior-facing output, but the power requirements ended up being such that it was easier to fill the bottom with AAA batteries, have a respectable battery life, and save having to pass more signals between the top and bottom sections for another design.
Choosing an appropriate input device took some thought. For earlier input examples I had constructed arrays of pushbuttons that looked a bit better than an off-the-shelf matrix pad, but were bulky. I decided that a touchpad offered a great input alternative. They can be used in absolute mode and mimic a set of buttons, or used in relative mode like a mouse on a window-based graphical user interface. The folks at Cirque were kind enough to send me a PS/2 touchpad to use, and it looks and works great. The design almost looks like a small touchpad-based laptop, which is fairly unique and a fun experiment. Because I implemented a fairly modest graphical interface for the prototype, I decided to make use of the touchpad in absolute mode, as if it were just a bunch of buttons at different spatial locations.
Sensors: I learned early on that "smart sensors" were the way to go. A number of different sensors were used in earlier versions that didn't make it into the final prototype, some of which include analog versions of the barometric pressure sensor, an analog non-contact IR thermopile temperature sensor, and a high-energy particle detector. Generally in each case there were difficulties with the signal-to-noise ratio of these analog sensors, and they could be easily replaced with low-noise versions that had integrated amplifiers, digital-to-analog converters, and digital interfaces. I also tried to shy away from sensors that had voltage requirements that were significantly different than logic voltage, or that were particularly bulky and would require increasing the size of the device. A bunch of interesting sensors for various kinds of gasses (such as O2 or CO2 level) fell into this category. In the end, I feel as though the Science Tricorder Mark 1 had a good and capable selection of sensors for a first prototype.
4.1 Electronics, Schematics, and Board Layout
The hardware source files are available in a single archive that includes:
- Schematics: Eagle files for the Motherboard, Sensor Board, and Power Supply Board
- Boards: Eagle board artwork for the Motherboard, Sensor Board, and Power supply Board
Eagle also allows parts lists to be exported from these source files. The hardware source is available under an open TAPR Non-Commerial License. The source files can be downloaded here, and previewed below:
4.2 Significant Parts List
The major components used in the Science Tricorder Mark 1, as well as some potential sources for less easy to find parts, are as follows:
|U3||Omron||PART###||Connector for LCD display||Digikey|
|U4||PNI||MicroMag3||3-axis Magnetometer Sensor||Sparkfun|
|U5||Maxbotics||LV-MAXSONAR-EZ1||Ultrasonic Distance Sensor||Sparkfun|
|U6||Sparkfun||IMU5DEG||5-DOF Inertial Measurement Unit||Sparkfun|
|U7||TAOS||TSLxxS||Light Intensity Sensor||Digikey/Mouser|
|U8||TAOS||TSLxxS||Light Intensity Sensor||Digikey/Mouser|
|U9||TAOS||TSLxxS||Light Intensity Sensor||Digikey/Mouser|
|U10||TAOS||TSLxxS||Light Intensity Sensor||Digikey/Mouser|
|U12||Invensense||IDG300||Optional 2-axis Gyro||Invensense|
|U13||FTI||SFW8R-4STE1LF||FFC Connector to Power Supply Board||FTI|
|U14||Lassen||iQ GPS & connector||GPS Module & SMD connector||Sparkfun|
|U15||TAOS||TSLxxS||Light Intensity Sensor||Digikey/Mouser|
|U16||TAOS||TSLxxS||Light Intensity Sensor||Digikey/Mouser|
|U18||Melexis||MLX90614||Non-contact temperature Sensor||Digikey or Future|
|U19||VTI||SCP1000||Barometric Pressure Sensor||Sparkfun|
|U20||Sensiron||SHT1xSMD||Atmospheric Temp/Humidity Sensor|
|U21||-||2x20||Connector, 0.1" pitch, female|
|U22||-||2x20||Connector, 0.1 pitch, male, right-angle|
|U23||FTI||SFW8R-4STE1LF||FFC Connector for Touchpad||FTI|
|U26||Microchip||25LC256||Optional Onboard Flash||Digikey|
|U27||Microchip||MCP6S26||Programmable analog gain array||Digikey|
|U28||Molex||WM24032CT||SD Card socket||Digikey|
|U29||-||1x3||0.1" pitch header, right-angle|
|U30||-||1x6||0.1" pitch header, right angle|
|U31||FTI||SFw8R-4STE1LF||FFC Connector for Touchpad/Power (Breakout)||FTI|
|U32||-||1x2||0.1" pitch header for GPS battery|
|U33||-||1x6||0.1" pitch header, right-angle|
|U34||-||1x8||Connector, 0.1" pitch|
|U35||-||1x2||0.1" pitch header|
|LCD1||Sony||ACX705AKM||240x160 TFT LCD Display||Electronics Goldmine|
(Please see the Eagle source files for a more complete parts list)
4.3 Source code and Firmware
The Science Tricorder Mark 1 firmware is written in Microchip C30 with project files for the MPLAB IDE. The source is divided into several sections:
- Sensors: Low-level functions to initialize each sensor, communicate with low-level sensor registers to retrieve sensor data, and parse that data into a physically-grounded measure such as degrees Celsius or microTesla.
- LCD: Low-level functions to communicate with the SED1375
- Font Renderer: Functions to render text on the screen with a preloaded array-based font
- Graphics: Basic functions for fundamental drawing (lines, circles, etc.), as well as higher-level routines to draw a Tricorder-like user interface
- Touchpad: Functions to poll the Touchpad in absolute mode, and retrieve position data
- Main Event Loop: The main event loop is a simple finite state machine that (1) polls sensor data for the currently active visualization, (2) displays that sensor data, and (3) polls the Touchpad for input that would signify a change in the visualization.
4.4 Known Errata
There are a few known errata:
- SCP1000: Have been unable to successfully communicate with this sensor. The sensor is extremely difficult to solder and very easy to damage, so it's not clear whether this is a hardware, software, or damage issue. Recommend migrating to a different barometric pressure sensor on future versions.
In addition, there are a few optional features that were never tested:
- Optional 25LC256 Flash: Untested
- Optional IDG300 2-axis Gyro: Untested
Assembly and Interior Pictures
Exterior and Operating Pictures
This project was generously sponsored in the form of commercial samples from Microchip's sampling program. I would also like to gratefully acknowledge the generosity of several folks who were more than happy to help out a graduate student building a Tricorder. First, Cirque sent along one of their wonderful touchpads, which are normally sold in large volumes to laptop makers. Texas Advanced Optical Systems contributed colour sensors, which were difficult to find from a distributor at the time. Finally, Melexis very generously sent a wonderful assortment of their MLX90614 series of non-contact temperature sensors, for which I am ever thankful.
Kevin Lam, an undergraduate thesis student in the Cognitive Science Lab at McMaster University at the same time I was beginning my PhD, donated a few hours of his time to take many of the wonderful photos of the Science Tricorder Mark 1 shown here.
I would also like to thank my Dad, who taught me how to make, create, design, build, program, and solder from a young age. I consulted him for his
advice at each stage of the project, and he is ever willing to lend a hand if I need one. He also financially contributed to the project, and very
much wants a Tricorder to play with, because it's "really cool".