Skip to main content

Introduction To Smart Wi-Fi

We need faster tools and media to prove our ideas, and this is where ready-to use modules like Smart Wi-Fi enter. Fig. 1 shows the top side of Smart Wi-Fi module.




fig 1
Fig. 1: Smart Wi-Fi module
fig 2
Fig. 2: Block diagram of the introduction of Smart Wi-Fi

The module is low-cost and versatile; all a developer needs is a USB cable and it is ready to work. For software developers, working with hardware is always a pain, and this is one of the biggest reasons why many ideas never exit a computer. Smart Wi-Fi enables making a product quickly and reliably. With open software resources and hardware data, moving to the final product after the proof of concept is also easy.
One of the major aims for writing this article is to show the versatility of this product and show how quick the development can be. In this article a few tests with Smart Wi-Fi are discussed, which show the applicability of this module for development of the Internet of Things (IoT) products.
parts list




fig 3
Fig. 3: Circuit diagram of the Smart Wi-Fi
 
Temperature is sensed by IC1 and its output is measured with ADC pin of BOARD1. BOARD1 sends data to the serial port. Data can be seen in the serial terminal of ESPlorer tool.
Real-time temperature data is uploaded over ThingSpeak (www.thingspeak.com).
Construction and testing
An actual-size, single-side PCB of Smart Wi-Fi is shown in Fig. 4 and its component layout in Fig. 5.
fig 4
Fig. 4: Actual-size PCB pattern of Smart Wi-Fi
fig 5
Fig. 5: Component layout of the PCB


ESP8266 module has many tools that are freely available, and you can select these as per your requirement. For a person new to this kind of development, following tools are recommended. Download and install these as per your PC configuration.
1. ESPlorer for serial port interface with Smart Wi-Fi.
2. CP210x USB drivers . 
3. Smart Wi-Fi comes with the latest version of NodeMCUfirmware pre-loaded
4. NodeMCU API.


We describe two tests (TEST1, TEST2) in this article. Before downloading the code in Smart Wi-Fi, you will need to connect it to the PC using a micro-USB cable. Start ESPlorer tool and set the port and baud rate [9600 default] and press Open Tab to open the port. It is ready to use now. We have used ESPlorer v0.2.0-rc2 version, and the corresponding test procedure is described below.
Test 1 (Temperature sensor interface with Smart Wi-Fi)
The code here is for data read on the ADC and sent to the serial port locally. Open Temperature_Interface.lua file (given in DVD), type =call(“Temperature_Interface.lua”) on the left side of Send and press Send.
We can now observe data into the serial terminal of ESPlorer tool. The code will keep sending data over the serial port every 15 seconds. In the code, we use internal timer # 1 of ESP to call an inline function every 15 seconds. The function reads ADC0 value, which it receives in terms of millivolts, and divides it by ten. As the resolution of LM35 is 10mV per degree Celsius, dividing by ten provides the actual temperature in Celsius. We can print this value to the serial port using print function:




tmr.alarm(1, 15000, 1, function()
current_temp = adc.read(0)/10;
print(fmt(“Temperature : %3.1f C”, current_temp));
end);
Test 2 (Temperature data upload on the Internet using ThingSpeak API)
In Test 1, we connected a temperature sensor and observed the data locally. This data can be used in multiple ways as per the application. In Test 2, we will make the same data available on the Internet and it would be accessible from anywhere in the world.
We use ThingSpeak API, which is a freely-available tool used to access and present data over the Internet. Before using ThingSpeak API, you need to create a user account for ThingSpeak and a channel. You will get an API key (Fig. 6) for the channel and then you can upload your data and present it in a graphical form. The only limitation is the frequency of posts, which is limited to 15 seconds.
Fig. 6: Key generated for posting data on ThingSpeak
fig 7
Fig. 7: Data posted on ThingSpeak API
Before going ahead with data upload, the local Wi-Fi router needs to be paired with Smart Wi-Fi. Use the following command to connect it to your Wi-Fi router:
call(“conenctap”,”your router SSID”,”your router password”);
This command will pair Smart Wi-Fi to the Wi-Fi router you want to connect with. The response will be the IP address assigned to Smart Wi-Fi by the router.
Open ThingSpeak_upload.lua file (given in DVD), type =call(“Thingspeak_upload.lua”) on the left side of Send and press Send. Data output on ThingSpeak API is shown as:
Error: Reference source not found.
The application code that will post data to ThingSpeak server (Fig. 7) is given below.



myKey = “put your API key here”
function post()
call(“setLED”, 2);
field1 = adc.read(0)/10;
print(fmt(“%3.1f”,field1));
call(“httpsend”, “api.thingspeak.com”, 80, “/update?api_key=”..myKey..”&field1=”..field1);
call(“setLED”, 0);
tmr.delay(50);
end
call(“connectap”,” your router SSID “,” your router password “)
tmr.alarm(1, 15000, 1, post)
Applications of Smart Wi-Fi
Smart Wi-Fi is an IoT-enabler tool.The applications it can cater to are only limited by the imagination of makers. The very basic applications could be for smarthomes or smartoffices.
This module can be used for data logging, data monitoring and more, and provides very good support for product development. It also has all features to act as a full-fledged product.

Conclusion
Using Smart Wi-Fi module, we have seen how easy it is to interface and connect sensors to the Internet. Tools like ESPlorer and open source LUA scripts make development very easy and fast. Platforms such as ThingSpeak add to the benefits and provide support for testing and development of an IoT product.

Comments

Popular posts from this blog

Make Your Own Air Quality Monitoring Device!

Air pollution and concern about air quality is not something new. Complaints were recorded even in the 13th century when coal was first used for industrial purposes in London. From the middle of the 19th century, the atmosphere of major British cities was regularly polluted by coal smoke in winters, giving rise to the infamous mixture of fog and smoke known as smog. Today the emphasis has shifted from pollution problems caused by the industry to the ones associated with motor vehicle emissions. Author’s Prototype Air Quality Index Air Quality Index, or AQI, is a number used by government agencies to communicate to the public how polluted the air currently is, or how polluted it is likely to become. As AQI increases, an increasingly large percentage of the population experiences severe adverse health effects. Different countries have their own air-quality indices corresponding to different national air-quality standards. Some of these are Air Quality Health Index (C

Learn to Build Real Time Clock using 8051and DS1307 RTC Module

In this article, we are going to see how to interface an RTC (Real Time Clock) Module to 8051 micro controller. There are different kinds of RTC module available in the market. We are using the most common RTC module that comes with the DS1307 IC, an LCD module and AT89S52 (8051 variant) for this tutorial. AT89S52 is a typical 8051 microcontroller manufactured by Atmel. Interfacing an RTC module to 8051 microcontroller is pretty simple. You only need to make 2 connections between the RTC module and 8051. So lets get to business! A Real Time Clock module is basically a time tracking device which gives the current time and date. RTC modules that comes with DS3231 IC have the provision to set alarms. Notes On DS1307 RTC Module Here we are using an RTC module with clock chip DS1307 based on I2C protocol (Two Wire Protocol). The module provides details such us second, minute, hour, day of week, day of month, month and year including correction for leap year. It can operate eithe

Hit Counter