All Projects → melexis → mlx90632-library

melexis / mlx90632-library

Licence: Apache-2.0 license
MLX90632 library for the Melexis 90632 Infra Red temperature sensor.

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects
HTML
75241 projects

Projects that are alternatives of or similar to mlx90632-library

BioBalanceDetector
Bio Balance Detector's products aim to show the weak electromagnetic fields around every living being (including plants, animals and humans) and display it in a heat-map like hyper-spectral image.
Stars: ✭ 18 (-47.06%)
Mutual labels:  sensor, driver, sensors
arduino-sht
Repository for Sensirion humidity and temperature sensor support on Arduino
Stars: ✭ 43 (+26.47%)
Mutual labels:  sensor, driver, temperature-sensor
embedded-sht
Embedded SHT Drivers for Sensirion Temperature and Humidity Sensors - Download the Zip Package from the Release Page
Stars: ✭ 53 (+55.88%)
Mutual labels:  sensor, driver, temperature-sensor
Sensors
A macOS application displaying the thermal, voltage and current sensor values.
Stars: ✭ 70 (+105.88%)
Mutual labels:  sensor, sensors
Asus Wmi Sensors
Linux HWMON (lmsensors) sensors driver for various ASUS Ryzen and Threadripper motherboards
Stars: ✭ 193 (+467.65%)
Mutual labels:  driver, sensors
Micropython Mpu9x50
Drivers for InvenSense inertial measurement units MPU9250, MPU9150, MPU6050
Stars: ✭ 146 (+329.41%)
Mutual labels:  sensor, driver
SensorsAndAi
SensorAndAi is an android application which will give you the complete information about all the sensors and some basic information about artificial intelligence.This application will tell you about the use and implementation of the sensor and artificial intelligence.This app will show you how sensor and artificial intelligence is used in any an…
Stars: ✭ 29 (-14.71%)
Mutual labels:  temperature-sensor, sensors
gspca-kinect2
Kinect2 Sensor Device Driver for Linux
Stars: ✭ 25 (-26.47%)
Mutual labels:  sensor, driver
pymetawear
Community developed SDK around the Python bindings for the C++ SDK
Stars: ✭ 42 (+23.53%)
Mutual labels:  sensor, sensors
pysensors
PySensors is a Python package for sparse sensor placement
Stars: ✭ 47 (+38.24%)
Mutual labels:  sensor, sensors
rssd
Rohde & Schwarz SCPI Driver (in Python)
Stars: ✭ 25 (-26.47%)
Mutual labels:  sensor, driver
ha-gismeteo
Gismeteo Weather Provider for Home Assistant
Stars: ✭ 84 (+147.06%)
Mutual labels:  sensor, sensors
ublox
Arduino and CMake library for communicating with uBlox GPS receivers.
Stars: ✭ 89 (+161.76%)
Mutual labels:  sensor, sensors
embedded-sps
Embedded i2c Driver for Sensirion Particulate Matter Sensors - Download the Zip Package from the Release Page
Stars: ✭ 36 (+5.88%)
Mutual labels:  sensor, driver
embedded-ccs811-rs
Platform agnostic Rust driver for the CCS811 ultra-low power digital gas sensor for monitoring indoor air quality
Stars: ✭ 12 (-64.71%)
Mutual labels:  sensor, driver
arduino-sps
Arduino library for Sensirion SPS30
Stars: ✭ 36 (+5.88%)
Mutual labels:  sensors
MetaWear-SDK-Cpp
MetaWear C++ SDK - Platform Agnostic - Main lib - No Bluetooth
Stars: ✭ 42 (+23.53%)
Mutual labels:  sensors
rust-radio-sx127x
Rust driver for the Semtech SX127x series of Sub-GHz LoRa/ISM radio transceivers
Stars: ✭ 21 (-38.24%)
Mutual labels:  driver
janitor
Availability monitoring and alerting for IOT devices
Stars: ✭ 55 (+61.76%)
Mutual labels:  sensors
homebridge-tion
Homebridge plugin to control Tion breezers
Stars: ✭ 32 (-5.88%)
Mutual labels:  sensor

Build Status Coverage Status Uncrustify Coverity Scan Documentation License CII Best Practices Contributions welcome

This is 90632 example driver with virtual i2c read/write functions. There will be some mapping needed with MCU's own i2c read/write procedures, but the core calculations should remain the same. Functions that need to be implemented for each individual MCU are listed in mlx90632_depends.h file.

Since there is one source and two header files they can be built also just as normal source files. They are dependent on mathlib and errno so appropriate flags are required. For ease of development and unit-testing Makefile was added with following targets:

# All targets can take `CC=clang` variable, otherwise default compiler is GCC. If
# you need to cross-compile just feed `CROSS_COMPILE` variable to Makefile

