Energy Meter module to analyze the electrical grid parameters and consumption: the software (part 2)

By on July 25, 2018
Pin It

 

In the first installment, you had the opportunity of learning about our energy meter, and of learning about its details, with special attention the technical ones. Our energy meter is based on the coupling – by means of two measuring transformers – to an integrated circuit, that enables the detection of the values as for voltage and current, in addition to the corresponding phase angles, so to be able to know the real, the reactive and the apparent power, in addition to the phase angle (cosφ). We developed a software to be paired to our measuring board, so that it may be used for the configuration and calibration of the integrated circuit, and for the real-time display of the electrical measurings that it has carried out. The software may also be used in order to calibrate a hardware base that is different from ours, given that the measuring hardware described in the first instalment is only one of the many possible examples of development; if anyone wanted to try with his own project – provided that it is based on the MCP39F511 – he may take advantage of our software, for the configuration of the integrated circuit.

 

Fig. 1

 

The software has been divided into two distinct pages: the first one is needed in order to configure/calibrate the MCP39F511 integrated circuit, found on our measuring board, while the second one is needed in order to graphically display the electrical measurings in progress. Fig. 1 highlights the configuration/calibration page: as you may notice, it is divided into distinct sections, in which the different configuration registers have been grouped. Fig. 2 shows the display page for the measures: we will soon return on this subject. As for now, let’s analyze the sections in Fig. 1.

 







Fig. 2

 

Output Registers

In this section, the electrical measurings in progress are displayed. After having clicked on the “Start Read” command, the system starts a data transmission towards the integrated circuit, along with a reading request of the registers of interest, once per second. The data received is then processed in order to achieve its proper display; the processing depends on how the resolutions of the electrical measures have been defined or, if you prefer, on the number of decimals we want to display for a certain measure. At the moment we want to end a certain data communication, it is enough to click on the “Stop Read” command. When we decide to start reading session, it is needed that a data communication towards the integrated circuit has been previously activated. In order to do so, we have to give the “Open Communication” command from the “Communication” menu. Fig. 3 shows the window, along with the commands needed in order to activate a serial communication with the MCP39F511 integrated circuit.

 

Fig. 3

 

If you know the serial port to be used, you may manually select it from the drop-down menu and then click on the “Open Device” command. On the other hand, if you do not know the serial port to which the board is connected, it is possible to click on the “Auto Find Device” command; in this way an automatic search will start, and in the case the device we were looking for is found, it will be automatically connected, and will occupy the corresponding serial port. Once the device has been found, a series of information will appear in the “Connected Device” section. On the side, in the “Cmd Type” section, a list of the commands sent is created. If we wanted to see the data packets that have been sent and received, it is possible to activate the “Logger”, by clicking on the “Start Logger” command. In order to end the communication and to free the serial port, we have to click on the “Close Device” command.

 

Let’s move on now on to the display section for the electrical measures (the one proposed in Fig. 1), we would like to point out that the following measures may occur:

  • Vrms;
  • Irms;
  • Frequency;
  • Power Factor;
  • Apparent Power;
  • Active Power;
  • Reactive Power;
  • Import/Export Active Energy;
  • Import/Export Reactive Energy.

 

In order to enable the latter two functions (that are disabled, as per default settings) it is possible to click on the “Enable Energy Acc.” button; on the other hand, if you want to disable the accumulation, you will have to click on “Disable Energy Acc.”

Next, to the displayed electrical measures, the flag values found in the “System Status Register” are shown, among them there is the sign of the active (or real) power and the one for the reactive one. If the flag value is “1”, the sign is positive; if it is “0”, the sign is negative. In this section, there are also the flags for the events we discussed in the previous installment. Finally, there is the “Set the Decimals” command, needed in order to recall a window from which to set the number of decimals to be used when displaying the electrical measures. The number of decimals strictly depends on how the “Design configuration Registers” are set. As for our application, that is to say, our measuring board, the decimals have been configured as follows:

  • RMS voltage with 2 decimals;
  • RMS current with 3 decimals;
  • network frequency with 3 decimals;
  • power factor with 3 decimals, it cannot be modified;
  • apparent, real and reactive power with 2 decimals.

 

