nooLite
Recently, the modules of the new system were received in the laboratory of Hi-Lab.ru nooLite-F to Nootechnika for testing and integration with Arduino Mega Server and I bring to your attention a brief summary of the new system, my opinion about it and simple examples of the Arduino code for managing new devices.
This article is one of the first swallows On this system and I think that soon you will see many other reports about it, but for now the hottest and current information from the The first hands
What is nooLite?
For those who did not know or forgot, recall that nooLite is a wireless control system for electrical equipment, such as lighting in your home or electrical appliances that can be turned on and off with wireless control panels. The controllers have many options, but mostly they look like ordinary lighting switches. The control units that receive commands are small boxes with several wires, some of which are connected to the supply voltage, and some to the load.
It’s simple and understandable. Thanks to this simplicity, the nooLite system has gained popularity and is sold in a large number of online and offline stores. But there is one “but”. Everyone is good nooLite system, but it has one (and even two) significant drawbacks. The first is the lack of serious encryption of transmitted commands and data. For most household applications, this is not very critical, but for many people this is unacceptable from a security point of view – there is at least a small, but not zero, chance that you will not be lucky and someone from hooligan or criminal considerations will decide to open your connection and direct your
The second drawback is the lack of feedback in the system (there is truth pseudo-feedback using special blocks, but this is not very serious). What does it mean? This means that you, having given the command to include something, you can not be sure that this team was actually executed, and did not leave without a trace on the world ether.
That’s just with these two shortcomings and the new A version of the system called nooLite-F. Conversations about the need to release a new version have been going on for a long time and at last the first devices of the new series appeared on sale.
Some technical details
From a technical point of view, the nooLite system is a receiving and transmitting device operating at 433 MHz and using amplitude modulation of the transmitted signal. The choice of amplitude modulation is due to the fact that according to the manufacturer of the system, it is a simple and weakly susceptible to interference mode of command transmission for a short distance. The system uses PIC controllers (12, 16, 18). The power consumption of the devices is small and the panels and sensors of the system operate on batteries.
In the new system nooLite-F, the operating frequency remained the same, 433 MHz, and more importantly, compatibility with the old version of the equipment. That is, you can use the nooLite-F control modules to work with conventional nooLite devices.
In the new system, the modulation was replaced by a frequency one, but surprisingly, this does not prevent the new devices from working with old ones using amplitude modulation . How is this possible? The engineers of the company had to slightly modify the transceiver of the new modules to work simultaneously with both types of modulation.
The new transceivers have better sensitivity and, as a result, approximately 30% longer communication range
Security and encryption
The system nooLite-F uses a serious encryption standard AES, which should reliably secure the operation and use of this equipment. In turn, the work with encryption required an increase in processing power and forced the use of PIC 32 controllers. But this is still an energy-efficient solution and the units and modules of the system can operate for a long time from batteries.
Available equipment
At the moment, three devices of the new system are available for purchase:
- MTRF-64-USB adapter for controlling via USB interface from a computer
- MTRF-64 module for control by means of controllers with UART interface
- Wireless power unit SLF-1-300
We will conduct our experiments with the power unit SLF-1-300 and the module MTRF-64.
Only three products are temporary phenomenon – the company plans to release a whole line of equipment of the system nooLite-F, including devices for DIN-rail.
The power unit of the SLF-1-300
Externally, the power blocks of the new system are no different from the usual blocks of nooLite. The same neat case and the same few wires for connecting power and load.
The content of the block looks somewhat more interesting. On the left in the picture are two chips – one (smaller) is a transceiver chip, accurate marking:
MRF49XA
1637
RG3
and the second chip of the controller controlling the unit, accurate marking
STI E4 7B572
32F030F4P6
The board is SLF-1-300 “/>
Everything is very compact and tidy. This is the long-awaited nooLite with encryption and feedback.
The reverse side of the board is almost completely covered by the radiator.
What is under the radiator can be seen by looking at the power unit board from the side: several voluminous details not fitting on the back of the board. That’s all the circuitry.
Module MTRF-64
As I said, we will consider the MTRF-64 module with a UART interface, we will not touch its colleague with the USB connection, they are almost identical, except for a few details about which will be told below. Photo of the control module:
As you can see, it is very similar to the power block, the same chips, quartz and a few more details. Here is the exact marking of the chips installed on the board. Transceiver:
MRF49XA
1636
M5H
Microcontroller:
STI E4 7B573
32F042F6P6
PHL 648 A
The empty space for the missing chip is the place to install the FTDI USB-UART adapter. There is also a place to install a USB connector – it’s obvious that the same PCB is used for both devices.
Now a little about connecting the module to microcontrollers in general and to Arduino in particular: Wires – RX, TX, VCC, GND.
For those who not only read the articles but do something with their own hands, I note that the module Feeds strictly from 3.3 volts and its conclusions are not tolerant to 5-volt signals, so keep this in mind and be careful when connecting the module.
A little about the functionality of the module. It has four main operating modes:
- Transmitter for “old” devices of the nooLite system. This is an analogue of the functional of the nooLite MT1132 module
- Receiver for “old” devices of the nooLite system. Analog of the nooLite module MR1132
- Transmitter for new equipment nooLite-F
- Receiver for new equipment nooLite-F
That is, this module is a universal solution for the interaction of microcontrollers with the nooLite system. Plus, unlike its analogs, it has the ability to work with 64 channels, instead of 32.
Arduino and nooLite-F
Now let’s take a look at a simple example that will give you an idea of working with this module in an Arduino environment. By analogy, you can organize work with this module with any other system.
The module interacts with the control controller via the serial interface (Serial) at a speed of 9600 bps. Since MTRF-64 only works with 3.3 V voltage, we will put aside our favorite Arduino Mega and take it from the Arduino Due shelf and connect the module to it. Four wiring and everything is ready. For communication with the module we will use Serial3.
- The output of the RX module is connected to TX3 (14) Arduino Due.
- The output of TX module is connected to RX3 (15) Arduino Due.
Now you can write a test demo sketch. Let’s start with the setup () function.
void setup () {
Serial.begin (115200);
Serial.println ();
Serial.println (F ("NooLite-F test"));
Serial3.begin (9600);
Delay (1);
BootOut ();
// Commands:
// 0 - Off
// 2 - On
// 4 - Switch
// 9 - Unbind
// 15 - Bind
SetCommand (0);
SetChannel (0);
SetChecksum ();
Serial.print (F ("CH:")); Serial.println (TO_MTRF [4]);
Serial.print (F ("CMD:")); Serial.println (TO_MTRF [5]);
Serial.print (F ("CHECKSUM:")); Serial.println (TO_MTRF [15]);
MtrfSend ();
Delay (100);
}
We run Serial to output debugging messages and Serial3 to work with the MTRF-64 module. At startup, the module enters the software update mode for 12 seconds and to interrupt this mode we enable the function
void bootOut () {
For (byte i = 0; i <= 16; i ++) {
Serial3.write (BOOT_OUT [i]);
}
}
Which sends the magic data to the module, removing it from the software update mode.
Next, we form the command:
// Commands:
// 0 - Off
// 2 - On
// 4 - Switch
// 9 - Unbind
// 15 - Bind
In fact, the commands are much more, with a full description of the protocol and the work of the module you can find in the document on the manufacturer’s website.
Next, we display test messages about the channel, command and checksum of the package. At this point, the initial setup () routine is finished and the sketch enters the infinite loop loop ().
void loop () {
// setBind ();
// setUnbind ();
// setOn ();
// setOff ();
SetSwitch ();
Delay (1000);
}
Here there are five lines that initiate the sending of a command to the MTRF-64 module. You must select any one command and run the sketch (the remaining commands should be commented out). You start with the command to bind the power block to the setBind () module.
Binding procedure:
- Press the button on the power block – the
- Run the sketch with the uncommented string setBind ()
- Confirm the binding by pressing the button again on the power block
All, now comment the string setBind () and uncomment, for example, the string setSwitch (), run the sketch and the test lamp, connected to the power block, starts blinking once a second. This is just a test case and on the basis of this sketch you can create any, no matter how complex control system devices nooLite.
A little more about the work of the sketch. The code forms the contents of the TO_MTRF array in accordance with the documentation for MTRF-64, the link to which I gave just above. Next, the contents of this array are sent via the serial interface directly to the module.
After that, the module’s response is expected and the incoming data is filled with FROM_MTRF array, then this array is parsed and pre-programmed solutions are accepted.
Here is the purpose of the other functions of the test SetChannel (byte ch) – sets the required channel number (0 – 63).
setCommand (byte cmd) – sets the desired command.
setChecksum () – calculates the checksum of the package.
mtrfReceive () – receiving and parsing module responses.
So you can bind and untie devices on any channel, enable , Turn off and switch the light with Arduino and MTRF-64. I would like to remind you once again that this is only a demonstration of the work and an example for further development.
/ *
* NooLite-F
* MTRF-64 test sketch
* /
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Byte BOOT_OUT [17] = {171, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.175,172};
Byte TO_MTRF [17] = {171, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.172};
Byte FROM_MTRF [17];
// Send the send adapter to exit the software update mode
Void bootOut () {
For (byte i = 0; i <= 16; i ++) {
Serial3.write (BOOT_OUT [i]);
}
}
Void setChannel (byte ch) {
TO_MTRF [4] = ch;
}
Void setCommand (byte cmd) {
TO_MTRF [5] = cmd;
}
Void setChecksum () {
TO_MTRF [15] = 0; // low byte
For (byte i = 0; i <= 14; i ++) {
TO_MTRF [15] + = TO_MTRF [i];
}
}
Void mtrfSend () {
For (byte i = 0; i <= 16; i ++) {
Serial3.write (TO_MTRF [i]);
}
Delay (50);
MtrfReceive ();
}
Void setOff () {
SetCommand (0);
SetChecksum ();
MtrfSend ();
}
Void setOn () {
SetCommand (2);
SetChecksum ();
MtrfSend ();
}
Void setSwitch () {
SetCommand (4);
SetChecksum ();
MtrfSend ();
}
Void setBind () {
SetCommand (15);
SetChecksum ();
MtrfSend ();
}
Void setUnbind () {
SetCommand (9);
SetChecksum ();
MtrfSend ();
}
Void setup () {
Serial.begin (115200);
Serial.println ();
Serial.println (F ("NooLite-F test"));
Serial3.begin (9600);
Delay (1);
BootOut ();
// Commands:
// 0 - Off
// 2 - On
// 4 - Switch
// 9 - Unbind
// 15 - Bind
SetCommand (0);
SetChannel (0);
SetChecksum ();
Serial.print (F ("CH:")); Serial.println (TO_MTRF [4]);
Serial.print (F ("CMD:")); Serial.println (TO_MTRF [5]);
Serial.print (F ("CHECKSUM:")); Serial.println (TO_MTRF [15]);
MtrfSend ();
Delay (100);
}
Void loop () {
// setBind ();
// setUnbind ();
// setOn ();
// setOff ();
SetSwitch ();
Delay (1000);
}
Void printFromMTRF () {
Serial.println ();
For (byte i = 0; i < 17; i++) {
Serial.print(FROM_MTRF[i]); Serial.print(" ");
}
Serial.println();
}
void mtrfReceive() {
if (Serial3.available() > 0) {
Serial3.readBytes (FROM_MTRF, 17);
If (FROM_MTRF [0] == 173 && FROM_MTRF [1] == 2 && FROM_MTRF [16] == 174) {
// printFromMTRF ();
Serial.print (F ("Receive:"));
If (FROM_MTRF [10]! = 0 && FROM_MTRF [2] == 0) {Serial.println (F ("On!"));}
If (FROM_MTRF [10] == 0 && FROM_MTRF [2] == 0) {Serial.println (F ("Off!"));}
If (FROM_MTRF [2] == 1) {Serial.println (F ("Error!")));}
} Else {
Serial.println (F ("Receive error or bind"));
PrintFromMTRF ();
}
}
}
Conclusion
This short review did not include a story about many of the functions of the new system, such as air flashing, remote snapping and many other features – it’s impossible to embrace everything in one review article, but I’m sure other articles about nooLite-F from the set will soon appear Enthusiasts and enthusiasts of automation.
Now my opinion about the new system nooLite-F. Definitely, this is a big step forward for Nootechnika. The difference between the old system and the new one is great – encryption makes it safe, and feedback allows you to be sure of the execution of the given commands. And all together this brings nooLite to a new level and allows building serious automation projects on this system.