How does it work?
IR Sense 4 Click is based on the STHS34PF80, a low-power, high-sensitivity infrared (IR) sensor from STMicroelectronics. The sensor has a high IR sensitivity and low RMS noise, and it is factory-calibrated and temperature-compensated. The sensor itself has an integrated IR filter, has an 80-degree field of view, and operates in a wavelength of 5μm to 20μm. It measures the object’s radiation with unique TMOS technology to detect its presence or motion. When the object is inside the FoV, it is based on a matrix of floating vacuum thermal transistors connected together and acting as a single sensing element. The sensor is split into two parts, one exposed to IR radiation and the other shielded. Differential reading between the two parts is implemented to remove the effect of sensor self-heating.
IR Sense 4 Click can use a standard 2-wire I2C interface to communicate with the host MCU supporting clock frequency of up to 1MHz. It can also use a 3-wire SPI interface for the same purpose with a clock frequency of up to 10MHz. The selection can be made over the COMM SEL jumpers. The smart processing will detect or discriminate between stationary and moving objects and assert an interrupt INT pin.
This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Specifications
Type
Temperature & humidity
Applications
Can be used for the development of presence and proximity sensing applications, alarm and security systems, home automation, smart lighting, and more
On-board modules
STHS34PF80 – low-power high-sensitivity infrared (IR) sensor from STMicroelectronics
Key Features
A high-sensitivity infrared presence and motion detection sensor, it can reach up to 4m, integrated silicone IR filter, is capable of detecting stationary objects, capable of distinguishing stationary and moving objects, is factory calibrated, has low power consumption, and more
Interface
I2C,SPI
Feature
ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V
Pinout diagram
This table shows how the pinout on IR Sense 4 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
JP1-JP3 | COMM SEL | Right | Communication Interface Selection SPI/I2C: Left position SPI, Right position I2C |
IR Sense 4 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
IR Sensing Range | – | – | 4 | m |
Temperature Sensor Resolution | – | – | 16 | bit |
Full Field of View | – | 80 | – | deg |
Software Support
We provide a library for the IR Sense 4 Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for IR Sense 4 Click driver.
Key functions
-
irsense4_get_presence_data
IR Sense 4 get the presence detection data function. -
irsense4_get_motion_data
IR Sense 4 get the motion detection data function. -
irsense4_get_amb_temperature
IR Sense 4 get the ambient temperature function.
Example Description
This example demonstrates the use of theIR Sense 4 Click board™, by showing parameters for detection of the presence and motion as well as ambient temperature.
void application_task ( void )
{
static float temperature = 0.0;
static int16_t detection_data = 0;
static uint8_t status = 0;
while ( IRSENSE4_OK != irsense4_wait_new_data_ready( &irsense4 ) );
if ( IRSENSE4_OK == irsense4_get_status( &irsense4, &status ) )
{
if ( status & IRSENSE4_STATUS_DETECT_FLAG )
{
if ( ( IRSENSE4_OK == irsense4_get_presence_data( &irsense4, &detection_data ) ) &&
( status & IRSENSE4_STATUS_PRES_FLAG ) )
{
log_printf( &logger, " Presence: %d rn", detection_data );
}
if ( ( IRSENSE4_OK == irsense4_get_motion_data( &irsense4, &detection_data ) ) &&
( status & IRSENSE4_STATUS_MOT_FLAG ) )
{
log_printf( &logger, " Motion: %d rn", detection_data );
}
if ( IRSENSE4_OK == irsense4_get_amb_temperature( &irsense4, &temperature ) )
{
log_printf( &logger, " Temperature: %.2f Crn", temperature );
}
log_printf( &logger, " ------------------------rn" );
Delay_ms( 100 );
}
}
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.IRSense4
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.