On the Internet page http://www.semifluid.com I found a very simple solution for creating a digital computer oscilloscope. The device is based on the eight-bit PIC12F675 processor.

The processor operates at a frequency of 20 MHz. The microcontroller continuously measures the input voltage, converts it and sends digital value to the computer's serial port. The serial port baud rate is 115Kbps and as shown in the following figure, data is scanned and sent at a rate of about 7.5 kHz (134 µs).

Device diagram


The basis of the circuit, the PIC12F675 microcontroller (U2 chip) which operates at a clock frequency of 20 MHz of the Y1 crystal. J1 is a standard power connector for connecting 9-12V power, which is then stabilized at U1 to 5V to power the processor.

After U2, a simple TTL level converter with a PC RS232 serial port is added to the circuit. It is based on a BC337 transistor (Q1) and resistors R1 and R3. Input 5 of the microcontroller leads to switch S1. In its main position (1-2), the instrument switches to DC oscilloscope mode (DC measurements), which is capable of displaying a 0-5V input signal. In the second position - to the AC oscilloscope mode. In this position, the maximum voltage is from -2.5 to +2.5 V. I used a 22000nF ceramic capacitor C6 to observe low frequencies without much distortion.

If necessary, you can add additional input attenuator (splitter), or op-amp.

Software

In the original site mentioned above, also available simple program controls for Windows. The program is written in Visual Basic.

The program starts immediately and waits for data to appear on the serial port COM1. On the left, four sliders used to measure the period and voltage of the signal. Then there are on/off synchronization, fields for scaling or changing sample size values.

Mounting

I didn't start doing printed circuit board, but mounted everything in a small plastic box with a hinged mounting. The case must have holes for the switch RS232 connector, input jack, power jack.

Firmware for the processor - at the end of the article. The configuration bits (fuse) must be set during programming as follows:

Photo of my finished prototype



Below you can download the source, firmware and software for windows

List of radio elements

Designation Type of Denomination Quantity NoteScoreMy notepad
U1 Linear Regulator 1 Search in Chip and DipTo notepad
U2 MK PIC 8-bit 1 675-I/PSearch in Chip and DipTo notepad
Q1 bipolar transistor 1 Search in Chip and DipTo notepad
C1, C2, C5 Capacitor0.1uF3 Search in Chip and DipTo notepad
C3, C4 Capacitor22 pF2 Search in Chip and DipTo notepad
C6 Capacitor22 uF1 Search in Chip and DipTo notepad
R1, R3 Resistor 2

Nowadays, the use of various measuring devices built on the basis of interaction with personal computer, enough. A significant advantage of their use is the ability to save the obtained values ​​of a sufficiently large amount in the device's memory, with their subsequent analysis.

Digital USB oscilloscope from computer, which we describe in this article, is one of the options for such measuring instruments for a radio amateur. It can be used as an oscilloscope and a device for recording electrical signals in RAM and on HDD computer.

The circuit is not complicated and contains a minimum of components, as a result of which it was possible to achieve a good compactness of the device.

Key Features of USB Oscilloscope:

  • ADC: 12 bits.
  • Timebase (oscilloscope): 3 ... 10 ms / division.
  • Time scale (recorder): 1…50 sec/sample.
  • Sensitivity (without divider): 0.3 volts / division.
  • Synchronization: external, internal.
  • Data recording (format): ASCII, text.
  • Maximum input impedance: 1 MΩ in parallel to 30 pF capacitance.

Description of the operation of the oscilloscope from a computer

To exchange data between the USB oscilloscope and a personal computer, the Universal Serial Bus (USB) interface is used. This interface operates on the basis of the FT232BM (DD2) chip from Future Technology Devices. It is an interface converter. The FT232BM can operate in both direct BitBang bit control mode (using the D2XX driver) and virtual COM port mode (using the VCP driver).

The AD7495 (DD3) integrated circuit from Analog Devices was used as an ADC. It is nothing more than a 12-bit analog-to-digital converter with an internal voltage reference and a serial interface.

The AD7495 also has a frequency synthesizer that determines how fast information will be exchanged between the FT232BM and the AD7495. To create the necessary communication protocol, USB program The oscilloscope populates the USB output buffer with separate bit values ​​for the SCLK and CS signals as shown in the following figure:


The measurement of one cycle is determined by a series of nine hundred and sixty successive transformations. The FT232BM chip sends the SCLK and CS electrical signals at a frequency determined by the built-in frequency synthesizer, in parallel with the transfer of conversion data on the SDATA line. The period of the 1st complete conversion of the FT232BM ADC, which sets the sampling rate, corresponds to the duration of the sending period of 34 bytes of data output by the DD2 chip (16 data bits + CS line pulse). Because the FT232BM's baud rate is determined by the frequency of the internal frequency synthesizer, all you need to do to modify the sweep values ​​is to change the frequency synthesizer values ​​of the FT232BM.

The data received by the personal computer, after certain processing (scaling, zero adjustment) are displayed on the monitor screen in graphical form.

The signal under test is fed to connector XS2. The OP747 op amp is designed to match the input signals to the rest of the oscilloscope's USB circuitry.

On modules DA1.2 and DA1.3, a circuit for shifting a bipolar input signal to the positive voltage zone is built. Since the internal voltage reference source of the DD3 microcircuit has a voltage of 2.5 volts, without the use of dividers, the input voltage coverage is -1.25 .. + 1.25 V.

In order to be able to investigate signals with a negative polarity, with virtually unipolar power from the USB connector (a), a DD1 voltage converter was used, which generates a negative polarity voltage to power the op-amp OP747. To protect against interference of the analog part of the oscilloscope, components R5, L1, L2, C3, C7-C11 are used.

The uScpoe program is designed to display information on the computer monitor screen. With the help of this program, it becomes possible to visually evaluate the magnitude of the signal under study, as well as its shape in the form of an oscillogram.


