Prototyping The Future: Building A “Star Trek” Tricorder
Michael Parks, P.E. for Mouser Electronics
Licensed under CC BY-SA 4.0
Overview
MSP430 vs MSP432
The new MSP432-based LaunchPad is the core of our project, specifically with the new MSP-EXP432P401R processor. These new LaunchPads pack quite the computing punch, perfect for our Tricorder project. Some highlights include:
- 48MHz 32-bit ARM Cortex M4F with Floating Point Unit and DSP acceleration
- Analog: 24Ch 14-bit differential 1MSPS SAR ADC, Two Comparators
- Memory: 256KB Flash, 64KB RAM
- Timers: 4 x16-bit, and 2 x 32-bit
- Communication: Up to 4 I2C, 8 SPI, 4 UART
- 40 pin BoosterPack Connector, and support for legacy 20 pin BoosterPacks
It should be noted that while the new 40-pin BoosterPack connector can support the new legacy 20-pin connectors physically, that some functionality has been moved around. As always, download and read the user guides before using a new board or BoosterPack. For example, I originally intended to use the two capacitive touch buttons on the Sharp96 display BoosterPack as the buttons for the user interface (UI). While the Sharp96 (which was originally built for older MSP430-based LaunchPads) will physically plug into the new MSP432 LaunchPad, two pins used by the Sharp96 for the left capacitive button are now the hardware I2C pins on the MSP432P401R. Please note, the Tricorder BoosterPack will only support the newer 40-pin based connectors.
While there are some compatibility issues, these can be easily corrected with revisions to a BoosterPack design. This small inconvenience is more than made up for by the ability to utilize drop-dead easy multitasking (MT). The Energia IDE, which will be using to code the software for the Tricorder, has been updated to allow newer MSP432 microcontrollers to leverage the TI-RTOS to allow for the creation of multiple “parallel” tasks by simply creating a different .ino file for each task. We put “parallel” in quotes because there are no multiple cores running truly in parallel; rather, we are relying on the TI-RTOS and Energia to give us the results that we would expect as if we were running multiple hardware processing cores. In short, it makes running multiple concurrent tasks much, much easier. Inter-process communication is achieved through the use of global variables.
The HDC1000 Digital Humidity Sensor
The first sensor we’ve included is the HDC1000, which can detect humidity levels. It comes in a tiny 2.1mm x 1.6mm, 8-bump DSBGA package. It operates on 3V to 5V and relies on an I2C interface to the microcontroller. The HDC1000 offers a 14-bit measurement resolution and a relative humidity accuracy of ±3%.
The I2C address is 0x40 be default. After startup the HDC1000 requires 15ms before it can begin to report humidity readings. Humidity measurements can be found in the 16-bit 0x01 register. All data bytes are transmitted MSB first. The humidity measurement itself is 14-bits, with the two lowest significant bits of the humidity register being reserved and always set to 0.
To calculate the relative humidity (%), you can apply the following formula:
Figure 2: The HDC1000: shown is a typical application wiring diagram from the HDC1000 data sheet. The HDC1000 is a digital RH&T sensor with excellent measurement accuracy at very low power, with a 200 nA sleep mode current. No worries; the HDC1000 are factory calibrated.
The LMT70 Precision Analog Temperature Sensor
We’re demonstrating two devices with temperature sensing capabilities on the Tricorder: the above HDC1000, and this LMT70, for a couple of reasons. In general, analog temperature sensors are a bit cheaper than digital temperature sensors, and if you have an application that is low on digital inputs, it’s always good to know how to use an analog input if that’s all you have left to work with. The other major difference is that a digital signal operates using discrete signals or steps, which makes it less susceptible to noise than analog signals. Analog design in general is more complicated, as well. For most applications, however, a digital sensor is going to provide the same information as an analog signal. The Tricorder has both so you have the opportunity to evaluate both. For some designs, footprint and/or cost is paramount, and so tradeoffs can sway choices either way. If you can think of another reason why one might want to use analog over digital (besides the application requiring it, like in many RF designs) please tell us in the comments section.
The LMT70 precision analog temperature sensor comes in a 0.88mm x 0.88mm DSBGA - WLCSP package. The LMT70 provides an analog output that has an accuracy of ±0.36°C over an operating range of −55°C to 150°C. The supply voltage can range from 2.0V to 5.5V with a typical current draw of a mere 9.2 µA, and 12 µA maximum.
Figure 3: There are just four pins on the LMT70: GND is ground reference for the device, VDD is supply voltage, TAO is the temperature analog output pin, and T_ON is active high input. If T_ON=0, then the TAO pin output is open. If T_ON=1, then the TAO pin is connected to the temperature output voltage. For more information see the Texas instruments data sheet for the LMT70.
Unlike the HDC1000, the LMT70 temperature sensor does not use the I2C protocol. Instead, it relies on two microcontroller pins; one GPIO pin and one analog input pin. One connects to the T_ON pin of the LMT70. When T_ON is driven high, it enables a temperature-varying analog output voltage on the pin TAO. The LMT70 requires 0.6ms from the time power is applied before the final voltage on TAO is achieved. Similarly, the TAO requires 30µs to stabilize after T_ON is driven high.
To calculate the temperature value, the following equation can be used if the expected temperature range is -10C and 110C:
TM = a(VTAO)3 + b(VTAO)2 + c(VTAO) + d
where:
a = -1.809628E-09
b = -3.325395E-06
c = -1.814103E-01
d = 2.055894E+02
VTAO is measured in mV. TM is measured in degrees Celsius.
To convert to Fahrenheit use the formula TF = [(9/5) * TM] + 32.
The OPT3001 Ambient Light Sensor
For the ability to detect ambient light intensity, we’ve included the OPT3001 optical sensor, which measures the intensity of visible light as visible to the human eye. The OPT3001 is a single-chip lux meter which can mimic the human eye’s reaction in measuring the intensity of light; and it outputs a signal proportional to the amount of visible light incident upon the Sensor. No external components are required for the OPT3001 to operate, however a filtering capacitor is included across the Vcc and ground pin.
Both the inputs and outputs of the OPT3001 communicate over the I2C bus. The address of the sensor is set at 0x44, and all data bytes are transmitted most-significant bits first. The OPT3001 can be configured to run in an automatic mode, where it always selects the optimal full-scale range settings for the given ambient lighting conditions. The OPT3001 can be configured to operate continuously or in a power-sipping, single-shot measurement mode. The result register is 0x00 and the configuration register 0x01; both are 16-bits wide. The result register contains a 4-bit exponent ( RR[15:12] ) and 12-bit mantissa ( RR[11:0] ).
To translate the contents of the results register into a lux value, use the following equation:
lux = 0.01 * (2RR[15:12]) * RR[11:0]
The OPT3001 can be placed into automatic full-scale-range setting mode by setting the configuration register range number field (RN[3:0]) to 1100b. The first measurement that the OPT3001 takes when placed in the auto-range mode is a brief assessment measurement used to determine the appropriate full-scale range. After the calibration is complete, the OPT3001 takes its first actual measurement. As a way to help visualize the lux unit of measure, remember that 1 lux is the equivalent to the amount of light received 3 feet from a single candle.
Figure 4: Pin-out of the OPT3001 on the left, with a peek under the package cover of the OPT3001. Source: OPT3001 datasheet and TI product page.
The MAG3110 Magnetometer
What would a Tricorder be without a magnetic field sensor? After all, the earth’s magnetic field (the magnetosphere) is what shields us from solar radiation and enables our atmosphere to remain intact over the long term. The magnetosphere is also what makes compasses and this magnetometer work.
Figure 5: "A magnetosphere is that area of space, around a planet, that is controlled by the planet's magnetic field. The shape of the Earth's magnetosphere is the direct result of being blasted by solar wind, compressed on its sunward side and elongated on the night-side, the magnetotail." – nasa.gov/mission_pages/sunearth/multimedia/magnetosphere2_prt.htm. Credits: NASA.gov
With the addition of the Freescale MAG3110, the Tricorder gains the ability to detect magnetic fields. The MAG3110 is a three-axis magnetometer in a tiny 2mm x 2mm form factor. Magnetometers are often used as embedded digital compasses in many products. The full scale range of the magnetometer is ±1000μT, with a sensitivity of 0.10μT/LSB.
The I2C address of the MAG3110 is 0x0E. The magnetic field along each axis is measured as a 16-bit number, which in turn is split into a high and low register of 8-bits each. Therefore to measure each axis, you most poll a total of 6 registers as follows:
X-axis MSB (OUT_X_MSB): 0x01
X-axis LSB (OUT_X_LSB): 0x02
Y-axis MSB (OUT_Y_MSB): 0x03
Y-axis LSB (OUT_Y_LSB): 0x04
Z-axis MSB (OUT_Z_MSB): 0x05
Z-axis LSB (OUT_Z_LSB): 0x06
To cut down on power consumption, the Tricorder will rely on the triggered measurement mode of operation. Per the MAG3110 datasheet/user guide, a measurement is taken as follows:
1. Enable automatic magnetic sensor resets by setting bit AUTO_MRST_EN in CTRL_REG2. (CTRL_REG2 = 0x80)
2. Initiate a triggered measurement by writing 0b00011010 to CTRL_REG1 (CTRL_REG1 = 0b00011010).
3. MAG3110 will acquire the triggered measurement and go back into STANDBY mode. It is possible at this point to sync on INT1 or resort to polling of DR_STATUS register to read the acquired data out of MAG3110.
The MAG3110 can take a new reading every 12.5ms.
The LMP91000 Electrochemical Sensor Interface
The LMP91000 is not a sensor itself, but rather it’s an integrated circuit that allows a microcontroller to easily interface with electrochemical sensors such as the Alphasense O2-A1 oxygen sensor. Electrochemical gas sensors work by oxidizing a target gas at an electrode and producing a corresponding electrical current. The LMP91000 then measures this resulting current and produces a corresponding output voltage that can be read directly by a microcontroller’s ADC pin.
A key advantage of technology used electrochemical sensors is the output current is linearly proportional to the gas concentration. However electrochemical sensors are tailored for specific gases, thus requiring different sensors for different gases.
The LMP91000 supports both 3-lead amperometric sensors and 2-lead galvanic cell gas sensors. The three leads used in electrochemical sensors (Counter, Worker and Reference) has been broken out to a set of header pin for the developer to interface whichever sensor they choose. Configuring the gain of the LMP91000 is done over the I2C bus, the device’s address is 0x90. In addition, the MENB pin needs to be held low during the whole I2C communication.
Figure 6: LMP91000 works with a gas sensor, in this case we used the Alphasense oxygen sensor. Once we measure oxygen in sufficient quantities in an alien atmosphere, we can take off space helmets and boldly go where no one has gone before...
The PGA900 Programmable Resistive Sensing Conditioner
Similar to the LMP91000, the PGA900 itself is not sensor. It serves as an interface for resistive bridge sensors such as a Honeywell NBP pressure sensor. Resistive bridge sensors trace their beginnings to Wheatstone bridge circuits which we used to make highly accurate resistance measurements without the need for accurate voltage sources. The PGA900 onboard the Tricorder BoosterPack has been configured to interface with a Honeywell NBP pressure sensor with voltage output. The internal configuration of the NBP pressure sensor is a resistive bridge in which the resistance of one of the branches varies with pressure. Fluctuations in pressure will result in changes in the voltage measured across the LMP91000 pins VINPP and VINPN. The two RC low pass filters (tuned for 106 Hz cutoff) should be placed in between the output of the pressure sensor and the VINPP and VINPN leads.

