Prototyping The Future: Building A “Star Trek” Tricorder
Michael Parks, P.E. for Mouser Electronics
Licensed under CC BY-SA 4.0
System Build Up
The Tricorder BoosterPack has been built to provide some flexibility in terms of hardware tweaks by the user. The Pmod interface and breakout headers for the LMP91000 and PGA900 will let the user test a wide variety of sensors of their choice.
In terms of software, the systems is very modular and adding additionally functionality should be quite straightforward for anyone with a basic understanding of C or C++ programming.
Expanding Functionality: How to add additional sensors to the Tricorder BoosterPack using the Pmod interface
The Peripheral Module (Pmod) interface is a specification managed by Digilent Inc. Similar in concept to the USB specification, but instead of handling high-speed data, Pmod serves as a standard, low-level interface between sensors and a microcontroller. For more information about the Pmod specification visit the Digilent website.
The Tricorder BoosterPack Pmod interface follows the Type I GPIO Interface specification provided by Digilent. This version of the Pmod interface provides access to four GPIO pins, 3.3V or 5V, and ground.
The four Pmod GPIO pins are tied to the following pins on the MSP432P401R LaunchPad:
Pmod 0: Pin 11 (P3_6)
Pmod 1: Pin 32 (P3_5)
Pmod 2: Pin 33 (P5_1)
Pmod 3: Pin 34 (P2_3)
In addition to the four GPIO pins there are pins for power and ground. The power pin can provide 3.3V or 5V depending on the position of the switch atop the Tricorder BoosterPack.
For custom built peripheral boards, the only requirement is to include 6 right angle male headers in order to plug into the Pmod host interface on the Tricorder BoosterPack.
Adding a Third Party Pmod Peripheral Device in Software
Building a Pmod peripheral board is only half the solution. The demonstration could will also have to be tweaked to incorporate the new sensor.
First increment the numSensors value to account for a new sensor:
#define numSensors 6
Next, under the “initialize sensors” portion of the code, a new entry will have to be made for the new Pmod sensor:
// Initialize sensors and data fields
tricorderSensor[HDC1000_id].sensorID ="HDC1000";
tricorderSensor[HDC1000_id].UM = "% Humidity";
tricorderSensor[HDC1000_id].sensorVal = -1;
tricorderSensor[LMT70_id].sensorID ="LMT70";
tricorderSensor[LMT70_id].UM = "Degrees F";
tricorderSensor[LMT70_id].sensorVal = -1;
tricorderSensor[OPT3001_id].sensorID ="OPT3001";
tricorderSensor[OPT3001_id].UM = "Lux";
tricorderSensor[OPT3001_id].sensorVal = -1;
tricorderSensor[MAG3110_id].sensorID ="MAG3110";
tricorderSensor[MAG3110_id].UM = "uT";
tricorderSensor[MAG3110_id].sensorVal = -1;
tricorderSensor[LMP91000_id].sensorID ="O2 Sensor";
tricorderSensor[LMP91000_id].UM = "ppm";
tricorderSensor[LMP91000_id].sensorVal = -1;
tricorderSensor[PGA900_id].sensorID ="Pressure";
tricorderSensor[PGA900_id].UM = "kPa";
tricorderSensor[PGA900_id].sensorVal = -1;
The data structure consists of the three parts:
- tricorderSensor[x].sensorID: The name of the sensor
- tricorderSensor[x].UM: The unit of measure the sensor will be reporting
- tricorderSensor[x].sensorVal: The value of the sensor’s output, default should be -1
Lastly, a library for the sensors needs to be included to handle the low level communication and control of the sensor. Refer to the “Expanding Functionality” section above for the list of the Pmod GPIO pins that will be needed for the library.
We would love to hear what you think about this project; please tell us in the comments section below.