TOP Contributors

  1. MIKROE (2650 codes)
  2. Alcides Ramos (350 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 (136553 times)
  2. FAT32 Library (69756 times)
  3. Network Ethernet Library (55853 times)
  4. USB Device Library (46194 times)
  5. Network WiFi Library (41814 times)
  6. FT800 Library (41009 times)
  7. GSM click (28930 times)
  8. PID Library (26386 times)
  9. mikroSDK (26296 times)
  10. microSD click (25304 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: 2044 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

RTC click

0

Example for RTC click board in mikroBUS form factor. It is a simple demonstration how to read/write date and time from PCF8583 RTC (real-time clock). Date and time are read from the RTC every 10 milliseconds and printed on LCD. Communication with the board is done via I2C interface;

[Learn More]

POT 2 click

5

POT 2 click is a Click board with the accurate selectable reference voltage output. By utilizing a multi-turn precision potentiometer, this Click board can provide very accurate voltage output on the AN pin of the mikroBUS.

[Learn More]

Turbidity click

0

Turbidity Click is an adapter Click board™, used to interface a compatible turbidity sensor with the host MCU. This board features one 1x3 2.5mm connector suitable for connecting a TSD-10 Turbidity Sensor via an additional 3-wire cable for Turbidity Click specially made for this purpose. It allows users to upgrade their projects with a sensor that senses the cloudiness or haziness of a fluid caused by large numbers of individual particles invisible to the naked eye. This sensor also measures temperature as well as turbidity.

[Learn More]