Monitoring electric consumption over GSM

Monitoring electric consumption over GSM

A few years ago, we explained why the Yocto-Watt is limited to 16A and we gave you some clues on how to measure high currents. But, at that time, we didn't have a simple solution to offer for the most current application: measuring and transmitting the main consumption parameters of a power distribution panel. This gap is today filled and we offer you a detailed solution, easy to implement, based on commercial components.



The energy counter


To accurately measure the voltage, the current, the power, and the sum of the consumed energy, we looked for a counter which could easily be integrated in a distribution panel. We therefore needed a DIN rail fixation, and an enclosure of a shape that would go well with standard distribution panels. As the domain is heavily regulated, we recommend using a certified device. And naturally, to easily transmit measures, this device must have an interface that is supported by one of our interface modules.

The best quality/price ratio that we found in this category is the Femto D4 70A ECT RS485, produced by Electrex. For about EUR 150, this little counter provides all the required features, on three phases simultaneously. Add to it three little current transformer (CT) rings, sold for about EUR 20 apiece, and you'll have a conform measuring system that takes no more than 7.2 linear cm in your distribution panel and that even includes a screen to read the data immediately.

The Femto D4 counter takes the same volume as 4 circuit breakers
The Femto D4 counter takes the same volume as 4 circuit breakers



Connecting everything is relatively easy for someone who knows how a distribution panel works. If in doubt, get an electrician to help you. Shut the power off before you start and don't forget that you have only one life in this game. The needed connections are:

  • Power the counter with 220V with a phase and a neutral.
  • Connect each of the 3 phases as well as the neutral at the top of the counter, for voltage measures.
  • Make each power supply wire of each phase go through a CT ring and connect the coils at the bottom of the counter, for the current measures. You must use the same phase order as for voltage measures, otherwise the power measures will not be correct.
  • Connect 3 wires on the RS485 outputs at the bottom of the counter (A, B, and ground), to transmit the measures.

The energy counter connection diagram
The energy counter connection diagram



Reading the measures


Connection to the energy counter is done with a Yocto-RS485 which can communicate with the Femto D4 counter using the MODBUS RTU protocol.

Measure transmission diagram
Measure transmission diagram


You can configure the counter address, the communication parameters, and so on with the help of buttons on the device. By default, the counter communicates at 38400 baud, 8 bits, without parity, 2 stop bits. Here is therefore how to configure the Yocto-RS485:

Communication parameters to communicate with the Femto D4
Communication parameters to communicate with the Femto D4


Among the energy counter communication parameters, one is not well documented. This parameter, called "S.T.", corresponds to the delay before sending the answer to the MODBUS requests. Its default value of 100ms enables somewhat slow RS485/RS232 converters to avoid losing the answer. With the Yocto-RS485, you can bring this down to 10ms to speed up the data exchange.

The energy counter computes about sixty values, but we are not interested in all of them. You must select a maximum of nine that the Yocto-RS485 reads regularly, with the adequate MODBUS command. For example, you can choose among:

  • the voltage on each phase
  • the current on each phase
  • the power on each phase
  • the total active power
  • the global phase factor (cos phi)
  • the total energy sum

Each value is coded as a 32 bit floating point numbers (IEEE754), big-endian, spanning over two 16-bit MODBUS registers. Fortunately, the Yocto-RS485 latest firmware can decode this for us transparently. You only need to configure a periodical request task specifying the corresponding type and indicating the register number where the value starts, as indicated in the documentation provided by Electrex. The counter default address is 27, but if you use several counters, you can naturally change it.

Reading a floating point measure
Reading a floating point measure



You now have to activate the job that you have created so that it runs automatically when the module starts, and that's it: you have an autonomous interrogation of the Femto D4 counter, that you can now read like any other Yoctopuce sensor, either by USB or by the network. You can also activate the data logger embedded in the Yocto-RS485 and store up to 500'000 measures.

Transmitting the measures


To transmit the measures to a remote recording system, we suggest that you use one of our YoctoHubs. We assume that you don't have a network access near the distribution panel and the example is therefore with a YoctoHub-GSM-3G-EU. But if you have a local network, you can use a YoctoHub-Ethernet or a YoctoHub-Wireless-g in exactly the same way.

To connect the Yocto-RS485 to the YoctoHub, you can use the small USB-OTG-MicroB-MicroB-20 cable, but you can make everything more compact by mounting the module directly on the YoctoHub-GSM-3G-EU with a Fix-2.5mm and a Board2Board-127 connector to be soldered. In that way, both can fit into a high enclosure of the type YoctoBox-HubEth-Transp, of which you can modify one side to fix the GSM antenna.

Connection using a Yocto-RS485 mounted on a YoctoHub-GSM-3G-EU
Connection using a Yocto-RS485 mounted on a YoctoHub-GSM-3G-EU



To configure the YoctoHub-GSM-3G-EU, use a USB-A-MicroB-30 cable, because long USB cable sometimes cause trouble with GSM hubs because of consumption peaks. However, when in the production phase, you can remove the USB cable and power your hub for example with a 5V power supply on a DIN rail, such as TracoPower TBL-015-105. The result is a better integration in your installation than using a simple USB charger. To connect the YoctoHub, you can use a 1.27-1.27-11 connector, making sure to check polarity twice. Here is a picture of the complete installation:

A distribution panel with an energy counter connected by GSM
A distribution panel with an energy counter connected by GSM



The YoctoHub can transmit measures to your own server, but also to existing cloud services. As the aim of this post is to provide a ready-to-use example, we used for this post the Valarm service. To start, you must connect yourself to tools.valarm.net and set the YoctoHub parameters as described in the post on this topic. When you reach the measure configuration step, you'll notice that the voltage measures are listed (voltage1, ...) but not the current or the power measures. The probable reason is that few Valarm customers have needed them until now. Simply use the user1 entries for these measures.

When the configuration is done, you should see the measures appearing on the Valarm console when you press the Refresh data button:

Data registered on the Valarm console
Data registered on the Valarm console


If you click on the Graph All Sensors button and select the desired measures, you can display a consumption graph:

Data graph on the Valarm console
Data graph on the Valarm console


That's it. You can now monitor the energy consumption of this distribution panel from the other end of the world.

Conclusion


To conclude, note that we would have liked to show you in this post how to use the free EmonCMS service for this application. But the new version currently on the site was too full of bugs to allow us to do so. We are going to have to find a more reliable free alternative for small projects which can't pay for a commercial cloud service.

Also note that Electrex offers its own solutions to connect its counters to the network as well. One is even called Yocto Net, although there is no link between this product and ours. Their solutions are more sophisticated and more expensive than the simple solution presented in this post. They moreover require using proprietary software, for which you have to pay as well.

Add a comment No comment yet Back to blog












Yoctopuce, get your stuff connected.