USB adapter for Arduino Mega V7-28 digital voltmeter

article-v7-28.jpg

Our laboratory is engaged, inter alia, in measuring the electrical resistance of various samples. The main workhorses of our measuring installation are digital multimeters of the American company Agilent, such as 34401A.

In addition, for a long time several old, but working V7-28 voltmeters (one of them in the photo) lay unused. This voltmeter, however, is inferior to the “Americans” in accuracy and speed, but is still quite good: accuracy up to 5 decimal digits, acceptable noise, shielded inputs, and most importantly - the ability to remotely control with a PC (which are now called PCs).

They could not be used for the following reasons:

  • Non-standard hardware interface: on the rear panel there are two connectors with 56 and 22 contacts, through which the B7-28 receives commands and returns the measurement results. It is impossible to directly connect a voltmeter to a PC;
  • The lack of a software interface, that is, some kind of control command system. You need to enable the DC voltage measurement mode - if you please, apply the appropriate combination of digital levels to the control connector. You need to read the readings - at your service are 21 digital signals on the CPU connector, and so on.
    At the same time, the measurement setup software, written and debugged, uses SCPI commands to control voltmeters, and adding support for non-standard interfaces there would be too difficult.

Thus, the problem was reduced to two points:
  1. Equip the B7-28 with some modern hardware interface to connect it directly to the PC;
  2. "Teach" him to understand the SCPI commands so as not to touch the high-level software.

Why Arduino Mega?


We do not have full-time electronic engineers who could develop and solder the microcontroller board, so we had to choose something ready, and Arduino turned out to be what we needed. I will not list her well-known advantages, but she came up with the fact that she allowed us to minimize the amount of soldering and dispense with special programmers.

Of the entire “arduino” family, only the Arduino Mega 2560 came up to us: only it had a sufficient number of digital inputs and outputs. The fee is quite expensive, in Russian online stores the Italian original costs about 4 thousand rubles (at the time of writing). Fortunately, there are many Chinese counterparts priced at $ 10 or even lower.
Communication with a PC at Arduino is via a USB interface, and this solved the problem number 1. It remains to develop firmware that would implement a subset of SCPI commands and translate them into control signals for B7-28.

Firmware implementation


As a starting point, we used a wonderful library scpi-parser, kindly written by a colleague from the Czech Republic. This library took on all the "dirty work" associated with the parsing of SCPI commands, which saved us up to 6 person months.

The heart of the firmware is a library scpi-multimeterthat implements the logic of SCPI commands and a state machine engaged in asynchronous reading and processing of voltmeter readings. The library abstracts from the hardware, delegating work with input / output ports to the outside, for which it uses a certain abstract programming interface. This allows you to use the library with almost any type of microprocessor or voltmeter.

And finally, the firmware itself is a projectv7-28-arduino. This is a small projection code that implements the abstract library interface scpi-multimeter, that is, it actually writes and reads to digital and serial ports on the microcontroller board.

Soldering Cases


article-wires.jpg

Of course, we did not manage to completely do without soldering, but the amount of work was quite small:
  • take a mounting plate compatible with the Arduino Mega for the location of the contact holes;
  • unsolder the pin connectors on the circuit board for installation on the microcontroller board;
  • connect the circuit board with B7-28 connectors with two 30-wire loops;
  • finally, plug the circuit board into the microcontroller: due to the large number of pin contacts, it is not so simple.

article-box.jpg

The result is visible in the photographs. To protect the soldering from mechanical damage and “loosening”, we placed the microcontrollers with the installed circuit boards in the “branded” boxes. As a result, our adapter has acquired, though not a factory, but rather decent appearance.

Adapter check


We omit the description of the long process of testing and debugging the firmware. When, finally, it was all over, we decided to connect the B7-28 together with the Agilent 34401A into one measuring unit. As stated above, high-level software controls voltmeters through SCPI commands. In the program settings, we specified a virtual COM port corresponding to the microcontroller, and: The program worked! Now we have more voltmeters and we can simultaneously measure more samples. PROFIT!

article-pc.jpg



Conclusion


Who, besides us, might be interested in this work?

Firstly, these are, of course, the proud owners of the B7-28, who were given the opportunity to supply their voltmeters with an adapter for moderate means, which allows them to be used as simply as modern counterparts. Any PC is now equipped with a USB interface, and LabVIEW and similar development tools understand the SCPI command language “out of the box”.
Secondly, as mentioned above, the main part of the library does not depend on the particular brand of voltmeter or microcontroller. For example, it is simple enough to modify the firmware to support other types of voltmeters, for example, B7-34A.

We invite all interested parties to the project page with the source texts, there is also a link to ready-made binary assemblies and documentation.

Thanks for attention!

Also popular now: