We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2020-04-03
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Motion
Downloaded: 2429 times
Not followed.
License: MIT license
Motion 2 Click is a based on EKMC1607112, PIR motion sensor from Panasonic Corporation that's used as human motion detector. Also it is featured with TLP241A photorelay from Toshiba that is used to provide a reinforced galvanic isolation for the external signals used to drive some external high power electronic equipment when motion is detected.
Do you want to subscribe in order to receive notifications regarding "Motion 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Motion 2 click" changes.
Do you want to report abuse regarding "Motion 2 click".
Library Description
The library has a function to activate the motion sensor and functions to check Movement detection in the vicinity of the sensor.
Key functions:
void motion2_active ( uint8_t status )
- Functions for active motion sensorsuint8_t motion2_detect_state ( void )
- Gets detection stateExamples description
The application is composed of three sections :
void application_task ( )
{
uint8_t motion_state;
motion_state = motion2_detect_state( );
if ( ( motion_detect_flag == 0 ) &&
( motion_state == MOTION2_DETECT_OBJECT ) )
{
mikrobus_logWrite( ">>> Object is detected...", _LOG_LINE );
motion_detect_flag = 1;
Delay_ms( 500 );
}
if ( ( motion_detect_flag == 1 ) &&
( motion_state != MOTION2_DETECT_OBJECT ) )
{
mikrobus_logWrite( ">>> Sensor has stabilized..", _LOG_LINE );
mikrobus_logWrite( ">>> Ready for new detection...", _LOG_LINE );
mikrobus_logWrite( ">>> --------------------------", _LOG_LINE );
motion_detect_flag = 0;
}
}
Other mikroE Libraries used in the example:
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.