This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMP107: I am trying to build a stand-alone data logger with 32 TMP107 in daisy chain. I am unable to find the right low powered design with MCU, RTC, Memory unit.

Part Number: TMP107

I am trying to build a stand-alone (low powered) data logger with 32 TMP107 in daisy chain. I am unable to find the right low powered design with MCU, RTC, Memory unit. How do we address / initialize of the TMP107 daisy chain when connected with data logger.

I tried with Arduino, but I find it is not as simple to build stand-alone data logger circuit with TMP107 daisy chain as it need to initialize the daisy chain through a separate PC/Laptop and not through data logger circuit. Can you please support for building circuit diagram for using low powered data-logger with TMP107.

  • Dear Tejas Bhatt - 

    This application note http://www.ti.com/lit/an/sboa138a/sboa138a.pdf describes what you are wanting to do and has a schematic from which you can base your design from. That example uses MSP432P401 (see figure 7 on page 9), and i would venture to say that MSP430 devices like the MSP430F55xx family of devices would work here as well. I have also alerted other engineers who will most likely comment on this further, once they are back from holiday. 

     

  • Hello Tejas,

    What is the current consumption budget that you are looking for in the low power data logger, i.e. what is the mAh for the battery, how often you want to log the data (i.e. interval duration). This will help you/us find the right MCU for your application.

    The next phase is to identify, how many data samples you want to log, as that will help identify the need for an external non volatile memory, like SD Card, SPI based flash, USB thumb drive.

    The initialization sequence is straightforward, but that I would say is the last step as that is SW and depends on what you select in the steps above.

  • Hi Amit, I am looking for about 30 days of standalone operation on battery with a sampling time of 10 minutes with the data logger.

    MCU, RTC, Memory card reader, 2 LEDs and TMP107 (max.32) will be the power consumed.

    I look forward to use AA or AAA or other size - Li-ion battery of 2500mAhr (or 2 such batteries making it 5000mAhr). 

    Will MSP432 be suitable for the application and how could the schematic & SW be when it comes to initialization sequence.

    thanks.

  • Hello Tejas,

    The first step will be to calculate the power consumption from each of the components to see if it can meet the total mAh budget.  As an example the conversion current for every TMP107 is a max of 400 uA for 18 ms (considering the max conditions). So for 32 devices it will be 32 x 400 uA x 18 ms. The shutdown current would be 32 x 10 uA x (Interval - 18 ms). Sum them up based on the interval at which the conversions will be done. This will give you the current consumption taken out from the battery. Repeat the step for other components like MCU, memory card reader and LED's. At the end it should tell whether the battery would last that long for 30 days or not.

    Once done, the next step is to use the MSP432 (or the MCU of your choice) and connect the UART TX and RX pins to the TMP107's. after which we can talk about the software. Clearly, there are quite a few steps before you reach schematics and SW.

  • Hi Tejas,

    There shouldn't be anything stopping you from using Arduino with TMP107. When connected correctly, the TMP107 daisy chain is compatible with all UARTs including PC COM ports. The TMP107EVM uses usb-to-serial hardware and the software uses standard calls to the assigned COM port. 

    thanks,

    ren

  • 1) I am connecting the TMP107 daisy chain to the SDA port with pull-register (approx 4k ~ 10k ohms) with the program as attached. I could not get the temperature readings.

    2) I will need this port for DS3231 RTC also for data logging as Arduino has only 1 SDA port !!

    2) The TX0/RXI port is occupied with FTDI232 for programming hence unable to monitor the data if I use this port for connecting the daisy chain.

    Not sure how to go ahead !

    #define SMAARTWIRE_CALIBRATION_SEQ        0x55
    
    // TMP107 register map
    #define TMP107_REG_TEMPERATURE            0x00
    #define TMP107_REG_CONFIGURATION          0x01
    #define TMP107_REG_HIGH_LIMIT_1           0x02
    #define TMP107_REG_LOW_LIMIT_1            0x03
    #define TMP107_REG_HIGH_LIMIT_2           0x04
    #define TMP107_REG_LOW_LIMIT_2            0x05
    #define TMP107_REG_EEPROM_1               0x06
    #define TMP107_REG_EEPROM_2               0x07
    #define TMP107_REG_EEPROM_3               0x08
    #define TMP107_REG_EEPROM_4               0x09
    #define TMP107_REG_EEPROM_5               0x0A
    #define TMP107_REG_EEPROM_6               0x0B
    #define TMP107_REG_EEPROM_7               0x0C
    #define TMP107_REG_EEPROM_8               0x0D
    #define TMP107_REG_DIE_ID                 0x0F
    
    //TMP107_REG_CONFIGURATION
    #define TMP107_CONV_RATE_15_MS            0b00000000
    #define TMP107_CONV_RATE_50_MS            0b00100000
    #define TMP107_CONV_RATE_100_MS           0b01000000
    #define TMP107_CONV_RATE_250_MS           0b01100000
    #define TMP107_CONV_RATE_500_MS           0b10000000
    #define TMP107_CONV_RATE_1_S              0b10100000
    #define TMP107_CONV_RATE_4_S              0b11000000
    #define TMP107_CONV_RATE_16_S             0b11100000
    
    // TMP107 commands
    #define TMP107_CMD_ADDRESS_INIT           0x95
    #define TMP107_CMD_ADDRESS_ASSIGN         0x0D
    #define TMP107_CMD_LAST_DEVICE_POLL       0x57
    #define TMP107_CMD_GLOBAL_SOFT_RST        0x5D
    #define TMP107_CMD_GLOBAL_ALERT_CLR_1     0xB5
    #define TMP107_CMD_GLOBAL_ALERT_CLR_2     0x75
    #define TMP107_CMD_GLOBAL_READ            0b00000011
    #define TMP107_CMD_GLOBAL_WRITE           0b00000001
    #define TMP107_CMD_INDIVIDUAL_READ        0b00000010
    #define TMP107_CMD_INDIVIDUAL_WRITE       0b00000000
    #define TMP107_CMD_PTR_PADDING            0b10100000
    
    // number of sensors in daisy chain
    #define NUMBER_OF_SENSORS                 2
    
    // include the library
    #include <SmaartWire.h>
    
    // the first TMP107 is connected to Arduino pin 4
    // IMPORTANT: pull-up resistor MUST be used on the line!
    //            the recommended value is 4.1k
    //            (4.7k should be fine)
    SmaartWire tmp107(4);
    
    // array to hold sensor addresses
    byte addr[NUMBER_OF_SENSORS];
    
    // function to iniaitalize the sensor chain
    // IMPORTANT: this function MUST be run before any measurements!
    void addrInit(byte* addr) {
      // calibration phase
      tmp107.write(SMAARTWIRE_CALIBRATION_SEQ);
    
      // command phase
      tmp107.write(TMP107_CMD_ADDRESS_INIT);
      
      // address assign byte
      tmp107.write(TMP107_CMD_ADDRESS_ASSIGN);
      
      // data phase
      for(int i = 0; i < NUMBER_OF_SENSORS; i++) {
        addr[i] = (tmp107.read() & 0b11111000) >> 3;
      }
    
      // wait until address initialization is complete
      delay(1250);
    }
    
    // function the read temperature from sensor at a given address
    float getTemp(byte addr) {
      // calibration phase
      tmp107.write(SMAARTWIRE_CALIBRATION_SEQ);
    
      // command and address phase
      tmp107.write(TMP107_CMD_INDIVIDUAL_READ | (addr << 3));
    
      // register pointer phase
      tmp107.write(TMP107_REG_TEMPERATURE | TMP107_CMD_PTR_PADDING);
    
      // data phase
      byte tmpLSB = tmp107.read();
      byte tmpMSB = tmp107.read();
    
      // convert raw 14-bit number to temperature
      int raw;
      float temp;
      if(tmpMSB & 0b10000000) {
        // temperature is negative, convert it and output
        raw = ~((tmpMSB << 6) | (tmpLSB >> 2)) + 1;
        raw &= 0x3FFF;
        temp = (float)raw * -0.015625;
      } else {
        // temperature is positive, just output
        raw = (tmpMSB << 6) | (tmpLSB >> 2);
        temp = (float)raw * 0.015625;
      }
      
      return(temp);
    }
    
    // function to set measurement interval
    void setInterval(byte lastAddr, byte convRate) {
      // calibration phase
      tmp107.write(SMAARTWIRE_CALIBRATION_SEQ);
    
      // command and address phase
      tmp107.write(TMP107_CMD_GLOBAL_WRITE | (lastAddr << 3));
    
      // register pointer phase
      tmp107.write(TMP107_REG_CONFIGURATION | TMP107_CMD_PTR_PADDING);
    
      // data phase
      tmp107.write(0x00);
      tmp107.write(convRate);
    }
    
    void setup() {
      Serial.begin(9600);
      Serial.println();
    
      // initialize SmaartWire interface at 9600 baud
      tmp107.begin(9600);
    
      // initialize sensors
      Serial.println("Initializing sensors");
      addrInit(addr);
    
      // print the sensor addresses
      for(int i = 0; i < NUMBER_OF_SENSORS; i++) {
        char str[23];
        sprintf(str, "Sensor %d address: 0x%02x", i, addr[i]);
        Serial.println(str);
      }
    
      // set measurement intervals of all sensors to 100 ms
      setInterval(addr[NUMBER_OF_SENSORS - 1], TMP107_CONV_RATE_100_MS);
    }
    
    void loop() {
      // get temperature from each sensor and calculate the average
      float average = 0;
      for(int i = 0; i < NUMBER_OF_SENSORS; i++) {
        average += getTemp(addr[i]);
      }
      average /= (float)NUMBER_OF_SENSORS;
    
      // print the average temperature
      Serial.println(average);
    
      // wait before the next measurement
      delay(100);
    }

  • Hi Tejas,

    1. The TMP107 must be connected to the TX/RX pins. It cannot be used with the SDA pin. 

    2. You can't use TMP107 with SDA, so there isn't an issue here.

    3. Some Arduino boards allow the user to make use of TX/RX.

    thanks,

    ren