-
This example use FRDM-MCXW71 and on-board FXLS8974CF accelerometer or NMH1000 magnetic switch using Hall Switch 3 click expansion board or MPL3115 pressure sensor using FRDMSTBC-P3115 expansion board to demonstrate autonomous detection of tampering/theft/abuse on device using low-power motion or magnetic wakeup feature and trasmit ALERT message via BLE wireless UART.
-
FXLS8974CF is 3-axis accelerometer targeted for application requiring low-power motion wake up. This sensor has SDCD embedded block which implements an efficient and flexible inertial event detection function to detect various inertial events like no-motion/motion detecting tamper/theft/abuse on an asset. This ultra-low power wake-up on motion can trigger host MCU to wake-up or go back to deep sleep mode when no motion detected autonomously.
The image below shows SDCD block configuration to detection No-Motion to Motion:
-
NMH1000 is an ultra-low power monolithic Hall effect magnetic field sensor that triggers an output when surrounding magnetic field is greater than the user-defined detection threshold. It can find lots of applications requiring change in magnetic field strength to wake-up and raise interrupt to wake-up host MCU/System.
-
MPL3115A2S is an compact piezoresistive absolute pressure sensor that can detect change in pressure when is greater than the user-defined detection threshold. It can find lots of applications requiring change in magnetic field strength to wake-up and raise interrupt to wake-up host MCU/System.
-
There are many applications where user would like to detect unwanted, intentional touch or damage/abuse or act of theft on their high value/secure assets at home and/or workplace environment. Target applications include:
- Smart meters tampering,
- Home security, Safebox/locker tampering
- Personal medical device abuse, personal laptop/tablets tamper/theft
- Warehouse theft detection, machine tampering,
- Door open/close detection etc.
-
This example demonstrates ease-of-enablement using NXP's FRDM-MCXW71/7x and sensors development ecosystem to accelerate prototyping for your multiple such applications.
- IoT Sensing SDK (ISSDK) v1.8 offered as middleware in MCUXpresso SDK for supported platforms
- MCUXpresso SDKv2.16.0 for FRDM-MCXW71 or newer
- MCUXpresso IDE v11.10.0
- Git v2.39.0
- NXP IoT ToolBox App - Android Store or NXP IoT ToolBox App - Apple Store
- FRDM-MCXW71/7x MCU board with on-board FXLS8974CF accelerometer
- Hall Switch 3 Click expansion board for NMH1000 magnetic switch sensor
- FRDMSTBC-P3115 expansion board for MPL3115 absolute pressure sensor.
- Personal Computer
- Mini/micro C USB cable
- Android or Apple Mobile Phone supprting BLE wireless connectivity.
- The FRDM-MCXW71 board comes with pre-flashed code in Narrow Band Unit (NBU) for the radio core.
- In case you need to reflash the NBU firmware, please follow instructions available at: Flash NBU Firmware on FRDM-MCXW71 Check NBU Incompatible Versions
- Connect a micro USB cable from connector MCU-LINK to a host computer.
- For running tamper detection using NMH1000 magnetic switch sensor, connect Hall Switch 3 click board to FRDM-MCXW71 MCU board.
- For running tamper detection using MPL3115 pressure sensor, connect FRDMSTBC-P3115 board to FRDM-MCXW71 MCU board. Make sure to connect J7 and J8 pins 1-2 on FRDM-STBC-P3115 shield board.
- Download & Install MCUXpresso IDE v11.10.0 or newer
- Download and Install MCUXpresso SDKv2.16.0 or newer for FRDM-MCXW71
- Install Git v2.39.0 (for cloning and running west commands)
- Download and Install NXP IoT ToolBox App - Android Store or NXP IoT ToolBox App - Apple Store
- Clone this repository to get the example projects:
- Change directory to cloned project folder:
cd dm-tamper-detection-using-low-power-wakeup-sensor-over-ble
- Open MCUXpresso IDE and select a directory to create your workspace.
- Install MCXUpresso SDK 2.16.0 for FRDM-MCXW71 (drag and drop SDK zip into "Installed SDK" view) into MCUXpresso IDE.
- Go to "Quickstart Panel" and click on "Import Project(s) from file system",
- Select "Project directory (unpacked)" and browse to the cloned project folder.
- Select example project ("frdmmcxw71_fxls8974_tamper_detect" or "frdmmcxw71_nmh1000_tamper_detect" or "frdmmcxw71_mpl3115_tamper_detect") that you want to open and run.
- Right click on project and select build to start building the project.
- Connect a USB-C cable between the host PC and the MCU-Link USB port on the target FRDM-MCXW71 board.
- Choose the "frdmmcxw71_fxls8974_tamper_detect" or "frdmmcxw71_nmh1000_tamper_detect" or "frdmmcxw71_mpl3115_tamper_detect" project.
- Right click on the project and select "Debug As". Select MCUXpresso IDE LinkServer (inc. CMSIS DAP) probes.
- Debugger will start downloading the program to device. MCU-LINK probes will be identified. Click “OK” to continue.
- Click on “Resume” button or press “F8” key on your keyboard to continue running the downloaded program on device.
- Click on “Terminate” button or press “CNTR + F2” to terminate the debug session.
- Disconnect the USB-C cable connected to FRDM-MCXW71 and reconnect.
- To enable your board to start its BLE advertising, press and release button SW3.
- Open the installed NXP IoT Toolbox (available from Play Store and App Store) on your mobile phone. Make sure bluetooth connection is ON.
- Inside the application, click on the Wireless UART widget. Scan should start automatically.
- When a device called NXP_WU appears, click on it. Your phone should now be connecting to the board.
- After connecting with the FRDM-MCXW71 device, the serial UART terminal will show this message:
- With no tampering/motion shown on the FRDM-MCXW71 board, the Wireless UART application on IoT ToolBox mobile app will show status as: "Your Asset is Safe"
- When you show tampering/movement on the FRDM-MCXW71, the on-board FXLS8974CF accelerometer detects the motion and wakeup.
- At that point, you will see Wireless UART app showing ALERT message as shown below:
- FRDM-MCXW71 board will also show "RED" LED status. The "RED" LED status will continously remain ON till tampering/motion detected.
- If there is no further tampering/motion detected for continous ~5 sec, the on-board FXLS8974CF accelerometer will detect no-motion and update the status message on wirless UART app. The "RED" LED status on FRDM-MCXW71 board will also go OFF.
- When you put a magnet near to the NMH1000 sensor to show tampering on the FRDM-MCXW71, NMH1000 detects change in magnetic field and wake-up.
- At that point, you will see Wireless UART app showing ALERT message as shown below:
- FRDM-MCXW71 board will also show "RED" LED status. The "RED" LED status will continously remain ON till tampering/magnetic field change detected.
- When you press/apply pressure using your index finger to the MPL3115 sensor to show tampering on the FRDM-MCXW71, MPL3115 sensor detects change in pressure and wake-up.
- At that point, you will see Wireless UART app showing ALERT message as shown below:
- FRDM-MCXW71 board will also show "RED" LED status. The "RED" LED status will continously remain ON for few seconds to show alert.
- After "RED" LED goes OFF, the Wireless UART app will show message "Your Asset is Safe".
- Reach out to NXP Sensors Community page for more support - NXP Community
- For more details on FXLS8974CF SDCD block, refer to the application note - AN12004
- Learn more about FXLS8974CF 3-axis accelerometer, refer to - FXLS8974CF DS
- Learn more about NMH1000 mangetic switch, refer to - NMH1000 DS
- Learn more about MPL3115 Pressure Sensor, refer to - MPL3115A2S DS
- Accelerate your sensors development using Sensor ToolBox, refer to - Sensors Development Ecosystem
Questions regarding the content/correctness of this example can be entered as Issues within this GitHub repository.
Version | Description / Update | Date |
---|---|---|
1.0 | Initial release on Application Code Hub | July 29th 2024 |