I was recently approached by Seeed Studio to try out their new nRF52840 powered XIAO BLE board and make a project with it, so I agreed.
The board is quite powerful and has a lot of features, but what stood out for me was its support for Bluetooth Low Energy communication so I decided to make a project that utilizes it by combining it with a complimentary Android application that serves as a UI for the project. The XIAO BLE board can be programmed in multiple ways, but I opted for using the Arduino IDE as that is most familiar to me.
The project uses the XIAO BLE board, a DHT22 temperature and humidity sensor, a relay, and an SPDT switch to act as a manual override for the activation of the thermostat if you are around, but don't have the phone in your hands. You can check out the demo and the full project explanation in the video below or in the project Instructable.
The mobile application for controlling the thermostat is made using the MIT App Inventor software, where you can build Android and iOS applications directly in the browser. The software has two major parts, the designer and the blocks editor where all the code is created using a visual editor. This was my first time using this platform and it was relatively easy to figure stuff out.
Since the XIAO nRF52840 board has the ability to charge a lithium battery and use it as a backup power source, the project can be extended in many ways so that is also powered during a power outage. Additionally, the software on both the thermostat and the mobile app can be extended so that it adds a lot more features like schedules, automatic on/off cycles, triggers based on temperatures, anti-frost mode, and a lot more so it becomes a versatile DIY thermostat option for people to use in their home automation setups.
If this sounds interesting to you and you want to contribute to it, feel free to fork out the GitHub repository and create a pull request for some of the features. I will be more than happy to review it!
Additionally, if you want to try out the project on your own, the Arduino code, as well as the App Inventor .aia file can be also downloaded from the GitHub repository.
Tools and materials used in the project:
- XIAO BLE nRF52840 - https://s.click.aliexpress.com/e/_DkcvU6B
- 5V Single Channel Relay - https://s.click.aliexpress.com/e/_DBClgLv
- Mini SPDT Switch - https://s.click.aliexpress.com/e/_DCf9Wy3
- DHT22 Temperature & Humidity Sensor - https://s.click.aliexpress.com/e/_DkKeupl
- Mini breadboards - https://s.click.aliexpress.com/e/_De573zh
- Mini breadboard jumpers - https://www.tindie.com/products/taste_the_code/mini-breadboard-jumper-pcb/
- Breadboard jump wires - https://s.click.aliexpress.com/e/_DkQ8JdZ
- LiPo Battery - https://s.click.aliexpress.com/e/_Dla5QV5
- Soldering station - https://s.click.aliexpress.com/e/_DE40F35
- Cheap Android phone - https://s.click.aliexpress.com/e/_DCDG5tD