During a flight back home from a recent business trip, I was lucky to get a window seat. I was thinking of the possibility to see some stars of the night sky above the clouds and I wasn’t disappointed. The flight was held entirely during night time with cabin lights turned off. This was crucial because cabin lights are an additional light source which make unwanted reflections visible. The reflections usually overcast faint light sources such as stars. I took some photographs with my smartphone Samsung Galaxy S22 at exposure duration of 20-30 seconds and ISO 3200. The exact location of the photograph is unknown, it must have been somewhere in a part of south-eastern Algeria over the Sahara desert while looking to the east. I would estimate the position as follows: 23° North, 8° East, flight attitude 11 km (36 000 ft).
Result of a shaky picture during long exposure duration (20 – 30 seconds). The stars appear “smeared”
I made about a dozen pictures of the night sky but due to minor turbulence and slight flight course corrections, most of the images were shaky and had to be discarded. However, I was able to get 1-2 pretty decent pictures of the night sky which turned out to be OK. I was pressing my smartphone against the window to avoid shaking motion and put a pillow over it to block most of the residual (emergency) cabin lights.
Beautiful night sky picture taken with a smartphone from an airplane window. 20 second exposure at ISO 3200
The taken pictures show some prominent stars from the constellations Cygnus and Lyra: Vega, Deneb, Albireo and others. I was able to identify some stars by using an web-based star map application such as Stellarium Web. During the flight I could observe meteor flashes occasionally (no picture taken though) and lightning of distant thunderstorms, which were perhaps >200 km away. There were virtually no city lights visible during the flight over Sahara desert. Just imagine being there and watching the night sky without any light pollution…
Identified stars from the constellations Cygnus and LyraStellarium Web
The 8-hour-flight was very tiring because of lack of space to move and stretch. Sitting for hours in an uncomfortable position wasn’t very pleasant but it worked out somehiw. However, I was able to catch some nice pictures of the world 11 km below my feet. #worthit
Rising sun and parts of the night sky
City lights from Khenchela, Algeria
Picture of Genua, Italy
Skyline and Football Stadion from Frankfurt/Main, Germany
I’m really happy of being a new owner of a Tektronix 7104 oscilloscope – one of the fastest analog oscilloscopes made by man.
Tektronix 7104, 1 GHz analog oscilloscope
Last time I saw one of those on eBay, I was hesitating to buy it and it went away for dirt cheap. Anyways, I didn’t want to miss a chance this time. The unit is working and in a very good condition. The horizontal and vertical plug-ins delivered with the scope are meant for the full bandwidth of 1 GHz.
The Microchannel Plate CRT display is still in a good shape – no burn-ins except the typical wear-out areas (horizontal trace, annotation areas).
Measured rise time of Tektronix 7104 with Leo Bodnar pulse generator on a 7A29 single channel vertical amplifier plugin: approx. 300 psSine wave at 1.0 GHz, approx. -13 dBm into 50 Ohm
Bandwidth test with Leo Bodnar pulser on one of the 7A29 plug-ins gave me a rise time of 300 ps with an estimated bandwidth of approx. 1.16 GHz. This is my fastest oscilloscope now. I’ll check the innards in a couple of weeks.
Measuring voltages accurately is a basic task for technicians, engineers and scientists. The voltages to be measured range from perhaps few picovolts to several megavolts – a dynamic range of 18 orders of magnitude! But every modern digital multimeter is kinda limited in resolution. The multimeter’s resolution can be stated in the number of digits it can resolve. A 6 digit multimeter can resolve six decimal places going from 0 to 9. In a decimal number system, this corresponds to \(10^6\) numbers or 1 million digitizing steps. Without going much into detail and exposing my limited knowledge on this matter, I’ll just link to Keysight’s Website where everything is well explained.
Older multimeter models such as the shown MeraTronik V543 can resolve only \(2 \cdot 10^4\) numbers in the selected measurement range (e. g. ±1 V = 2 V full scale: \(2~V/2 \cdot 10^4 \rightarrow 100~µV\) resolution).
MeraTronik Type V543 (PRL T-189), 4.5 digit multimeter with Nixie tube display
One of the best and most accurate digital multimeters in present time – the HP 3458A – has “only” a resolution of 8.5 digits, which hasn’t improved for about 35 years.
HP/Agilent/Keysight 3458A 8.5 digit multimeter
The so-called “Voltnuts” (crazy electro-fanatics) buy those HP multimeters on a second hand market for $3k to $7k. This surely is crazy and overpriced and in my opinion just not worth it. How about buying a couple of cheaper 6.5 digit multimeters (e. g. HP 34401A for about $200 to $400) and combining them in a serial configuration? I’ve achieved a total of 19.5 digit resolution this way*. I was able to display 10 volts up to 18 decimal places, e. g. attovolts resolution and saved a lot of money.
Two HP/Agilent/Keysight 34401A 6.5 digit multimeters in an unusual configuration showing exactly 10 Volts on April 1st…
*If you don’t believe this nonsense, it’s fine. I can live with that. It’s April Fools’ day anyway 😉
About a year ago I saw one of CuriousMarc’s YouTube videos on repairing a Xerox Alto computer. CuriousMarc published shortly afterwards an episode, which compared the Tauntek LogICTester with the TL866II+ EEPROM programmer which has some transistor-transistor logic (TTL) testing capabilities. 1970’s and 1980’s era test equipment used alot of those intergrated circuits (IC) in order to operate. Servicing or repair of older test equipment like oscilloscopes, multifunction calibrators, power supplies etc. will be much easier with tools such as a logic tester. After reading a very positive review from a friend at the Wellenkino, I thought it would be very nice to own such a tester for servicing or repairing my (broken) equipment.
Tauntek LogIC Tester
I contacted Bob Grieb of Tauntek and ordered one of his kits back in March 2022. The $35 kit contained the printed circuit board and two pre-programmed PIC microcontrollers. The shipment to Germany cost me about $19 with additional 10 EUR for customs and fees. The total cost for the kit ans shipment was in the order of $64 or approx. 60 EUR. The shipment from USA to Germany took about week and a half.
Shipment received from Bob Grieb of Tauntek.
After receiving Bob’s package, the project got delayed because I’m always kinda busy. I ordered most of the remaining parts via Mouser in December 2022. The ordered parts would cost additional 69 EUR. Many of the components on the bill of materials (BOM) list could have been easily skipped (e. g. resistors and 2x PIC microcontrollers, RS232 level shifter) resulting in 45…48 EUR price range. Nevertheless, I ordered few extra parts just to be sure if anything fails. Extra parts can be always used for different projects or experimenting with other circuits.
Two of needed parts on the BOM weren’t available at the time: the 74HC138 3-to-8 line decoder and LM358AN dual opamp. According to Mouser, the lead times for the decoder were four weeks and for the opamp approx. 1 year (which has been reduced to May 2023 in the meanwhile). So yeah, I had to order both parts on eBay instead. Waiting a year for an opamp wasn’t acceptable. I also ordered an USB to TTL FTDI Serial Adapter on Amazon (2 pieces for 8 EUR) so I could use the Tauntek LogICTester via USB instead of RS232. Everything arrived last week so I had to find few “quiet hours” for the soldering job.
Building the IC Tester
One starts with the printed circuit board and two PIC microcontrollers (U1 as Master and U2 as Slave) as shown in the picture below.
The unboxed Tauntek LogICTester.
I started populating the resistors and diodes in the first place. After soldering and cutting excess wires, I moved on to capacitors.
Starting the population with passive components is always a good idea….
Population continues, only few more parts…
Chaos unfolds when doing a soldering project…
After hours and hours, I finally got it finished. The pins in the top right corner needed to be removed. Also JP1 and JP2 (top right above the IC socket) were shorted by a solder blob in order to use the FTDI to USB adapter instead of the RS232 level shifter. The level shifter 16 pin socket on the top right remains unpopulated. The final assembly can be seen in the picture below.
After assembly I checked for cold joints or shorts. Everything looked fine and I turned it on.
Tauntek LogIC Tester: finally assembled and ready for IC testing.
After plugging in the USB cable of the FTDI adapter into the Windows 10 machine, the driver installation started automatically. No additional drivers were needed to be installed. The settings for communication via Serial connection were by default “8-N-1”, which corresponds to 9600 baud, 8 data bits, no parity bit, 1 stop bit and no flow control. The connection needs to be established via a terminal emulator such as PuTTY. After establishing a connecting to the tester, one has to press ENTER to get the welcome screen and voilà, We’re In Like Flynn.
The usage of the IC tester is pretty much straight-forward. Power up the tester, establish a PC connection and put the IC into the socket as shown in the picture above. Enter the IC model inside of the console. If the IC is found inside of the database, type t and press enter to start the IC test. The results are presented in a very comprehensive way. Typing v and pressing enter displays the pin voltages.
Tauntek LogICTester menu via terminal emulator PuTTY.
That’s it – there isn’t much more to it. Very simple and effective when it comes to debugging the 1970s to 1980s era logic ICs. Few additional hints and comments:
Unfortunately the IC tester can not be used in order to recognize part numbers of ICs under test. The part numbers have to be looked up manually inside of the terminal emulator (or Bob’s list)
Bob maintains the firmware and the list of supported ICs. Perhaps by writing him an email and by sending him the missing or unsupported IC, Bob may update his firmware in the future and add support for the missing IC
The logic tester certainly isn’t free of bugs – some tests may result in a “FAIL” although the IC is still fine according to the datasheet specifications. Please, don’t blindly trust the machine. Take your time and try to sanity-check or interpret the results
If one wants to capture analog images or analog videos (e. g. images coming from a CCTV camera), those signals need to be digitized, decoded and displayed with a device called framegrabber. A framegrabber is basically a video capture card with fast video processing capabilities and onboard memory which is useful for image processing.
I wrote in my previous post how to make good quality screenshots of the Anritsu MS2661N front display. However, there is another ancient method how to acquire images of frequency spectra. In modern test equipment, the video signals are transmitted digitally via DisplayPort or HDMI. Some 20 to 40 years ago, the manufacturers offered instruments with an optional analog video output which could be connected to a television screen or to a video recorder for viewing or documentation purposes.
75 Ohm composite output can be seen on the back side of the Anritsu MS2661N spectrum analyzer
I’ve got myself a framegrabber card NI PCI-1405 for different projects. I wanted to test the card for its functionality. The quickest access to an analog video was via the composite output of my spectrum analyzer as shown in the previous picture.
NI PCI-1405 Video Framegrabber Card
The NI PCI-1405 framegrabber card has two inputs: a 75 Ohm video input and a 75 Ohm trigger. The video input is connected via a 75 Ohm cable (type RG-59) to the composite output of the spectrum analyzer.
The 75 Ohm coaxial cable (RG-59) needs to be connected to the video input of the framegrabber card
After installing the drivers from National Instruments, the framegrabber card was successfully detected and I was able to grab some frames inside of NI MAX (Measurement & Automation Explorer).
Framegrabber user interface inside of NI MAX
I didn’t bother to improve the image quality – this task will be relevant for future projects as soon as I get my Tektronix C1001 camera running 🙂 So far, it’s been a successful test!
Grabbed frame in a 640×480 resolution. The analog source signal was received in greyscale NTSC format at approx. 30 frames per second
Tektronix 2456B with attached Tektronix C1001 video camera
A spectrum analyzer (SA) is a very useful tool when it comes to measure spectra of radio frequency signals. I recently acquired a 2004 era spectrum analyzer. It’s from a Japanese test equipment manufacturer Anritsu and the model number is MS2661N. Luckily there are operating manuals available online but I wasn’t able to find service manuals for this type of spectrum analyzer on the internet. There are some service manuals available for similar models of spectrum analyzers (e. g. MS2650/MS2660) which would allow troubleshooting but I would be lost if the instrument breaks.
Anritsu MS2661N Spectrum Analyzer (100 Hz – 3 GHz). Those blue handles totally aren’t butchered from Rohde & Schwarz test equipment… Sacrilege! Don’t ask!
However, I’ve been looking for a decent SA for a longer time and stumbled upon the Anritsu MS2661N. It had a bunch of very nice and useful features: frequency range 100 Hz to 3 GHz, 30 Hz resolution and video bandwidth, oven controlled crystal oscillator (OCXO), GPIB interface, 10 MHz reference IN/OUT and a tracking generator ranging from 9 kHz to 3 GHz. I was looking for a similar SA from HP/Agilent 8590 Series or Tektronix but there were no attractive offers at the time. Either the SA frequency range was too low for modern ages (1 GHz) or outside of my measurement capabilities (26 GHz), the price was either too high or it was partially broken. There were also 75 Ohm spectrum analyzers which aren’t very useful for what I’m doing. On the other side, the documentation for HP/Tek hardware is the real deal so leaving this kind of test equipment ecosystems was a tough decision.
Long story short: I wasn’t disappointed and the SA works perfectly fine. I don’t want to write a lengthily blog about it. One of the first experiments was connecting my GPS disciplined oscillator to the signal generator and spectrum analyzer simultaneously in order to provide the same external reference for both instruments and checking if the frequency (1.5 GHz) and the amplitude (-35 dBm) are accurate. Acquiring measurements was super easy and the operation of the SA is very straight-forward.
Agilent E4432B Signal Generator. Note that the EXT REF is on and the output signal is referenced to a 10 MHz GPS disciplined oscillator.
10 MHz reference signal distribution from a GPS Disciplined Oscillator (GPSDO).
Back side of the Anritsu MS2661N. The 10 MHz signal is fed into the REF IN.
Documentation of Measurements
I would consider the somewhat cumbersome recording of readings as a minor disadvantage of this SA. Taking a photograph of the display may be “quick and dirty” but you have to deal with bad image quality due to reflections, visible RGB pixels and picture alignment. It is possible to take screenshots in bitmap format (BMP) but one needs a special type of a Memory Card (basically a PCMCIA or PC Card) in order to save the screenshots on an external storage. That’s really unfortunate but measuring instruments of that era were either equipped by a floppy disk or Memory Carc. I was always afraid of damaging the fragile pins while pushing the PCMCIA card in its slot although it is rated for 10k mating cycles. The MS2661N type SA even has a 75 Ohm composite out – it’s possible to record video stills in the NTSC format. However, there are two elegant methods which I would like to show how to transfer the readout from the instrument to the personal computer (PC) by modern means.
A photograph taken of the frequency spectrum. The image shows LCD pixels, scratches on the surface of the front panel and reflections due to bad light conditions.
Method 1: Sending a Hard Copy from SA to a PC
Back in the days, the measurement results such as frequency spectra would be printed on a piece of paper as a part of the documentation. A device called printer or plotter was needed and the process was called “hard copy”. The difference between a printer and plotter is how the drawing is generated: while the printer generates text and images line by line, a plotter can draw vectors in a X-Y-coordinate system. HP developed its own printer control language back in 1977 for this purpose – the HP-GL or Hewlett-Packard Graphics Language. HP-GL consists of a set of commands like PU (pen up), PD (pen down), PAxx,yy (plot absoute) and PRxx,yy (plot relative) in order to control a plotter, which is basically an electro-mechanically actuated pen. The commands are transmitted in plain ASCII via GPIB or RS-232C interfaces. If we were somehow able to capture the HP-GL ASCII code, it should be possible to generate a lossless vector graphics instead of a lossy bitmap.
An example of the acquired HP-GL code in a text editor.
Hardware Requirements
Besides the already mentioned spectrum analyzer one needs either a GPIB/USB or GPIB/Ethernet adapter. I have tested it successfully with a National Instruments GPIB-ENET/100 on a Windows 10 machine with NI 488.2 v17.6 drivers. It should also work with a NI GPIB-USB-HS+ (Chinese clone) adapter.
Software Requirements
I was looking for a quick solution how to acquire hard copies. Thanks to einball on a certain Discord channel 😉 for showing me the KE5FX 7470.EXE HP-GL/2 Plotter Emulator. John Miles, KE5FX, already wrote a software back in 2001 which does emulate a HP 7470A pen plotter. The 7470.EXE is still maintained by John and supports popular spectrum analyzers from HP and Tektronix. His software is able to fetch the HP-GL ASCII via GPIB and render the hard copy image on the screen. The image may be saved in a bitmap format (BMP, TIFF, GIF) or in a vector format (PLT, HGL). I have tested John’s software with Anritsu MS2661N and it worked perfectly fine. I suppose this could work on similar Anritsu spectrum analyzer models, such as MS2661C.
Setting up the Spectrum Analyzer
Here is a brief summary how to obtain a hard copy from an Anritsu MS2661N spectrum analyzer:
Connect the spectrum analyzer to the GPIB adapter and boot up the device
Go to the Interface menu and use settings as followed → GPIB My Address: 1, Connect to Controller: NONE, Connect to Prt/Plt: GPIB, Connect to Peripheral: NONE
The SA wants to send its data via GPIB to a plotter. It’s important to disable the “Connect to Controller” option, otherwise it won’t be possible to select GPIB as “Connect to Prt/Plt”. The GPIB address is set arbitrarily to 1
Go to Copy Cont menu (Page 1) → Select Plotter
Copy Cont menu (Page 2) → Plotter Setup → Select following options: HP-GL, Paper Size: A4 Full Size, Location: Auto, Item: All, Plotter Address: 2
It’s important to set the “Plotter Address” value to a different number than the “GPIB My Address“. If both addresses share the same number, the hard copy will result in a timeout error
Install John’s 7470.EXE software and start the HP 7470A Emulator. There is no need to change the settings of the GPIB controller, it works out of the box. Click on GPIB → Plotter addressable at 2. The selected address in 7470.EXE should be identical as the previously set Plotter Address. In order to obtain a hard copy, press the button w and the 7470.EXE should display a message like shown in the screenshot below. Once you press the Copy button on the spectrum analyzer, a data transfer progress should be visible. It takes about 10-15 seconds to transfer the data (approx 7-10 kb) from the SA to the PC. Once it’s complete, an image of the current frequency spectrum is shown on the display. That’s it.
HP7470A Plotter Emulator in “Reading data from instrument” mode (Button: “w”)
The downloaded hard copy in KE5FX’s plotter emulator software 7470.EXE
Creating Publication-Quality Vector Images
At this point, it’s possible to save the acquired hard copy in a bitmap image format. If one needs a publication quality images – which should be free of compression artifacts – one should save the images in a vector format such as PLT/HPGL. This workflow proved to be a little bit inconvenient but it’s perfectly doable. Save the hard copy as .PLT and open the image in a HP-GL supported viewer. John suggests few of them on his website – I’ve tried CERN’s HP-GL viewer. It’s distributed free of charge and still maintained by the developers. Download their viewer and load the PLT-image. If the colors seem wrong, there is a setting where you can change the pen colors. Once done, it’s possible to export the PLT image as PostScript (PS) or Encapsulated PostScript (EPS) or print as PDF. EPS files can be embedded in LaTeX documents or can be imported in a vector graphics editor such as Inkscape.
This hard copy was exported into EPS format and loaded in Inkscape. It’s possible to further edit the image (create annotations etc.)
CERN’s HP-GL Viewer may further process the PLT vector image and export it in different formats such as PS/EPS/PDF
The results turned out to be really good. Especially the vector images are crisp and sharp. One can zoom in without any image quality losses. The printouts on my laser printer are perfect. A little downside would be few breaks in the workflow: one has to use three different applications in order to obtain, convert and process the images. But it’s worth it 😉
Method 2: Readout Data via pyvisa and Plot it via Matplotlib
A different method to plot the frequency spectra would be by downloading the acquired raw data via GPIB and plot it directly. This is exactly what I’ve done. I’ll share the Python code down below. It’s possible to refine the plot by automating more stuff: one can generate annotations directly from queried instrument settings. Just put enough time in it and you’ll get superb results. The plotted image can be saved directly in a Scalable Vector Graphics (SVG) or any supported bitmap/compressed format.
Spectrum analyzer data plotted via Python’s library Matplotlib
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 3 16:45:39 2023
@author: DH7DN
"""
import numpy as np
import pyvisa
import pandas as pd
import matplotlib.pyplot as plt
#%% Open the pyvisa Resource Manager
rm = pyvisa.ResourceManager()
print(rm.list_resources())
#%% Create the Spectrum Analyzer object for Anritsu MS2661N at GPIB address 13
sa = rm.open_resource('GPIB0::13::INSTR')
# Print the *IDN? query
print(sa.query('*IDN?'))
#%% Take a measurement
# Set frequency mode to CENTER-SPAN
sa.write('FRQ 0')
# Set the center frequency in Hz
cf = 1.5E9
sa.write('CF ' + str(cf) + ' HZ')
# Set span in Hz
span = 10000
sa.write('SP ' + str(span) + ' HZ')
# Take a frequency sweep (TS)
sa.write('TS')
# Select ASCII DATA with 'BIN 0' according to Programming Manual
print(sa.write('BIN 0'))
# Create a Python pandas Series
data = pd.Series([], dtype=object)
# Fetch data, convert string to float, print the power level values
for i in np.arange(501):
data[i] = float(sa.query('XMA? ' + str(i) + ',1')) * 0.01
print(data[i])
#%% Plot the results
# Generate the frequency values for the x-axis
f = np.linspace(cf-span/2, cf+span/2, 501)
# Plot the results, set a title and label the axes
plt.plot(f, data)
plt.xlabel('f in Hz')
plt.ylabel('Power Level in dBm')
plt.title('CF: 1.5 GHz, Span: 10.0 kHz, RBW: 100 Hz, VBW: 100 Hz, \n Peak at 1.5 GHz and -35.85 dBm')
plt.grid(axis='both')
plt.minorticks_on()
plt.show()
Few things to consider when using Python to obtain data from the spectrum analyzer:
Anritsu MS2661N acquires only 501 data points per sweep
The frequency axis values need to be generated manually. I used numpy‘s linspace method. It was a bit tricky because you one has to change the generation of frequency step values depending on whether parameters “Center Frequency & Span” or “Start/Stop Frequency” are used
Fetching the data takes quite some time (approx. 30 seconds). This is due to the fact that every single data point needs to be queried with the XMA? command in a for-loop. This is at least how it’s done in an example from Anritsu’s Programming Manual. I haven’t figured out yet how to fetch a block of data
Summary and Conclusion
I was clearly impressed how easy it was to obtain good quality frequency spectra images from a 20 year old instrument. I’ll refine the workflows and do further testing in Python. It should be possible to do all of this “automagically” via one little Python script. So far I’m really happy with the results where I don’t have to rely on smartphone pictures anymore. Thanks to einball for his help (basically googling for me) and to John (KE5FX) for writing his plotter emulator which helped me a lot to obtain hard copies from my SA. That’s it for today! Happy measurements! 😉
let’s just forget 2022 and move on. Covid, inflation, wars and conflicts – it doesn’t get better. Nevertheless, I had many positive moments in 2022, too! I had some lucky test equipment acquisitions, I managed to sell unused test equipment and free up some space, did some Python and GPIB programming, did a bike tour, met lots of nice and interesting people throughout the year, finally published some decent blog posts and successfully reduced my weight from 132.9 kg (290 lbs) to 115.5 kg (254 lbs) in 365 days.
There is a lot more to do in 2023 and I’ll try to keep up with publishing interesting blog posts. My new year resolution in 2023? No new resolutions! They are useless – at least for me. I have a bunch of interesting projects on my list and I hope they will happen some day… perhaps this year. If you take on too much, you will end up doing nothing at all.
Happy New Year 2023, stay positive, safe and sound 🙂
Over the past two years, I have acquired a decent amount of Tektronix analog oscilloscopes. I would say “decent amount” because having 10+ oscilloscopes is not that much compared to other Tektronix enthusiasts. Nevertheless, my colleagues already started questioning my sanity. Different topic. I really like Tek analog oscilloscopes and I love to work with them. However, doing everyday measurements in analog has its downsides in terms of comfort and workflows. It was about time to go digital!
“Hello little one, wanna be my best friend?”
…and suddenly they have multiplied exponentially!
Analog vs Digital
Do you want to do a “quick” measurement and document it? Sure: turn on the oscilloscope, set the ranges/triggering and observe the electron beam trace! Experienced users can set up the measurement in seconds to less than a minute. However, when it comes down to taking quantitative measurements, this process may take a while. If the values of the amplitude, phase or frequency of a signal are not of importance, e. g. one does qualitative measurements where just the shape of the signal is of interest (sinewave, squarewave, noise), the measurement can be done in a matter of seconds. However, if quantitative measurements are of importance (amplitude, phase, frequency, risetime), the average user will spend a lot of time counting the marks on the graticule which can be prone to errors, too.
In order to document the measurements, one has to take photographs of the screen. Unfortunately, some analog oscilloscopes have no measurement annotations on the screen. The user has to take care of this – it can be a huge trap for young players. I’ve been there before and it wasn’t easy figuring out why I have 13 pictures of oscillograph curves but only 10-ish lab notes documenting the oscilloscope settings… Which setting did I use for Channel 1 and Channel 2? Why are the images blurry? How about those annoying reflections on the screen? Another downside of an analog oscilloscope would be of a “first-world-problem” type: at very low frequencies (in the range of few Hz), it’s very difficult to view a complete image of a single waveform. The electron beam sweeps too slowly across the screen – it doesn’t leave a persistent trace which makes reliable measurements difficult. However, it is possible to view single waveforms with an analog storage oscilloscope.
Back in the day, we took photographs and annotated it like this. The reflections on the screen were noticed when it was too late.
This is an example of a very bad oscillogram. It’s blurry and there is no chance to know, which horizontal and vertical settings were set. The amplitude and frequency of these signals remain unknown.
Fast-forward to the 1990’s to 2020’s – the era of digital oscilloscopes. The early digital models were slow and limited in their measurement capabilities. The advances in technology (improved analog-to-digital converters, more RAM and storage, digital signal processing, automation) helped digital oscilloscopes to become very powerful instruments. As the name suggests, a digital oscilloscope converts an analog signal into a digital one. Once the time-dependent (analog) voltage has been converted into basically numbers, one can play with waveforms and do useful calculations. It’s very easy to calculate values such as min/max/average or standard deviation. Implementation of sophisticated signal processing algorithms opened the doors to Fast Fourier Transform (FFT), logic analysis, complex triggering and much much more. Digital oscilloscopes also have one huge advantage over their analog counterparts: one can capture and store a single waveform for viewing (e. g. zoom in in order to see more details). Tektronix released a very nice publication on this matter, The XYZs of Oscilloscopes Primer. It can be downloaded for free from Tek’s website.
Purchase Criteria for a Digital Oscilloscope
In my case, I just needed a general-purpose digital oscilloscope in order to make quick measurements and do the documentation stuff.
Now what to look for? The key specifications would be: number of channels, analog bandwidth, sampling rate, memory and vertical resolution. Modern-day oscilloscopes have all kinds of additional features such as interfaces (USB, RS-232, Ethernet, GPIB), touchscreen display, integrated digital multimeters, VGA/HDMI/DisplayPort, input termination (1 MΩ/50 Ω) and much more. Those features can improve your workflow and speed up your work. I should mention that the size of the oscilloscope can be important, too. Digital oscilloscopes can be very compact and take almost no space on the bench compared to their analog counterparts. This is important for people with space constraints like a student’s living room or a small garage. There is one more parameter which sums up the features: the price 🙁
I’ve scrambled few hundred Euros in order to buy myself a 2nd hand digital oscilloscope. Since 2010’s/2020’s oscilloscopes are a little bit too expensive, I’ve looked into the mid 1990’s to mid 2000’s era digital oscilloscopes. By the end of 1990’s, digital oscilloscopes had quite potent measurement capabilities. Tektronix and Agilent Technologies (successor to Hewlett-Packard, now Keysight Technologies) designed excellent oscilloscopes for all kinds of applications – mobile communications, digital design and debugging, video and others. Other brands to consider would be Fluke/Philips, Hameg (today Rohde & Schwarz) or LeCroy. Fast-forward 25 years into the future and a 1990’s 20k USD high-end oscilloscope can be bought today in the order of just few hundreds Euros. I guess the only reason I’m stuck with Tektronix oscilloscopes in general is their excellent documentation (User and Service Manuals) and the ability to repair it according to the documentation. Huge props to Kurt of TekWiki and also to all the TekWiki contributors and enthusiasts which maintain the wiki pages and manuals archives. Another invaluable source of Tektronix-related information is the mailing list TekScopes@Groups.io.
Speaking of few hundreds of Euros: the price range below 1k EUR is in direct competition with modern-day digital oscilloscopes! I certainly had considered whether to spend let’s say 500 EUR on a new Rigol oscilloscope (which can be hacked/upgraded to a multi thousand dollar machine) or on a 25 year old vintage chobby which has possibly seen darkness, torture, abuse and failures. I’ve been hesitating buying different brands such as PeakTech, Rigol, Siglent or UNI-T for different reasons. Don’t get me wrong – they manufacture great and affordable oscilloscopes. The devil is in the details.
Tektronix TDS 754D Series Oscilloscope
The Tektronix TDS Series seemed to fit very well in my scope scheme. I was looking for a decent amount of analog bandwidth (at least 400 MHz), a high sampling rate (if possible 5x to 10x the analog bandwidth) and 4 channels. Tektronix TDS 784D came in my mind because it had everything I needed. Unfortunately, it wasn’t available at the time on German markets like eBay or eBay-Kleinanzeigen (German analogy to craigslist). So I was looking for a suitable alternative. The EEVBlog community has quite a few threads on TDS Series oscilloscopes. One in particular was interesting: the models TDS 754D and 784D are electronically nearly identical. It is possible to convert a TDS 754D model (500 MHz bandwidth) into a TDS 784D (1 GHz bandwidth) by means of a small modification. This modification (removing a resistor and few capacitors) is well documented and can be done very easily. Since there were few Tek TDS 754D oscilloscopes on the market, I thought to give it a try.
First Impression
Booting screen of the Tektronix TDS 754D Digital Phosphor Oscilloscope
Self-test passed! The boot sequence takes about a minute
Tek TDS 754D front panel
The motion blur was intended in order to demonstrate the color fringing effect on the CRT screen
Rear side of Tektronix TDS 754D Digital Phosphor Oscilloscope
Tektronix TDS 754D is a compact unit when compared to my 7000 Series “boat anchors”. It has a very clean designed front panel, color display and vents for a large fan (approx 15 cm diameter) on the left hand side. The noise generated by the fan is a little bit annoying but tolerable. Since the heat generated by the oscilloscope has to be carried away, it’s crucial to maintain a proper airflow. There are many ventilation slots on the housing which need some clearance, otherwise the oscilloscope may be damaged due to overheating. Booting up the device takes about a minute and the warm-up time is at least 15 minutes. The color display is a little bit strange: while moving my head, the display colors are splitted into their red/green/blue components (color fringing). This is a little bit annoying but on the other hand, the image quality (in resting position) is very good – sharp image, rich colors, “dark theme” which is pleasing for my eyes when working in dim or darker environments. The oscilloscope takes quite a lot of space on the workbench. Placing the oscilloscope outside of ergonomic positions is not recommended because one has to push many buttons and turn the knobs in order to find optimal settings.
Quick Check of the Four Channels
10 MHz squarewave
10 MHz squarewave with zoom
Channel 1 rise time measurement
Channel 2 rise time measurement
Channel 3 rise time measurement
Channel 4 rise time measurement
The pictures provided by the seller showed a deviation on Channel #2 which was a little bit worrying. He attached the probe and got no signal displayed. The root of cause could have been anything ranging from a defective channel to false user setting. Luckily, it turned out to be a false setting by him. All four channels were tested with a function generator in 50 Ω and 1 MΩ (“High Z”) terminations. The amplitude was set to 1 Vpp at various frequencies – The sine waveforms were clean without any visible noise or distortion. I was able to test the analog bandwidth with my Leo Bodnar Fast Pulse Generator. It generates a 10 MHz squarewave with a very steep rising edge. When measuring the 10% to 90% rise time, one can determine the oscilloscope bandwidth as shown in my previous blog entry. The rise time of channel 1 through 4 with a 50 Ω termination was in the order of 680 ps which corresponds to a -3 dB bandwidth of 514 MHz.
Menus and Settings
The menus and settings are easily accessible through push buttons and knobs. The response is good, the menus and sub-menus are arranged in a logical order. Some settings are a little bit hidden, e. g. the switch between XY and YT display modes and waveform average settings. Nevertheless, with a little bit of practice, one will memorize the location of the settings automagically. The numerical keyboard is very convenient as soon as exact setting values are needed (e. g. if you want to set the trigger level to an arbitrary value, you don’t have to turn the knob and fine-tune).
Tektronix WaveStar and Remote Control via GPIB
I must admit, this one blew my mind. I was concerned how to transfer screenshots and images from the oscilloscope to my PC. I have bunch of 3.5″ diskettes lying somewhere around and an “old PC” (IBM ThinkCentre from the early 2000’s) which could be used for data transfer. However, transferring the data from oscilloscope to an ancient PC and from there to the local network would have been a workflow horror. According to the oscilloscope manuals, the data transfer was possible either via serial interface (RS-232) or the general-purpose interface bus (GPIB). Older oscilloscopes with GPIB interface (e. g. the Tek 2465B) can be controlled remotely but the user is unable to readout the measurements. TDS Series oscilloscopes do have this capability! It’s possible to control the oscilloscope remotely and fetch the waveform data in a human-readable ASCII format. The communication with the oscilloscope can be established either via RS-232 or GPIB. The setup is straight-forward in case of GPIB: set up a GPIB address on the device, connect the oscilloscope via a GPIB controller to the PC, install VISA drivers and it should work. Once everything is installed, the communication with the oscilloscope can be checked by sending the *IDN? command.
Installing Tektronix WaveStar and Setting Up the Oscilloscope Communication
The Tektronix WaveStar Software manages the communication between the remote controllable oscilloscope and the PC. Unfortunately, the software isn’t maintained or supported by Tektronix anymore. I’m not sure if WaveStar can be obtained from the Tek website directly – however, there is a downloadable ZIP file on TekWiki. The product key for this application is available on the internet (e. g. Tektronix user forum). I have successfully installed WaveStar on my Windows 10 (version 21H2) PC. Windows 7 or Windows XP should work, too. I’ve set up an image gallery with screenshots from the installation.
Tektronix WaveStar installation dialog
Now select the WaveStar Software for Oscilloscopes
WaveStar v3.0.0.0 Release Notes
It wouldn’t be a genuine Windows installation without a reboot 😉
After reboot: start the Tektronix Instrument Manager Service
Select the correct oscilloscope GPIB address (e. g. 14)
Descriptive name of the instrument
Testing the connection to the device
Success! The oscilloscope communication is set up an can be controlled via WaveStar now
Instrument properties
Tektronix Instrument Manager Software version 3.0.0.0 (Sep 18 2009)
Tektronix WaveStar GUI
Using the Graphical User Interface or GUI wasn’t very intuitive after starting it. WaveStar has a Explorer View which allows access to the oscilloscope functions, such as settings, measurements, cursors etc. In order to transfer data from the oscilloscope to the PC, one has to generate a new datasheet. The selection of datasheets leads to different types of measurements. The YTSheet for example is able to plot the voltage vs. time. In order to create a “screenshot”, one has to create a new datasheet “NotesSheet” and drag-and-drop the “Screen Copy” from the Explorer View Local > TekTDS454D > Data > Display > Screen Copy (Color) into the newly created NotesSheet. After downloading the Screen Copy into the NotesSheet, it is possible to copy & paste it into different applications, such as LibreOffice Writer or MS Paint. The resolution of the image is 640 x 480 px and good enough for quick documentation purposes.
Downloading the measurement into WaveStar YTSheet
Arrangement of different measurements: WaveformMeasurement, DatalogMeasurement, NotesSheet and YTSheet
Further Data Processing
After playing few hours with WaveStar, I figured out how to extract measurement data in different ways: as vector graphics and as comma separated values or CSV. Vector graphics are very nice when it comes to publication quality images. It is possible to print out the YTScreen as a PDF file (Windows 10 offers a PDF printer driver natively, otherwise you’ll have to install one manually). The informations inside of the PDF are vector graphics which can be imported into a suitable program such as InkScape (another well-known programs would be Corel Draw or Adobe Illustrator). InkScape is an open source vector graphics editor which allows to manipulate vector graphics. Vector graphics are basically numbers which contain x,y-coordinates for lines to be drawn. Bitmap graphics on the other hand are color and brightness informations stored in a matrix. Whenever scaling bitmap images, one has to deal with (ugly) scaling artefacts where vector graphics can be scaled (or zoomed in) indefinetely.
After printing out the YTSheet as a PDF file, I imported the PDF into InkScape. It is possible to manipulate the vector images as one wishes!
Last but not least, I was able to export the WaveformTabular data into a CSV file. A CSV file can be loaded into a spreadsheet application such as LibreOffice Calc or Microsoft Excel. The waveform data can be processed afterwards – doing statistics or digital signal processing (e. g. with Python) can be done very easily!
Exporting waveform data into a CSV and plotting it in LibreOffice Calc.
Conclusion
Well, I’ve got myself a very powerful digital oscilloscope now. I still haven’t tested the full capabilities of this instrument but I’m very satisfied with its performance at this point and can recommend it to anyone seeking a 20-30 year old instrument. Although I paid far too much for it (it was well over 500 EUR), it was worth it. I’ll test its measurement capabilities during my vacation which is starting next week 😉
Since June 1st 2022 it is possible to travel within the whole country of Germany by public transportation system with a flat-rate ticket which costs only 9 Euros per month. The ticket is time-limited and valid only during the current month. It applies only to the German public transportation system (e. g. trains of German Railways such as DB RegionalBahn, RegionalExpress, S-Bahn, also metropolitan transportation systems such as U-Bahn, busses & trams). The ticket doesn’t apply to inter-regional trains such as ICE, IC or EC and doesn’t cover 1st class travelling in any of the mentioned transportation systems.
It was proposed by the German Government as a time-limited experiment in order to motivate people to drive less cars and as a financial relief due to very high energy and gasoline prices. The 9 Euro ticket will be obtainable during months June, July and August in 2022. The financial losses to the transportation companies due to this very cheap ticket will be compensated by the taxpayers. I think this is a good idea although its execution wasn’t very well planned. Nevertheless, it’s a step in the right direction! The German public transportation system is “OK” but isn’t able to handle – let’s say – sudden passenger increases of 20% or more very easily.
My Trip from Braunschweig to Meschede
I’ve bought myself a 9 Euro ticket and went on a trip from Braunschweig to a small city called Meschede. I’ve been living and working in Meschede for about 1.5 years before moving to Braunschweig. Although its location is in mid-western Germany and it’s only 260ish kilometers distant, it is a remote location because it’s surrounded by forests and hills of the Sauerland region. There is no easy way to get inside or outside of Sauerland 😉 My trip planner calculated a total travel time of about 5 hours and 21 minutes with approx. 1 hour of exchange durations. Travelling from Braunschweig to Meschede and back by train will be at least a 10 hr and 42 minute trip (which was the case).
9 Euro ticket in June 2022.
Bielefeld train station.
Dortmund train station.
Arrival at Meschede.
I’ve started from my apartment at roughly 6:30 in the morning and took the bus to the central station. My first train went from Braunschweig to Bielefeld, a ~2hr trip. The two floor train was very clean and there was enough room for passengers and bicycle users. Changing train in Bielefeld offered a different image. The train was heading in direction to Dortmund. It was pretty full with passengers and commuters but I was able to get a seat in the bike wagon. People standing around me were 10 drunk ladies (bachelor party) which were very funny and entertaining. In Dortmund, the train filled up to its maximum capacity where I felt sorry for the passengers. They were stuffed like canned tuna. I’ve spent about 20 minutes on the Dortmund central station gathering some fresh air. Nothing special: cops everywhere, fewer-than-usual soccer fans, LGBTQ pride flag carriers, occasionally religious fanatics and beggars. It’s a wild place but somehow appealing. The last section of the route was from Dortmund to Meschede. The train was OK – clean, not too full, a little bit loud due to its diesel engines. I found a seat near a group of drunk guys which were also very funny and entertaining. At one of the train stations, another drunk guy joined and collected refundable bottles. This was so unreal, he looked like a 70 year old smashed alcoholic, barely able to walk but the drunk party donated like 10-12 empty bottles of beer instantly to him 😀
To my surprise, all trains were on time and there were no major delays. I arrived in Meschede at 12:40 so the total travelling time starting from my apartment was approx. 6 hr 10 min. I couldn’t stay for a long time in Meschede because of the 6h return trip so I planned to stay for about 4.5 hours. This is one thing to consider when using 9 Euro ticket: the travel duration killed most of the day and reduced the visit duration significantly.
However, I was able to visit my old workplace and say hello to my former colleagues and some old friends. The Open-Door Day at University of Applied Sciences in Meschede offered a rich program of science, engineering, entertainment and food. The weather was excellent and very inviting.
Interesting sculpture of the city Meschede.
Ruhr river in Meschede.
Small river in Meschede.
Entrance to FH Südwestfalen
Entrance to the Meschede campus site of FH Südwestfalen.
Entrance to the main building, FH Südwestfalen Campus Meschede.
Funny and exciting physics experiments performed by “Physikanten”.
Prof. Dr. Bianca Will explaining her radar ranging experiment.
Physics experiment: Van de Graaf Generator.
Offsite-building of FH Südwestfalen in Meschede.
The return journey was very tiring: the train from Dortmund to Bielefeld was 15 minutes late and full to the max. We were standing for about 30 minutes without any room to move until a portion of passengers left the train. Luckily due to long exchange duration, the meanwhile 20 minute delay didn’t affect the connecting train from Bielefeld to Braunschweig. The section from Bielefeld to Braunschweig was OK – no problems whatsoever. About 90% of people inside of trains were wearing a face mask due to COVID-19 pandemic which was very nice. The current infections are very low in the region of 350 per 100 000 inhabitants but one has to be careful anyways. There may be a new infection wave in the autumn this year…
Summary and conclusion
Dortmund central train station – definitely an interesting place to be! 😉
I’ve spent most of my day travelling in trains. It was cheap but also do-able. I was able to travel from Braunschweig to Meschede and back in one day for 9 Euros! This trip would have cost at least 50 Euros instead without much improvement in travel quality. I’ve been to Meschede few weeks before this trip by car and the gasoline alone cost me 80 Euros. The quality of trains (size, cleanliness) and its connection vary significantly from region to region. One has to consider that trains will be full during commuting hours and empty outside of them. During weekends, bicyclists take up a lot of space in the trains so this can be an issue, too. The people are usually friendly and very helpful but there are also exceptions: drunk and loud people, some of them smell badly due to sweat or even urine. The toilets are in an acceptable condition but don’t rely on this – try to take Number One/Number Two at a train station instead inside of a train toilet.
The 9 Euro ticket is definitely worth it and should be used to visit all kinds of places in Germany. There are wonderful towns and regions which should be visited during the summer time. I haven’t been to cities such as Rostock, Schwerin, Konstanz, Kiel, Flensburg, Saarbrücken and many others so I’ll try to catch up with my visits.
Taking measurements with electronic equipment doesn’t require much skill and effort: turn the device on, set up the measurement parameters such as input channel/range/sensitivity, trigger the measurement and read the numbers on the screen (if there are any). The same procedure can be applied in everyday situations – whether you have to read the time from a clock or check the temperature in your fridge/oven.
But what if one does have to take thousands or even million of measurements every day? What happens if measurements have to be performed 24/7? There surely are applications where it is necessary to take measurements manually but putting a human behind a bench and performing boring and repetitive measurements during a 8-hour-workday is prone to exhaustion and errors. This is where automated test equipment (ATE) kicks in. It is possible to let a computer do the “boring stuff” while the human operator may spend his or her precious time on solving problems instead of doing repetitive work. I’ve successfully stolen borrowed and tested foreign Python code and want to demonstrate how to control a digital multimeter and a function generator via General-Purpose Interface Bus (GPIB) and Python’s pyvisa module.
GPIB
GPIB is a 8-bit parallel interface bus which has been invented in the late 1960’s by Hewlett-Packard (see Wikipedia article). Prior to its standardization in the late 1970’s as IEEE 488, it was known as HP-IB (Hewlett-Packard Interface Bus). It allows interconnection between instruments and controllers. It is system independent of device functions. This de facto standard has been around for a while and is well established in the Test & Measurement industry. Fast forward to the year 2022, GPIB is still present in test equipment although in recent two decades, communication with instruments have been enabled with modern-day interfaces such as USB or Ethernet. GPIB allows a very diverse topology – one can connect all instruments either in a Daisy Chain or parallel configuration or even in a combination of both of them. There are certain GPIB-specific limitations concerning cable lengths, maximum number of connected devices, data transfer speeds and others which have to be considered when automating test equipment.
Experimental Setup
Schematic of my test test setup. The HP 3325B function generator provides a sinusoidal voltage for the HP 34401A digital multimeter in order to measure a well-known test signal. Both instruments are connected via GPIB to a GPIB/Ethernet controller.
I’ve connected a HP 34401A digital multimeter to a HP 3325B function generator in order to generate a sinusoidal test signal, which can be represented by an equation \(v(t) = v_0 \cdot \sin (\omega t) \) with \(\omega = 2\pi f\). Both instruments are connected to a GPIB controller National Instruments GPIB-ENET/100. The GPIB-ENET controller acts as a bridge and allows communication to GPIB devices via ethernet, which is highly convenient in my lab. It allows me to control the instruments via LAN from any of my computers. This device requires drivers from National Instruments so I’ve chosen NI MAX v17.5 along with NI-488.2 driver in order to be able to use the legacy GIPB-ENET/100 controller. I’m using Windows 10 along with the WinPython distribution. WinPython comes along with Python 3.9.10 and hundreds of useful modules, such as numpy, pandas, matplotlib etc. (which are optional). The pyvisa module needs to be installed manually via pip, see PyVISA’s project website for further installation instructions.
National Instruments GPIB-ENET/100. This unit is legacy and is not supported by current NI drivers anymore. The last known driver version which supports this unit is v17.5. The GPIB-ENET/1000 (1 Gbit/s version) is currently supported by National Instruments.
Important notice for new users
Many of the GPIB-USB adapters sold on eBay are fakes or counterfeits. They are sold very cheap (different brands such as National Instruments, Agilent/Keysight, Keithley) in the price range of 100 EUR to 120 EUR per piece whereas the genuine GPIB-USB adapters often cost more than 400 EUR. Buying a new unit directly from the manufacturer will cost in the order of 900 -1200EUR which is kinda crazy! Nevertheless, some of the fake GPIB-USB adapters seem to work pretty well and are recognized by the official drivers. However, some EEVBlog users also report having problems with fake adapters… So it’s really a gamble.
I’ve bought a 2nd hand “fake” GBIB-USB-HS for cheap which didn’t work for the previous owner but works perfectly on my Windows 10 machine. I haven’t tested it with Raspberry PI yet which will be done in a future project. The GPIB-ENET/100 unit is a little bit pricy (~200ish EUR) but the most affordable interface cards are the PCI-GPIB types. I’ve seen genuine units being sold on eBay for 40-80 EUR. No need to spend hundreds of Euros for a GPIB interface. Microcontroller-based GPIB-USB projects also exist where one can assemble a GPIB-USB or GPIB-LAN controller for cheap (which may not work always but gets the job done). Proper GPIB-cables can be expensive, too, but I’ve seen them being sold for approx. 7 … 12 EUR per piece occasionally. Custom-made GPIB cables out of ribbon cable and Centronics/Amphenol connectors may also work and get the job done.
NI GPIB-USB-HS adapter. Unfortunately, this unit is a fake (counterfeit). Despite being a fake, it works on my PC.
Example Code
First of all we’re gonna need to import some Python modules. pyvisa is mandatory, other modules will be useful.
# Import Python modules
import pyvisa
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import datetime
import time
Next step: we need to open the pyvisa Resource Manager. We need to know the GPIB addresses of our instruments. For example, I’ve assigned GPIB address No. 4 to my digital multimeter dmm and the frequency generator fgen has the GPIB address No. 18. GPIB 22 is another digital multimeter which isn’t used in this example.
# Open pyvisa Resource Manager, print out a list with active devices
rm = pyvisa.ResourceManager()
print(rm.list_resources())
The print(rm.list_resources()) statement gives us the GPIB addresses of the connected devices, such as: ('ASRL3::INSTR', 'GPIB0::4::INSTR', 'GPIB0::18::INSTR', 'GPIB0::22::INSTR'). Now we can open a connection to the resources.
# Assign GPIB address 4 to dmm and open resource
dmm = rm.open_resource('GPIB0::4::INSTR')
dmm.read_termination = '\n'
dmm.write_termination = '\n'
# Assign GPIB address 18 to fgen and open resource
fgen = rm.open_resource('GPIB0::18::INSTR')
fgen.read_termination = '\n'
fgen.write_termination = '\n'
The dmm and fgen objects have been created. The statements dmm.read_termination = '\n' deal with line feed and carriage returns. The next step will set the DMM settings and call an identify string via a SCPI command*IDN?
# Set the DMM for measurements
print(dmm.query('*IDN?')) # Identify string
print(dmm.write('CONF:VOLT:DC 10,0.001')) # Set DC voltage range and 4.5 digits of resolution
The same commands are applied to our frequency generator. The output of the DMM looks something like (name, model, firmware version): HEWLETT-PACKARD,34401A,0,4-1-1 22
# Set the FGEN for measurements according to the manual
print(fgen.query('*IDN?')) # Identify string
print(fgen.write('AM 2.0 VO')) # Set amplitude to 2 V_pp
print(fgen.write('FR 0.1 HZ')) # Set frequency to 0.1 Hz
The parameters such as measurement range, frequency and amplitude have been set. Now let’s take a single measurement. This is done via query command. A query is a short representation of dmm.write() and dmm.read() commands. The READ? command fetches the current measurement value from the digital multimeter.
# Example 1: Take a single measurement
print('Measured value: {} Volts.'.format(dmm.query('READ?')))
Measured value: -9.97000000E-02 Volts.
We have measured the voltage! Yaay! Its value is -99.7 mV, written in the engineering notation. Our next code example will be used to take 2048 measurements and timestamp them. I’ve used the pandas DataFrame as a convenient structure to store the data. This could have been done with numpy arrays for sure! OK, after setting the Number of acquired samples to N = 2048, I’ve created an empty pandas DataFrame. It will be filled with our precious data. The next line (6.) prints out the date and time. The t0 variable in line (7.) is used to get the timestamp value at the beginning of the measurement. This value will be subtracted from the timestamps generated by time.time().
The for loop starts at the value 0 and calls two commands according to line (9.). It writes a timestamp and measured value into the DataFrame df at index 0. After execution of line (9.), the for loop is repeated N-1 = 2047 times. As soon as the for loop finishes, we need to convert the string-datatype voltages into floating point numbers, otherwise Python will have difficulties handling them with further calculations.
# Example 2: Take N numbers of measurements
N = 2048 # Number of samples to acquire
df = pd.DataFrame(columns=['t', 'V']) # Create an empty pandas DataFrame
# Print date and time, write data into the DataFrame
print(datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f'))
t0 = time.time()
for i in range(N):
df.loc[i] = [time.time()-t0, dmm.query('READ?')]
# Convert dmm readout strings to a float number
df.V = df.V.astype(float)
That’s it! We’ve acquired 2048 measurements. Just imagine sitting there and typing all these numbers in Excel! Such a waste of time 😉 The next line of code extracts the total measurement time from the DataFrame timestamps. The measurement took approx. 25.8 seconds to complete. This corresponds to approx 79.2 samples per second at 4.5 digits of precision.
# Show elapsed time in seconds
df.iloc[N-1].t
25.846375942230225
# Calculate the sampling rate in Samples per Second
str(np.round((len(df)-1)/df.iloc[N-1].t, 3))
'79.199'
The last step of this example will be to plot the results into a graph figure. First we create an empty figure called fig with sizes 11.6 x 8.2 inches at 300 dpi resolution. The plt.plot() command needs the \(x\)– and \(y\)– values (or time and voltage values) as function arguments in order to plot a nice diagram. We label the axes, set a title and grid. The figure is then saved as PNG file and displayed. See picture below!
# Plot the results, annotate the graph, show figure and export as PNG file
fig = plt.figure(figsize = (11.6, 8.2), dpi=300, facecolor='w', edgecolor='k')
plt.plot(df.t, df.V, 'k.')
plt.xlabel('Time (s)')
plt.ylabel('Voltage (V)')
plt.title('HP 34401A measurement (Range: 10 V (DC), Resolution: \n 4.5 digits @ ' + str(np.round((len(df)-1)/df.iloc[N-1].t, 3)) + ' Sa/s, $f$ = 0.1 Hz, $v_0$ = 2 V$_{pp}$)')
plt.grid(True)
plt.savefig('Measurement_result.png')
plt.show()
Measurement result after data acquisition of 2048 samples.
Now we could do some statistics or fit a sine function to it. I’ll explain this in a future blog post. A small bonus can be achieved via the following command:
dmm.write('DISP:TEXT "73 DE DH7DN"')
HP 34401A with a custom text message, sent to the device via GPIB.