Please remember to use the same amount of decimals for the measures of the three power quantities. Fig. 4 shows the configuration window as for the decimals; we advise you not to modify these values since they have already been optimized for our application. In the case in which you wanted to configure the integrated circuit for another application, one that is different from ours, and therefore with a modified hardware, it will be up to the user to select how many decimals to use for his own electrical measures.

 

Fig. 4

 

Calibration Registers







In this section it is possible to set the calibration registers of the integrated circuit; in particular, there are:

  • Gain Current RMS = the gain value during the calculation of the RMS current (as indicated by Fig. 3 in the first installment); the gain value must be calculated as previously indicated, in the “Calibration” paragraph;
  • Gain Voltage RMS = the gain value during the calculation of the RMS voltage (as indicated by Fig. 3 in the first installment); the gain value must be calculated as previously indicated, in the “Calibration” paragraph;
  • Gain Active Power = the gain value during the calculation of the real power (as indicated by Fig. 5 in the first installment); the gain value must be calculated as previously indicated, in the “Calibration” paragraph;
  • Gain Reactive Power = the gain value during the calculation of the reactive power (as indicated by Fig. 6 in the first installment); the gain value must be calculated as previously indicated, in the “Calibration” paragraph;
  • Phase compensation = the value for the phase compensation; it is applied to the voltage measures (as in Fig. 2, in the first installment);
  • Offset Current RMS = the calibration register of the offset in the AC current measurings; during the calibration of the offsets on the voltage and current differential inputs, no signal must be found;
  • Offset Active Power = the calibration register of the offset in the real power measurings; during the calibration of the offsets on the voltage and current differential inputs, no signal must be found;
  • Offset Reactive Power =  the calibration register of the offset in the reactive power measurings; during the calibration of the offsets on the voltage and current differential inputs, no signal must be found;
  • DC Offset Current = in the DC applications, the high-pass filters on the voltage and current measuring channels are turned off; in order to remove the residual DC value it is possible to use this register;
  • Apparent Power Divisor = in this register, an integer value must be specified, in order to align the apparent power to the resolution set as for the RMS current and voltage.

 

Fig. 5

 

Once the correct values for your application have been specified, you will have to move on to the veritable programming, that simply consists in sending the pieces of data to the MCP39F511 integrated circuit, so to then memorize them in the Flash memory. First of all, the registers you want to program must be ticked; after that, you will have to click on the “Write Calibration Registers” command; in this way, the registers will be programmed, with the desired values. On the other hand, if you wish to read the data found in the registers of the MCP39F511 integrated circuit, you will have to click on the “Read Calibration Registers” command; in this case, all the registers in the “Calibration Registers”’ section will be read and displayed in the corresponding boxes.

 

Fig. 6

 

Design Configuration Registers

In this section, the calibration registers, the reference for the network frequency, the register with the accumulation interval, the power threshold for the energy accumulation and the Range register are programmed. There are the following entries.

  • Calibration Current = the register containing the value of the calibration current used during the calibration stage; we advise to have a purely resistive load that absorbs a known current; if we suppose a resistive load having a 5A absorption, the value to be specified in the register is 5,000, if we suppose we wish a 1mA resolution on the measure (3 decimals). If on the other hand, we had wished for a 10mA resolution, the value to be specified would have been 500, and therefore 2 decimals. As regards our application, we have a 1mA resolution and therefore 3 decimals.
  • Calibration Voltage = the register containing the voltage value used during the calibration stage. In this case, it would be useful to have a stable network voltage. Supposing we supply a stable voltage value, one that is equal to 230V, the value to be specified in the register – with a 10mV resolution on the measure – is 23,000. As regards our application, we have a 10mV resolution and therefore 2 decimals.
  • Calibration Active Power = the register containing the real power value that has been used during the calibration stage. Supposing a calibration power equal to 2kW, a possible value to be specified in the register could be 200,000. In this case, a 10mW resolution is ensured. As regards our application, we have a 10mW resolution and therefore 2 decimals.
  • Calibration Reactive Power = as for the previous entry but applied to the reactive power.
  • Line Frequency Reference; in this register, the expected frequency value is specified. Supposing a 1mHz resolution, the value to be specified is equal to 50000 in the case of a frequency network equal to 50Hz. If the network frequency was 60Hz, the value to be specified would have been 60000. As regards our application, we have a 1mHz resolution and therefore 3 decimals.
  • Accumulator Interval = the register containing the accumulation interval, that is to say, the number of network cycles that we wish to use as for the calculation of the electrical measures. A possible value is 5, that corresponds to 32 network cycles.
  • No Load Threshold; in this register, a value for the threshold power is specified, concerning the energy accumulation. With a 1mW resolution, a value that is equal to 1000 indicates a 1W threshold.
  • Range = that’s a 32-bit register and – apart from the most significant 8 bits, that are unused – it is possible to divide it into three distinct sections: P-Range, I-Range, and V-Range. Each one of them identifies the number of shifts to the right that must be applied to the measured value so that it is within a specific measuring range. This value is strictly related to the calibration formula (the one that we studied before), so to get the measured value as much as possible closer to the expected value. Therefore, depending on the kind of hardware and on how the amplification section was configured, the correct value to be specified in the registers will be calculated.

 

 

