IR Sense 2 Click Board
IR Sense 2 Click Board
The IR Sense 2 Click Board™ is the infrared sensor Click Board™, designed to be used for short-range IR sensing applications. Unlike other pyroelectric sensors, it is able to sense environmental heat changes up to 1m, even through glass. The IR Sense 2 Click Board™ is perfectly suited for human presence detection, so it can be used in many human presence detection applications. A programmable interrupt engine simplifies the software development and saves MCU cycles, that would be otherwise wasted on polling. The ability to sense IR through the glass allows an unconstrained design of the final product.
Software Support
We provide a library for the IR Sense 2 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo application can run on all the main MikroElektronika development boards.
Library Description
The library contains basic functions for reading from, and configuring the click's registers,
as well as functions for calculation of temperature and IR data.
Key Functions
uint8_t irsense2_readReg(uint8_t registerAddress)
- generic read function.
void irsense2_writeReg(uint8_t registerAddress, uint8_t data_)
- generic read function.
float irsense2_readTemp()
- reads temperature data, and converts to Celsius degrees.
float irsense2_readIR()
- reads IR data, and converts to pA.
Example Description
The demo application is composed of three sections:
- System Initialization - Initializes logger and I2C peripheral.
- Application Initialization - Initializes click driver, and configures click settings to required values.
- Application Task (code snippet) - Reads out IR and temperature data, and prints them out via UART.
void applicationTask() { char txt[10] = {0}; float temperature; float IRdata; temperature = irsense2_readTemp(); FloatToStr(temperature, txt); mikrobus_logWrite("Temperature reading: ",_LOG_TEXT); mikrobus_logWrite(txt,_LOG_LINE); IRdata = irsense2_readIR(); FloatToStr(IRdata, txt); mikrobus_logWrite("IR reading: ",_LOG_TEXT); mikrobus_logWrite(txt,_LOG_LINE); Delay_ms( 1000 ); }
The full application code, and ready to use projects can be found on our LibStock page.
mikroE Libraries used in the example:
- UART
- Conversions
- C-String
Additional Notes and Information
Depending on the development board you are using, you may need a 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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
MIKROSDK
The IR Sense 2 Click Board™ is supported with mikroSDK - MikroElektronika 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.
IR Sense 2 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.