vc830 is a little C program which reads serial data from a voltcraft VC830 digital multimeter and transform it to different output formats.
The VC830 is based on the FS9922-DMM4 IC from Fortune Semiconductor Corporation, see the FS9922-DMM4-DS-15_EN.pdf manual.
After different tests with sigrok I didn't find a working solution with this framework and its vc830 driver. Additionaly, having some RS232 adapter problems (the adapter uses an optical IR recveiver and needs power from RTS/DTR lines) I decided to "understand" the whole situation. And what's better suited than solving the problem by myself for doing that? 🤔
Here we are...
The program has no dependencies to external libraries and you can simple compile the single file with gcc or use the given Makefile:
$ make
gcc -O3 -Wall -o vc830.armv7l vc830.c
Because I worked with multiple environments, a architecture extension is added to the compiled program (.armv7l in this case).
The program supports the following parameters:
Usage: vc830 [-f output-format] [-t time-format] [-c count] <tty device>.
-f output-format keyvalue, json, human, si, speech Default = human
-t time-format iso, local, epochsecms, human, none Default = none
-c count number of samples Default = endless
If you have a connected VC830 (as device /dev/ttyUSB0
in my case) you can use the following command:
$ ./vc830.armv7l /dev/ttyUSB0
-8.26 V DC AUTO
-8.26 V DC AUTO
-8.26 V DC AUTO
...
This will produce around 2 samples per second.
You can also test the program with the test data set. If you don't want the default output format, use the option -f keyvalue/json/human/si
with one of the format specifier.
$ ./vc830.armv7l -c 1 -f json test.dat
{
"receivedAt": "2021-04-17T23:45:51.173158+0200",
"sign": "-",
"mode": "DC",
"unit": "V",
"prefix": "",
"fullUnit": "V",
"info": "AUTO",
"barGraph": 8,
"barGraphIsShown": true,
"batteryWarning": false,
"autoRangeActive": true,
"holdActive": false,
"deltaActive": false,
"overflow": false,
"rawRisplay": "08.26",
"formatedValue": "-8.26 V",
"formatedSiValue": "-8.26 V"
}
receivedAt=2021-04-18T00:59:12.597168+0200
sign=-
mode=DC
unit=V
prefix=
fullUnit=V
info=AUTO
barGraph=8
barGraphIsShown=true
batteryWarning=false
autoRangeActive=true
holdActive=false
deltaActive=false
overflow=false
rawRisplay=08.26
formatedValue=-8.26 V
formatedSiValue=-8.26 V
-8.26 V DC AUTO
Same as "Human", but the value is normalized to SI base units. E.g. if the VC830 with autorange enabled (default) has "50 mV", then the output shows:
0.050 V DC AUTO
This output format is specifically for feeding a voice synthesizer. It generates an output only in case of changes. The number of decimal places is limited to one.
Currently only German is supported, but this can be easily changed (see textToSpeechData[]
array).
Batterie Warnung
Automatische Bereichswahl
Gleichspannung
3,3 Volt
2,5 Volt
1,6 Volt
2,6 Volt
3,3 Volt
1,5 Volt
1,2 Volt
...
You can prefix the "Human" and SI outputs with different time formatings. In the JSON and Key/Value output you will find the chosen time format in the receivedAtFormated
field. The receivedAt
field always contains the ISO 8601 format.
Use the -t iso/local/epochsecms/human
to select one.
watch_and_compile.sh
Background compile script. Calls the makefile every time the source is changed. Ideal for fast developments with different operating systems. This script needs the fswatch package (install with "apt install fswatch" on debian or "brew install fswatch" on macOS)capture_data.sh
Dumps from raw data from serial device to file test.dat. This file can be used as a input file to test the program. You should start the vc830 once before to setup the serial parameter (2400 baud)!.test.dat
Pre-Captured data with different measurements.
- macOS
- Debian on Rasberry Pi
The C source is formated with:
{ BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 0, AlignConsecutiveAssignments: true, AlignConsecutiveMacros: true, AlignConsecutiveDeclarations: true, AlignOperands: true, AllowShortBlocksOnASingleLine: true, AllowShortIfStatementsOnASingleLine: true, AllowShortLoopsOnASingleLine: true, KeepEmptyLinesAtTheStartOfBlocks: true, BreakBeforeBraces: Linux }
- Describe adapter circuit
- Add CSV output option
- Add symlinks for device files
- Loop until device file appears (waiting until USB adapter is plugged in)
- Suppress multible same outputs (stable measurement)
- ...
Have fun,
Thomas Welsch. [email protected], 2021