System Configuration Register

This register must be very carefully configured; it is divided into different sections, each one having a specific function. The configuration bits with programmable gains of the input section concerning the voltage and the current, that is to say, “PGA CH0” and “PGA CH1”, are essential ones. In our application, we have a value for both “000”s, it identifies a gain equal to “1”, that is compatible with the maximum differential value found at the inputs (±600mV). If we had a maximum signal equal to ±300mV as an input value, we would have had to set the gain to “2” and then “001” and so on, as shown by the table found on the datasheet. The second group of bits identifies the communication speed of the UART interface, that in our case is the default one, at 115,200 Baud, and it is identified by the “000” value. The “ADC Reset” section is needed in order to reset both ADC converters (“11”), or just the voltage ADC converter (“10”), or just the current ADC converter (“01”), or to have no reset (“00”), that is the default condition. The “ADC Shutdown” section is needed to shut down both ADC converters (“11”), or just the voltage ADC converter (“10”), or just the current ADC converter (“01”), or to have no shutdown (“00”), that is the default condition.

The “VREFEXT” flag is needed in order to select the internal or the external voltage reference. As per default settings, the internal reference is used, and therefore the flag must be set to “0”. The “TempComp” flag enables or disables the temperature compensation. The “Single Wire” flag is needed to enable or disable a “Single Wire” transmission, and as per default settings, the latter is disabled. The three remaining flags concern the management of the Zero Cross Detection. The “ZCD_Output_Dis” flag is needed in order to enable or disable the ZCD output. As per default settings, it is set to “0“ and therefore the output is enabled. The “ZCD_Puls” flag sets if the Zero Cross is to be returned as the logical state of the input for each zero crossing identification of the input voltage, or if it is to be returned as a 100µS pulse for each zero crossing. Finally, the “ZCD_Inv” flag indicates if the ZCD output has been inverted or not. The “VREFCAL” parameter indicates the internal voltage reference concerning the temperature coefficient.

 

Event Configuration Register

This 32-bit register contains a series of flags that are needed for the management of the events we previously discussed. The bits that are needed in order to configure and manage the events are 5: in practice there are 2 bits for the mapping of the required event on the outputs pins (EVENT1 pin or EVENT2 pin), 1 bit in order to simulate the event (TST), 1 bit in order to test if the event occurred (LA) and 1 bit in order to reset the event itself (CL). In addition to the configuration bits we just mentioned, we also have to consider the registers in which to memorize the threshold above which the event is registered. These events concern the “Voltage Sag Limit”, the “Voltage surge Limit”, the “Overcurrent Limit”, the “Overpower Limit” and the “Overtemperature Limit”.

