Artik cloud is an amazing platform for IoT devices. With features like analytics, rule formations and cloud connectors Artik cloud not only support Io devices from other vendors, but also supports communications with other IoT cloud services . This is one remarkable feature that most cloud services do not provide. So, now it’s simple to connect my S2 Gear to my Artik account and track my health. Not only that but now I can create rules that would notify my fridge about the calories burnt, so the fridge might suggest me interesting drink maybe.
Though all this seem very futuristic, but there are many devices in our home that are not yet IoT enabled or are not “compatible“. Sometimes buying these devices also becomes a bit heavy on the pocket. Example a smart Bulb costs around 90$ or so, but instead what if we are able to control our regular bulb over Wi-Fi. Or maybe we can control a table fan.
Well IVY suite for the rescue. IVY suite is basically a collection of small devices build around open source hardware like arduino and ESP that allows you to connect some incompatible devices to Artik cloud. IVY suite consists of:
· Smart Button
· Smart reader
· Smart socket
· Smart bulb
Smart Button is basically a button that connects to Artik cloud, and one can create rules for controlling other devices like AC, garden lights or maybe for alarming something. Smart button can be easily reconfigured to control other devices around the home.
Smart Reader is a small stick-it-up LCD module that you can stick it to places like fridge doors, walls desk and your devices connected to the Artik cloud can display alerts or messages over the LCD. The user can generate rules to redirect data to smart reader.
Smart Socket is again an amazing little device that can be placed between AC connections to be switched on/off over Wi-Fi form Artik cloud. Suppose you have a tube light or table fan that doesn’t support IoT connectivity, smart socket can help you bridge the gap between the device and the cloud.
Smart Bulb, the name itself tells the story. It is a LED bulb that can be controlled over Artik cloud. So maybe if your Samsung S4 sends GPS location that you’re closing in to your home, the porch lights will turn themselves on for you.
After introduction to these small devices, the functionality of the Artik cloud has extended to a whole new level. Now one can control devices that are not supported, control multiple devices at a click of a button, get notified on a small stick-it-up LCD and don’t have to turn on/off the bulb.
-----------------------------------------------------------------------------------------------------------------------
Let's begin the show then :
The key hardware we are going to use in the project is the ESP 8266 - 01 . Its a small ardunio compatible WiFi module a.k.a. "IoT Enabler", which is a self contained SOC with integrated TCP/IP protocol stack that can give any micro-controller access to your WiFi network. It's a fully programmable chip and can even host a small web-server on it. The main reason it's an IoT enabler is because of the cost and the functionality. At just 5$ you can add a fully functional WiFi module to your ardunio project. The ESP 8266 comes in various variants, out of which we will be using 01 version and the nodeMCU version of it.
So now that we know the key hardware we are going to use, let us understand how to use it. If you already know the working and use of ESP 8266, just skip this paragraph and move to the next one. Here is a good tutorial to how to get started with this chip https://openhomeautomation.net/getting-started-esp8266/ .You will find a whole lost of resources on "How to's " with ESP 8266 chip, after all its the most famous piece of hardware around the internet. Here is another tutorial about programming the ESP 8266 using a serial adapter http://fab.cba.mit.edu/classes/863.14/tutorials/Programming/serialwifi.html
-----------------------------------------------------------------------------------------------------------------------
Now that we know the basics of ESP, lets focus on the next step. Now every little device in the Ivy Suite we are using, has this ESP 8266 chip on it, which means we are going to need to program this chip every now and then. So here i have created a small ESP 8266-01 adapter, which would help us program the chip as well as we can use the adapter as a test bench hardware.
You'll find the PCB layout in the schematics below. With some fair amount of electronics knowledge one can either solder a PCB using the schematics or go ahead and print a PCB. The adapter PCB I've attached is a double sided PCB, that houses a two led's, two switches and a reset key. I've named every other component on the PCB stencil. You will have to download this software called Express-PCB to use this file attached. It's a pretty neat and easy to use software and with basic skills one can learn to design PCB's on it with no problems. Below are the pics of my build of ESP adapter
Alrighty then, we are ready to move to next step, where we are going to start building each of this Ivy Suite devices, so buckle up and enjoy the ride. Further on, in every section we will be talking of an individual smart device from Ivy suite. You'll find the schematics, layouts, breadboard design in the schematics section below. You will also find the code attached below, to corresponding device name written on the file name. Also, i'm hosting a github repository of all my designs and codes, feel free to pull request or share.
-----------------------------------------------------------------------------------------------------------------------
First stop's, Smart Button :
You might have heard about amazon's smart button or Flic button, which is basically a IoT button that enables you to automate small tasks around the internet. So, my flic button can easily be instructed to send a email to my dad that i'll be coming late home today, at just a click of a button. Isn't that something. The amazon's button lets you order something of amazon, which you regularly buy at a click of the button. Ohkay, now lets build ourselves a smart button for artik cloud. So you can easily use it to control/instruct other IoT devices on your Artik cloud account.
Above you'll find the smart button schematics and breadboard design. Go ahead first test it on breadboard first and then make a small PCB button out of it. Just make sure before, soldering the ESP chip onto the board you flash the code on this chip. You will find the code to the ESP smart button project the code section below. You can customize the design of the button the way you want to. Like for example, instead of using 2 Double size battery, i'm using a mobile battery that would last long and can be recharged properly. Also i'm using berg strips to hold my ESP8266-01 chip so that i can reuse/reprogram the chip. Below are some of the pics on my smart button build :
Ok, now lets program the ESP chip. Here's the main git repository for using ESP as ardunio chip. https://github.com/esp8266/Arduino Use it as a reference to flash the code to the ESP. In the code section you will find a file named "smartbutton.ino" go ahead and download the file, open it in ardunio. Check out the code, i've commented instructions in the file. You'll have to add the device token, device ID,etc. once you follow the next steps where you register the device on the developers account of Artik cloud. Use a USB-to-ttl converter, hook up the ESP adapter to it and place the ESP 8266-01 chip to it. Now Press the "FLS/0" button on the ESP adapter and click the flash button on the ardunio. Volla you have successfully burnt your code to ESP. Though it's not always that simple, but after few tries, i'm sure you'll figure it out to burn the code.
So, now you have a ESP8266 enabled smart button that sends some data via the MQTT service to the Artik cloud. Hhh? right. Actually, we have created a smart device that talks to our Artik cloud via the MQTT broker at the Artik cloud side. So when ever we press the button, the device sends a MQTT message to artik cloud or can receive a MQTT message to trigger a buzzer or small mobile-vibrator on the smart button. Now head to the developers.artik.cloud and lets create a device type for our smart button. Follow the below images to create your own device type. Anyways i have publicly made available my device type so you can directly start by adding new device at artik.cloud account. (name of device is "Ivy-smartbutton")
With this we have successfully built a Ivy-smartButton, then created a new device type, created a new manifest, added new device and used it. Congrats... time for some coffee now..!
-----------------------------------------------------------------------------------------------------------------------
After the break, lets move on to next Ivy device that's the Smart Socket :
Well the idea was that we all have devices like table lamps, table fans, old traditional radios or TV's, that connect to power sockets. How do we connect these devices to WiFi or make them a IoT device? Cutting off the power supply or turning it back on, sometimes makes it feel a IoT device. So smart socket acts as a adapter between your ordinary power socket and the device power supply cable. This smart socket adapter connects to Artik cloud via WiFi, which enables us to control the device (turn on/off ) over internet. That's simple and sweet. So lets get our hands dirty and make one yourself. Use the following diagrams and schematics to build the device. Most instructions are same as one you had during the smart button build. You'll find the code, fritzing project in the below section
Head to developer.artik.cloud to register a new artik device. Use the following steps to create the device. I've already publicly made available the device named "Ivy-smartsocket", you can use. Later then add the device to artik.cloud account.
Once you're done with that use the code file named "smartsocket.ino". The instructions are same to burn the ESP chip with the code, and place on the socket PCB, and there you have another Ivy smart socket device. Below are few images from my build.
-----------------------------------------------------------------------------------------------------------------------
Next device is Smart bulb, now most of the build instructions are the same, so i won't be repeating them to bore you guys. You'll find the fritzing project and code by the name "Smart Bulb.ino" below in the attachment sections. Below are the diagrams and schematics :
Next head to developer.artik.cloud to create a new device type use the following images to create the device type. you can use the device type i created, name is "Ivy-smartbulb".
Here you'll find the device ID and device token from the above steps. Update those values in the code below named "smart bulb.ino" Flash the code to the ESP and place it on the PCB and you have a smart bulb.Below are pics of some of my built, for which i have reverse engineered a regular led bulb and used the LED array and the power supply kit in it.
-----------------------------------------------------------------------------------------------------------------------
Last but not the least, the final Ivy device is Smart Reader. Well the idea behind this device was that, we have many devices generating tons of data all around us. To visualize this data we have laptops, mobile phones etc. But sometimes for small application, why to increase the cost of the whole application. Like for, if i have a smart device that measures the temperature of the room or the amount of light in Lux's in the room. So if i want to check out that, why use a smartphone or laptop, why not have a small reader LCD that can be reconfigured to show this data with other useful data too. So there comes the smart Reader, i simple device that can be used to visualize real time data on a small LCD.
So lets make the device. Use the below schematics and diagrams to build the device, you'll also find the fritzing project below in the sections.
Once you do that, lets register the device on the developer.artik.cloud . Use the following steps to register the device on the developers account, or use the readily available device named "Ivy-smartreader".
Next is use the code attached below in the code section. Update the device ID and the device Token in the code named "smart reader.ino" and Flash it like all the previous devices. And finally you have all the devices ready.
-----------------------------------------------------------------------------------------------------------------------
After a long days work you have everything in place. Now all you have to do is create rules to orchestrate these devices together. You can use the smart button to control the smart bulb in the porch or hall. Or if no ones home the old oven can turn off itself based on data from PIR sensor of the smart AC. And the smart reader can read out the temperature of the room, with the current time and date.
Isn't that just amazing. Enjoy the Ivy suite project, Feel free to comment me issues or pull request on the github repository or reach out to me on social media.
Also checkout my Artik bounty submissions :
New Device-Type : Intel Edison Board Author : Swapnil Kalhapure Project Page : https://www.scifiswapnil.in/edison_artikcloud/ Github Page : https://github.com/scifiswapnil/edison_artikclou
New Device-Type : Xiaomi Mi Band (Fitness band) Author : Swapnil Kalhapure Project Page : scifiswapnil.in/gadgetbridge_artikcloud/ Github Page : github.com/scifiswapnil/gadgetbridge_artikcloud
-----------------------------------------------------------------------------------------------------------------------
Do checkout my other project here : www.scifiswapnil.in/projects/
check out my website : www.scifiswapnil.in/
email ID : kalhapure.swapnil@gmail.com
happy {h|cr}acking ...!!
Comments