Adafruit MS8607 Library
Classes | Macros | Enumerations
Adafruit_MS8607.h File Reference
#include "Arduino.h"
#include <Adafruit_BusIO_Register.h>
#include <Adafruit_I2CDevice.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>

Go to the source code of this file.

Classes

class  Adafruit_MS8607_Temp
 Adafruit Unified Sensor interface for the temperature sensor component of the MS8607. More...
 
class  Adafruit_MS8607_Pressure
 Adafruit Unified Sensor interface for the pressure sensor component of the MS8607. More...
 
class  Adafruit_MS8607_Humidity
 Adafruit Unified Sensor interface for the pressure sensor component of the MS8607. More...
 
class  Adafruit_MS8607
 

Macros

#define MS8607_PT_ADDRESS   0x76
 The pressure and temperature I2C address for the sensor. More...
 
#define MS8607_HUM_ADDRESS   0x40
 The default pressure and temperature I2C address for the sensor.
 
#define HSENSOR_RESET_COMMAND   0xFE
 reset command
 
#define HSENSOR_READ_HUMIDITY_W_HOLD_COMMAND   0xE5
 read humidity w hold command
 
#define HSENSOR_READ_HUMIDITY_WO_HOLD_COMMAND   0xF5
 read humidity wo hold command
 
#define HSENSOR_READ_SERIAL_FIRST_8BYTES_COMMAND   0xFA0F
 read serial first 8bytes command
 
#define HSENSOR_READ_SERIAL_LAST_6BYTES_COMMAND   0xFCC9
 read serial last 6bytes command
 
#define HSENSOR_WRITE_USER_REG_COMMAND   0xE6
 write user reg command
 
#define HSENSOR_READ_USER_REG_COMMAND   0xE7
 read user reg command
 
#define HSENSOR_TEMPERATURE_COEFFICIENT   (float)(-0.15)
 temperature coefficient
 
#define HSENSOR_CONSTANT_A   (float)(8.1332)
 constant a
 
#define HSENSOR_CONSTANT_B   (float)(1762.39)
 constant b
 
#define HSENSOR_CONSTANT_C   (float)(235.66)
 constant c
 
#define TEMPERATURE_COEFF_MUL   (175.72)
 temperature coeff mul
 
#define TEMPERATURE_COEFF_ADD   (-46.85)
 temperature coeff add
 
#define HUMIDITY_COEFF_MUL   (125)
 humidity coeff mul
 
#define HUMIDITY_COEFF_ADD   (-6)
 humidity coeff add
 
#define HSENSOR_CONVERSION_TIME_12b   16
 conversion time 12b
 
#define HSENSOR_CONVERSION_TIME_10b   5
 conversion time 10b
 
#define HSENSOR_CONVERSION_TIME_8b   3
 conversion time 8b
 
#define HSENSOR_CONVERSION_TIME_11b   9
 conversion time 11b
 
#define HSENSOR_USER_REG_RESOLUTION_MASK   0x81
 user reg resolution mask
 
#define HSENSOR_USER_REG_END_OF_BATTERY_MASK   0x40
 user reg end of battery mask
 
#define HSENSOR_USER_REG_ENABLE_ONCHIP_HEATER_MASK   0x4
 user reg enable onchip heater mask
 
#define HSENSOR_USER_REG_DISABLE_OTP_RELOAD_MASK   0x2
 user reg disable otp reload mask
 
#define MS8607_RH_ADDRESS   (0x40)
 
#define MS8607_RH_LSB   0.0019073486328125;
 register More...
 
#define PROM_ADDRESS_READ_ADDRESS_0   0xA0
 16-bit registers through 0xAE
 
#define P_T_RESET   0x1E
 Pressure and temperature sensor reset.
 
#define CONVERT_D1_OSR_256   0x40
 Sampling rate 256.
 
#define CONVERT_D1_OSR_512   0x42
 Sampling rate 512.
 
#define CONVERT_D1_OSR_1024   0x44
 Sampling rate 1024.
 
#define CONVERT_D1_OSR_2048   0x46
 Sampling rate 2048.
 
#define CONVERT_D1_OSR_4096   0x48
 Sampling rate 4096.
 