The last three events are a matter of routine, while the first two require some additional explanations since the integrated circuit manages them in a way that is very different from the last three. The “Voltage Sag” term indicates a sudden decrease in the RMS voltage in an extremely short lapse of time. This phenomenon may be due to a short circuit on the line, or to an overload or to an electric engine starting. The RMS voltage could decrease for a value between the 10% and the 90% of the nominal voltage, as shown in Fig. 5. Moreover, it is possible to identify three kinds of SAGs: the instantaneous one, the momentary one, and the temporary one. The first one lasts from half a sinusoid cycle to a maximum of 30 cycles, the second one lasts from a minimum of 30 cycles to a maximum of 3 seconds and the last one from a minimum of 3 seconds to a maximum of 1 minute. Differently, from the previous one, the “Voltage surge Limit” term indicates a sudden increase in RMS voltage in an extremely short lapse of time, as shown in Fig. 6. The duration of these pulses remains at about a maximum of 50 µs, as concerns the overvoltages, and at 20µs as for the overcurrents.

As hinted before, and given their nature, these events are managed by the MCP39F511 integrated circuit in a different way, with respect to the other ones. In practice, the algorithm carries out a verification for each sinusoidal cycle, instead of waiting that a computation cycle is completed. The equation the system refers to is the following one:

 

Therefore, each time there is a ready piece of data coming from the ADC, the VSA value will be compared to the threshold values set for the “Voltage Sag” and the “Voltage surge”. If the thresholds have been exceeded and if these events have been mapped on the output pins, then an interrupt will be generated. It will then be up to the user to manage this event and then to reset the dedicated flags so that they are ready to intercept again this event type. If the flags corresponding to the event are not reset, the integrated circuit will not record any other event anymore. In order to set the threshold levels, the dedicated window must be recalled, by clicking on the “Set Event Threshold” command.

In order to load the registers with the above-shown configurations, excluding the thresholds for the events, you will have to click on the “Write Design Configuration Registers” command, while in order to read the registers, you will have to click on “Read Design Configuration Registers”. Please notice that the configuration set for the “System configuration Register” and for the “Event Configuration Register” will always be sent to the integrated circuit when the programming is started by means of the “Write Design Configuration Registers” command, while as for all the other registers they must be selected by means of the dedicated tick box, in the same way, shown as for the “Calibration Registers”. Everything that has not been ticked will not be sent to the MCP39F511 integrated circuit. To satisfy your curiosity, we advise you to take a look at the log of the data packets sent from the PC to the integrated circuit, as hinted before. From an educational point of view, this is very useful, so that you may get an idea of the “frames” sent and of the replies received from the integrated circuit.

Let’s see now how to set and program the thresholds as for the above-described events. First of all, you will have to recall the specific configuration window, by clicking on the “Set Event Threshold” command; Fig. 7 shows the configuration window. It may be noticed that, for each text box in which to specify the threshold value, there is a corresponding tick box in order to select which values have to be sent to the integrated circuit, and which ones should not. Once the thresholds of interest have been configured and selected, you will have to click on the “Write Event Threshold” command, in order to send the data to the integrated circuit, with the memorization on the Flash memory following. If on the other hand, you wish to see how the registers have been configured, you will have to click on the “Read Event Threshold” command; in this way, the memorized information concerning the integrated circuit will be shown. Please notice that the threshold value to be specified must have the same resolution set as for the electrical measurings. In other words, if you have set two decimals as for the voltage measuring, then the voltage threshold value must have two decimals; the same goes for the other measurings. The only threshold that does not follow this rule is the “Over Temperature Limit” one, that accepts values ranging from 0 to 1023.

 

Fig. 7

 

Min/Max Registers

In this section, it is possible to program the registers for the management of the minimum and maximum values detected by the integrated circuit during the electrical measurings. It is possible to set up to two minimum/maximum measures and in order to do so, it is enough to load – in the dedicated registers – the memory address of the electrical measure we wish to monitor. For example, if we wish to trace the minimum/maximum of the RMS voltage measure, we will have to load the “0x0006” value in the “MinMaxPointer1” or in the “MinMaxPointer2” register.  The tracing of the minimum/maximum measures may be associated with all the electrical measures, excluding the ones related to the imported/exported energy. Let’s return therefore to our software, in which it is possible to select, by means of two drop-down menus, which measure to associate to the corresponding minimum/maximum register. Immediately below it, there are some text boxes that show the minimum and maximum values that have been recorded by the integrated circuit, as for the set measuring value. Depending on the selected measure, the labels before the text boxes will change the meaning. In other words, if the RMS voltage has been selected, the label will be VRMS; if the RMS current has been selected, the label will be IRMS; and so on. In order to make the chosen configuration an operational one, you will have to send the data to the integrated circuit; in order to do so, you will have to click on the “Write Min/Max register settings” command, but before that please tick the boxes on the side of every drop-down menu whose electrical measure has been selected so that it may be monitored. With the “Read Min/Max registers settings” command, the parameters that have been configured as for the minimum/maximum and the corresponding memorized values during the electrical measurings will be read. In order to reset the minimum/maximum configurations, you will have to write the 0x0000 value in the two configuration registers. In order to do so, you will simply have to click on the “Reset Min/Max” command.

 