make libs	# builds library with single file. Include inc/ for header definitions
make doxy	# builds doxygen documentation in build/html/
make utest	# builds and runs unit test program mlx90632 (dependent on ceedling)
make all	# builds unit tests, doxygen documentation, coverage information and library
make coverage   # builds coverage information
make clean	# cleans the crap make has made
make uncrustify # style fixup of the source, header and test files

Documentation

Compiled documentation is available on melexis.github.io/mlx90632-library. Datasheet is available in Melexis documentation.

Example program flow

You can either include library directly or object file. Definitions are found in library inc/ folder and you need to point your compiler -I flag there.

After you have your environment set you need to enter below flow to your program.

/* Before include, make sure you have BITS_PER_LONG defined. This is a CPU
 * specific value which is used to generate bit masks. You can also use -D
 * to input definition to compiler via command line
 */
#include "mlx90632.h"

/* Declare and implement here functions you find in mlx90632_depends.h */

/* You can use global or local storage for EEPROM register values so declare
 * them whereever you want. Do not forget to declare ambient_new_raw,
 * ambient_old_raw, object_new_raw, object_old_raw
 */
int main(void)
{
    int32_t ret = 0; /**< Variable will store return values */
    double ambient; /**< Ambient temperature in degrees Celsius */
    double object; /**< Object temperature in degrees Celsius */

    /* Read sensor EEPROM registers needed for calcualtions */

    /* Now we read current ambient and object temperature */
    ret = mlx90632_read_temp_raw(&ambient_new_raw, &ambient_old_raw,
                                 &object_new_raw, &object_old_raw);
    if(ret < 0)
        /* Something went wrong - abort */
        return ret;

    /* Now start calculations (no more i2c accesses) */
    /* Calculate ambient temperature */
    ambient = mlx90632_calc_temp_ambient(ambient_new_raw, ambient_old_raw,
                                         P_T, P_R, P_G, P_O, Gb);

    /* Get preprocessed temperatures needed for object temperature calculation */
    double pre_ambient = mlx90632_preprocess_temp_ambient(ambient_new_raw,
                                                          ambient_old_raw, Gb);
    double pre_object = mlx90632_preprocess_temp_object(object_new_raw, object_old_raw,
                                                        ambient_new_raw, ambient_old_raw,
                                                        Ka);
    /* Calculate object temperature */
    object = mlx90632_calc_temp_object(pre_object, pre_ambient, Ea, Eb, Ga, Fa, Fb, Ha, Hb);
}

Example program flow for extended mode

You can either include library directly or object file. Definitions are found in library inc/ folder and you need to point your compiler -I flag there.

After you have your environment set you need to enter below flow to your program.

/* Before include, make sure you have BITS_PER_LONG defined. This is a CPU
 * specific value which is used to generate bit masks. You can also use -D
 * to input definition to compiler via command line
 */
#include "mlx90632.h"

/* Declare and implement here functions you find in mlx90632_depends.h */

/* You can use global or local storage for EEPROM register values so declare
 * them whereever you want. Do not forget to declare ambient_new_raw,
 * ambient_old_raw, object_new_raw, object_old_raw
 */
int main(void)
{
    int32_t ret = 0; /**< Variable will store return values */
    double ambient; /**< Ambient temperature in degrees Celsius */
    double object; /**< Object temperature in degrees Celsius */

    /* Read sensor EEPROM registers needed for calcualtions */
    
    /* You can check if the device supports extended measurement mode */
    ret = mlx90632_init();
    if(status == ERANGE)
    {
       /* Extended mode is supported */
    }
    
    /* Set MLX90632 in extended mode */
    ret = mlx90632_set_meas_type(MLX90632_MTYP_EXTENDED)
    if(ret < 0)
        /* Something went wrong - abort */
        return ret;

    /* Now we read current ambient and object temperature */
    ret = mlx90632_read_temp_raw_extended(&ambient_new_raw, &ambient_old_raw, &object_new_raw);
    if(ret < 0)
        /* Something went wrong - abort */
        return ret;

    /* Now start calculations (no more i2c accesses) */
    /* Calculate ambient temperature */
    ambient = mlx90632_calc_temp_ambient_extended(ambient_new_raw, ambient_old_raw, 
                                                  PT, PR, PG, PO, Gb);
    
    /* Get preprocessed temperatures needed for object temperature calculation */
    double pre_ambient = mlx90632_preprocess_temp_ambient_extended(ambient_new_raw,
                                                                   ambient_old_raw, Gb);
    double pre_object = mlx90632_preprocess_temp_object_extended(object_new_raw, ambient_new_raw,
                                                                 ambient_old_raw, Ka);
    
    /* Calculate object temperature assuming the reflected temperature equals ambient*/
    object = mlx90632_calc_temp_object_extended(pre_object, pre_ambient, ambient, Ea, Eb, Ga, Fa, Fb, Ha, Hb);
}

Example program flow for burst mode

You can either include library directly or object file. Definitions are found in library inc/ folder and you need to point your compiler -I flag there.

After you have your environment set you need to enter below flow to your program.

