, Sweat-proof “smart skin” takes reliable vitals, even during workouts and spicy meals
, Sweat-proof “smart skin” takes reliable vitals, even during workouts and spicy meals

Automate Measurements with the Digilent Analog Discovery PRO

Oscilloscopes are the tool of choice for every engineer when it comes to measurements. If the instrument can also work as a waveform generator and can do some mathematical calculations on the signals acquired, or allows automated tests, even better.

For many measurement tasks that designers face in their daily work, oscilloscopes are an excellent choice as they offer many ways to achieve good results. But occasionally, it is necessary to document the obtained data or to process the signals further. Just as a simple example: You want to quantify the power of a certain block in your circuitry, and you are also interested in the waveform originating from these calculations, not only in the absolute values.

But most oscilloscopes only measure voltages, the current, and therefore the power cannot be measured directly. So, a shunt resistor must be used to obtain the current passing through the circuit, allowing for the computation of the power consumed (Figure 1). You also have into account that the channels of most oscilloscopes are single ended, and all measurements therefore must be referred to ground. It is not possible to read the voltage drop over the load directly. A second measurement taking the voltage drop over the shunt resistor is necessary. In the end, this means that some computations have to be done to get the power reading.

, Sweat-proof “smart skin” takes reliable vitals, even during workouts and spicy meals

Figure 1: A simple power measurement system
Credit: Digilent

Here oscilloscopes capable of doing the calculations right on the device, like the Analog Discovery Pro (ADP 3450) from Digilent, enter the game. This four-channel oscilloscope (a two-channel version is available as well) with 14 bits of resolution at a sampling rate of up to 0.5 GSamples/s is a true mixed-signal measurement device that the meets the needs for professional-level electronic test-benches at the office or at home. Besides the analog inputs, it also provides engineers with 16 digital I/O-channels, two external trigger inputs, and a two-channel arbitrary waveform generator (Figure 2).

, Sweat-proof “smart skin” takes reliable vitals, even during workouts and spicy meals

Figure 2: Oscilloscopes like the Analog Discovery
Pro from Digilent come with multiple instruments
like waveform generator or analyzers and can be
scripted for automated testing. Credit: Digilent

Analog Discovery Pro is smaller and lighter than a laptop and has no built-in user-interface. It connects to a host computer through one of its four high-speed USB 2.0 ports or through its Ethernet interface, and it is controlled by the free WaveForms software from Digilent running on the host. This software, refined by over 10 years of customer feedback, provides a user experience with the look-and-feel of traditional benchtop applications and is compatible to the macOS, Windows, and Linux operating systems.

One Software for All Instruments

WaveForms comes with twelve built-in software instruments, like an oscilloscope, a pattern- and a waveform-generator (which, for example, could create the test signal for our power measurement), a controllable power supply, I/Os, logic-, spectrum-, network-, impedance- and protocol-analyzers, as well as a voltmeter and a data logger. This way users can capture, record, analyze, document, and generate mixed-signals and mixed-domain signals. Additionally, the WaveForms application includes a script editor tool, which allows custom programming of the instruments in JavaScript.

Sometimes, however, like in the case of the power-measurement example, it is not even necessary to create a script. The software’s oscilloscope instrument contains so-called Math channels, which perform the calculations and plot the result alongside the measurements. So, to display the total power of the circuit, simply writing “(C2 – C1) * C1 / RS“ in the “Script” field of a dialog is sufficient, with RS being the value of the shunt resistor.

This equation computes the current by dividing the voltage VS across the sensing resistor (Channel 1) by its resistance value and then multiplies the result with the voltage across the combined load (capacitance and resistance) derived by subtracting the voltage VS (Channel 1) from the voltage VG across the load (Channel 2). In the same window, also the unit of the signal and the range of the channel in units per division can be set. It is also possible to rename the measurement channels and the math channels for more clarity (Figure 3). Additional calculations, like the power consumption of the resistor RL, can be performed as well by simply adding more math channels. Besides arithmetic operations,

, Sweat-proof “smart skin” takes reliable vitals, even during workouts and spicy meals

Figure 3: The math channels in the software makes simple calculations using the
inputs to the oscillo-scope easy. Credit: Digilent

the module also supports trigonometric operations, and others.

Script Module Eases Automation

Each of the Waveforms’ instruments can be run by scripts. By writing JavaScript code and executing it in the “Script” instrument, engineers can control any other instrument through extensive Application Programming Interfaces (APIs). This way, it is also possible to configure and run several instruments simultaneously in an easily repeatable way.

The script instrument not only allows to control the instruments and to acquire data. It also includes a plot pane, where users can integrate the data from many different instruments and display them in a highly customizable way. Moreover, GUI actions can be automated, as well as custom data analysis and manipulations.

This way, engineers can monitor signals and document the measurement results. With the WaveForms Software Development Kit (WaveForms SDK), even more customization is possible, as the SDK can be used to create custom applications and scripts in Python, C, C++, C#, and Visual Basic. For LabVIEW and MATLAB,
third-party toolkits are available.

Full Automation in Linux Mode

, Sweat-proof “smart skin” takes reliable vitals, even during workouts and spicy meals

Figure 4: The “Script” instrument in WaveForms allows to
write user applications in JavaS-cript.
Credit: Digilent

Beside the standard mode, where the device is connected to a host PC running WaveForms using a USB port or the Ethernet interface, the Analog Discovery Pro also operates in a Linux mode. In this mode, the ADP boots into a terminal-based Linux distribution from Debian installed on the device. This allows to run automated test scripts written in Python, C, C++, C#, or Visual Basic through the APIs of the WaveForms SDK without a host computer. The Analog Discovery Pro acts then as an embedded device and adds additional flexibility and connectivity. Figure 6 shows an excerpt from a Python script demonstrating an automated test of the analog-to-digital converter on a Pmod AD5 as an example.

 When running automated tests, user-defined functions are exercised for repeating tasks like resetting or closing the used instruments, displaying error messages, and reading data from the SPI. Programmers will also have to define certain keywords and interrupt handlers before using them.

The Analog Discovery Pro has four USB ports on the back of the panel that are enabled in Linux mode. This makes it possible to connect peripherals such as a compatible Wi-Fi dongle or a FAT/FAT32 formatted Flash drive. When scripts are run on the device, data can be stored locally, or streamed over a USB or a wireless interface, for example, to a cloud-based service like ThingSpeak, for storage, display, and manipulation.

, Sweat-proof “smart skin” takes reliable vitals, even during workouts and spicy meals

Figure 5: In Linux-mode, the Analog Discovery Pro can
be accessed via a serial termi-nal. Change username
and password after the first startup. Credit: Digilent

When running in Linux mode, the device is accessible through a serial terminal program like PuTTY or TeraTerm. Communication between the device and the host computer is supported through USB, Ethernet, and Wi-Fi. Internet access for remote access or the Internet of Things (IoT) is also possible. Through WaveForms and a connected Flash drive, users can update the on-board Linux, keeping the operating system current. Updated OS-images are provided by Digilent.

With the different methods of automating tasks – math channels, scripts, and Linux mode – the Analog Discovery Pro supports engineers to research, validate, and test the increasingly complex systems and it helps to reduce the design cycle time.

, Sweat-proof “smart skin” takes reliable vitals, even during workouts and spicy meals

Figure 6: Example script for controlling the analog-to-digital converter on a
Pmod AD5. Credit: Digilent

Check out the Analog Discovery Pro Resource Center for more guides, tutorials and applications.

Digilent Analog Discovery Pro 3000 series are available in Digi Key, the Digilent authorized distributor in Israel.


Comments are closed.