Registers list

Last but not least in this discussion, in this section, a table with all registers found in the MCP39F511 integrated circuit will be shown. The table has been divided into colored sections, so to highlight a different kind of registers: “Output registers”, “Calibration Registers”, “Design Configuration Registers”, “EMI Filter Compensation Registers” and “Temperature Compensation and Peripheral Control Registers”. In order to read all the registers in a single run, please click on the “Read All” command. Once all the pieces of data found on the integrated circuit have been read, the software will deal with updating the table. Please notice that even with the  “Start Read” command the table is updated, but in this case, it will NOT be that all the registers are updated, only the ones concerning the electric measurings in progress will be. The same goes for all the reading commands we previously discussed. The last two commands complete this overview: the first one is named “Write All” and, as suggested by the name, it is needed in order to program the MCP39F511’s registers by means of a single command. Therefore, once all the registers have been programmed with the values that are the correct ones for your application, it is possible to choose to use the programming commands shown above for each section, or to use the “Write All” command that will deal with sending all the relevant pieces of data to the integrated circuit. Obviously, only the pieces of data that have been ticked (by means of the dedicated tick box) will be sent. All the other ones will be ignored. Finally, there is the “Reload Factory Parameters” command, that is needed in order to reload the factory default settings. This is carried out by writing 0xA5A5 at the 0x005E memory address.

All the configuration settings we have discussed may be saved in an XML file, so to recall them at any moment. Inside the file, both the values assigned to the registers during the configuration and the ticked boxes for their programming will be memorized. Therefore, every time you want to configure and calibrate the MCP39F511 integrated circuit to be used in your application, it is possible to read the corresponding XML file and to proceed to the programming of the integrated circuit. To operate in this way is useful in the case in which you have to program different boards having the MCP39F511 integrated circuit on board. For this kind of programming, it is advised to use the “Write All” command.

The second page (“Graphs S1346 Board with MCP39F511”) may be used for a continuous reading of the electrical measures and to display their trend, both in a numerical and in a graphical way, during the execution of the electric measures that have been carried out in time. You have seen in Fig. 2 how the different electric measures have been displayed, along with the corresponding diagrams. On the left, there are all the electrical measures that have been displayed in a numeric form, and they give the idea of the real-time situation of the electrical system. The measures that are displayed include the three power measures (apparent, real and reactive). Down and on the right, some of the electrical measurings in progress are displayed. The voltage and the current have been separately traced, while the three power measures are traced together.  These are some scroll graphs, with a 30 seconds temporal window, in which it is possible to see the electrical measures flowing in time. Depending on the loads connected to the system, we will see changes in the way the measure is graphically displayed, and highlighting the variations in the power absorption, in real time.

As for the energy measures – if active – they are traced in a diagram, down and on the left, in the bar chart format. All the four energy measures are returned by means of four different colors.

In the display page, there are six commands, that you will see as follows:

1) the icon signed with the number “1” is needed in order to start the reading of the registers containing the electrical measures, the reading frequency occurs once per second. Before starting to read the registers containing the electrical measures, the communication between the PC and the MCP39F511 integrated circuit must be enabled, as previously described;

2) the icon signed with the number “2” is needed in order to end the reading of the registers in progress;

3) the icon signed with the number “3” is needed in order to delete the data displayed in a numeric form and traced in the respective diagrams;