The ms/div buttons are used to control the sweep of the oscilloscope. In the program, you can save the waveform and data to a file using the corresponding menu items. For virtual inclusion and turn off the oscilloscope, use the Power ON/OF buttons. When disconnecting the oscilloscope circuit from the computer, the uScpoe program is automatically switched to OFF mode.

In the electrical signal recording mode (recorder), the program creates text file, whose name can be set in the following path: File->Choice data file. the data.txt file is initially formed. Further, the files can be imported into other applications (Excel, MathCAD) for further processing.

(3.0 Mb, downloaded: 3 610)

An oscilloscope is a very important instrument that is used in radio engineering laboratories involved in the manufacture and testing of many instruments. But they can also be used in conventional radio workshops. The main task of devices of this type is the detection and correction of electronic circuits, debugging their work, and most importantly, the prevention of problems in the manufacture of new circuits.

A significant drawback of oscilloscopes is a rather high price. Therefore, not everyone can buy them. That's why the question arises, ? Although many variants of such manufacturing are known, one main element is involved in each method - a PC sound card. An adapter is attached to it, thanks to which the levels of the measured signals are coordinated.

Software

This device works thanks to specific program. It transmits signals to the screen that are visualized. Thus, the measured pulses are converted. The choice of utilities is quite large, but not all of them can work consistently well.

The proven Osci program has gained the greatest popularity. Thanks to it, the oscilloscope works in normal mode. The program has an interface, a grid is installed on the screen, thanks to which you can measure the signal in length and amplitude. This grid is special because it provides additional functions. By choosing this program, there are a number of positive aspects that other programs cannot guarantee.

Technical details

To build an oscilloscope from a computer, it is necessary to assemble a so-called voltage divider or attenuator. This device allows you to cover a large range of measured voltage, protect the input port of the sound card from damage. Damage of this level occurs mainly due to high voltage.

Almost all audio cards have an input voltage of no more than 2 volts. An oscilloscope made from a computer is limited in the capabilities of a sound card. If we consider budget cards, then for them this figure is kept at the level of 0.1 Hz-20 kHz.

The voltage at its lowest point is 1 mV. Such a low figure is due to the limitation of the background and noise levels. Upper voltage parameters - up to 500 volts. It is limited by adapter parameters.

Advantages and disadvantages of oscilloscopes

No radio amateur can do without an oscilloscope. Although this unit is sold for enough high price. But at the same time, it has both advantages and a number of disadvantages.


The main plus of an oscilloscope created by oneself from a computer is its low price. That is, it will have to spend quite a bit of money on its re-equipment. But there are several disadvantages:
1. High sensitivity. The device responds to interference even at a low level. This leads to large errors.
2. The amplitude of the sound signal is up to 2V. Entrance sound card unable to withstand a higher rate. Therefore, the sound card can fail quite quickly. However, this can be avoided.
3. Failure to continuously measure voltage. This, in fact, is not a significant drawback.

Creating an oscilloscope

Since some oscilloscopes do not allow a signal above 2V, and for some it does not exceed 1V, you need to try to eliminate this problem, since this amplitude is clearly not enough. The solution to the problem lies in increasing the limits that the adapter can handle. The modern program that ensures the operation of the oscilloscope allows you to achieve such measurement limits - 12.5 and 250 volts.

If a signal whose amplitude is 250 volts is not needed, then an adapter with two channels can be made. For this, protection is installed that controls the operation of the device, that is, it does not allow erroneous switching on if the voltage indicator is quite high.


To reduce the influence of external interference on the oscilloscope from the computer, it is necessary to place the board in a case made of metal. After that, a common wire is connected to this case.

The process of setting up a sound card is accompanied by turning off the microphone gain. To do this, the volume on it is made medium or below average. Once all the work is done, you can start measuring the secondary processing pulses of the transformer. If everything is done correctly, then it will be able to display waveforms of even the most low frequencies. Thanks to installed program it will be possible to easily determine the frequency level of the signal.

It's so easy to make a modern device from a computer. The oscilloscope will draw waveforms that will help in the work and experiments carried out in radio engineering and home laboratories.

Below is a USB oscilloscope project that you can build yourself. The capabilities of a USB oscilloscope are minimal, but for many amateur radio tasks it will do. Also, the circuit of this USB oscilloscope can be used as a basis for building more serious circuits. The scheme is based Atmel microcontroller Tiny45.

The oscilloscope has two analog inputs and is powered by a USB interface. One input is activated via a potentiometer, which allows you to reduce the input signal level.

The software for the tiny45 microcontroller is written in C and compiled with and V-USB Development Obdev , which implements the HID device from the microcontroller side.
The circuit does not use external quartz, but the frequency from USB is 16.5 MHz. Naturally, one should not expect 1Gs/s from this sampling scheme.

The oscilloscope works via USB via HID mode, which does not require the installation of any special drivers. The software for windows is written using .NET C#. Based on my source code of the program, you can add to the software as you need.

The circuit diagram of a USB oscilloscope is very simple!


List of used radio elements:
1 LED (any)
1 LED resistor, 220 to 470 ohm
2 x 68 ohm resistors for USB D+ & D-lines
1 x 1.5K resistor for USB device detection
2 x 3.6V zener diodes for equalizing USB levels
2 capacitors 100nF and 47uF
2 filter capacitors on analog inputs (10nF to 470nF), optional
1 or 2 potentiometers on analog inputs to reduce the input voltage level (if needed)
1 USB connector
1 microcontroller Atmel Tiny45-20.

List of radio elements

Designation Type of Denomination Quantity NoteScoreMy notepad
R1, R5 Resistor 2 Search in Chip and DipTo notepad
R2 Resistor 1 Search in Chip and DipTo notepad
R3 Resistor 1

Quite often lately, instead of making, for example, an oscilloscope from a computer, many people prefer to simply buy a digital USB oscilloscope. However, looking at the market, you can understand that in fact the cost of budget oscilloscopes starts at about $ 250. And more serious equipment does have a price several times higher.

It is for those people who are not satisfied with such a cost that it is more relevant to make an oscilloscope from a computer, especially since it allows you to solve a large number of tasks.

What should be used?

One of the best options is the Osci program, which has an interface similar to a standard oscilloscope: there is a standard grid on the screen, with which you can independently measure the duration, or the amplitude.

Among the shortcomings of this utility, it can be noted that it works somewhat unstable. In the course of its work, the program may sometimes freeze, and in order to reset it later, you will need to use a specialized Task Manager. However, all this is offset by the fact that the utility has a familiar interface, is quite easy to use, and also has a sufficiently large number of functions that allow you to make a full-fledged oscilloscope from a computer.

On a note

It should be noted right away that these programs include a specialized low-frequency generator, but its use is highly discouraged, as it tries to completely independently regulate the operation of the audio card driver, which can cause irreversible sound muting. If you try to use it, make sure that you have your own restore point or the ability to make a backup operating system. The best option on how to make an oscilloscope out of a computer with your own hands is to download a normal generator, which is located in the "Additional Materials".

"Vanguard"

Avangard is a domestic utility that does not have a standard and familiar measuring grid, and also has a screen that is too large for taking screenshots, but at the same time provides the ability to use the built-in amplitude voltmeter, as well as a frequency meter. This allows you to partially compensate for the disadvantages that were mentioned above.

Having made such an oscilloscope from a computer with your own hands, you may encounter the following: at low signal levels, both the frequency meter and the voltmeter can greatly distort the results, however, for beginner radio amateurs who are not used to perceiving diagrams in volts or milliseconds per division, this utility will be perfectly acceptable. Its other useful feature is that it is possible to carry out a completely independent calibration of the two existing scales of the built-in voltmeter.

How will it be used?

Since the input circuits of the audio card have a specialized coupling capacitor, the computer can only be used as an oscilloscope with a closed input. That is, only the variable component of the signal will be observed on the screen, however, with some skill, using these utilities, it will also be possible to measure the level of the constant component. This is quite relevant if, for example, the countdown time of the multimeter does not make it possible to fix a certain amplitude value of the voltage across the capacitor, which is charged through a large resistor.

The lower voltage limit is limited by the noise and background levels and is approximately 1 mV. The upper limit is limited only by the parameters of the divider and can even reach several hundred volts. The frequency range is directly limited by the capabilities of the audio card itself and for budget devices is approximately 0.1 Hz to 20 kHz.

Of course, in this case, a relatively primitive device is considered. But if you do not have the opportunity, for example, to use a USB oscilloscope (prefix to a computer), then in this case its use is quite optimal.

Such a device can help you repair various audio equipment, and can also be used exclusively for educational purposes, especially if you supplement it with a virtual bass generator. In addition, the oscilloscope program for a computer will allow you to save a plot to illustrate certain material or for the purpose of posting it on the Internet.

Wiring diagram

If you need a prefix to a computer (an oscilloscope), then making it will be a little more difficult. On the this moment on the Internet you can find a fairly large number of different schemes for such devices, and to build, for example, a two-channel oscilloscope, you will need to duplicate them. The use of the second channel is often relevant if you need to compare two signals or if a set-top box to a computer (oscilloscope) will also be used with an external synchronization connection.

In the vast majority of cases, the circuits are extremely simple, but in this way you can independently provide a fairly wide range of voltages available for measurement, while using the minimum number of radio components. In this case, the attenuator, which is built according to the classical scheme, would require you to use specialized high-megaohm resistors, and its input resistance would constantly change in the event of a range switch. For this reason, you would experience certain limitations in using standard oscilloscope cables, which are rated for an input impedance of no more than 1 mΩ.

We provide security

To line input audio card was protected from the possibility of accidental exposure to high voltage, you can install specialized zener diodes in parallel.

With the help of resistors, you can limit the current of the zener diodes. For example, if you are going to use your computer oscilloscope (generator) to measure a voltage of about 1000 volts, then in this case you can use two one-watt or one two-watt resistor as a resistor. They differ among themselves not only in their power, but also in what voltage in them is the maximum allowable. It is also worth noting the fact that in this case you will need a capacitor, as much as possible permissible value for which is 1000 volts.

Attention!

It is often necessary to initially look at the variable component of a relatively small amplitude, which, in this case, may differ in a rather large constant component. In this case, on the screen of an oscilloscope with a closed input, there may be a situation where you will not see anything but the variable component of the voltage.

Choosing voltage divider resistors

Due to the fact that quite often modern radio amateurs experience certain difficulties in order to find precision resistors, it often happens that you have to use standard devices for general use, which will need to be adjusted with maximum accuracy, since otherwise it would not be possible to make an oscilloscope from a computer. will come out.

High-precision resistors in the vast majority of cases are several times more expensive than conventional ones. At the same time, today they are most often sold at once in 100 pieces, and therefore their acquisition cannot always be called expedient.

Trimmers

In this case, each divider arm is made up of two resistors, one of which is constant, while the second is trimmer. The disadvantage of this option is its bulkiness, however, the accuracy is limited only by what available parameters the measuring device has.

We select resistors

The second option to make a computer in the role of an oscilloscope is to pick up pairs of resistors. Accuracy in this case is ensured due to the fact that pairs of resistors from two sets with a sufficiently large spread are used. The important thing here is to first make a careful measurement of all devices, and then choose pairs whose sum of resistances is the most suitable for the circuit you are performing.

It is worth noting that this particular method was used on an industrial scale in order to adjust the divider resistors for the legendary TL-4 device. Before you make an oscilloscope from a computer with your own hands, you need to study the possible disadvantages of such a device. First of all, we can note the complexity, as well as the need to use a large number of resistors. After all, the longer the list of devices you use, the higher the final accuracy of the measurements will be.

Resistor Fitting

It is worth noting that fitting resistors by removing part of the film is sometimes used today even in modern industry, that is, an oscilloscope is often made from a computer (USB or some other) in this way.

However, it should be noted right away that if you are going to adjust high-resistance resistors, then in this case the resistive film should in no case be cut through. The thing is that in such devices it is applied to a cylindrical surface in the form of a spiral, so it is necessary to make a cut with extreme caution in order to exclude the possibility of breaking the chain.

