Wearable Smart Home Control Hub can control light, AC, music player and TV all on waist band.
2 Hardware and SoftwarenRF5340 DK + Adafruit Display + nRF52840 Dongle
nRF SDK 1.6.0 rc2
Segger IDE
3 Installing IDE and SDKs3.1 The proper segger driver shall be installed. But the download do not work fine and the nRF Programmer can not work well as follows, Which shall be solved later,
3.2 After several try, the debug can work. The design can continue with the follows functions, Build one Wearable Smart Home Control Hub to control light, AC, music player and TV all on waist band by touch panels and GUI. This is different from existing smart solutions, all by moble APPs. In fact, no one carry mobile around the house as waist band can do. That is simply much portable and energy saving. nRF5340 is low-life battery powered.
3.3 Touch Panel shall work with SPI, Touch panel with vivid GUI on waist can be used as control UI. Control command sent by Bluetooth 5.2 to remote bluetooth controlled smart light or A/C, TV etc. Main features include, Bluetooth pairing, GUI interface, Remote controll.
4 Coding and Demo4.1 Start nRF connect and open IDE ToolChain
4.2 Start the Segger Embedded Studio and New Project from nRF SDK, use cupnet core for BLE,
4.3 Coding is modular with Zephyr OS, same coding can be done with west commands.
It is simple to start bluetooth LE
void main(void)
{
int err;
printk("Initializing...\n");
err = bt_enable(bt_ready);
if (err) {
printk("Bluetooth init failed (err %d)\n", err);
}
}
Start the bt_ready with bt_mesh_init()
static void bt_ready(int err)
{
if (err) {
printk("Bluetooth init failed (err %d)\n", err);
return;
}
printk("Bluetooth initialized\n");
dk_leds_init();
dk_buttons_init(NULL);
err = bt_mesh_init(bt_mesh_dk_prov_init(), model_handler_init());
if (err) {
printk("Initializing mesh failed (err %d)\n", err);
return;
}
if (IS_ENABLED(CONFIG_SETTINGS)) {
settings_load();
}
/* This will be a no-op if settings_load() loaded provisioning info */
bt_mesh_prov_enable(BT_MESH_PROV_ADV | BT_MESH_PROV_GATT);
printk("Mesh initialized\n");
}
With Button and LED, connect On/Off relay and LEDs can trigger the control of motor and LED on smart home. That make the frame applicable to smart home control
4.4 Build and run the programs with zyphyr.elf binary code, download the binary file in flash via J-link
Debug the code step by step then.
4.5 Start nRF connect mobile
5 Plug Power or Battery and Run
Power the board with USB, the board can run with bluetooth.
That would be important to make the board run with customized mobile APP. That part is still on progress now.
WIth LCD panel the GUI shall be build with the pin assignment.
The Project is still on the way.
Comments
Please log in or sign up to comment.