It will be a question of how to manage electric devices via the Internet. The task is rather simple if there are a good, wire Internet and, especially, static IP address. But when an Internet access is possible only via the GSM modem, for example, at the dacha, the choice of solutions is not so big … but is! Now to worldwide network it is connected users more, than inhabitants of Earth. Full Internet users are different devices for a long time and many of them communicate among themselves, using the popular MQTT protocol, more than once here described. At the Master Keith there are several devices which also use the MQTT protocol and a free cloud server of iot.eclipse.org. It will be a question of their setup and application.
At first briefly about what the MQTT technology of communication of devices among themselves on the Internet of Things is. It is the chat very similar to a chat for communication of people. One device, for example, "Internet thermometer" creates the record, so-called "topic" on the special server. Other interested devices "are signed" for this topic and receive all updates which take place in real time, or send to a chat the information, for example, of control instruction.
Everything is very simple. From you the network by means of a household router is required to unroll local Wi-Fi and it will be connected to the Internet by any method, for example, by means of the GSM modem. Any 2/3/4G-modem of any mobile network operator will be suitable for our case
Now that are devices from the Master Keith? Them so far only three in this line. These are the electronic payments collected, of course, based on widely known ESP8266-01. As at this chip only two inputs and outputs which it is possible to manage or read out information and the line of devices turned out as a combination of opportunities of the temperature sensor and electromagnetic relay.
Purpose of devices will be clear, I hope, from the name. By means of the first it is possible to manage two electric devices (heaters, lighting, pumps, gate, watering, a siren etc....) As you can see on a payment two are placed, enough powerful electromagnetic relays
MP3506 — the relay Internet, 2 channels
The second, MP3504 — the relay Internet + the thermometer
This device allows to connect only one electric device, but at the same time to obtain information on temperature on "object". Both devices are assembled on the same payment and are powered from 12B of a direct current. Relays allow to switch loading to 7A. But, if you want to manage a heater, then it is better to do it through the additional contactor. As the temperature sensor the same DS18B20 is used, you want in the normal body, want in hermetic.
The third device differs in compactness, is powered from 5B via the most standard USB connector.
It is MP3507 the Internet thermometer, 2 channels.
Why two channels? The example is simple — one takes temperature in the house, the second on the street. 2 sensors are included in the package, but for street the sensor in hermetic execution well will approach. In the photo the hermetic sensor together with the MP3504 module. But also it is also compatible to the MP3507 module
Existence of the USB connector for power supply allows to connect the module to any USB charger that is very convenient.
After the party of iron is bole-less described, it is necessary to tell about the application which manages of the Master Keith offers the free application for each of the described modules which reminds a demoversion for demonstration of opportunities of the module more likely, than a superversatile tool of management of the house at distance. But the instruction set is open therefore modules can be connected safely to OpenHab or to write the application in any operating system. And though even by means of the designer of App Inventor.
Here examples of screenshots from Applications for the Android
All of them are similar and differ in a set of necessary icons, proceeding from purpose of the module (the part of functions is mortgaged "for the future"):
"Bulb" — shows a relay status. The illuminated lamp — the switched-on relay. If to click a lamp — it will be switched off, once again — will join.
"Number over a bulb" — the counter of minutes of the switched-on relay status, it is possible to use as the logger of operating time of your electric device, for example, for calculation of revenue if it is light over a billiard table which joins if time is paid.
"Temperature" — the current indication of the temperature sensor. If them 2, then and values is two.
"Globe" — the button of connection to the device from the smartphone
"The hammer with an extension wrench" — the call key of application controls.
Connection and setup consists of 2 stages
1. connection of the module of your local area network
2. installation and setup of the Android-application for work with your module.
For connection to your local area network it is necessary to transfer the module to the setup mode. For this purpose within 1-2 seconds after giving of power supply it is necessary to close 2 contacts and to take them in such status of seconds 5-7. At this time the blue LED shortly will blink 1 time per second. If it went out — means it is necessary to repeat operation again. Look at the picture with the module with two thermometers.
For setup it is necessary to close, for example, tweezers or segment of a wire contacts 2 and 3 (on top)
After the module passed into the setup mode, he creates around himself a local area network which name begins with the word MQTT and comes to an end with 7-unit ID. Between these parts of the name there is a sign of functionality and the version.
There is an example: MQTT_2RELE V1.6_1234567 you should be connected to this network with the password by default. And, by the way, remember this number. It is useful at setup of the managing director of the Android-application. It is also names of a topic to which your smartphone or the tablet will be connected.
Further you have a choice, to configure by means of the Android-application "Configurator" or by means of its Windows of the version, I like Windows more. The window of setup looks simply and visually
In the first two lines you write the Name and the Password of Wi-fi of a network to which you want to connect your module. In the second block you or permit the module to work at the same time also access point or prohibit. If not to prohibit, then it is possible to be connected to the module directly. And it is fraught for safety. It is better to prohibit. Then access to the module at you is protected by system of access of a router.
After settings the module will automatically be connected to your router and will automatically be registered on the MQTT server. We selected free iot.eclipse.org
It is necessary to click in the predefined application Setup (the hammer with an extension wrench) and to pass several steps, generally it is necessary just to confirm action, only in one place it is necessary to enter the ID module — seven-digit number which we remembered at a stage of connection to a network. Is on the website in more detail in instructions therefore there is no sense them to reprint here.
Now when settings are made, it is necessary to connect your electric devices to output relays, to place temperature sensors, to provide the Internet and it is possible to use. The smartphone can be also connected to the Internet by any method. In the Moscow Subway works too.
In total With coming New Year!
This article is a translation of the original post at geektimes.ru/post/267922/
If you have any questions regarding the material covered in the article above, please, contact the original author of the post.
If you have any complaints about this article or you want this article to be deleted, please, drop an email here: firstname.lastname@example.org.
We believe that the knowledge, which is available at the most popular Russian IT blog geektimes.ru, should be accessed by everyone, even though it is poorly translated.
Shared knowledge makes the world better.