Smart Flame Detector Application Demonstration on PIC32CM LE00 Curiosity Pro Evaluation Kit

Download

Description:

This application demonstrates detection of flame using Flame Click, and if the flame has been detected, it alerts through the Microchip Bluetooth Data (MDB App) and on the OLED Display.

Further, the flame detection data is also logged with the help of SD Card (Along RTC Timestamp). Additionally, user can reset the RTC timestamp by pressing SW0 switch.

Modules/Technology Used:

Hardware Used:

Hardware Nos. Required
PIC32CM LE00 Curiosity Pro Evaluation Kit 1
I/O1 Xplained Pro Extension Kit 1
RNBD451 Add On Board 1
OLED C CLICK 1
FLAME CLICK 1
mikroBUS Xplained Pro 2
SD Card 1

Software/Tools Used:

This project has been verified to work with the following versions of software/development tools: - Refer Project Manifest present in harmony-manifest-success.yml under the project folder firmware/src/config/pic32cm_le00_cpro

Because Microchip regularly update tools, occasionally issue(s) could be discovered while using the newer versions of the tools. If the project doesn’t seem to work and version incompatibility is suspected, It is recommended to double-check and use the same versions that the project was tested with. To download original version of MPLAB® Harmony v3 packages, refer to the document How to Use the MPLAB® Harmony v3 Project Manifest Feature

Hardware Setup:

RNBD Setup:

Follow these instructions to setup the RNBD before running the demo: - Connect the RNBD451 Add On Board as a standalone to your host microcontroller or PC, using a USB Type-C Cable. To power this standalone module, change the Power Supply Selection (J7) jumper - Open a serial terminal application (such as Tera Term) on your PC - To enter command mode, send the charaters $$$ as instruction - Set the baud rate to 9600 using SB command and the instruction is SB,03 - Enable pin UART Transparent mode and Bluetooth Status LED using SR command and the instruction is SR,0101 - Reboot the module to save the changes using R command with the instruction R,1 - Reposition the Power Supply Selection (J2) jumper to power from the host board and mount the RNBD451 Add On Board on the hardware setup

Programming hex file:

The pre-built hex file can be programmed by following the below steps: ### Steps to program the hex file: - Open MPLAB® X IDE - Close all existing projects in IDE, if any project is opened. - Go to File -> Import -> Hex/ELF File - In the “Import Image File” window, Step 1 - Create Prebuilt Project, click the”Browse” button to select the prebuilt hex file. - Select Device has “PIC32CM5164LE00100” - Ensure the proper tool is selected under “Hardware Tool” - Click on “Next” button - In the “Import Image File” window, Step 2 - Select Project Name and Folder, select appropriate project name and folder - Click on “Finish” button - In MPLAB® X IDE, click on “Make and Program Device” Button. The device gets programmed in sometime. - Follow the steps in the Running the Demo section below ## Programming/Debugging Application Project: - Open the project (pic32cm_le00_cpro_smart_smoke_detector/firmware/pic32cm_le00_cpro.X) in MPLAB® X IDE - Ensure “PIC32CM LE00 Curiosity Pro” is selected as hardware tool to program/debug the application - Build the code and program the device by clicking on the “Make and Program Device” button in MPLAB® X IDE tool bar - Once programming is complete and successful, perform a power cycle of the board. - Note: A power cycle is mandatory because only upon power-on-reset (POR), does the SPI_SCK pin which is shared between OLED and RNBD reinstates as expected. Else, the OLED may not start-up properly. - Follow the steps in Running the demo section below ## Running the Demo: - Perform Hardware Setup and Programming/Debugging Application Project steps mentioned above, if not done already. - For demonstration, the Flame Click is used to detect the flame. Shining a flashlight on the flame click sensor should be good enough to trigger it, for demo purposes. - If the flame has been detected, the Flame Labeled LED(Flame Presence LED Indicator) in the Flame Click will glow. - The OLED display shows the ADC result values of the Flame sensor periodically as shown here:

- The SD Card log the flame detection message along with the Timestamp (RTC). - To get the fire alarm detection in the mobile app, please proceed the following steps: - Install the Microchip Bluetooth Data Android App in your Android Smartphone using the MicrochipBluetoothData_Smartsmoke.apk file under the project folder Android_App. Alternatively, Click here to download it. - Enable and allow Bluetooth and location from Smartphone settings - Open the “Microchip Bluetooth Data (MBD)” android app from your smartphone and tap on “BLE UART” icon on the dashboard. If prompted, allow the application to turn on Bluetooth, as shown:


- Click on flame detector option from the list, as shown:


- Now, scan for RNBD451 Bluetooth device under the Device window and connect it. The RNBD device should appear as RNBD451_XXXX (deviceId) in the list of Bluetooth devices. After, click on it. Note, for your setup, the deviceId may vary


- Select the “Text Mode option”, as shown:


- Then, the GUI of the mobile app, displays the fire detection data, as shown:

Comments: