Motion 2 Click Board
Motion 2 Click Board
the The Motion 2 Click Board™ is based on the EKMC1607112, PIR motion sensor from Panasonic Corporation that's used as a human motion detector. Also featured on Motion 2 Click Board™ is TLP241A photo relay from Toshiba that is used to provide reinforced galvanic isolation for the external signals used to drive some external high power electronic equipment when motion is detected. It's allowing up to 40V between the SSR contacts in the OFF state, and currents up to 2A while in the ON state, thanks to a very low ON-state resistance.
The Motion 2 Click Board™ is supported by a mikroSDK compliant library, which includes functions that simplify software development. This Click Board™ comes as a fully tested product, ready to be used on a system equipped with the mikroBUS™ socket.
How Does The Motion 2 Click Board™ Work?
The Motion 2 Click Board™ is using a PIR sensor that can detect changes in the amount of infrared radiation impinging upon it, which varies depending on the temperature and surface characteristics of the objects in front of the sensor. Detection performance of EKMC1607112 at ambient temperature of 25°C with temperature difference of 8°C is up to 7m and for temperature difference of 4°C it's up to 5m.
Output from PIR sensor is feed into buffer and then photo relay allowing users to directly control with galvanic isolation from sensor and MCU electronic devices such as lights, motors, gates etc. The TLP241A photo relay is able to effectively replace traditionally used mechanical relays, bringing up the full set of inherited benefits: virtually unlimited number of cycles since there are no moving parts that would wear off, no bouncing effect on the output contacts, high resistance to mechanical shock and environmental influence, low current required for the activation, constant resistance since no carbon and rust can build up on contacts, there is no sparking or electric arc forming while operated, compact size, higher isolation voltage, and so on.
When an object, such as a person, passes in front of the background, such as a wall, the temperature at that point in the sensor's field of view will rise from room temperature to body temperature, and then back again. The sensor converts the resulting change in the incoming infrared radiation into a change in the output voltage, and this triggers the detection. Objects of similar temperature but different surface characteristics may also have a different infrared emission pattern, and thus moving them with respect to the background may trigger the detector as well. In some cases, going back and forth towards the sensor (parallel movement to the axis Z), may not be detected.
Difficulty in sensing the heat source is that glass, acrylic or similar materials standing between the target and the sensor may not allow a correct transmission of infrared rays and also non-movement or quick movements of the heat source inside the detection area.
SPECIFICATIONS
Type | Motion |
Applications | Alarm systems, light switch controllers, automatic doors and similar systems where human presence needs to be detected. |
On-board modules | EKMC1607112 the PIR motion sensor |
Key Features | 32 detection zones with 90°C of horizontal and vertical detection angles |
Interface | GPIO |
Compatibility | mikroBUS |
Click board size | M (42.9 x 25.4 mm) |
Input Voltage | 3.3V or 5V |
PINOUT DIAGRAM
This table shows how the pinout of the Motion 2 Click Board™ corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes | Pin | Pin | Notes | ||||
---|---|---|---|---|---|---|---|
NC | 1 | AN | PWM | 16 | NC | ||
NC | 2 | RST | INT | 15 | INT | Interrupt | |
Enable | EN | 3 | CS | RX | 14 | NC | |
NC | 4 | SCK | TX | 13 | NC | ||
NC | 5 | MISO | SCL | 12 | NC | ||
NC | 6 | MOSI | SDA | 11 | NC | ||
Power Supply | 3.3V | 7 | 3.3V | 5V | 10 | 5V | Power Supply |
Ground | GND | 8 | GND | GND | 9 | GND | Ground |
ONBOARD SETTINGS AND INDICATORS
Label | Name | Default | Description |
---|---|---|---|
PWR | LD1 | - | Power LED Indicator |
ON | LD2 | - | Photorelay ON Indicator |
JP1 | VCC SEL | Left | Logic voltage level selection: left position 3.3V, right position 5V |
DETECTION PERFORMANCE AND ELECTRICAL CHARACTERISTICS
Detection Range | Temperature Difference | Value |
8°C | up to 7m | |
4°C | up to 5m | |
Detection Area | Detection Angle | Value |
Horizontal | 90°(±45°) | |
Vertical | 90°(±45°) | |
Detection Zones | 32 | |
Photorelay Characteristics | Maximum Voltage | Maximum Current |
40V | 2A |
Software Support
We provide a library for the Motion 2 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
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 state
Example 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; } }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- UART Library
Additional Notes and Information
Depending on the development board you are using, you may need USB UART Click Board™, USB UART 2 Click Board™ or RS232 Click Board™ 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 Motion 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.
Software Support
We provide a library for the Motion 2 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
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 state
Example 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; } }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- UART Library
Additional Notes and Information
Depending on the development board you are using, you may need USB UART Click Board™, USB UART 2 Click Board™ or RS232 Click Board™ 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 Motion 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.
Motion 2 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.