#define CONVERT_D1_OSR_8192   0x4A
 Sampling rate 8192.
 
#define CONVERT_D2_OSR_256   0x50
 Sampling rate 256.
 
#define CONVERT_D2_OSR_512   0x52
 Sampling rate 512.
 
#define CONVERT_D2_OSR_1024   0x54
 Sampling rate 1024.
 
#define CONVERT_D2_OSR_2048   0x56
 Sampling rate 2048.
 
#define CONVERT_D2_OSR_4096   0x58
 Sampling rate 4096.
 
#define CONVERT_D2_OSR_8192   0x5A
 Sampling rate 8192.
 
#define ADC_READ   0x00
 Command to read from ADC.
 
#define HUM_RESET   0xFE
 Humidity sensor reset.
 
#define HUM_WRITE_REGISTER   0xE6
 Humidity sensor write register.
 
#define HUM_READ_REGISTER   0xE7
 Humidity sensor read register.
 
#define HUM_MEASURE_RH_HOLD   0xE5
 Humidity sensor measure relative humidity hold master.
 
#define HUM_MEASURE_RH_NO_HOLD   0xF5
 Humidity sensor measure relative humidity no hold master.
 
#define PSENSOR_RESET_COMMAND   0x1E
 Command to reset pressure sensor.
 
#define PSENSOR_START_PRESSURE_ADC_CONVERSION   0x40
 Command to start pressure ADC measurement.
 
#define PSENSOR_START_TEMPERATURE_ADC_CONVERSION   0x50
 Command to start temperature ADC measurement.
 
#define PSENSOR_READ_ADC   0x00
 Temp and pressure ADC read command.
 
#define HSENSOR_READ_HUMIDITY_W_HOLD_COMMAND   0xE5
 read humidity w hold command
 
#define HSENSOR_READ_HUMIDITY_WO_HOLD_COMMAND   0xF5
 read humidity wo hold command
 

Enumerations

enum  ms8607_pressure_resolution_t {
  MS8607_PRESSURE_RESOLUTION_OSR_256, MS8607_PRESSURE_RESOLUTION_OSR_512, MS8607_PRESSURE_RESOLUTION_OSR_1024, MS8607_PRESSURE_RESOLUTION_OSR_2048,
  MS8607_PRESSURE_RESOLUTION_OSR_4096, MS8607_PRESSURE_RESOLUTION_OSR_8192
}
 Pressure sensor resolution options. More...
 
enum  ms8607_humidity_resolution_t { MS8607_HUMIDITY_RESOLUTION_OSR_12b = 0x00, MS8607_HUMIDITY_RESOLUTION_OSR_11b = 0x81, MS8607_HUMIDITY_RESOLUTION_OSR_10b = 0x80, MS8607_HUMIDITY_RESOLUTION_OSR_8b = 0x01 }
 Options for setHumidityResolution.
 
enum  ms8607_hum_clock_stretch_t { MS8607_I2C_HOLD = 0xE5, MS8607_I2C_NO_HOLD = 0xF5 }
 Options for I2C clock stretch for humidity readings.
 

Macro Definition Documentation

◆ MS8607_PT_ADDRESS

#define MS8607_PT_ADDRESS   0x76

The pressure and temperature I2C address for the sensor.

I2C ADDRESS/BITS/SETTINGS. The MS8607 uses two different I2C addresses

◆ MS8607_RH_ADDRESS

#define MS8607_RH_ADDRESS   (0x40)

Humidity I2C address for the sensor.

◆ MS8607_RH_LSB

#define MS8607_RH_LSB   0.0019073486328125;

register

value for each count coming from the humidity

Enumeration Type Documentation

◆ ms8607_pressure_resolution_t

Pressure sensor resolution options.

Enumerator
MS8607_PRESSURE_RESOLUTION_OSR_256 

0

MS8607_PRESSURE_RESOLUTION_OSR_512 

1

MS8607_PRESSURE_RESOLUTION_OSR_1024 

2

MS8607_PRESSURE_RESOLUTION_OSR_2048 

3

MS8607_PRESSURE_RESOLUTION_OSR_4096 

4

MS8607_PRESSURE_RESOLUTION_OSR_8192 

5