Storing Cookies (See : http://ec.europa.eu/ipg/basics/legal/cookies/index_en.htm ) help us to bring you our services at overunity.com . If you use this website and our services you declare yourself okay with using cookies .More Infos here:
https://overunity.com/5553/privacy-policy/
If you do not agree with storing cookies, please LEAVE this website now. From the 25th of May 2018, every existing user has to accept the GDPR agreement at first login. If a user is unwilling to accept the GDPR, he should email us and request to erase his account. Many thanks for your understanding

User Menu

Custom Search

Author Topic: Zero price oscilloscope using the computer's sound device  (Read 6861 times)

ayeaye

  • Hero Member
  • *****
  • Posts: 866
Zero price oscilloscope using the computer's sound device
« on: October 24, 2016, 07:05:08 AM »
Now i actually measured the wall adapter, with xoscope, on the first image below is the xoscope screen, and on the second image is the actual circuit. There you see the cable going to the computer's microphone input connected, voltage dividers with 100k and 100 ohms resistors, the blue and red jumper wires go to the wall adapter.

xoscope (linux, open source) had to be compiled from sources, then it used alsa for input, with standard packages it used oss, and this was badly broken.

The wall adapter was 14.3 V ac, as you see the scale is 1:1, even in spite of the 1000:1 voltage divider, so it can be scaled up and down how much one wants. The 1000:1 voltage divider protects the microphone input completely from voltage peaks, etc, when the voltages are not more than a few tens of volts. It's better not to use lesser voltage divider, as it is a too big risk to damage the motherboard, with 1000:1 voltage divider and lower voltages there is no such risk.

The microphone input is high resistance, so there are no further problems. Different from the line in input, that may be low resistance, it's better not to use that input.

Make the circuit as i did. Don't use the circuits said to be used by radioshack, etc, for that purpose. They use much lesser voltage divider and two diodes on opposite directions, also low speed diodes, to protect the microphone input. This doesn't protect from fast voltage peaks, and is completely useless as protection.

The cable can be like the cord from an old headphones, microphone and headphones cables are identical. I measured 78 mV on both channels when there was no output, it has been said some sound cards provide voltage to power the microphone. The actual voltage measured was only 14 mV, so that should not cause any problems. But measure these voltages, as they may be different with your sound device.

The sound device is ac coupled, and it has at least a high pass filter, if not other filters. The sampling rate is 41 k, this enables to measure signals up to a few kilohertz. The sound device is for sound, not for measuring. One may say too bad, but the thinking is different for these who do everything low cost. It is not useless, it can be useful in some cases, especially it may be useful for replicating some experiments, which are maybe done with more advanced measuring instruments.

xoscope also enables to calculate, i think it enables to calculate power from two channels. It can also save images, in a text format that can be read by gnuplot, and are maybe not very difficult to process with python, or other languages.

The typical 3.5 mm audio jackets used for computer sound, are called trs, which stands for tip, ring, sleeve. The tip and ring are left and right channels, or left and right microphone, and the sleeve is ground. On some android devices there are two ring jacks, and the second ring, next to the sleeve, is microphone (even when a normal headphones jack goes in and the headphones work), but this may vary from device to device so find it out first.

Hope it was useful for someone for some purpose.

conradelektro

  • Hero Member
  • *****
  • Posts: 1842
Re: Zero price oscilloscope using the computer's sound device
« Reply #1 on: October 24, 2016, 02:59:13 PM »

I like it, interesting:


http://xoscope.sourceforge.net/  (the software)


http://xoscope.sourceforge.net/hardware/hardware.html (elaborate input circuit)


My be you could post schematics of your input circuit?


Greetings, Conrad




ayeaye

  • Hero Member
  • *****
  • Posts: 866
Re: Zero price oscilloscope using the computer's sound device
« Reply #2 on: October 24, 2016, 06:02:31 PM »
My be you could post schematics of your input circuit?

This circuit from the xoscope project in theory can be used, as it uses an op amp. What is missing though, is power rails on the op amp that restrict its output voltage to the range acceptable for the microphone input. This did protect the microphone input completely. On that diagram, as i understand, the op amp power is +/- 12 V, and with that this circuit doesn't protect the microphone input enough. The right range, as it appeared from my test, is approximately +/- 15 mV. With that change this circuit were better and completely safe for the microphone input, even no matter what the measured voltage is, like measure high voltage and what burns is the op amp, not your computer's motherboard. The 100k potentiometer at the output of the op amp is not a good idea, as microphone input is a high resistance input, and the best is to connect a low resistance output to it, that is the op amp output directly.

My circuit is much simpler, and it protects the microphone input completely what concerns the measured voltages and voltage peaks, when the voltages are not greater than a few tens of volts. What is not entirely clear to me, is the small voltage (78 mV in my case) supplied by the microphone input to the microphone. But it is not better at all in this circuit in the xoscope project mentioned above, nothing is done about it, it is not decoupled by capacitor or anything. Nor is it done in other widely known circuits. I think it shouldn't be a problem, as the voltages are so very small, especially it is not a problem in my case, when the actual voltage on the microphone input is never more than 20 mV, except possible short voltage peaks, this cannot short circuit the whatever voltage source there is, if that can ever happen.

Schematics? There is not much schematics to draw, all is seen on that picture, but ok.

Paul-R

  • Hero Member
  • *****
  • Posts: 2086
Re: Zero price oscilloscope using the computer's sound device
« Reply #3 on: October 24, 2016, 07:11:39 PM »
How does this compare to  the Winscope?

http://www.zen22142.zen.co.uk/Prac/winscope.htm

As always, putting an uncontrolled input into the sound card can blow it. Fat variable resistors would be a good idea.

ayeaye

  • Hero Member
  • *****
  • Posts: 866
Re: Zero price oscilloscope using the computer's sound device
« Reply #4 on: October 24, 2016, 08:37:35 PM »
How does this compare to  the Winscope?

The circuit i used should certainly also work with winscope. But, the 10:1 voltage divider there is much too small. It should be at least 1000:1, and as i showed, this also provides the right voltage on the microphone input. The 11k series resistance is also too small, this influences the measured circuit too much. Properly that resistance should be 1M, as in most measuring instruments. But i chose 110k, as mostly good enough, to not make the microphone input voltage too small. 1k as the output resistance is also too great, the microphone input requires small output resistance. Maybe even 100 ohms is too great, 10 ohms may be better, but considering that the input resistance of the microphone input is at least 10k, and mostly much more, this should be enough.

The voltage supplied to the microphone by the microphone input, is i think called phantom power. As in this circuit of the microphone input  http://www.datasheet4u.com/datasheet-pdf/ETC/AS016/pdf.php?id=624331 , it is supplied to the microphone (or whatever is connected to the microphone input) and a 6k resistor in series, by a 48V power supply. 20 mV and much more than that, certainly does nothing to the 48V power supply. The 100 ohms resistor causes because of that a 787 mV constant voltage on the microphone input, but it is even worse with the 1k resistor in the winscope circuit. If the resistance were 10 ohms or less, then that voltage were comparable to the normal voltage on the microphone input. But, the microphone input is ac coupled, that is, it has capacitors in the input, thus a constant voltage should do nothing to the microphone input.

Thus i found nothing that may ever cause any damage to the microphone input with the circuit that i used. This is not exactly so with the other circuits mentioned.

ayeaye

  • Hero Member
  • *****
  • Posts: 866
Re: Zero price oscilloscope using the computer's sound device
« Reply #5 on: October 26, 2016, 02:20:09 AM »
I had to try it better but, i'm too lazy. So i tried this saving in xoscope, with microphone only. It looks like that what is on the screen at the moment, can be stored into "memories", like from menu   channel -> store -> mem c . Then when saving into a file, that file is quite simple. It starts with some information about the sampling rate, etc.

But what follows, are just columns of numbers, looks like one for every channel, and "memory". It looks like that it has 45 samples per screen, not clear why 45, 50 did make sense, but it seems to have 45. So there are 45 rows, in each several numbers ("columns") separated by tabs. Numbers are integers, all appeared to be less than 100, not sure how many vertically.

Anyway, this is a very easy format, no problem to read it with python, to do calculations. Instead of the rather cryptic way how it does calculations using perl. I have not tried it yet, but, selecting a channel that is not used, and pressing $, enables to calculate a trace for that channel. It has functions for perl for that, like a perl script can be called by $, to do calculations. There is some example of such script. And this script most likely also enables to write some output to terminal, such as power. So calculations can be done in that way, but as i said it's rather cryptic. But then calculations can also be easily done by reading the saved file with a python script. So no matter what way, calculations can be done.

It looks like $ enables to enter a perl expression, and  cannel -> math -> external command  enables to run a perl script. Who tries it out may write here how to do it.

So, how much i figure so far. operl.in is the perl script (filter) that is run when entering a function, that may be an expression, with $. External command could be the same, a user script instead of operl.in. To that external script, the samples of the channels 1 and 2 are given in an input stream number 3, calculated samples are written into the standard output stream. The function is supplied in the environment variable FUNC, as a string. As the standard output stream is taken, it is possible to write to terminal by writing to the standard error stream, or write to a file. And there is nothing more to it. Thus, these scripts can also be written in python instead of perl.

Just to give you some idea.
« Last Edit: October 26, 2016, 05:34:51 AM by ayeaye »

ayeaye

  • Hero Member
  • *****
  • Posts: 866
Re: Zero price oscilloscope using the computer's sound device
« Reply #6 on: October 27, 2016, 03:56:42 PM »
If you want to make it adjustable, replace the 100 ohm resistors with 100 ohm trimmers or potentiometers, as below. Then though the the resistances of the trimmers have to be measured every time after adjusting, to calculate the voltages.

About these, two opposite diodes in parallel, this can be used for protection, but then there has to be a low pass filter before, to filter out short voltage spikes, otherwise these are useless for protection. And in several widely known circuits there is no such filter at all. With that filter, it should protect well, but 1 volt or such is still a too high voltage for the microphone input, there still has to be some 100:1 voltage divider after such diodes.

The voltage on the microphone input is very low, usually maybe some 5 mV.