Motion detection via IBM Quickstart using PIR Sensor and IDW01M1V2 wifi sheild

Document created by HAMDI Mustapha on Nov 8, 2017Last modified by HAMDI Mustapha on Nov 8, 2017
Version 2Show Document
  • View in full screen mode

Objectif: The main goal of this lab is to be able to develop a sample application around a home automation sensor such as PIR Motion sensor. 

 

Step 1: Required Hardware 

 

NucleoF401RE board with X-Nucleo-IDW01M1V2 wifi Sheild.  

 

PIR motion sensor :

Raspberry pi GPIO pin tutorial

 

 

                                                                                                                  PIR Motion Sensor pin out

 This motion sensor consists of a fresnel lens, an infrared detector, and supporting detection circuitry. The lens on the sensor focuses any infrared radiation present around it toward the infrared detector. Our bodies generate infrared heat, and as a result, this heat is picked up by the motion sensor. The sensor outputs a 5V signal for a configurable period. 

The sensor output state as streamed on IBM Quick-start. 

 

Step 2: Developing with Ecosystem 

 

You should connect o the Arm® Mbed™ IoT Device Platform, the applications for this lab can be developed using the mbed online IDE, a free online code editor and compiler. sign in to the compiler :

https://os.mbed.com/compiler 

Create new project , configure it with your hardware : NucleoF401RE board .

 

You must include the required libraries such as : 

MQTT

MBED

X_NUCLEO_IDW01M1v2

NetworkSocketAPI

 

Create new file (main.cpp) into the project.  you can use ST online project as template, the project allows to Connect through Wifi to IBM MQTT cloud https://quickstart.internetofthings.ibmcloud.com

ST code :  

IDW01M1_Cloud_IBM - a mercurial repository | Mbed 

Otherwise, you find attached a project to complete. 

Use pin D13 as sensor digital output. 

compile your project , upload it to the nucleo. You need to get the wifi sheild MAC adress, as it is used as Object identifier with IBM quick-start platform.  Install and run a serial terminal interface (e.g.Teraterm) to visualize log messages and to get parameters such as Wi-Fi MAC adress. 

When connection to access point is established, you can take note of the MAC address of your Wi-Fi expansion board :

Step 3: Visualize data on IBM Quickstart web-page

The application will read and transmit Quickstart raw data from the PIR sensor. The Quickstart web page showing the data can be opened by approaching the device , as the output is binary (0, 5V): 


Top : PIR motion sensor with nucleo and wifi shield, Bottom: presence streamed on IBM quick-start. 

 

Attachments

Outcomes