4) the icon signed with the number “4” is needed in order to set the parameters for the writing on a file; in practice, it is possible to save the electrical measures directly on a file, so to have a complete picture of the daily consumption as for the electrical system; the user may choose if to save the data in the CSV or in the xlsx format; Fig. 8 shows the configuration window with all the parameters available;

5) the icon signed with the number “5” is needed in order to recall and display all the data that has been memorized in the CSV files that we previously saved, in a graphical way. In this case, the measures as for frequency, power factor and imported/exported energy will be shown;

6) the icon signed with the number “6” is needed in order to recall and display the data that has been memorized in the CSV files that we previously saved, in a graphical way. In this case, it will display the measures as for voltage, current, and power.

 

Fig. 8

 

As said before, Fig. 8 highlights the configuration parameters as for saving the electrical measures on a file. The program enables the saving of the data, both in the CSV format (exclusively text ones) and in the xlsx format, that contains both the data and the corresponding diagrams.

By means of two tick boxes, it is possible to select whether to save the data in the CSV or in the xlsx format, or in both formats. In the case in which you decided to save the data in the CSV format, you will have to select the separator. For each measuring that has been carried out by the program, it saves a string with the acquired data, and each one of them is separated from the others by means of the chosen separator. Among the available separators, the default one is the semicolon. It is advised to use it if the pieces of data that are saved in the file have already been rescaled (the rescaled pieces of data are of the double type and therefore they contain the comma as a decimal separator). If on the other hand the data has been saved in the non-rescaled format, that is to say, the RAW one, it is possible to choose the comma or any other separator. Of course, it is possible to choose only a single separator at the time.







Once the separator to be used has been selected, you will have to decide which measures to save on the file, in this case, there is a series of tick boxes that enable us to select the measures you’re interested in. The measures that have not been ticked will not be included in the file. Another parameter to be configured is the sampling frequency, in other words, how many samples are to be saved in a given time window. It is possible to choose among three options:

  1. Sample/Sec  One sample per second (86,400 electrical measurings per day). In this mode, the measurings that have been carried out are saved once per second. However, the software does not save on the file once per second, but it gathers the pieces of data in the RAM, for a period of 60 seconds; once it has expired, the accumulated data is saved on the file.
  2. Sample/10Sec  One sample every 10 seconds (8,640 electrical measurings per day). In this mode, the measurings that have been carried out are saved every 10 seconds. In this case, the software gathers the data in the RAM, for a period of 10 minutes; once it has expired, the accumulated data is saved on the file.
  3. Sample/60Sec  One sample every 60 seconds (1,440 electrical measurings per day). In this mode,  the measurings that have been carried out are saved every 60 seconds. In this case, the software gathers the data in the RAM, for a period of 60 minutes; once it has expired, the accumulated data is saved on the file.

 

Therefore, the more you want to be accurate with your measurings, and thus to have a better graphic representation of the data that has been acquired in time, you will have to choose “Sample/Sec” as a sampling frequency. If on the other hand, you want to acquire fewer samples and have less accurate diagrams, it is possible to opt for a sample every 10 seconds or every 60 seconds.

Finally, if you have to select in which directory to save the electrical measures that have been acquired, in order to do so you will have to click on “Path Selection” and then to select the path in which to save the files containing the measures. Once the path has been selected, the software will divide – in a totally automatic way – the electrical measures by day, month and year. In other words, the directory for the current year will be created, if not found; under the directory for the current year, twelve folders will be created (one per each month of the year), and finally in each folder for the current month, the data acquired by the integrated circuit will be saved, daily. The names assigned to the files will be thus composed: “YYYYMMDD” in which “YYYY” identifies the current year, “MM” identifies the current month and “DD” identifies the current day. Once all the parameters have been configured, please click on “OK” in order to save the configuration. The saved configuration will be retrieved and used at each time the software is started.

The CSV files are text files that – as said before – take advantage of the characters known as separators, in order to divide the fields therein contained. For each generated file, the software creates a heading line with the names of the measures contained in the file, followed by as many lines as the measurings that have been carried out. In practice, it is as if the file was divided into rows and columns. Each line identifies a set of electrical measures and each column identifies the corresponding electrical measure. Before each line there is a piece of data named as timestamp, it indicates the moment of the day in which that set of measurings has been carried out. Just to be clear, the content of each line found in the CSV file could be as the following one:

 

