Battery Powered Wi-Fi Smart Button to Control HUE Lights

by sylwekbala in Circuits > Remote Control

1984 Views, 8 Favorites, 0 Comments

Battery Powered Wi-Fi Smart Button to Control HUE Lights

ezgif.com-video-to-gif.gif

This project demonstrates how to build a battery powered IoT Wi-Fi button in less than 10 min. The button controls HUE lights over IFTTT.

Today you can build electronic devices and connect them to other smart home devices literally in minutes. What's more you can do it without dedicated programmers and writing a single line of code. In this blog we show a battery powered Wi-Fi Smart Button, which controls HUE lights remotely over the internet. It can be built effortlessly by developers at all skills level.
The button will last 15k activation events on 2xAAA lithium batteries - this is by far the best low-power smart button. If we take into account 8x pushes/events a day it will last 5+ years. It is due to the IoT module, which is used in this project, doesn't drain any current when is not activated - true 0A. This instruction comprises with the following steps:

  1. Assembly using bread board
  2. Setting-up IFTTT and HUE service
  3. Configuring IoT module
  4. Connecting IoT module to the internet

Everything can be done under 10 minutes without a single line of code or cloud knowledge.

Supplies

Parts

Software apps and online services

Tools

  • Soldering iron (generic)

Assembly

IoT Smart Button to control HUE lights under 10minutes
168b39ae-afdc-4f2d-8a3d-3976277c6c1c (1).jpg
img_20200318_122549_k5Vxy5jVcC.jpg
img_20200318_122609_lJnNkMzi0D.jpg
img_20200318_122618_cx6n1vNv0U.jpg
assembled-button.jpg

Solder Pin Header PCB breakaway connector to Cricket module. The header makes it easier to connect Cricket module to breadboard.

  • Connect 1st pin from the button to battery VCC (+)
  • Connect 2nd pin from the button to WAKE_UP port on Cricket module
  • Connect battery VCC (+) to BATT port on Cricket module
  • Connect battery GND (-) to GND port on Cricket module

IFTTT Setup

screencapture-ifttt-create-2020-03-18-12_36_09_T9yDVugDvB.jpg
screencapture-ifttt-create-if-2020-03-18-12_36_26_0KO8CFKMEU.jpg
screencapture-ifttt-create-if-receive-a-web-request-2020-03-18-12_36_48_DmSRuAuxLW.jpg
screencapture-ifttt-create-if-receive-a-web-request-then-2020-03-18-12_36_55_FYvtodpG1n.jpg
screencapture-ifttt-create-if-receive-a-web-request-then-2020-03-18-12_37_08_hE86o1f0Lw.jpg
screencapture-ifttt-create-if-receive-a-web-request-then-hue-2020-03-18-12_37_16_1fppCXEFtl.jpg
screencapture-ifttt-create-if-receive-a-web-request-then-turn-on-lights-2020-03-18-12_37_30_09qhBs9vH7.jpg
screencapture-ifttt-create-if-receive-a-web-request-then-turn-on-lights-2020-03-18-12_37_48_s0rGzRmKyK.jpg
8cc5e377-9d64-4247-ad78-bf512fb0901f.jpg
588382b9-58aa-4b29-91e3-71bdaf2ab290.jpg

Steps to follow:

  1. Go to: https://ifttt.com/
  2. Login or register
  3. Click Create from User / Account menu (top right corner)
  4. Click + to create new source event
  5. Select Webhooks service
  6. Click Continue
  7. Click Receive a web request (on the left hand side)
  8. Create event name e.g. button_event
  9. The source event should be set-up now, click + after Then event
  10. Search HUE service
  11. Select HUE service event
  12. if you do not have yet HUE you need to add by -> Connect
  13. Select device (light) to which this event will be attached
  14. Click Finish

Nearly done, we need to get a HTTP address to which we can post event from IoT module.

Search for Webhooks service and click in document in in the right up corner.

Next copy web links under "Make a POST or GET web request to:" you will need it latter.

Configure Wi-Fi Cricket Module

c6ccf1ff-2a60-434e-8730-bc85f23a67ea.jpg
186524ee-e324-496e-87a5-f5a1d0b53db5.jpg
390a6084-bda8-453f-8734-6b63586d3fa6.jpg

Cricket is entirely configured OTA (Over The Air) through Things On Edge - Developer Portal (https://dev.thingsonedge.com). The configuration will be retrieved by Cricket via the internet when it is connected to your Wi-Fi (which is described in the next section). Now let's configure it first.

For the button we need to configure Cricket to send POST HTTP request when is woken up by high signal on IO1: WAKE_UP pin. This signal is provided when the button is pressed.

Now open TOE Developer Portal from any browser either from PC or mobile. You must register/login to Developer Portal to activate and configure the device in your account. Otherwise the device won't work.

After successful login / registration you need to click "Add new" device to activate your device in the system. You need to use the unique serial number printed on a label stick on the back of Cricket.
WARNING: You must keep the serial number for yourself only. Do not share it with anyone else.

Now you can configure your device.

Set the following configuration:

  • RTC: OFF
  • IO2: OFF
  • IO3: Off
  • Battery monitor: OFF
  • Force updates on - IO1 Wake Up: On
  • Force updates on - RTC Wake Up: OFF
  • Post Events: see below

Copy/Paste the link you copied from Webhooks into io1_wakeup and leave data empty

http://maker.ifttt.com/trigger/button_event/with/key/hfNIx8SKn_xxxxxxxxxxxxxxxxxxxxxx_YW3xx5yFw5MGD

Once you set the configuration hit Save button.

Well done! You are almost there! Now you just need to connect your device to the internet over your Wi-Fi network. Please follow the next section how to do it.

Connecting IoT Module to the Internet

8e274aa9-a0f4-4fb0-a4c4-09c35176b0f5.jpg
d03399bb-ba3a-4358-88fe-5d0b5f54f130.jpg
067ed15e-f63a-4b83-bef1-b88b28d9b6fc.jpg

In a few steps you will connect your device to the internet over your Wi-Fi network. All you need to do is to activate Cricket's private Wi-Fi hotspot and then open a private web page to pass your Wi-Fi network credentials. Please follow the steps below:

  1. Press and hold a button on the module for 5 seconds until the LED is constantly lit.
  2. Once the LED is constantly lit Cricket opened a private Wi-Fi hot spot. Connect from either a laptop or smartphone to the hot spot with the following credentials:

    SSID: toe_device
    No password is required

  3. Once connected, open a private web page: http://192.168.4.1/index.html
    NOTICE: make sure LED is still ON! If is OFF repeat the steps from the beginning

  4. Now you can pass your Wi-Fi network credentials and click CONNECT. If you passed correct SSID and Password then after few seconds the device should report it is online and the LED will be OFF.

Congratulations! Now your device is live and connected to the internet!

Summary

Now you can switch on/off HUE light with your button device !!!

You can find more information: