Today's presentation concerns my final version of an amateur oscilloscope and a generator based on an external USB sound card. Seemingly nothing special as for today's times, but the device is easy to install, inexpensive, and most importantly useful.
The frequency of the generator and the oscilloscope depends on the sound card. These are for reference only. In practice, the useful frequencies are much lower.
Construction: The device consists of a symmetrical power generator based on the well-known Max232 chip. It is quite an unusual application of this cube, but its choice was impressed by the modest number of external components, low price, and quite stable output voltage. However, it should be remembered that the maximum output current of the internal converter does not exceed 10mA. In this case, this small current is more than enough. Another important element powered by the Max inverter is the TL082 dual operational amplifier. One amplifier (A) acts as a voltage follower, acting as the oscilloscope input buffer, and the other half (B) of the cube acts as an amplifier for the waveform generator, making it possible to obtain an output amplitude of 10Vpp. The oscilloscope input of the amplifier is equipped with two dividers. The first one allows you to measure voltage up to 5Vpp, and the second one up to 25Vpp - they are switched using a jumper on goldpins. Additionally, the oscilloscope input has been protected by two 1N5819 diodes against voltage higher than 1Vpp. However, this does not exempt us from being careful when taking measurements. I emphasize that I am not responsible for any damage resulting from the operation of the device. You use the material provided here at your own risk.
Sound card selection: In principle, you can use any. However, it is worth bearing in mind that the one with which you can remove the DC component filter, both on the microphone input and on the headphone output, is better. The DC component filter causes that the input cannot be given DC voltage. As a result, the rectangular graph will not resemble it at all, the sine wave will have characteristic "spouts" at the top, and the triangle will lie on the right side. In my copy, it was only possible to partially remove the input filter. Unfortunately, not at the output, which can be seen on the oscillograms from the generator. Cards that I tested: 3D Sound - filters cannot be removed GreEw Counterfeit (currently) - can only be partially removed from the MIC input. Apparently, the original one can completely get rid of the input filter. About the output filter, I have no information.
Measurement: It is known for a long time that the sound card was designed for slightly different purposes than those described here . This does not mean, however, that it is completely unsuitable for measurements. It is true that the results will have a slight error, but it is a cheap amateur device. After installing the device, unfortunately, you cannot expect that it will correctly measure the input voltage, because it must be properly calibrated.
Calibration: Let's start by setting the generator output amplitude, which will then serve as a reference. To do this exactly, it is best to use a commercial oscilloscope, but most people interested in making a device do not have one. However, there is an alternative way to calibrate, unfortunately less accurate.
1. Connect the device to the computer and then run the "Generator.exe" program. 2. In the program, set the amplitude to max, Sinusoidal waveform, and frequency exactly 50Hz. 3. Apply the AC voltmeter to the generator output and set the potentiometer on the board to 10V. Don't turn off the app!
This way we have a fairly accurate reference voltage that can be used to calibrate the oscilloscope.
1. Put a jumper on the x5 divider, connect the generator output with the oscilloscope input, and then run the Miniscope.exe program 2. Using the "paw" from the upper bar, set the visible waveform in such a way that it is easy to determine its half (actual crossing through 0), and then select the "crosshair" from the upper bar. 3. Right-click where the graph should go through "0" and then left-click at the top of the sine. 4. From the menu select Tools -> Calibrate Sensitivity, and in the field under point 4 enter 1. Click the "Calculate" button, and then "Store Calibration" [10 (Uwe) / 5 (5 divisor) / 2 (two halves of the chart) = 1]
To check the correctness of the indications, the current Vpp index should be multiplied by 5, and the output should be about 10V, which is as much as it really is.
Oscillograms: Below is a collection of oscillograms showing the actual graphs from the mini oscilloscope and the generator. As a comparative oscilloscope, I used a commercial "Hantek 6022". As a signal source for the oscilloscope, I used a generator once presented in the pages of the "Elektronika Praktyczna" magazine (once I presented my performance in the DiY section).
Oscilloscope, approx. 2kHz: ]
Oscilloscope, approx. 300 Hz:
Generator, 440Hz: The graph showing the rectangular and triangular graph shows the undesirable effect of the constant component filter.
The whole thing looks pretty nice, for PLN 20 worth of it I encourage you to implement and comment on my project
Cool cheap and looks effective. I had this Hantek so I suspect yours works better - maybe not this range, but still
However, I have a question, what is the use of an additional amplifier before entering the sound card? Could you please share the source code of your application - I saw that you were doing this in visual studio c ++?
I would like to say hello to everyone (first post). I have some doubts about the method of simplified calibration. The AC voltmeter shows the effective voltage. We calibrate the amplitude. It seems that only after taking into account the coefficient ?2 we will get the correct calibration. Maybe I was wrong, so please explain. It is possible that the calibration procedure takes this fact into account. Best regards, SM
Could you please share the source code of your application - I saw that you were doing this in visual studio c ++?
I am not the author of the application, but it seems to me that he shares the source on his website. http://tomeko.net/miniscope v4 / (the address is at the end of the post).
I have some doubts about the method of simplified calibration.
Yes ... this calibration is not accurate, as I wrote above. For people who do not have access to an external oscilloscope, however, only this remains. The method I wrote about above has been checked by me. The discrepancies are, but not enormously large, and it is better to calibrate this way than by eye Overall, you're right, but this is probably the only sane alternative.
At what sampling rate is the above true? Because at 44.1kHz you are not completely able to judge the shape of the 20kHz signal because that gives 2 samples per period. At 192kHz (if the card has one) I can believe it.
Sound card selection: In principle, you can use any. However, it is worth bearing in mind that the one with which you can remove the DC component filter, both on the microphone input and on the headphone output, is better. The DC component filter causes that the input cannot be given DC voltage. As a result, the rectangular graph will not resemble it at all, the sine wave will have characteristic "spouts" at the top, and the triangle will lie on the right side.
A very valid comment. However, it is not only about the DC component but also filters that cut the band to 20kHz. For example, a 1kHz square wave signal from a sound card where the bandwidth is limited to 20kHz will look like this:
I hope that at 192kHz the filter of such cards is set to around 100kHz, so its operation can be omitted.
Generally, looking at the charts from Hantek: good job for this money, and this Hantek is not worth PLN 10. You did not mention that the FFT analysis from the sound card (16 bit or 24 bits) will be reliable and the Hantekt (which is probably 8 bits ...) will be a worthless slug.
What about phase inversion of the signal through the sound card (MIC input)? I had this problem myself and it is quite common (supposedly it is a software issue - drivers, but I did not study this topic). In addition, in cheaper cards, the phase likes to break at the band boundaries, which additionally "spoils" the charts.
You can't call it an oscilloscope or a generator. Oscilloscope: - DC coupling where is it? - triggered by an external signal? The simplest oscilloscopes have such functions.
Generator: - offset adjustment? - variable output resistance, depending on the load (low efficiency of the power source)
The generator narrows its application to audio devices, and the "oscilloscope"? At 44kHz sampling, "digital" 22kHz "analog" band, max 1..2kHz (10..20 samples per period), real 100..200Hz (100..200 samples per period). What can such an "oscilloscope" be for. Only to find the ripple of the linear power supply.
Just like using a sound card as a generator or oscilloscope can be understood (if you don't like what you like, you like it), building the peripheral circuits for the card does not make sense. Better to buy a used oscilloscope and generator.
At 44kHz sampling, "digital" 22kHz "analog" band, max 1..2kHz (10..20 samples per period), real 100..200Hz (100..200 samples per period). What can such an "oscilloscope" be for. Only to find the ripple of the linear power supply.
Therefore, 192kHz sampling can and must be used. Then it starts to make sense and you can analyze something.
Let it be for 10 - 20 PLN and even fun
Better to buy a used oscilloscope and generator.
The problem is that you can buy an analog oscilloscope for a small amount of money. And this one in the era of microprocessors is in my opinion of little use.
Digital ones, again below PLN 2,000, are basically toys. With the one used for PLN 1000, it is appropriate to have an analog one next to it, because something like this in audio measurements means a toy and not an oscilloscope:
Because what does this +/- 1 bit noise mean? That for stupid audio we need not 8 but 12 bits of resolution + "digital phosphor" and that costs money.
So I would criticize the fact that it costs PLN 20 and not 2000.
Your criticism is not unfounded, and it is actually hard to call the device that I presented an oscilloscope, or a useful generator. However, it must be remembered that this is an amateur toy that can more or less reproduce the actual course, and even make simple measurements, which, however, are burdened with errors. By publishing this article, I wanted to satisfy inexperienced people who do not have the funds for expensive equipment, the capabilities of which would not have to be used anyway. Why was it a sound card that is theoretically not suitable for this? Everyone has it, and it is known for a long time that it can be used for the purposes described above. There are already many different schematics and PC applications that made it possible to view waveforms. For example the article "Indecently cheap oscilloscope" published in the AVT magazine. https://sklep.avt.pl/avt2767.html From the article you can also find out why a buffer in the form of an amplifier - for "katakrów" Most of the constructions were characterized by a complete inability to measure the amplitude, due to a smooth divider (potentiometer), or a low input resistance. In my project, I wanted to squeeze the most out of one cheap sound card, which in my opinion I managed to do (without too much interference with the sound card itself). The result was a generator with a much higher amplitude than a typical audio output, and a single-channel primitive oscilloscope.
Does the talk about 8/12-bit resolution somehow relate to my project? - not really. Comparing the original oscilloscope to a sound card is also pointless, because it's like comparing a 40 'Full HD LCD TV to a Rubin Remarks on the calibration and taking into account the coefficient ?2 also miss the point, because the measurement accuracy itself has large discrepancies.
According to the PWN dictionary: an oscilloscope is an instrument for the observation and measurement of electrical waveforms
According to the wiki: Oscilloscope - an electronic device used to observe, imaging and study the dependence waveforms between two electrical quantities or other physical quantities represented in electrical form
So no matter if the bandwidth is 20kHz or 10GHz - this is an oscilloscope
Does the talk about 8/12-bit resolution somehow relate to my project? - not really. Comparing an oscilloscope for> PLN 2,000 to a sound card is also pointless, because it's like comparing a 40 'Full HD LCD TV to a Rubin
My friend COMPLETELY did not understand my speech. Totally.
There has been a misunderstanding ... With this digression I wanted to make all the critics realize how much would cost what they criticized in your appetizer. I wanted to show that even these super "oscilloscopes" for over PLN 1000 (Siglents, Rigoles, Owons) have a lot of problems. And here the cost is at PLN 20. No cost. If you turn up the sampling to 192kHz (is it possible?), This band should be interesting and not so much can be previewed. And not super precisely? In 90% of cases, the idea is to view the chart for an overview.
Hey, not everyone can afford a device worth 1000+, and here it is cheap, simple and that it has disadvantages, as even super expensive gems will have them and that's it. After all, you can see a lot with the oscilloscope described above. And everyone can afford it.
As I mentioned in the first post, I only managed to get rid of the DC component filter only partially. Unfortunately, I do not have a photo, and I would not like to desolder the card from the board to make it.
In general, the entire filter consists of a capacitor connected in series in the input circuit (it cannot be removed or bridged, because the input stops working, and it is it that gets dirty the most), and then branches into an additional capacitor and a resistor connected to another path that goes under the integrated circuit . This capacitor should be desoldered (do not short-circuit!).
Unfortunately, it is not possible to remove it completely in this model, because the integrated circuit itself has internal protection against the constant component. In my opinion, when writing for my project, it is worth looking for a card that is susceptible to this modification.
Not all. On the website of the author of the miniscope program, you can find descriptions for various cards (link to a foreign page with descriptions). It seems to me that the usb is better. You'll need a usb for power anyway. With a PCI card you will have better parameters than with a cheap usb, but it's still a substitute for an oscilloscope.