If you are making an oscilloscope from a computer with your own hands, then in order to adjust the resistors at home, you just need to use the simplest zero sandpaper.

  1. Initially, the resistor with a known lower resistance must be carefully removed from the protective layer of paint.
  2. After that, you should solder the resistor to the ends, which will be glued to the multimeter. By performing careful movements with sandpaper, the resistance values ​​\u200b\u200bof the resistor are brought to a normal value.
  3. Now that the resistor is finally fitted, the cut must be covered extra layer specialized protective varnish or glue.

At the moment, this method can be called the simplest and fastest, but at the same time it allows you to get good results, which makes it optimal for work at home.

What should be taken into account?

There are a few rules that you need to follow in any case if you are going to carry out such work:

  • The computer you are using must be properly grounded.
  • Under no circumstances should you plug a ground wire into the outlet. It connects through a specialized line-in connector housing to the housing system block. In this case, regardless of whether you fall into zero or into phase, you will not have a short circuit.

In other words, only a wire connected to a resistor, which is located in the adapter circuit and has a rating of 1 megohm, can be plugged into the outlet. If you try to plug in the cable that connects to the case, then in almost all cases this leads to the most unpleasant consequences.

If you will use the Avangard oscilloscope, then in this case, during the calibration process, you should select the scale of the voltmeter "12.5". After you see the mains voltage on your screen, you will need to enter the value 311 into the calibration window. It is worth noting that the voltmeter should then show you a result in the form of 311 mV or close to it.

Among other things, do not forget that the voltage shape in modern electrical networks is different from sinusoidal, since today electrical appliances are produced with switching power supplies. It is for this reason that you will need to focus not just on the visible curve, but also on its sinusoidal continuation.

Tell in:
CONTINUATION: Selection of resistors. Another way is to select pairs of resistors. Accuracy is ensured by selecting pairs of resistors from two sets of resistors with a large spread. First, all resistors are measured, and then pairs are selected, the sum of the resistances of which most closely matches the circuit.
It was in this way, on an industrial scale, that the divider resistors were adjusted for the legendary TL-4 tester.
The disadvantage of the method is the laboriousness and the need for a large number of resistors.
The longer the list of resistors, the higher the accuracy of selection.
Fitting resistors with sandpaper. Fitting resistors, by removing part of the resistive film, does not disdain even the industry.
However, when fitting high-resistance resistors, it is not allowed to cut through the resistive film through. In high-resistance MLT film resistors, the film is deposited on a cylindrical surface in the form of a spiral. Such resistors must be filed very carefully so as not to break the circuit.
Precise adjustment of resistors in amateur conditions can be done using the finest sandpaper - “null”. First, a protective layer of paint is carefully removed from the MLT resistor, which obviously has a lower resistance, using a scalpel. Then the resistor is soldered to the "ends" that are connected to the multimeter. With careful movements of the “zero” skin, the resistance of the resistor is brought to normal. When the resistor is adjusted, the cut is covered with a layer of protective varnish or glue.
In my opinion, this is the fastest and easiest way, which, nevertheless, gives very good results. Construction and details. Elements of the adapter circuit are placed in a rectangular duralumin case.
Switching the attenuator division ratio is carried out by a toggle switch with an average position. A standard CP-50 connector is used as an input socket, which allows the use of standard cables and probes. Instead, you can use a regular 3.5mm Jack audio jack.
The output connector is a standard 3.5mm audio jack. The adapter is connected to the line-in of the audio card using a cable with two 3.5mm jacks at the ends. The assembly is made by the method of hinged mounting To use the oscilloscope, you will also need a cable with a probe at the end.
How to make it will be described in detail in another manual in the near future called " How to make a probe cable for a low frequency virtual oscilloscope? "How to calibrate a virtual oscilloscope? To calibrate an oscilloscope, you need to have at least some measuring device. Any pointer tester or digital multimeter you trust will do.
Due to the fact that some testers have too high a measurement error AC voltage up to 1 Volt, calibration is carried out at the maximum possible, but unlimited in amplitude, voltage.

Before calibration, we make the following settings.

Disable audio equalizer.
“Line output level”, “WAVE level”, “Line input level” and “Recording level” are set to the maximum gain position. This will ensure the repeatability of the result in further measurements.
Resetting the generator settings just in case with the Command > Get Generator Default Setting command, set the “Gain” (level) to 0db.
We select the frequency of the generator 50Hz with the “Frequency Presets” switch (presets), since all amateur devices for measuring AC voltage can work at this frequency, and our adapter cannot yet work correctly at higher frequencies. We switch the adapter input to 1: 1 mode .
Looking at the oscilloscope screen, we select the maximum unlimited signal level using the Trim generator knob.
The signal can be limited both at the input of the audio card and at its output, while the calibration accuracy can be significantly reduced. AudioTester even has a special overload indicator, which is highlighted in red in the screenshot.
We measure the voltage at the output of the generator with a tester and calculate the value of the corresponding amplitude value.
Example.
Voltmeter reading = 1.43 Volts (rms).
We get the amplitude value.
1.432*√2 = 2.025 (Volt)
The “Options > Calibrate” command brings up the “AudioTester” calibration window.
And although the dimension in “mVrms” is indicated near the input window, which in theory should mean the root-mean-square value, in reality, in the “oszi v2.0c” oscilloscope from the “AudioTester” kit, the input values ​​\u200b\u200bcorrespond to ... it’s not clear what. Which, however, does not interfere with the precise calibration of the device.
By entering values ​​in small increments, you can fine-tune the size of the sine wave image to the amplitude value calculated above.
The picture shows that the signal amplitude was a little more than two divisions, which corresponds to 2.02 Volts.
The accuracy of displaying the amplitude of the signals received from the inputs 1:20 and 1:100 will depend on the accuracy of selecting the appropriate divider resistors.
When calibrating the Avangard oscilloscope, the values ​​obtained when measured by the tester must also be multiplied by √2, since both the voltmeter and the Avangard-a calibrator are designed for amplitude values.
We enter the resulting value into the calibration window in millivolts - 2025 and press Enter.
To calibrate the second range of the Avangard oscilloscope, which is marked as “250”, you must first calculate the real division ratio by comparing the readings of the built-in voltmeter in two divider ranges: 1:1 and 1:20. The oscilloscope voltmeter should be in the “12.5” position

Example.
122 / 2323 = 19,3
Then you need to tweak the "calibr" file, which can be opened in Notepad (Notepad). On the left is the file before editing, and on the right is after.
The "calibr" file is located in the same directory as the current copy of the program.
AT eighth line we enter the real division coefficient corresponding to the divider of the first (left) channel.
If you have built a dual channel adapter, then in ninth line we make an amendment for the second (right) channel. How to equalize the amplitude-frequency characteristic of the adapter? The line input of the audio card, and the adapter circuits themselves, have some input capacitance. The reactance of this capacitance changes the division ratio of the divider at high frequencies. To equalize the frequency response of the adapter in the 1:1 range, you need to select the capacitance of the capacitor C1 so that the signal amplitude at a frequency of 50 Hz is equal to the signal amplitude at a frequency of 18-20 kHz. Resistors R2 and R3 reduce the effect of input capacitance and create a boost frequency response in the high frequency region. You can compensate for this rise by selecting capacitors C2 and C3 in the appropriate ranges of 1:20 and 1:100.
I picked up the following capacities: C1 - 39pF, C2 - 10nF, C3 - 0.1nF. Now that the Y-channel of the oscilloscope's vertical deviation has been calibrated and linearized, you can see how these or those periodic signals, and not only, look like. In "AudioTester-e" there is a "pending sweep sync". What if there is no tester? Or dangerous experiences. Can the lighting network be used for calibration?

Since any self-respecting radio amateur, despite all the warnings, first of all tries to get his offspring into the socket, I found it necessary to tell more about this dangerous occupation.
According to GOST, the mains voltage should not go beyond 220 Volts - 10% + 5%, although, in real life, this condition is not met as often as we would like. Measurement errors during resistor fitting and impedance measurements can also introduce high errors in this method calibration.
If you have assembled a precision divider, for example, on high-precision resistors, and if it is known that in your house the voltage in the lighting network is maintained with sufficient accuracy, then it can be used for rough calibration of the oscilloscope.
But, there are a lot of BUT, because of which, I categorically do not recommend you to do this. The first and most important "BUT" is the very fact that you are reading this article. Anyone who is on you with electricity would hardly spend time on this. But if that's not an argument... The most important!
1. The computer must be securely grounded!!!
2. Do not, under any pretext, stick an "earth" wire into the socket! This is the wire that is connected through the line-in connector housing to the system unit housing!!! (Other names for this wire: ground, body, common, screen, etc.) Then, regardless of whether you get into phase or zero, a short circuit will not occur.
In other words, only a wire that is connected to a 1 megohm resistor R1 located in the adapter circuit can be plugged into the outlet !!!
If you try to plug a wire connected to the case into the network, then in 50% of cases this will lead to the most sad consequences.
Since the maximum unlimited amplitude at the linear input is about 250mV, then in the 1:100 divider position, you can see an amplitude of about 50 ... 250 Volts (depending on the input impedance). Therefore, to measure the mains voltage, the adapter must be equipped with a 1: 1000 divider.
The 1:1000 divisor can be calculated by analogy with the 1:100 divisor.
An example of calculating the divisor 1:1000.
The upper arm of the divider = 1007 kOhm.
Input impedance = 50kΩ.
Input division ratio 1:1 = 20.14.
We determine the overall division factor for the input 1:1000.
20.14*1000 = 20140 (times)
We calculate the value of the resistor for the divider.
1007*50 / 50*20140 -50 -1007 ≈ 50 (Ohm)TO BE CONTINUED:
Section: [Measuring technology]
Save article to:

Thousands of schemes in categories:
-> Other
-> Measuring technology
-> Devices
-> Schemes of electrical equipment
->
-> Theoretical materials
-> Reference materials
-> Devices on microcontrollers
-> Chargers (for batteries)
-> Chargers (for cars)
-> Voltage converters (inverters)
-> Everything for the cooler (Fan)
-> Radio microphones, bugs
-> metal detectors
-> Power regulators
-> Security (Alarm)
-> Lighting control
-> Timers (humidity, pressure)
-> Transceivers and radios
-> Constructions for the house
-> Constructions of simple complexity
-> Competition for the best design on microcontrollers
-> Structures of medium complexity
-> Stabilizers
-> Low frequency power amplifiers (based on transistors)
-> Power supplies (pulse)
-> RF Power Amplifiers
-> Soldering and PCB Design Tools
-> thermometers
-> Board. net
-> Measuring instruments (tachometer, voltmeter, etc.)
-> Iron
-> Soldering irons and soldering stations
-> radio transmitters
-> Auxiliary devices
-> Television technology
->


How to make a digital oscilloscope from a computer with your own hands?

Dedicated to novice radio amateurs!

About how to assemble the simplest adapter for a software virtual oscilloscope, suitable for use in repairing and tuning audio equipment. https://website/

The article also talks about how you can measure the input and output impedance and how to calculate the attenuator for a virtual oscilloscope.


The most interesting videos on Youtube

related topics.

About virtual oscilloscopes.


Once I had a fix idea: to sell an analog oscilloscope and buy a digital USB oscilloscope to replace it. But, having wandered around the market, I found that the most budgetary oscilloscopes “start” at $ 250, and the reviews about them are not very good. More serious devices are several times more expensive.

So, I decided to limit myself to an analog oscilloscope, and to build some plot for the site, use a virtual oscilloscope.

I downloaded several software oscilloscopes from the network and tried to measure something, but nothing good came of it, because either I could not calibrate the device, or the interface was not suitable for screenshots.


It was, I had already abandoned this business, but when I was looking for a program for removing the frequency response, I came across a set of programs "AudioTester". I didn’t like the analyzer from this kit, but the Ossi oscilloscope (hereinafter I will call it AudioTester) turned out to be just right.

This device has an interface similar to a conventional analog oscilloscope, and the screen has a standard grid that allows you to measure the amplitude and duration. https://website/

Of the shortcomings, one can name some instability of work. The program sometimes freezes and in order to reset it, you have to resort to the help of Task Manager. But, all this is compensated by the familiar interface, ease of use and some very useful features, which I have not seen in any other program of this type.


Attention! The set of programs "AudioTester" has a low frequency generator. I don't recommend using it, as it tries to manage the audio card driver itself, which can lead to irreversible sound muting. If you decide to use it, take care of a restore point or an OS backup. But, it's better to download a normal generator from the "Additional Materials".


Another interesting program of the Avangard virtual oscilloscope was written by our compatriot O. L. Zapisnykh.

This program does not have the usual measuring grid, and the screen is too large for taking screenshots, but it has a built-in amplitude value voltmeter and frequency counter, which partially compensates for the above drawback.

Partly because at low signal levels, both the voltmeter and the frequency meter begin to cheat a lot.

However, for a novice radio amateur who is not used to perceiving diagrams in Volts and milliseconds per division, this oscilloscope may well fit. Other useful property oscilloscope "Avangard" - the possibility of independent calibration of the two existing scales of the built-in voltmeter.


So, I will talk about how to build a measuring oscilloscope based on the AudioTester and Vanguard programs. Of course, in addition to these programs, you will need any built-in or separate, most budget audio card.


Actually, all the work comes down to making a voltage divider (attenuator), which would cover a wide range of measured voltages. Another function of the proposed adapter is to protect the input of the audio card from damage when high voltage is applied to the input.

Technical data and scope.

Since there is a decoupling capacitor in the input circuits of the audio card, the oscilloscope can only be used with a “closed input”. That is, on its screen it will be possible to observe only the variable component of the signal. However, with some skill, using the AudioTester oscilloscope, you can also measure the level of the DC component. This can be useful, for example, when the countdown time of the multimeter does not allow fixing the amplitude value of the voltage across the capacitor charging through a large resistor.


The lower limit of the measured voltage is limited by the noise level and the background level and is approximately 1mV. The upper limit is limited only by the parameters of the divider and can reach hundreds of volts.


The frequency range is limited by the capabilities of the audio card and for budget audio cards is: 0.1 Hz ... 20 kHz (for a sinusoidal signal).


Of course, we are talking about a rather primitive device, but in the absence of a more advanced device, this one may well fit.

The device can help in the repair of audio equipment or be used for educational purposes, especially if it is supplemented with a virtual bass generator. In addition, with the help of a virtual oscilloscope, it is easy to save a plot to illustrate any material, or for posting on the Internet.

The electrical circuit of the hardware of the oscilloscope.



The drawing shows the hardware of the oscilloscope - "Adapter".

To build a two-channel oscilloscope, you will have to duplicate this circuit. The second channel can be useful for comparing two signals or for connecting external synchronization. The latter is provided in "AudioTester".


Resistors R1, R2, R3 and Rin. – voltage divider (attenuator).

The values ​​of the resistors R2 and R3 depend on the virtual oscilloscope used, or rather on the scales it uses. But, since the “AudioTester” has a division price that is a multiple of 1, 2, and 5, and the “Avangard” has a built-in voltmeter that has only two scales interconnected by a factor of 1:20, the use of an adapter assembled according to the given scheme should not cause inconvenience in both cases.


The input impedance of the attenuator is about 1 megohm. In a good way, this value should be constant, but the design of the divisor would be seriously complicated.


Capacitors C1, C2 and C3 equalize the frequency response of the adapter.


Zener diodes VD1 and VD2, together with resistors R1, protect the line input of the audio card from damage in case of accidental high voltage entering the adapter input when the switch is in the 1:1 position.


I agree that the presented scheme is not elegant. However, this circuit solution allows the most in a simple way achieve a wide range of measured voltages using just a few radio components. A classic attenuator, on the other hand, would require high-megaohm resistors, and its input impedance would change too much when switching ranges, which would limit the use of standard oscilloscope cables designed for an input impedance of 1 MΩ.

Protection from the "fool".

To protect the line input of the audio card from accidental high voltage, zener diodes VD1 and VD2 are installed in parallel with the input.



Resistor R1 limits the current of the zener diodes to 1mA, at a voltage of 1000 volts at the input 1:1.

If you really are going to use an oscilloscope to measure voltages up to 1000 Volts, then you can install MLT-2 (two-watt) or two MLT-1 (one-watt) resistors in series as resistor R1, since resistors differ not only in power, but also according to the maximum allowable voltage.

Capacitor C1 must also have a maximum allowable voltage 1000 volts.


A little explanation of the above. Sometimes it is necessary to look at an AC component of relatively small amplitude, which nevertheless has a large DC component. In such cases, you need to keep in mind that only the AC component of the voltage can be seen on the screen of the oscilloscope with a closed input.

The picture shows that with a constant component of 1000 Volts and a swing of the variable component of 500 Volts, the maximum voltage applied to the input will be 1500 Volts. Although, on the oscilloscope screen, we will see only a sinusoid with an amplitude of 500 volts.

How to measure line output impedance?

This paragraph can be skipped. It is designed for lovers of small details.

The output impedance (output impedance) of a line output designed to connect phones (headphones) is too low to have a significant impact on the accuracy of the measurements that we will perform in the next paragraph.


So why measure the output impedance?

Since we will use a virtual low-frequency signal generator to calibrate the oscilloscope, its output impedance will be equal to the output impedance of the sound card's Line Out.

By making sure that the output impedance is low, we can prevent blunders when measuring the input impedance. Although, even under the worst set of circumstances, this error is unlikely to exceed 3 ... 5%. Frankly, it's even less possible error measurements. But, it is known that errors have a habit of "running in".


