# Measuring current and power voltage

## Simple circuits and software for AC and DC measurements

This article offers some techniques to measure voltage, current and power. The simplest variant requires only one component, a Hall sensor which measures the alternating current. The most sophisticated measure the effective value variant (RMS) voltage and current, It takes into account the waveform and corrects the phase shifts. Finally, an application on the PC calculates the real power, the power factor, the cost per hour and the total cost for a certain period of time.

An important aspect of measuring the real power is that it could also give negative values. A positive power value indicates that it is withdrawing energy, while a negative value indicates that you are entering energy towards the network. This feature is useful for those with solar panels. The power company in these cases uses two counters, but we'll get the same result by measuring at one point.

To collect data you can use a master module, or an Arduino for which we developed a firmware (Sketch) with improved characteristics compared to similar projects. The firmware that we have developed can easily be used by Arduino experts, even outside the Theremino system also seamlessly communicate with the PC.

## Measuring circuits

Here we present only the circuits for measuring currents and voltages alternate (50 O 60 Hz) but you could also measuring DC voltage and current and calculate the power. For the DC voltage (referred to ground), it simply would use a resistive divider. For the direct current you could use the current sensor illustrated in This Page.

To measure voltages and currents alternate, as well as the power consumed by the devices connected to the AC mains or the power generated by the solar panels, we have prepared two measuring circuits adaptable to different full-scale, from a few volts to thousands of volts, and from a few amperes to thousands of amperes.

Circuit for measuring the alternating voltage

Circuit for measuring the alternating current

These circuits are simple but accurate and reliable, and stand extra-voltage and extra-high currents.

The construction details and the detailed explanations in the documentation that is discharged at the end of this article.

## Measure the current with a magnetic sensor

As an alternative to the previous circuits, you could measure the alternating current with a single magnetic sensor (a Hall-effect sensor).

Simply approaching the sensor in a wire is obtained a signal proportional to the current that runs through it.

Theoretically, one could also use this method to measure DC currents, but the system would be sensitive to each magnetic unbalance. So in this project we will restrict ourselves to measure alternating currents to the frequency of the electricity network.

This method requires no electrical connections to the wire paths from the mains voltage, so it is very safe.

In the documentation that is discharged at the end of this article you will find a table with the initials of the sensors to be used, the advice to place the sensor, images for links and procedures for the calibration of the scale.

## Safety Note

Beware that some mistakes could be dangerous. For example,, during calibrations, He is linking the tester to measure the current in parallel, rather than in series, it would create a short circuit with severe consequences. Check out several times and if something is not clear documentation ask for help from an electrician or better from an electronics expert.

If you do not make blunders circuits that we propose are completely safe. The maximum voltage on the components is less than 30 volt, then you can touch them without any danger.

The only point to pay attention to is the primary of the transformer to measure the voltage which is connected to the network.

To make it safe, and comply with security regulations, just use a sealed transformer, with the cable and the plug, as explained in the documentation.

## The application PowerMeter

By means of the controls on the right you can configure the application to different measures:

• Measure the voltage only.
• Measure the current only.
• Measure voltage and current and calculate the apparent power.
• Measuring the effective values ​​of voltage and current.
• Correct the phase shifts of the measuring circuits.
• Taking into account the waveform of voltage and current.
• Calculate the real power and power factor.
• Highlight if the power that is measured is absorbed by the network or sent to the network.
• Calculate the Euro (or other currencies) They spend each hour.
• Calculate the Euro (or other currencies) total, I spent the last reset.
• Send the output slot calculated values, so that other applications can use them.

## Connection to the PC

Currently, whether using a master module that an Arduino, PC connection is via USB cable. So for a stable installation, you may use one StickPC near the counter. One StickPC consumes a few watts, You may be always on and accumulate data in a file. To control it and search the data you could use TeamViewer.

We are preparing the new modules that communicate via WiFi with your PC. They will be an evolution of the current NetModule. So will You can use this same firmware to control many users away from PCs.

## WiFi and compatibility with Arduino

The new modules, planned for the beginning of 2019, They will also be programmed using the Arduino IDE and can use libraries written for Arduino. Then, in addition to the usual easy control that you have with the system Theremino, They may also be expanded by those who know Arduino and know how to program in C ++.

These modules are the union of all that we have done so far (Master – HAL / netmodul to – Netaala / Arduino – ArduHal). We will use a single module that will do all. It will be called IotModule, It will be based on a ESP32 and communicate with the application via WiFi IotHAL, Network, Internet USB.

## Documentation

download This pdf file that contains all the details for the construction of the circuits, the pictures that explain how to connect the modules together and the instructions for using the firmware and software.

going on This Page you can download other documentation, including instructions in English, the application PowerMeter, the firmware for Arduino, The Eagle projects for making printed circuit boards and assembly plans with 3D images.

 VOTE
0 replies