Title: Wearable Tracking Device for Miners

By: sunnyiut                         

Previous Blogs
01: Introduction02: The Kit
03: Review_MSP432P401R04: Review_430BOOST-SHARP96
05: Review_BOOSTXL-SENSORS06: Review_DLP7970ABP
07: Project proposal update08: TFT interfacing


Design Challenge: Safe and Sound Wearables

Blog number: 09




This blog is based on MSP432P401r and OPT3001 Light sensor interface.



Objective:project idea.jpg


The OPT3001 Light Sensor will provide the ambient light intensity measurement.


According to my project proposal I have to design a wearable device mounted on the wrist of the Miners.

This wearable device consists of several sensors to collect environmental information.


In this blog post, I'll focus on

     - the interfacing of the OPT3001 and the MSP432P401r MCU

     - display the ambient light intensity on TFT

     - send data to PC UART for graphical representation



  • Sensors Boosterpack
  • MSP432 Launchpadboostxl-sensors msp432
  • TFT Proto
  • mikroplot [UART PC GUI]



MikroC pro for ARM - from MikroElektronika



Full source code and circuit diagram can be found in LIBSTOCK.

dependencies -

    • OPT3001.c [ambient 2 click]
    • mikroplot UART.c [mplot]

libraries -

    • TFT
    • TFT def


OPT3001 [BOOSTXL-SENSORS]:boostxl-sensors msp432


TI’s OPT3001 is an ambient light sensor. It’s a single-chip lux meter with infrared rejection. That measures only the visible

part of the light spectrum (mimicking the human eye’s response to light).

The sensor comes with BOSXL-SENSORS [sensors boosterpack] and  communicates with the MSP432 Launchpad using I2C.

     - operates at 3.3v

     - can produce hardware interrupt


OPT3001 I2C address = 0x47 (ADD pin is connected to SCL) [default in booasterpack]

OPT3001 I2C address = 0x44 (ADD pin is connected to GROUND)





boostxl-sensors msp432

#define OPT3001_I2C_ADDR   0x47
// ADD pin is connected to SCL)

char tmp_data[3];

 configuring OPT3001 Ambient Light sensor
void OPT3001_Configuration(){
  tmp_data[0] = 0x01;                                                       
// Configuration register
  tmp_data[1] = 0xC6;                                                       
// Set Mode of conversion operation field as
  tmp_data[2] = 0x10;                                                       
// 11 - Continuous conversions

// Send 3 bytes (tmp_data)


 reading ambient light data from OPT3001 sensor
float Get_OPT3001_Data() {
  unsigned int DataSum;
  float Ambient_Data;

  tmp_data[0] = 0x00;                                                       
// Ambient Light Result register address

// Send byte (tmp_data[0])
// Read light data and store it in tmp_data

  DataSum = ((tmp_data[0] << 8) | tmp_data[1]);                             
// Justify Ambient values
  tmp_data[0] = tmp_data[0] >> 4;                                           
// Justify exponent data
  DataSum = DataSum << 4;                                                   
// Justify fractional results

  DataSum = DataSum >> 4;
  Ambient_Data = 0.01 * (2 << tmp_data[0]) * DataSum;                       
// Lux equation

  if (Ambient_Data >= 5000.0)                                               
// The most useful ALS range is in the 1 to 1,000 lux range

Ambient_data = 5000.0;

  //Ambient_Data  /= 10;                                                    
// Lux to percents conversion

  return Ambient_Data;                                                      
// Return ambient data



Circuit Diagram:


boostxl-sensors msp432msp342p401r tft

          MSP432P401r with OPT3001                                             TFT display connection





When tested in my room it gives a reading of about 163 LUX.

2.jpgboostxl-sensors msp432

     Initialization screen               indoor ambient light intensity


I have used "mikroplot" to graphically present the data over a time period. The MSP432 Launchpad communicates with the PC GUI through UART @ 57600 BAUD.

boostxl-sensors msp432boostxl-sensors msp432

graph maintains ~163 LUX at indoor room light                            reading falls down to ~40 LUX with a transparent plastic placed on the sensor


I have checked the response of the sensor with a smart phone flash light placed beside [horizontally] it. Reading goes up to ~2000 LUX.

boostxl-sensors msp432boostxl-sensors msp432


variation of reading while moving the light source front and back -

flactuation with flash light.jpg

That's the end of this blogpost. In my next blog, I'll interface the BME280 sensor and display the output data on TFT.