HS300x (HS3001, HS3003) is a temperature and humidity sensor IC (-40 to +125°C, 0.0 to 100.0%RH) manufactured by Renesas Electronics. This posting will provide the OSS-ECAL(Open Source Software for Electronic Components Abstraction Layer) for HS300x.
MCU interface : I2C
CAUTION:Please be sure to refer to the latest version of the Datasheet prior to actual design.
HS300x series (HS3001, HS3003)
General description
The HS300x (HS3001 and HS3003) series is a highly accurate, fully calibrated relative humidity and temperature sensor. The MEMS sensor features a proprietary sensor-level protection, ensuring high reliability and long-term stability.
Integrated calibration and temperature-compensation logic provides fully corrected RH and temperature values via a standard I2C output. No user calibration of the output data is required.
The high accuracy, fast measurement response time, and long-term stability combined with the small package size makes the HS300x series ideal for a wide number of applications ranging from portable devices to products designed for harsh environments.
The HS300x series digital sensor accurately measures relative humidity and temperature levels. The measured data is internally corrected and compensated for accurate operation over a wide range of temperature and humidity levels – user calibration is not required.
Feature
- Humidity range: 0% to 100% RH
- Humidity accuracy: ±1.5% RH, typical (HS3001, 10 to 90% RH, 25°C)
- 14-bit resolution: 0.01% RH, typical
- Independent programmable resolution settings: 8, 10, 12, 14 bits
- Fast RH response time: 1 second time constant, typical (with 1m/sec air flow), 4 seconds time constant, typical (in still air)
- Temperature sensor accuracy: ±0.2°C, typical (HS3001, -10 to +80°C)
- Low current consumption: 1.0μA average (8-bit resolution, 1.8V supply), 24.4μA average (14-bit resolution, 3.3V supply), one RH and temperature measurement per second
- Excellent stability against aging
- Highly robust protection from harsh environmental conditions and mechanical shock
- Very low power consumption
Application
- Climate control systems
- Home appliances
- Weather stations
- Industrial automation
- Medical equipment
- Automotive cabin climate control
OSS-ECAL specification
API Function
etSTS oHS300X( etCMD cmd, stHS300X_O* rlt )
The oHS300X function is an API function that executes HS300x series (HS3001 and HS3003) processing according to the command in the argument.
NOTE:
The iHS300X_CNV_TIME_TEMP_HUMI[ms] elapsed measurement is calculated from the Thread period that calls this function, so set the Thread period to THREAD_OSS_ECAL_PERIOD [ms].
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_EXE | During execution | ||
eSTS_ERR_MIN | Minimum temperature error (rlt.temperature is minimum temperature) or Minimum humidity error (rlt.humidity is minimum humidity) | ||
eSTS_ERR_MAX | Maximum temperature error (rlt.temperature is maximum temperature) or Maximum humidity error (rlt.humidity is maximum humidity) | ||
eSTS_ERR_COMMAND_CODE | Command selection error | ||
eSTS_ERR_MODE | If the following commands are performed outside of Programming Mode. eCMD_WRITE_CFG_HUMI eCMD_WRITE_CFG_TEMP eCMD_READ_ID | ||
eSTS_ERR_DATA_STALE | Data stale error | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL | ||
eSTS_ERR_HAL_I2C | HAL I2C error | ||
Parameter IN | etCMD cmd | OSS-ECAL command code | |
eCMD_READ_TEMP_HUMI | This command transitions from Sleep Mode to Command that transitions from Sleep Mode to Measurement Mode, reads the Temperature Register and Humidity Register values, converts them into Temperature and Humidity, and saves the Temperature and Humidity in rlt.temperature and rlt.humidity. 1. Write Measurement Requests (0x88) to Slave address. 2. Wait until measurement time iHS300X_CNV_TIME_TEMP_HUMI[ms] has elapsed (return value eSTS_EXE while waiting). 3. Read the Temperature Register value and Humidity Register value. 4. Convert Temperature Register reading value to Temperature. Temperature = (Temperature Register value/Temperature Gain) + Temperature Offset Value (Min, Max Limit) 5. Convert Humidity Register reading to Humidity. Humidity = Humidity Register value/Humidity Gain (Min, Max Limit) 6. Store Temperature in rlt.temperature. 7. Store Humidity in rlt.humidity. NOTE : iHS300X_CNV_TIME_TEMP_HUMI[ms] Progress measurement is calculated from the Thread cycle that calls this API function, so please set the Thread cycle to THREAD_OSS_ECAL_PERIOD[ms]. | ||
eCMD_READ_HUMI | Command to transition from Sleep Mode to Measurement Mode, read the Humidity Register value, convert it to humidity, and save the humidity in rlt.humidity. 1. Write Measurement Requests (0x88) to Slave address. 2. Wait until measurement time iHS300X_CNV_TIME_HUMI [ms] has elapsed (return value eSTS_EXE while waiting). 3. Read the value of the Humidity Register. 4. Convert Humidity Register value to Humidity. Humidity = Humidity Register value/Humidity Gain (Min, Max Limit) 5. Store Humidity in rlt.humidity. NOTE : iHS300X_CNV_TIME_HUMI[ms] Progress measurement is calculated from the Thread cycle that calls this API function, so please set the Thread cycle to THREAD_OSS_ECAL_PERIOD[ms]. | ||
eCMD_ENTER_PROG_MOD | Command to transition from Sleep Mode to Programming Mode. 1. Write Programming mode command (0xA0, 0x00, 0x00). 2. Wait 120μs inside the function. NOTE : Please execute this API function within 10ms after powering on the HS300x. | ||
eCMD_WRITE_CFG_HUMI | Command to set Humidity Sensor resolution (8bit, 10bit, 12bit, 14bit). 1. Write Humidity Sensor resolution setting command (0xA0, 0x06, 0x00 ). 2. Wait 120μs inside the function. 3. Read the value of the Humidity Register. 4. Write resolution setting value (RESOL_HUMI) to Humidity Register. NOTE : Please execute this API function during Programming Mode. After this API function ends, it takes 14ms for it to be reflected in the Register. | ||
eCMD_WRITE_CFG_TEMP | Command to set Temperature Sensor resolution (8bit, 10bit, 12bit, 14bit). 1. Write Temperature Sensor resolution setting command (0xA0, 0x11, 0x00 ). 2. Wait 120μs inside the function. 3. Reads the value of the Temperature Register. 4. Write resolution setting value (RESOL_TEMP) to Temperature Register. NOTE : Please execute this API function during Programming Mode. After this API function ends, it takes 14ms for it to be reflected in the Register. | ||
eCMD_READ_ID | Command to read Sensor ID and save it to rlt.id. 1. Write Sensor ID-Upper command (0x80, 0x1E, 0x00). 2. Wait 120μs inside the function. 3. Reads the value of Sensor ID-Upper. 4. Write Sensor ID-Lower command (0x80, 0x1F, 0x00). 5. Wait 120μs inside the function. 6. Read the value of Sensor ID-Lower. 7. Store Sensor ID in rlt.id. NOTE : Please execute this API function during Programming Mode. | ||
eCMD_EXIT_PROG_MOD | Command to transition from Programming Mode to Sleep Mode. 1. Write Sleep mode command (0x80, 0x00, 0x00). 2. Wait 120μs inside the function. | ||
Parameter OUT | stHS300X_O* rlt | Receive data from HS300X | |
float32 temperature | Temperature [°C] | ||
float32 humidity | Humidity [%RH] | ||
uint32 id | HS300x Register Sensor ID |
etSTS oHS300X_READ_TEMP_HUMI( stHS300X_O* rlt )
The oHS300X_READ_TEMP_HUMI function reads the values of the Humidity Register and Temperature Register of the HS300X, converts them to temperature and humidity, and stores the temperature and humidity in rlt.temperature and rlt. temperature and rlt. humidity.
- Write Measurement Requests (0x88) to Slave address.
- Wait until measurement time iHS300X_CNV_TIME_TEMP_HUMI[ms] has elapsed (return value eSTS_EXE while waiting).
- Read the Temperature Register value and Humidity Register value.
- Convert Temperature Register reading value to Temperature.
Temperature = (Temperature Register value/Temperature Gain) + Temperature Offset Value (Min, Max Limit) - Convert Humidity Register reading to Humidity.
Humidity = Humidity Register value/Humidity Gain (Min, Max Limit) - Store Temperature in rlt.temperature.
- Store Humidity in rlt.humidity.
NOTE :
iHS300X_CNV_TIME_TEMP_HUMI[ms] Progress measurement is calculated from the Thread cycle that calls this API function, so please set the Thread cycle to THREAD_OSS_ECAL_PERIOD[ms].
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_EXE | During execution | ||
eSTS_ERR_MIN | Minimum temperature error (rlt.temperature is minimum temperature) or Minimum humidity error (rlt.humidity is minimum humidity) | ||
eSTS_ERR_MAX | Maximum temperature error (rlt.temperature is maximum temperature) or Maximum humidity error (rlt.humidity is maximum humidity) | ||
eSTS_ERR_DATA_STALE | Data stale error | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL | ||
eSTS_ERR_HAL_I2C | HAL I2C error | ||
Parameter OUT | stHS300X_O* rlt | Receive data from HS300X | |
float32 temperature | Temperature [°C] | ||
float32 humidity | Humidity [%RH] | ||
uint32 id | HS300x Register Sensor ID (not updated) |
etSTS oHS300X_READ_HUMI( stHS300X_O* rlt )
The oHS300X_READ_HUMI function is an API function that reads the value of the Humidity Register of the HS300x series (HS3001 and HS3003), converts that value to humidity, and stores that humidity in rlt.humidity.
- Write Measurement Requests (0x88) to Slave address.
- Wait until measurement time iHS300X_CNV_TIME_HUMI[ms] has elapsed (return value eSTS_EXE while waiting).
- Read the value of the Humidity Register.
- Convert Humidity Register value to Humidity.
Humidity = Humidity Register value/Humidity Gain (Min, Max Limit) - Store Humidity in rlt.humidity.
NOTE :
iHS300X_CNV_TIME_HUMI[ms] Progress measurement is calculated from the Thread cycle that calls this API function, so please set the Thread cycle to THREAD_OSS_ECAL_PERIOD[ms].
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_EXE | During execution | ||
eSTS_ERR_MIN | Minimum humidity error (rlt.humidity is minimum humidity) | ||
eSTS_ERR_MAX | Maximum humidity error (rlt.humidity is maximum humidity) | ||
eSTS_ERR_DATA_STALE | Data stale error | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL | ||
eSTS_ERR_HAL_I2C | HAL I2C error | ||
Parameter OUT | stHS300X_O* rlt | Receive data from HS300X | |
float32 temperature | Temperature [°C] (not updated) | ||
float32 humidity | Humidity [%RH] | ||
uint32 id | HS300x Register Sensor ID (not updated) |
etSTS oHS300X_ENTER_PROG_MOD( void )
The oHS300X_ENTER_PROG_MOD function is an API function that transitions the HS300x series (HS3001 and HS3003) from Sleep Mode to Programming Mode.
- Write Programming mode command (0xA0, 0x00, 0x00).
- Wait 120μs inside the function.
NOTE :
Please execute this API function within 10ms after powering on the HS300x.
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL | ||
eSTS_ERR_HAL_I2C | HAL I2C error |
etSTS oHS300X_WRITE_CFG_HUMI( void )
The oHS300X_WRITE_CFG_HUMI function is an API function to set Humidity Sensor resolution (8bit, 10bit, 12bit, 14bit) of the HS300x series (HS3001 and HS3003).
- Write Humidity Sensor resolution setting command (0xA0, 0x06, 0x00 ).
- Wait 120μs inside the function.
- Read the value of the Humidity Register.
- Write resolution setting value (RESOL_HUMI) to Humidity Register.
NOTE :
Please execute this API function during Programming Mode.
After this API function ends, it takes 14ms for it to be reflected in the Register.
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL | ||
eSTS_ERR_HAL_I2C | HAL I2C error |
etSTS oHS300X_WRITE_CFG_TEMP( void )
The oHS300X_WRITE_CFG_TEMP function is an API function to set Temperature Sensor resolution (8bit, 10bit, 12bit, 14bit) of the HS300x series (HS3001 and HS3003).
- Write Temperature Sensor resolution setting command (0xA0, 0x11, 0x00 ).
- Wait 120μs inside the function.
- Reads the value of the Temperature Register.
- Write resolution setting value (RESOL_TEMP) to Temperature Register.
Note :
Please execute this API function during Programming Mode.
After this API function ends, it takes 14ms for it to be reflected in the Register.
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL | ||
eSTS_ERR_HAL_I2C | HAL I2C error |
etSTS oHS300X_READ_ID( stHS300X_O* rlt )
The oHS300X_READ_ID function is an API function to read Sensor ID of HS300x series (HS3001 and HS3003) and store the value in rlt.id.
- Write Sensor ID-Upper command (0x80, 0x1E, 0x00).
- Wait 120μs inside the function.
- Reads the value of Sensor ID-Upper.
- Write Sensor ID-Lower command (0x80, 0x1F, 0x00).
- Wait 120μs inside the function.
- Read the value of Sensor ID-Lower.
- Store Sensor ID in rlt.id.
Note :
Please execute this API function during Programming Mode.
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL | ||
eSTS_ERR_HAL_I2C | HAL I2C error | ||
Parameter OUT | stHS300X_O* rlt | Receive data from HS300X | |
float32 temperature | Temperature [°C] (not updated) | ||
float32 humidity | Humidity [%RH] (not updated) | ||
uint32 id | HS300x Register Sensor ID |
etSTS oHS300X_EXIT_PROG_MOD( void )
The oHS300X_ENTER_PROG_MOD function is an API function that transitions the HS300x series (HS3001 and HS3003) from Programming Mode to Sleep Mode.
- Write Sleep mode command (0x80, 0x00, 0x00).
- Wait 120μs inside the function.
Note :
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_I2C_OBJECT | I2C object selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL | ||
eSTS_ERR_HAL_I2C | HAL I2C error |
Files
Folder* | File | summary |
---|---|---|
HS300X_HALNAME_VERSION/sample | sample.c (.cpp) | Sample Application Program |
| sample.h | Sample Application Header |
HS300X_HALNAME_VERSION | oHS300X.c (.cpp) | OSS-ECAL Program for HS300X |
| oHS300X.h | OSS-ECAL Header for HS300X |
HS300X_ARDUINO.ino | Sample application programs for Arduino | |
| oss_ecal.h | OSS-ECAL Common Header (Ver 01.01.00 or later, AUTOSAR is Ver 01.01.07 or later) |
| user_setting.c (.cpp) | Const and Table of User setting |
| user_setting.h | Header of User setting |
| readme.md | Readme |
| OSS-ECAL Terms of Use.txt | OSS-ECAL Terms of Use |
* For HALNAME, please refer to HAL Support.
HAL Support List
HAL | MCU* | Development environment* | HALNAME |
---|---|---|---|
Arduino 1.8.6 | ATmega2560 ATmega328P | Mega 2560 Rev3 Arduino Pro Mini 3.3V | ARDUINO |
ARM Mbed 6.17.0 | STM32F401RE | STM32 Nucleo-64 boards | MBED |
Infineon ModusToolbox HAL Cat1 2.4.3 | CYBLE-416045-02 | CY8CPROTO-063-BLE PSoC 6 BLE Prototyping Kit | ModusToolbox |
NXP MCUXpresso SDK iMXRT1051B_1052B ksdk2_0 | MIMXRT1052DVL6A | IMXRT1050-EVKB | iMXRT1051B1052B |
Renesas SSP 2.4.0 | R7FS7G27H3A01CFC | S7G2 SK | SSP |
* MCU and development environment at the time of development. Even if the same HAL is used, different MCUs and development environments may not work together.
OSS-ECAL Download Contact
Please login before contacting us for downloads.
To register as a new user, click here.
Built-in How to
Please refer to the following to incorporate API functions into your user program.
Set temperature and humidity resolution (8bit, 10bit, 12bit, 14bit) in user_setting.h
// Resolution bit setting bit8 8U, bit10 10U, bit12 12U, bit14 14U
#define RESOL_HUMI 8U // Humidity measurement Resolution bit setting
#define RESOL_TEMP 12U // Temperature measurement
How to incorporate OSS-ECAL into user programs
How to incorporate multiple OSS-ECALs in a user program (same MCU function)
How to incorporate multiple OSS-ECALs in a user program (different MCU function)
How to incorporate multiple identical electronic components into a user program
How to reduce the impact on user programs by replacing electronic components
CAUTION
The sample version of OSS-ECAL is not intended to be used with Threads (Tasks) or interrupts of different priority. Please do not use it as in the example below.
Example: If each sensor is assigned to the same ADC group and the OSS-ECAL API is executed in processes with different priorities, correct values may not be obtained.
ADC Gr0 Ch0 Temperature sensor AD22100A 100ms cycle Thread (low priority) to take in temperature
ADC Gr0 Ch1 Pressure sensor MPX5999D Event interrupts (high priority) to take pressure