TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136794 times)
  2. FAT32 Library (69981 times)
  3. Network Ethernet Library (55951 times)
  4. USB Device Library (46274 times)
  5. Network WiFi Library (41891 times)
  6. FT800 Library (41184 times)
  7. GSM click (28989 times)
  8. PID Library (26420 times)
  9. mikroSDK (26375 times)
  10. microSD click (25382 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

Motion 2 click

Rating:

5

Author: MIKROE

Last Updated: 2020-04-03

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Motion

Downloaded: 2071 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.

No Abuse Reported

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".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Motion 2 Click

Motion 2 Click

Native view of the Motion 2 Click board.

View full image
Motion 2 Click

Motion 2 Click

Front and back view of the Motion 2 Click board.

View full image

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 sensors
  • uint8_t motion2_detect_state ( void ) - Gets detection state

Examples description

The application is composed of three sections :

  • System Initialization - Initializes all necessary GPIO pins
  • Application Initialization - Initializes the GPIO driver and activates the motion sensor
  • Application Task - Checks if an object is detected. Prints a message about the object detection and whether the sensor has stabilized after object detection.
  • Note: The sensor needs a maximum of 30s to stabilize. See the sensor technical documentation for more information.
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:

  • UART Library

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

Oximeter 3 click

0

Oximeter 3 Click is a compact add-on board perfectly suited for measuring the blood oxygen saturation.

[Learn More]

Thermo 22 click

0

Thermo 22 Click is a compact add-on board that provides an accurate temperature measurement. This board features the TMP75C, a high-precision digital temperature sensor from Texas Instruments. The TMP75C houses an integrated digital temperature sensor with a 12-bit analog-to-digital converter (ADC), a reference circuit, and serial interface logic functions in one package. Characterized by its high accuracy (up to ±0.25°C typical) and high resolution of 0.0625°C, this temperature sensor provides temperature data to the host controller with a configurable I2C interface. This Click board™ is appropriate for thermal management and protection of various consumer, industrial, and environmental applications.

[Learn More]

Waveform click

0

Waveform Click is a precise sine/triangle/square waveform generator, capable of reproducing frequencies up to 12MHz.

[Learn More]