/* Before include, make sure you have BITS_PER_LONG defined. This is a CPU
 * specific value which is used to generate bit masks. You can also use -D
 * to input definition to compiler via command line
 */
#include "mlx90632.h"

/* Declare and implement here functions you find in mlx90632_depends.h */

/* You can use global or local storage for EEPROM register values so declare
 * them whereever you want. Do not forget to declare ambient_new_raw,
 * ambient_old_raw, object_new_raw, object_old_raw
 */
int main(void)
{
    int32_t ret = 0; /**< Variable will store return values */
    double ambient; /**< Ambient temperature in degrees Celsius */
    double object; /**< Object temperature in degrees Celsius */

    /* Read sensor EEPROM registers needed for calcualtions */
    
    /* Set MLX90632 in burst mode */
    ret = mlx90632_set_meas_type(MLX90632_MTYP_MEDICAL_BURST)
    if(ret < 0)
        /* Something went wrong - abort */
        return ret;

    /* Now we read current ambient and object temperature */
    ret = mlx90632_read_temp_raw_burst(&ambient_new_raw, &ambient_old_raw,
                                       &object_new_raw, &object_old_raw);
    if(ret < 0)
        /* Something went wrong - abort */
        return ret;

    /* Now start calculations (no more i2c accesses) */
    /* Calculate ambient temperature */
    ambient = mlx90632_calc_temp_ambient(ambient_new_raw, ambient_old_raw,
                                         P_T, P_R, P_G, P_O, Gb);

    /* Get preprocessed temperatures needed for object temperature calculation */
    double pre_ambient = mlx90632_preprocess_temp_ambient(ambient_new_raw,
                                                          ambient_old_raw, Gb);
    double pre_object = mlx90632_preprocess_temp_object(object_new_raw, object_old_raw,
                                                        ambient_new_raw, ambient_old_raw,
                                                        Ka);
    /* Calculate object temperature assuming the reflected temperature equals ambient*/
    object = mlx90632_calc_temp_object_reflected(pre_object, pre_ambient,ambient, Ea, Eb, Ga, Fa, Fb, Ha, Hb);
}

Example program flow for extended burst mode

You can either include library directly or object file. Definitions are found in library inc/ folder and you need to point your compiler -I flag there.

After you have your environment set you need to enter below flow to your program.

/* Before include, make sure you have BITS_PER_LONG defined. This is a CPU
 * specific value which is used to generate bit masks. You can also use -D
 * to input definition to compiler via command line
 */
#include "mlx90632.h"

/* Declare and implement here functions you find in mlx90632_depends.h */

/* You can use global or local storage for EEPROM register values so declare
 * them whereever you want. Do not forget to declare ambient_new_raw,
 * ambient_old_raw, object_new_raw, object_old_raw
 */
int main(void)
{
    int32_t ret = 0; /**< Variable will store return values */
    double ambient; /**< Ambient temperature in degrees Celsius */
    double object; /**< Object temperature in degrees Celsius */

    /* Read sensor EEPROM registers needed for calcualtions */
    
    /* You can check if the device supports extended measurement mode */
    ret = mlx90632_init();
    if(status == ERANGE)
    {
       /* Extended mode is supported */
    }
    
    /* Set MLX90632 in extended burst mode */
    ret = mlx90632_set_meas_type(MLX90632_MTYP_EXTENDED_BURST)
    if(ret < 0)
        /* Something went wrong - abort */
        return ret;

    /* Now we read current ambient and object temperature */
    ret = mlx90632_read_temp_raw_extended_burst(&ambient_new_raw, &ambient_old_raw, &object_new_raw);
    if(ret < 0)
        /* Something went wrong - abort */
        return ret;

    /* Now start calculations (no more i2c accesses) */
    /* Calculate ambient temperature */
    ambient = mlx90632_calc_temp_ambient_extended(ambient_new_raw, ambient_old_raw, 
                                                  PT, PR, PG, PO, Gb);
    
    /* Get preprocessed temperatures needed for object temperature calculation */
    double pre_ambient = mlx90632_preprocess_temp_ambient_extended(ambient_new_raw,
                                                                   ambient_old_raw, Gb);
    double pre_object = mlx90632_preprocess_temp_object_extended(object_new_raw, ambient_new_raw,
                                                                 ambient_old_raw, Ka);
    
    /* Calculate object temperature assuming the reflected temperature equals ambient*/
    object = mlx90632_calc_temp_object_extended(pre_object, pre_ambient, ambient, Ea, Eb, Ga, Fa, Fb, Ha, Hb);
}

Dependencies for library unit-testing

Because of increased functionality and code size unit test, mocking and building framework Ceedling was picked to ease and validate development. It is an established open-source framework that brings in additional dependency to ruby and rake (see .gitlab-ci file), but it allowed faster development with automatic mocking (CMock) and wider range of unit test macros (Unity). Because of it, cloning repository requires adding a --recursive flag (so git clone --recursive <url> <destination>) or initialization of submodules afterwards using git submodule update --init --recursive.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].