[excuse my English]
The problemAn exponential grows the amount of IoT devices has caused the generation of the huge amount of data. The IT industry is ready to store and analyze this big data wave but how about readiness of data itself to be a part of the mankind culture? I mean the quality of every data point which has sent by connected device. What is behind the measurement, say, 5V? How precise this value? Is measurement tool was certified, verified, and correctly calibrated? From science point of view the differences between the data point generated by some abstract ADC and data point which measured by recommended tools and calculated on statistical base, the same like a between the cherry and nettle.
The time to talk about Metrology - the science of measurement. Let's call it a metrology of things (MoT). In general, my EtherMeter project is just a metrologically correct data source. Every data point generated by this connected multimeter is a set of parameters containing not only single measured value but also indicating the level of measurement quality.
The idea is a very simple - to connect serial multimeter to the cloud (google sheet today) and to provide some statistical preprocessing of measured data.
Two main features have been realized:
- single measurement (by user's command)
- monitoring - periodial measurement and registering data into the cloud.
With EtherMeter user need not make any estimations of measurement precisions manually. The software do it for him on the fly accordingly to the guide provided by multimeter manufacturer.
Software InstallationClient application (Multimeter) is Microsoft .NET Core 2.1. In theory it is possible to run application on many platforms but I will use Microsoft Windows 10.
Tools
- Microsoft Windows 10
- Application archive EtherMeter.zip
.NET Core installation verification
In Command Prompt get dotnet version:
C:\Temp>dotnet --version
2.1.302
Expected reply (2.1.xxx):
Setup application EtherMeter
Download EtherMeter.zip and unzip it to new folder (C:\EtherMeter\ in this manual)
In command prompt get application help. Expected reply:
C:\EtherMeter>dotnet Multimeter.dll --help
Usage: Multimeter Console [options]
Options:
-?|-h|--help Show help information
-l|--list Serial Port List
-c|--com Serial Port Name
-m|--model Multimeter Model
-sm|--supported_models Supported Multimeter Models
-b|--barcode Multimeter Model Barcode
-i|--ip IP address and IP port
-g|--google_sheets_id Google Sheets ID
-mon|--monitoring Monitoring Application Mode
Get supported multimeter models (--sm).
Expected reply (Manufacturer, Model, Barcode):
C:\EtherMeter>dotnet Multimeter.dll -sm
info: Multimeter.MultimeterMain[0]
UNI-TREND, UT60A, 6935750560013
info: Multimeter.MultimeterMain[0]
UNI-TREND, UT60E, 6935750560051
Please note that I have tested only UT60A. Other models have the same protocol, accordingly this.
Hardware InstallationPlease note that in this manual I have changed real IP addresses. You must use correct ip addresses and port according your settings.
PC-COM connected Multimeter
If you have not WIZnet device you can connect multimeter to PC serial port.
Turn on multimeter. In Windows you can use Device Manager to get correct serial port name.
Run application with --com or -c option with serial port name parameter. Another option is a Multimeter model -m UT60A. By the way you can use unique barcode instead --model (-m) option. For example, --barcode 6935750560013 has the same effect like a -m UT60A option.
C:\EtherMeter>start dotnet Multimeter.dll -m UT60A --com COM3
And press "HOLD" button couple times to get single values.
Tools
- WIZnet firmware archive WIZnetFirmware.zip
Jumpers
Power off device before any hardware configurations.
Upload Firmware and setup IP address
- Download and unzip firmware archive WIZnetFirmware.zip.
- Connect Ethernet cable and Serial port cable to Multimeter (UT60A in this case).
- Power on WIZnet.
- Using WIZnet S2E Configuration Tool upload ethermeter.bin and setup IP Address and IP Port.
- Power Off and Power On WIZnet again.
- Turn ON multimeter and select Voltage, DC mode.
- PING WIZnet to be sure about configuration is correct.C:\EtherMeter>ping 192.xxx.yyy.zzzExpected reply:Ping statistics for 192.xxx.yyy.zzz:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss)
- Run PuTTY and connect to WIZnet by Telnet using IP:Port configured above.
- Close PuTTY
Run Multimeter client application
C:\EtherMeter>start dotnet Multimeter.dll -m UT60A -i 192.xx.yy.zz:5000:192.aa.bb.cc
To open application in separate window used start command.
Remote IP, Port and local IP: -i <remote IP>:<Port>:<local IP>
Preferable local IP you can get using ipconfig command.
After open application window, press couple times HOLD button on the multimeter.
Press <Enter> to exit.
Next step is sending data to the Cloud. I will use Google Sheets.
Google API setup- Login/Create GMail account
- Create API Project
- Go to Google Developer Console
- Select a project
- Create project (“+” button)
- Enter unique project name
- In this case, the application will be accessible by URL https://wiz-net.appspot.com/
- Enable API access
- Click ENABLE APIS AND SERVICES
- Search and choose Sheets API
- Enable API
- Create credentialsIf you see the warning “To use this API, you may need credentials. Click 'Create credentials' to get started.” you need to create it.
- Choose correct parameters (Google Sheets API; Web server; Application Data; No, I’m not using them). More details and laconic video is here
- Add credentials to your projectService Account Name: metrologistRole:Project/EditorKey type: JSON
Please note - service account name can be any you want but you need to save the json file and to know final account name. In this case: metrologist@wiz-net.iam.gserviceaccount.com. We will need this name to share sheets access to this account.
Now you must rename this json-file to “client_secret.json” and save it in application folder (see below).
- Create Sheets
- Go to the Google Drive
- Not required but you can create new folder for your measurements. Say “Measurements” (My Drive/New Folder…)
- Create blank spreadsheet (New/Google Sheets/Bland Spreadsheet)
- Not required but you can set an arbitrary name. Say “Multimeter Data”.
- Share editor access to API access account. In this case to metrologist@wiz-net.iam.gserviceaccount.com. SHARE link at right top corner.
- Get spreadsheet ID from URL address. In this case:https://docs.google.com/spreadsheets/d/10PJBzeEuGjfwFVBG_i6_W0qYL34Vm_hVDHw4nPMs0Pk/edit#gid=0Spreadsheet ID: 10PJBzeEuGjfwFVBG_i6_W0qYL34Vm_hVDHw4nPMs0Pk
We need this ID for application parameter --google_sheets_id
- Free quote provided by Google is limited. Use Dashboard to can control API usage here
Don’t forget to copy client_secret.json file into the application folder (C:\EtherMeter\, in this manual).Let’s use it together
There are two ways to use this system - single measurement (by hold) and continuous data registration (monitoring). Default mode is a Single measurement. Use -mon or --monitoring option to activate the Monitoring mode.
Single Mode
Run application with --google_sheets_id or -g option:
C:\EtherMeter>start dotnet Multimeter.dll -m UT60A -i 192.xx.yy.zz:5000:192.aa.bb.cc -g 10PJBzeEuGjfwFVBG_i6_W0qYL34Vm_hVDHw4nPMs0Pk
Settings sheet contains parameters user can change.
Default sheet contains rare used measurements (TON, DIODE, etc).
Press HOLD button on Multimeter couple times. In this case we can see something like that:
Please not that - date and time in application is local. The same date and time in spreadsheet is UTC to use it in international community.
This spreadsheet, for example, is shared to view and accessible by link.
Let’s change the measurement mode (use Resistance, for example)
And make more measurements:
Solar Cell test - HOLD
Monitoring Mode
Run application with an additional option --monitoring or -mon option:
C:\EtherMeter>start dotnet Multimeter.dll -m UT60A -i 192.xx.yy.zz:5000:192.aa.bb.ccc -g 10PJBzeEuGjfwFVBG_i6_W0qYL34Vm_hVDHw4nPMs0Pk -mon
Press <Enter> to exit.
To make our metrology smarter let’s make some changes on the Settings sheet:
- Increase time window up to 180 sec.
- Specify Multimeter and Serial number.
Run application again.
Press <Enter> to exit.
Please note that in contrast to Single mode, in Monitoring mode HOLD button pauses data monitoring. To continue monitoring process you need to press HOLD button again.
Solar Cell test - MONITORING
As you can see the weather was sunny during single mode test and cloudy during monitoring mode testing.
ConclusionI hope the general project goal has been achieved. All routine statistics calculations made by system provided to consumer with measurement value. Also integration with Google Sheets provides to user fantastic opportunities for visualization, analyzing and community collaboration.
I have a lot of ideas to improve it. Obviously new updates will follow.
Developer’s ManualIf you need to review the source you can do it. There are two main software parts - .net core client application (C#) and firmware C/C++.
All metrological calculations have been implemented accordingly UT60A manual (russian version)
Multimeter application
I need to say that current version of my code is not perfect, not commented enough, and contains couple OOP defects. But I am starting to improve it in a week or two. Final code will be accessible on github in a month. I promise.
Tools
- .NET Core 2.1 SDK for Windows
- Microsoft Visual Studio 2017 Community Edition
- Download and unzip the archive EtherMeterDotNet.zip
- Open solution EtherMeter.sln in Visual Studio 2017
- Rebuild
After successful build and testing you need to publish project “Multimeter” to Folder.
Firmware
Honestly current firmware version is WIZnet application Sample with minor changes. Today WIZnet intended only for transfering of the RS232 byte stream to Ethernet. I plan to develop more smarter firmware in the near future.
The firmware has been built using Eclipse IDE (Oxygen).
You can setup development environment just following this guide.
I want to say many thanks to Hackster. and WIZnet for this exciting opportunity!
Comments