When using the generator to repair and tune audio equipment, it is also desirable to know its internal resistance. This can be useful, for example, when measuring the ESR (Equivalent Series Resistance) of the equivalent series resistance or simply the reactance of capacitors.


I, thanks to this measurement, managed to identify the lowest-impedance output in my audio card.


If the audio card has only one output jack, then everything is clear. It is both a line output and an output to phones (headphones). Its impedance is usually small and need not be measured. These are the audio outputs used in laptops.


When there are as many as six sockets and there are a couple more on the front panel of the system unit, and each socket can be assigned a specific function, then the output impedance of the sockets can differ significantly.

Usually, the lowest impedance is the light green jack, which is the default line output.



An example of measuring the impedance of several different audio card outputs set to the "Phones" and "Line Out" modes.



As can be seen from the formula, the absolute values ​​of the measured voltage do not play a role, because these measurements can be done long before the calibration of the oscilloscope.


Calculation example.

U1 = 6 divisions.

U2 = 7 divisions.


Rx = 30(7 - 6) / 6 = 5(Ohm).


How to measure the input impedance of a line input?

To calculate the attenuator for the line input of an audio card, you need to know the input impedance of the line input. Unfortunately, you cannot measure the input resistance with a conventional multimeter. This is due to the fact that there are isolation capacitors in the input circuits of audio cards.

The input impedances of different audio cards can vary greatly. So, you still have to do this lock.


To measure the input impedance of an audio card using alternating current, you need to apply a sinusoidal signal with a frequency of 50 Hz to the input through the ballast (additional) resistor and calculate the resistance using the above formula.


A sinusoidal signal can be generated in a software LF generator, a link to which is in the "Additional Materials". The amplitude values ​​can also be measured with a software oscilloscope.

The picture shows the connection diagram.

The voltages U1 and U2 must be measured with a virtual oscilloscope in the corresponding positions of the switch SA. Absolute voltage values ​​do not need to be known, so the calculations are valid until the instrument is calibrated.


Calculation example.


Rx \u003d 50 * 100 / (540 - 100) ≈ 11.4(kOhm).


Here are the results of measuring the impedance of various line inputs.

As you can see, the input impedances differ many times, and in one case almost an order of magnitude.


How to calculate the voltage divider (attenuator)?

The maximum unlimited input voltage amplitude of the audio card, at the maximum recording level, is about 250mV. The voltage divider, or as it is also called, the attenuator allows you to expand the range of measured voltages of the oscilloscope.


The attenuator can be built according to different schemes, depending on the division factor and the required input resistance.


Here is one of the options for a divider that allows you to make the input resistance a multiple of ten. Thanks to the additional resistor Radd. you can adjust the resistance of the lower arm of the divider to some round value, for example, 100 kOhm. The disadvantage of this circuit is that the sensitivity of the oscilloscope will depend too much on the input impedance of the audio card.

So, if the input impedance is 10 kΩ, then the division ratio of the divider will increase tenfold. It is not desirable to reduce the resistor of the upper arm of the divider, since it determines the input resistance of the device, and is the main link in protecting the device from high voltage.


So, I suggest you calculate the divider yourself, based on the input impedance of your audio card.

There is no error in the picture, the divider starts dividing the input voltage already when the scale is 1:1. Calculations, of course, need to be done based on the actual ratio of the divider arms.

In my opinion, this is the simplest and at the same time the most versatile divider circuit.




Divisor example.

Initial values.

R1 - 1007 kOhm (the result of measuring a resistor of 1 mOhm).

Rin. - 50 kOhm (I chose a higher-resistance input from the two available on the front panel of the system unit).


Calculation of the divider in the switch position 1:20.

First, we calculate by formula (1) the division factor of the divider, determined by the resistors R1 and Rin.


(1007 + 50)/ 50 = 21,14 (once)


This means that the overall division ratio in the switch position 1:20 should be:


21,14*20 = 422,8 (once)


We calculate the value of the resistor for the divider.


1007*50 /(50*422,8 –50 –1007) ≈ 2,507 (kΩ)


Calculation of the divider in the switch position 1:100.

We determine the overall division ratio in the switch position 1:100.


21,14*100 = 2114 (once)


We calculate the value of the resistor for the divider.


1007*50 / (50*2114 –50 –1007) ≈ 0,481 (kΩ)


To make it easier, check out this link:


If you are going to use only the Vanguard oscilloscope and only in the 1:1 and 1:20 ranges, then the resistor selection accuracy may be low, since the Vanguard can be calibrated independently in each of the two available ranges. In all other cases, you will have to select resistors with maximum accuracy. How to do this is described in the next paragraph.


If you doubt the accuracy of your tester, then you can adjust any resistor with maximum accuracy by comparing the readings of an ohmmeter.

To do this, instead of a constant resistor R2, a tuning resistor R * is temporarily installed. The resistance of the tuning resistor is selected so as to obtain the minimum error in the corresponding division range.

Then the resistance of the tuning resistor is measured, and the constant resistor is already adjusted to the resistance measured with an ohmmeter. Since both resistors are measured by the same device, the ohmmeter error does not affect the measurement accuracy.

And this is a couple of formulas for calculating the classic divisor. A classic divider can be useful when a high input resistance of the device (mOhm / V) is required, but you do not want to use an additional dividing head.


How to choose or adjust voltage divider resistors?

Since radio amateurs often have difficulty finding precision resistors, I will talk about how you can fit with high accuracy conventional resistors wide application.

High-precision resistors are only a few times more expensive than conventional ones, but on our radio market they are sold in 100 pieces, which makes their purchase not very expedient.

Use of trim resistors.


As you can see, each divider arm consists of two resistors - a constant and a trimmer.

The disadvantage is bulkiness. Accuracy is only limited by the available accuracy of the measuring instrument.


Selection of resistors.


Another way is to select pairs of resistors. Accuracy is ensured by selecting pairs of resistors from two sets of resistors with a large spread. First, all resistors are measured, and then pairs are selected, the sum of the resistances of which most closely matches the circuit.


