A Practical Guide to Building Smart Devices
Part 1: Introduction
Smart Home Devices – Mastering the Art behind intelligence
Be it a LED light in your bedroom or the air conditioner of your car, everything now a days tends to be SMART. You don’t need to reach out to those devices physically. All you need to do, is use your phone and either speak or click on a button and the magic happens. In today’s world of network bandwidth abundance, connectivity is rarely an issue. While smart lighting concepts revolve around switching on and off the light, controlling the color and brightness of the light, you can actually do a lot more than the standard actions. What if you want to make the light flash every 10 minutes or want the color to change from red to green slowly for 10 minutes and back to red again in 10 minutes. You can do whatever you want as long as it is ‘digitally possible‘.
There are number of companies in the market who sell these smart devices. You would typically find Smart Bulbs, Smart ACs, Smart Washing Machines, Smart Refrigerators, Smart TVs and what not. Anything that you look around which has an electrical input, can actually work as a smart device.
SMART and not so SMART - Differences
Basic LED light circuits are very simple. All you need to do is, bring down the high line voltage to an acceptable DC voltage (known as forward voltage for LEDs) and then supply a constant current (known as forward current) to a series of LEDs.
The 5 millimeter LEDs (Light Emitting Diodes) used in electronic circuits generally operate with 20 mA of current with an operating voltage of 3v. You may read a sample datasheet here. Remember, LEDs work on constant current and not constant voltage. Varying the current will vary the brightness of the LED. There are different types of LEDs used in room lighting. Typical lights which are used in false ceilings use 3 numbers of 1w LEDs. These LEDs consume about 350 mA of current each with a forward voltage of 2v. You will notice that they have a lens fitted to the top which helps the light to disperse at a wide angle (about 180 degrees). A typical datasheet on 1w LEDs can be found here.
The smart LED light is as good as a normal LED light, except that it has a smart module which interfaces between the external world and the core LED driver. There are different ways to build that smart module, but the most easily available and flexible module to use would be ESP8266. The ESP8266 is a low-cost Wi-Fi microchip with full TCP/IP stack and microcontroller capability produced by manufacturer Espressif Systems in Shanghai, China. Read more about it here. There is a NodeMCU development kit which includes the ESP8266, a serial port and a USB port. I shall use this development kit to demonstrate the entire development. We shall be using Arduino development platform to work on this ESP8266.
Cost considerations
The most important consideration while building a digital circuit is the cost of making it. Let’s look at the cost components individually.
Normal LED Lights:
- Hardware:
- Cost of power driver
- Cost of LED
- Cost of enclosure
- Software:
- None
Smart LED Lights:
- Hardware:
- Cost of power driver
- Cost of WiFi and Microcontroller module
- Cost of LED
- Cost of enclosure
- Software:
- Cost of Device Cloud (development and cloud hosting)
- Cost of Amazon Alexa or Google Smart Home Device cloud
- Cost of standalone mobile app (Android and iOS)
Now, you can see that the cost of a smart LED light will be more than that of a normal LED light. As of writing this article, smart LED lights in the market costs about 3 to 4 times more that of a normal LED light.
As you can see, the cost of smart LEDs goes high because of the additional hardware and software. It is not only the cost, the following factors come into play when you deal with a smart device:
- How do you publish your device securely to the internet?
- How do you integrate with the smart cloud providers like Amazon Alexa and Google Smart Home?
- Do you want to provide access to the users without the Alexa and Google Smart Home?
Answers to these questions will actually tell you how complex it is to manage the entire show. It is much beyond managing only the hardware. It is all about the human interaction model that makes it absolutely beautiful but very complex.
Can the cost barrier be broken?
Yes, of course. The idea is to build smart home devices at a much cheaper cost and build competitive quality electronics without much of a worry. If you are already into the business of LED lights, with a small investment, you can turn those into smart LED lights. If you are an entrepreneur, you can easily start your own smart home business.
I am going to publish series of articles on how to make this entire thing happen with live examples. The different stages of development involve different technical abilities/skills:
- To create a LED lamp along with a power driver, you need a bit of electronics knowledge including tools like a soldering iron and various other components.
- To create the WiFi module along with the microcontroller, you need the knowledge of C/C++, a WiFi module with a microcontroller and few other components.
- To create the device cloud, you would need the knowledge of Node.JS and some interesting point to point communication technique. Of course, you would need access to a Linux based cloud system to host your device cloud.
- To integrate with Alexa, you would need developer access to AWS. Free-tier access to AWS is possible if you are able to limit your usage.
- And finally, a lot of patience.
Read the next article on “Building the Smart Controller“.