This application demonstrates a smart fan control system that operates in two distinct modes:
Temperature control mode and BLE control mode.
Users can switch between these modes using the touch sensor built into the Curiosity Nano board. Upon initialization, the application defaults to Temperature control mode. A single press on the touch sensor activates BLE control mode, while a subsequent press reverts the system to Temperature control mode. Furthermore, once the device is in BLE control mode, users can revert to Temperature control mode by either employing the touch sensor or issuing a BLE command.
Temperature Control Mode - Automatically controls the DC fan based on the temperature measurement from Weather Click. Both the temperature value and fan speed are displayed on e-paper display. The temperature ranges for the respective fan speed are;
BLE Control Mode - Control the DC fan based on BLE commands from Microchip Bluetooth Data (MBD) app in smartphone. Also, the user will be able to switch back to Temperature control mode. The available commands for use are;
Peripheral Modules
The MCC Harmony project graph with all the components would look like this;
This project has been verified to work with the following versions of software tools:
Refer Project Manifest present in mcc-manifest-generated-success.yml under the project folder *firmware_jh01_cnano.X*
Refer the Release Notes to know the MPLAB X IDE and MCC Plugin version. Alternatively, Click Here
Because Microchip regularly updates 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. https://ww1.microchip.com/downloads/en/DeviceDoc/How-to-Use-the-MPLAB-Harmony-v3-Project-Manifest-Feature-DS90003305.pdf)
The pre-built hex file can be programmed by following the below steps.
Temperature Control Mode:
The demo initializes working in Temperature Control Mode. Based on the temperature measurement from Weather click, the fan speed will be controlled automatically. The LED1 on the Curiosity Nano is turned ON to indicate that the application is in Temperature Control Mode
The temperature reading in degree Celsius, and the fan speed will be displayed on the e-paper display. The fan speed will be indicated as follows:
o Fan Low speed – ‘L’
o Fan High speed – ‘H’
o Fan Medium speed – ‘M’
o Fan Off – ‘OFF’
To switch to BLE Control Mode, press the touch button once. LED1 turns OFF indicating that the application has switched to BLE Control Mode.
Once the device switches to BLE Control Mode, the user can control the fan by following the steps mentioned below
Note: Users should wait for the e-paper display to stabilize before pressing the touch button
BLE Control Mode:
Enable Bluetooth and Location from Smartphone settings
Open the “Microchip Bluetooth Data” (MBD) application on your smartphone and tap on the “BLE UART” icon on the dashboard. If prompted, allow the application to turn on Bluetooth
The RNBD device should appear as RNBD451_XXXX in the list of Bluetooth devices
Once you see the ” RNBD451_XXXX ” device, click on the “CANCEL” button to cancel the device scanning
User can provide the available BLE commands for this application to control the fan as desired
In order to return to Temperature Control Mode again, user can either press the touch button again or send the BLE command ‘TEMP_MODE’. LED1 turns on again, indicating that the application has switched to Temperatue Control Mode
This application demo builds and works out of box by following the instructions above in Running the Demo section. If you need to enhance/customize this application demo, you need to use the MPLAB Code Configurator. Refer the below link to create your application using MCC Harmony.