Figure 7: The Honeywell NBP Series Board Mount Pressure Sensors are uncompensated, unamplified sensors that measure absolute and gauge pressures. They are intended for use with noncorrosive, non-ionic gases.
For the Tricorder BoosterPack the CSN pin has been grounded, setting it to a Logic 0. Thus the device’s I2C memory page addresses are 0x40:0x47, the complete listing is as follows:
| Slave Address when CSN = 0 |
PGA900 Memory Page |
| 0x40 |
Test registers |
| 0x41 |
Data RAM |
| 0x42 |
Control and status registers, di_page_address = 0x02 |
| 0x43 |
Development RAM |
| 0x44 |
OTP |
| 0x45 |
EEPROM cache/cells |
| 0x46 |
Reserved |
| 0x47 |
Control and status registers, DI_PAGE_ADDRESS = 0x07 |
The PGA900 has a 14-bit digital-to-analog converter (DAC) that will produce a ratiometric output voltage with respect to the VDD supply. Ratiometric mode is achieved by setting the DAC_RATIOMETRIC bit in DAC_CONFIG. For the Tricorder BoosterPack the DAC gain amplifier will be configured to operate in voltage amplification mode. Though the PGA900 is capable of operating in current amplification mode for 4- to 20-mA applications.
The DAC gain can be configured for a specific gain value by setting the DAC_GAIN bits in DAC_CONFIG register. The final stage of DAC gain is connected to supply voltage and ground which gives the PGA900 ability to drive VOUT voltage close to VDD voltage which can be fed into an ADC pin on the MSP432.
The Sharp® LCD BoosterPack for the LaunchPad
The Sharp96 LCD display was selected since it comes in a ready-to-use BoosterPack and offers very good low power performance. The Sharp96 is based on an LCD technology called Silver Metallic Polymer Network Liquid Crystal (PNLC). It is 1.35-inch display offering 96 x 96 pixels that can be controlled over the SPI bus. With typical power use of only 10 µW, the display is still visible in a low light setting (0.5 lux, by comparison a typical evening twilight is about 10 lux) without the need for a backlight. In addition, with a 50% reflectance the display will be nice and sharp outdoors as well.
Figure 8: The 430BOOST-SHARP96 Sharp LCD BoosterPack is the display used for the Tricorder. It is 1.35-inch display offering 96 x 96 pixels that can be controlled over the SPI bus.
The Sharp96 LCD display will be our primary interface with the Tricorder BoosterPack. It will be displaying all the readings that our sensors are pulling in by measuring the environment.
We would love to hear what you think about this project; please tell us in the comments section below.