Click here to Skip to main content
15,878,809 members
Articles / Programming Languages / C

USB Digital Multimeter Driver Using HIDAPI

Rate me:
Please Sign up or sign in to vote.
4.84/5 (20 votes)
3 Dec 2013CPOL2 min read 61.1K   4K   39   6
This driver program decodes and displays LCD output from a Victor 86B USB DMM data packet that has been accessed using HIDAPI functions.

Introduction

The Victor 86B DMM is cheap and widely available (http://www.dealexcel.com/victor-vc86b-3-34-digital-multimeter_p1985.html) and appears a great match for hobbyist projects.

Unfortunately, however no source code for the DMM app is available for the Victor application. http://www.china-victor.com/Files/Download/setup_86b_multi.rar and some of the application's features such as saving to a .csv file do not work.

Image 1

Although some other software for the Victor 86B is available, it is either closed-source (http://homepage.ntlworld.com/green_bean/coffee/roastlogger/dmmdetails.html) or incomplete and written in an interpreted language (http://www.daveansell.co.uk/?q=node/44), therefore it was decided to build a driver program from scratch.

This driver program decodes and displays LCD output from a Victor 86B USB DMM data packet that has been accessed using HIDAPI (http://www.signal11.us/oss/hidapi/) functions.

Image 2

The program decodes and displays output from Victor 86B USB DMM based on HIDAPI (http://www.signal11.us/oss/hidapi/).

The tables show how the USB HID packet (buf) decoded is reverse-engineered using a bench power-supply and other instrumentation to drive the Victor86B as there is no specification available for the LCD control bits contained in the HID packet.

Image 3

Background

All table entries are in decimal format and tables contain codes with and without the leading decimal point. In most cases, if 4 of one on the two characters is set, this means that the decimal point is active.

LCD       digits           annunciators
        -   -   -   - 
       | | | | | | | | 
     -  -   -   -   -       M            Hz  
       | | | | | | | |   DC REL          V
        -   -   -   -    AC HOLD m oC u  A
          .   .   .
 buf  3,10 6,9 5,7 0,2   1  4    8 11 12 13

Digit 4 decode:

              .
LCD b3    b10  b10
0   33    79   95
1   17    111  127
2   65    15   31
3   97    239  255
4   81    175  191

Digit 3 decode:

            .
LCD b6      b9  b9
    0   47  69  85
1   31      101 117
2   79      5   21
3   111     229 245
4   95      165 181
5   239     37  53
6   239     69  85
7   31      229 245
8   111     69  85
9   111     37  53

Digit 2 decode:

                .
LCD b5      b7  b7
    0   54  84  100
1   38      116 132
2   86      20  36
3   118     244 4
4   102     180 196
5   246     52  68
6   246     84  100
7   38      244 4
8   118     84  100
9   118     52  68

Digit 1 decode:

            .
LCD b0  b2  b0
0   75      29  91
1   107     13  123
2   11      61  27
3   235     93  251
4   171     77  187
5   43      221 59
6   75      221 91
7   235     13  251
8   75      93  91
9   43      93  59

LCD Annunciator Decode:

//         M            Hz
//      DC REL          V  
//      AC HOLD m oC u  A  
// buf  1  4    8 11 12 13

if ((unsigned)(buf[ 1]& 16)) LCD_DC   = 1; // DC
if ((unsigned)buf[13]== 140) LCD_V    = 1; // Volts
if ((unsigned)buf[13]== 124) LCD_A    = 1; // Amps
if ((unsigned)buf[ 8]== 134) LCD_m    = 1; // m - milliamps
if ((unsigned)buf[12]== 126) LCD_u    = 1; // u - microamps
if ((unsigned)buf[ 4]== 177) LCD_REL  = 1; // REL
if ((unsigned)buf[ 4]== 241) LCD_HOLD = 1; // HOLD
if ((unsigned)buf[13]== 172) LCD_Hz   = 1; // Hz
if ((unsigned)buf[11]== 191) LCD_oC   = 1; // degrees C
if ((unsigned)buf[ 4]== 145) LCD_M    = 1; // Mega - ohms

Using the Code

The MS project file is provided as a complete example. It can easily be extended to dump results to a .csv file etc.

Points of Interest

If ever there was an argument for publishing open specifications for instruments with USB interfaces, this is it. A spec would have saved a few days of experimentation to reverse engineer the storage format. Thankfully though, the HIDAPI library saved a lot of pain that would otherwise have been required to interrogate the USB interface.

History  

  • Version 0.1. 

Update 

For those unable to source a Victor 86B a driver for the Victor 70C has been published at https://github.com/mvneves/victor70c by Marcelo Veiga Neves.  

The protocol for the 86B/C and 70C is described quite succinctly here http://sigrok.org/wiki/Victor_protocol

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Chief Technology Officer Movidius
Ireland Ireland
David Moloney holds a B.Eng. degree from Dublin City University, and Ph.D. in Engineering from Trinity College Dublin. For the past 25 years he has worked in microelectronics starting in 1985 with Infineon in Munich and ST Microelectronics in Milan, before returning to Ireland 1994 to help found a series of start-up technology companies including Parthus-CEVA and Silansys. David is currently co-founder (2005) and CTO of Movidius Ltd., a fabless semiconductor company headquartered in Dublin and focused on the design of software programmable multimedia accelerator SoCs. He holds 18 US patents and numerous conference and journal papers on DSP and computer architecture. David is a member of the IEEE.

Comments and Discussions

 
Questiondriver download Pin
Member 1386813911-Jun-18 9:14
Member 1386813911-Jun-18 9:14 
GeneralMy vote of 4 Pin
raddevus27-Apr-16 10:38
mvaraddevus27-Apr-16 10:38 
Very interesting and great reference to the HIDAPI. Thanks for writing this up.
GeneralMy vote of 4 Pin
Zaid Pirwani29-Nov-12 10:07
Zaid Pirwani29-Nov-12 10:07 
QuestionCan't compile Pin
pscholl26-Sep-12 23:58
pscholl26-Sep-12 23:58 
GeneralMy vote of 5 Pin
Ștefan-Mihai MOGA4-May-12 18:21
professionalȘtefan-Mihai MOGA4-May-12 18:21 
GeneralMy vote of 5 Pin
sam.hill9-Jan-12 5:11
sam.hill9-Jan-12 5:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.