5 years, 4 months ago.

mDot internal temperature sensor

I am having trouble reading mDot internal temperature sensor and battery level when using libmDot-mbed5 and mbed-os 5. Code works OK with mbed 2.

mbed 2

#include "mbed.h"

AnalogIn   vrefint(ADC_VREF);   // Linear voltage regulator
AnalogIn   tempint(ADC_TEMP);   // Internal temperature sensor (see user manual)
Serial pc(USBTX, USBRX); 

int main() {
    
    float temp = 0, vref = 0;
    float VDDA = 3.174;          // mDOT - VDDA (VREF+) pin voltage
    
    pc.baud(115200);
    while(1) {
        temp = (VDDA * tempint.read() - 0.76f) / 0.0025f + 25.0f;
        vref = VDDA * vrefint.read();
        pc.printf("Temp: %f, Vref: %f\r\n", temp, vref);
        wait(1);
    }
} 

Question relating to:

The MultiConnect® mDot™ offers significantly longer range and improved radio performance compared to traditional wireless solutions—resulting in greater transmission range and reduced capital expense.

UPDATE: Using mbed-os-5.2 internal sensors work as expected. The problem is with mbed-os-5.1.5. Is there a way to solve this issue for mDot?

posted by Alejandro Veiga 28 Feb 2017

1 Answer

5 years, 4 months ago.

Hi Alejandro,

So the "libmDot-mbed5" is pre-compiled at the moment and built with a specific version of mbed-os that has to be placed into your program as the same version.

If you look at the history here for the library, you can see which version of mbed OS you require for the version of "libmDot-mbed5"

https://developer.mbed.org/teams/MultiTech/code/libmDot-dev-mbed5/shortlog

Regards,

Andrea, team mbed

Accepted Answer

Changed from "libmDot-mbed5" to "libmDot-dev-mbed5" and sensors work ok with "mbed-os-5.2". Thanks!

posted by Alejandro Veiga 02 Mar 2017