8.4.1. EKMC160111X (Panasonic)

8.4.1.1. Introduction

This is a high-sensitive human detection sensor with built-in amplifier. PaPIRs is a pyroelectric infrared sensor that detect variations in infrared rays. However, it may not detect when there is lack of movement or no temperature change in the heat source. It could also detect the presence of heat sources other than a human body. Its advantages include:

  • Simplified circuitry with fully integrated circuit design
  • 1µA low current consumption with the proprietary design
  • Excellent resistance to electromagnetic noise
  • High Signal/Noise ratio to minimize false operation
  • Environment-friendliness with “Lead-free” element

8.4.1.2. Applications

  • Lighting: lamp, automatic switch, street lighting
  • Anti-crime devices: security camera, crime-prevention sensor
  • Home appliance: air conditioner, air purifier, fan heater
  • Commercial equipments: vending machine, copy machine
  • Audio and Visual devices: TV, PC, display

8.4.1.3. Resources

8.4.1.4. Platform Integration

The sensor can be enabled by defining compile-time flag PLTFRM_EKMC160111X_ENA. An example of using this sensor is illustrated in App Examples.

8.4.1.4.1. Functions

PLTFRM_sts_t EKMC160111X_init(UINT8_t devId)

Initializes the sensor interface by configuring GPIO. Currently, the device is configured for P1.0. Callback function is also associated with the device to handle events from the sensor. This function is typically called during platform initialization.

Parameters:
  • devId – Identity of the device.
Returns:

PLTFRM_STS_SUCCESS is returned on success. A non-zero value indicates a failure. One possible error is PLTFRM_STS_INV_DEV_ID.

PLTFRM_sts_t EKMC160111X_unMaskDevEvent(UINT8_t devId)

GPIO interrupt is enabled by this function. Typically this is done after processing a previous interrupt during which further interrupts are usually disabled. In the case of this motion sensor, this function is called after the sensor is debounced.

Parameters:
  • devId – Identity of the device.
Returns:

PLTFRM_STS_SUCCESS is returned on success. A non-zero value indicates a failure. One possible error is PLTFRM_STS_INV_DEV_ID.

PLTFRM_sts_t EKMC160111X_maskDevEvent(UINT8_t devId)

Disable GPIO interrupt. Typically this is called just after an interrupt is received so that it can be processed.

Parameters:
  • devId – Identity of the device.
Returns:

PLTFRM_STS_SUCCESS is returned on success. A non-zero value indicates a failure. One possible error is PLTFRM_STS_INV_DEV_ID.

PLTFRM_sts_t EKMC160111X_checkPendingEvt(UINT8_t devId, UINT8_t *evtFlag_p)

Microcontroller is woken up by the interrupt from the PIR sensor. On an RFD, this function is typically called after waking up. If there is a pending event, the flag is cleared within the device context. The flag is originally set within the interrupt callback function EKMC160111X_intCbFunc(), which is called when the microcontroller is woken up.

Parameters:
  • devId – Identity of the device.
  • evtFlag_p – Points to location where event flag value is returned. Value 0 indicates no pending event. Value 1 indicates a pending event.
Returns:

PLTFRM_STS_SUCCESS is returned on success. A non-zero value indicates a failure. One possible error is PLTFRM_STS_INV_DEV_ID.

PLTFRM_sts_t EKMC160111X_powerDevUp(UINT8_t devId)

This is currently not implemented. Implement this if sensor is powered through a load switch.

Parameters:
  • devId – Identity of the device.
Returns:

Currently returns PLTFRM_STS_FEATURE_NOT_ENA.

PLTFRM_sts_t EKMC160111X_powerDevDown(UINT8_t devId)

This is currently not implemented. Implement this if sensor is powered through a load switch.

Parameters:
  • devId – Identity of the device.
Returns:

Currently returns PLTFRM_STS_FEATURE_NOT_ENA.

8.4.1.4.2. Macros

#define EKMC160111X_DFLT_DEBOUNCE_TIME  3

8.4.1.4.3. Type Definitions

typedef struct
{
   UINT8_t devId;
   PLTFRM_gpioPortId_t portId;
   PLTFRM_gpioPortPin_t portPinNr;
   UINT8_t evtPending;
#ifdef EKMC160111X_STATS_ENA
   UINT16_t evtCnt;
#endif
} EKMC160111X_cntxt_s;