It was in this way, on an industrial scale, that the divider resistors were adjusted for the legendary TL-4 tester.


The disadvantage of the method is the laboriousness and the need for a large number of resistors.

The longer the list of resistors, the higher the accuracy of selection.

Fitting resistors with sandpaper.

Fitting resistors, by removing part of the resistive film, does not disdain even the industry.

However, when fitting high-resistance resistors, it is not allowed to cut through the resistive film through. In high-resistance MLT film resistors, the film is deposited on a cylindrical surface in the form of a spiral. Such resistors must be filed very carefully so as not to break the circuit.

Precise adjustment of resistors in amateur conditions can be done using the finest sandpaper - “null”.


First, a protective layer of paint is carefully removed from the MLT resistor, which obviously has a lower resistance, using a scalpel.



Then the resistor is soldered to the "ends" that are connected to the multimeter. With careful movements of the “zero” skin, the resistance of the resistor is brought to normal. When the resistor is adjusted, the cut is covered with a layer of protective varnish or glue.

What is a “null” skin is written.

In my opinion, this is the fastest and easiest way, which, nevertheless, gives very good results.


Construction and details.

Elements of the adapter circuit are placed in a rectangular duralumin case.

Switching the attenuator division ratio is carried out by a toggle switch with an average position.


A standard CP-50 connector is used as an input socket, which allows the use of standard cables and probes. Instead, you can use a regular 3.5mm Jack audio jack.

The output connector is a standard 3.5mm audio jack. The adapter is connected to the line-in of the audio card using a cable with two 3.5mm jacks at the ends.


The assembly is made by the method of hinged mounting.


To use the oscilloscope, you will also need a cable with a probe at the end.


The oscilloscope is the most important tool for monitoring and measuring parameters electronic circuits. This is a device whose images are a graphical display of voltage (on the vertical axis) versus time (on the horizontal axis).

Functional Features

The main function of an oscilloscope is to provide a graph of voltage over time. Typically, the Y-axis represents voltage and the X-axis represents time. This is useful:

  • to measure parameters such as clock rates, duty cycles of pulse-width modulated signals, propagation delay or rise and fall times of signals received from sensors;
  • to warn the user about the presence of failures in the system or interceptors;
  • for research (observation, recording, measurement) of amplitude and time parameters.

For information. The measurement ranges are huge. For example, on a relatively cheap oscilloscope, you can adjust from 5 mV / cm to 5 V / cm (vertical scale) and from 2 μs / cm to 20 s / cm (horizontally).

Other device features:

  1. Display and calculate the frequency and amplitude of the oscillating signal;
  2. Show voltage and time. This feature is most commonly used in experimental labs;
  3. Help troubleshoot any faulty project components by reviewing the expected output;
  4. Show the change in AC or DC voltage.

To better understand the functions of the device, it is necessary to familiarize yourself with the terms used and what they are:

  1. The bandwidth indicates the range of frequencies that the device can accurately measure;
  2. Gain Accuracy measures how accurately a vertical system attenuates or boosts a signal. The value is indicated in percent error;
  3. The time base or horizontal accuracy indicates how accurately the horizontal system represents the timing of the signal. This is displayed as a percentage error;
  4. Rise time is another way of describing the useful frequency range of an instrument. The rise time must be taken into account when measuring pulses and steps. The instrument cannot accurately display pulses with rise times faster than the oscilloscope's specified rise time;
  5. Vertical sensitivity indicates how much a vertical amplifier can amplify weak signal. Vertical sensitivity is usually specified in mV/div (millivolts per division). The lowest voltage that a general purpose oscilloscope can detect is typically around 1 mV per vertical division of the screen;
  6. Sweep Speed ​​- This setting specifies how fast the trace can move across the screen. This is usually specified in ns/div (nanoseconds per division);
  7. The sample rate in a digital oscilloscope indicates how many samples per second the A to D converter can take. Maximum frequency The sampling rate is usually specified in Mp/s (megapixels per second). The faster an oscilloscope can try, the more accurately it can represent the fine details of a signal. The minimum sample rate can also be important if you want to watch slowly changing signals over long periods of time. Typically, the sample rate changes with changes made to the control to maintain a constant number of waveform points in the waveform record;
  8. The record length of a digital oscilloscope indicates the number of waveforms that the device can acquire for each record. The maximum record length depends on its memory. There is a possibility of getting detailed image signal for a short period of time or a less detailed image for a longer period of time.

Converting a computer to an oscilloscope

There are two conversion methods:

  1. The first is to connect the circuit to the I / O of the PIC microcontroller board. A kit with the appropriate program will allow you to read digital or analog signals and return the results through the computer's serial port. You can also create PWM signals, sound signals, impulses and manage them from a computer;
  2. The second method is cost-free, each PC has built-in ADCs and a sound card. Using them, you can convert a computer into an oscilloscope by installing software and soldering the input divider. Similar programs can be found easily on the Internet. One of them is Digital Oscilloscope V3.0.

Program "Computer - oscilloscope"

After starting the program, an image will appear on the screen that looks very similar to a conventional oscilloscope. The line input of the sound card is used for signaling. Applying a signal to the input is possible only with a limitation - no more than 0.5-1 V, so it is necessary to solder the input divider according to the simple circuit shown in the picture.

An important advantage of the program is a virtual storage oscilloscope. The work can be paused, the waveform remaining on the screen can be saved in the computer memory or printed. There are many controls on the front panel that allow you to increase or decrease the units of time and voltage.

Application in everyday life

An online oscilloscope is an essential tool for any electrical engineer. It can be used as a counter utilities. For example, it allows you to notice that electricity consumption is higher during the winter months than during the summer months, or that electricity consumption has decreased after purchasing a more efficient refrigerator, or that electricity consumption increases when the microwave oven is turned on. More often than not, it is more important to analyze these patterns in signals than the voltage readings themselves.

The smart meter displays the signal in real time. From his charts, you can see that less electricity is used on weekdays, when households are not at home, but at school or at work. This is information that cannot be obtained otherwise.