13:43:38;228,13;7,903;50,148;0,948;1802,88;1710,25;123,07;1;0;0;0

 

As said before, the timestamp is ahead. Each field is divided by the “;” separator.

The file heading, that is to say, the first line is thus represented:

 

TimeStamp; Voltage; Current; Frequency; Power Factor; Apparent Power; Active Power; Reactive Power; Imported Active Energy; Exported Active Energy; Imported Reactive Energy; Exported Reactive Energy

 

Even in this case, each field is separated by the “;” separator.

On the other hand, as regards the xlsx files, they are preconfigured Excel files, to which the software adds the data acquired during the electrical measurings; Fig. 9 shows what has been explained. Differently, from the CSV files, the xlsx files take up much more space on the hard disk. It is advised to use the CSV files, since they are more practical and lean in the management as for this kind of applications. The CSV files that have been created may be opened by the software and by taking advantage, as said before, of the previously described icons 5 and 6. Icon 6 is needed in order to recall the display window for the electrical measures as for voltage, current and for the three electrical power quantities, while icon 5 is needed in order to display the frequency measures, the power factor, and the imported/exported energy.

 

Fig. 9

 

Fig. 10 shows the content of the CSV file displayed, as regards the voltage, current and power measures. In order to properly open the files, a pair of selections must be carried out, as regards how the electrical measures have to be saved in the file, and as for the separator that has been used. As it has been said different times already, the software uses the “;” separator as per default settings. However, the user may select other separators, depending on the one that is used, in order to generate the CSV files he wishes to open. In addition to the separator, the user must select whether the data contained in the file has to be already rescaled during the writing stage, or if the file contains the RAW files, that is to say, in the way they were read by the integrated circuit, without any kind of processing. On the right there are three icons:

  1. the icon signed as “1” is needed in order to reset the content of the diagrams
  2. the icon signed as “2” is needed in order open a CSV file
  3. the icon signed as “3” is needed in order close the window for the diagram display

 

Fig. 10

 

Fig. 11 shows the content of the CSV file as displayed, as regards the frequency measures, the power factor, and the imported/exported energy. All of the remarks made as for the previous display window are still valid.

 

Fig. 11

 

Software installation

The software is supplied as an installation file and it is compatible with the Windows 7 SP1 operating systems, and following ones. In order to install the software, you will have to run the installation file, in the administrator mode. In order to do so, it is sufficient to click – by means of the right mouse button – on the file and to recall the “Run as administrator” option. Once the installation has been completed, you will have to install a font that is not found in the operating system; in order to do so, it is enough to reach the “C:\Windows\fonts” folder (we refer to a Windows 7SP1 operating system), and to copy and paste the two files, “TRANA___.TTF” and “TRANGA__.TTF”, there. The operating system will automatically install the desired fonts. These fonts simulate the character of a display, with 7 segments having a fixed spacing as if it were a Courier New. If we didn’t install the font, the graphic representation page of the measures would show a wrong character as for the numeric display of the electrical measures. We also supply an XML file, along with the software: it contains the configuration of the registers as for the MCP39F511 integrated circuit. The configuration has been calibrated on our electronics, and therefore might not be suitable for other applications. The file containing the configuration of the registers is named as “MCP39F511 calibration values (S1346)”; it may be found under the “MCP39F511 Configuration” folder, found in the directory in which you installed the software.

At this point, we may consider the discussion concerning the MCP39F511 integrated circuit, and the related configuration software, as complete. We will propose some applications based on this interesting product by Microchip as soon as possible, so to give you new development ideas.

 

From openstore

Energy meter module

USB to Serial converter

CURRENT MEASUREMENT TRANSFORMER

VOLTAGE MEASUREMENT TRANSFORMER

About Matteo.Destro

I'm a developer of hardware, firmware and software. I like understand the new tecnologies and use it to develop new devices. Currently i work for a society that produces and develops a system bus for home and bulilding automation

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
0 Comment authors
Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
trackback

[…] second post is a bit less lethal since it covers the software although it wasn’t clear where to actually get the code. However, since the MCP39F511 has a […]