Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

soundcard oscilloscope and function generator

Status
Not open for further replies.

bmandl

Full Member level 4
Joined
Feb 26, 2010
Messages
207
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
Slovenia
Activity points
2,965
Hello!
Sometimes, I miss an oscilloscope and function generator on my table. For it is very expencive equipment, I was thinking to build it myself. But I don't have the basic idea, how to do it. What would be the best way to do it? With soundcard on PC, or with soundcard as a standalone project. How to connect output from PC to test board and so on. Please, can someone advise me and point me to first step. Thank you!
 

FoxyRick

Advanced Member level 4
Joined
Jan 8, 2004
Messages
1,249
Helped
321
Reputation
640
Reaction score
277
Trophy points
1,363
Location
England, UK
Activity points
12,982
If you only need to work with audio frequencies, then you could use a PC soundcard. There is a free program that has a lot of functions here:

http://www.sillanumsoft.org/

You could give it a try and see if it answers your needs. I've never used it myself though.

For anything more (or less, the soundcard will be AC coupled and have a minimum as well as maximum frequency) you will need something more substantial.

Also, keep in mind that the input of the soundcard will be line level and will not like anything more than +/- a volt or so. It should be protected from this and would need a voltage divider to measure anything more.

There is a protection circuit shown here:

http://xoscope.sourceforge.net/hardware/hardware.html
 

bmandl

Full Member level 4
Joined
Feb 26, 2010
Messages
207
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
Slovenia
Activity points
2,965
And then you just connect your circuit with PC soundcard jack input?
 

FoxyRick

Advanced Member level 4
Joined
Jan 8, 2004
Messages
1,249
Helped
321
Reputation
640
Reaction score
277
Trophy points
1,363
Location
England, UK
Activity points
12,982
And then you just connect your circuit with PC soundcard jack input?
Do you mean the protection circuit that I posted, or the circuit you are working with?

What type of circuits are you building or testing?

While you might be able to connect directly to the soundcard's input jack, line level on consumer kit is usually -10dBV. That means that the full scale voltage is only 0.447V peak, above and below zero. Any more than that and it would probably just 'clip' at the maximum level. Too much and, of course, the soundcard would suffer.

So, unless you are only working on low-level signals like that, you need to use some form of scaling circuit on the input. Protection is good also, so that you don't accidentally blow up your soundcard (and even PC!)

In the protection circuit I posted above, the there is an amplifier that can be switched between x1 and x10, so that can be used to amplify smaller signals. You could easily add a simple voltage divider just before the amplifier's input to divide larger signals down. I would probably use /10 and /100 ranges so that you could measure up to about +/- 45V. You only need a few resistors to do that.

This method will never yield high accuracy of voltage levels though. Good enough to see what is happening, but not for making any critical measurements. It should be good enough for frequency measurements though.

Does any of that help?

- - - Updated - - -

Here is a very simple way to do it. There is no input protection, just a simple voltage divider to allow signals around 5V peak to be measured:

http://www.ledametrix.com/oscope/index.html

Be careful what you connect the probes to, though.

---

Another, simpler input circuit that the first one I posted is here:

http://www.sciencetronics.com/geocities/electronics/projects/soundcard_osci.html

It does not really protect the sound card though. What it does is give a high input impedance. See below.

---

There are a number of issues that might arise using a soundcard.

One is the input impedance of the soundcard's line in circuit. We do not know what it is! It's probably low enough that it might load the circuit under test and cause it to change when tested. That's not useful, so a useful addition to the input is a high impedance buffer. That is what the simpler input circuit above accomplishes.

Another thing to keep in mind is that the soundcard's line input ground is actually connected to the continuity earth in the building wiring. If your circuit's power supply also has the negative or ground side earthed, then make sure to connect ground to ground. Otherwise, if you might accidentally short out the power supply. I've even done this myself :oops: - things get hot and I even melted a 'scope probe once! If you work a lot with audio stuff though, be aware that this can cause a 'ground loop', the effects of which you are likely familiar with already.

(This second point is a minor one, as long as you remember to connect ground of the soundcard input to ground of the circuit under test.)

---

Don't let the seeming complications put you off what you are thinking, by the way. It's not that complicated and there is always help available here. I tend to look at what might go wrong, then make sure it doesn't, before I jump into doing something and sometimes it makes things sound worse than they are.
 
  • Like
Reactions: bmandl

    bmandl

    points: 2
    Helpful Answer Positive Rating

bmandl

Full Member level 4
Joined
Feb 26, 2010
Messages
207
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
Slovenia
Activity points
2,965
FoxyRick, thank you very much for your rich explanation. I understand things more now.
Anyway, Is there any option, to make an oscilloscope as a standalone embedded project? So it is more safe and that I can't broke my PC. I was thinking just as soundcard of an old PC, a monitor and some control circuit.
 

FoxyRick

Advanced Member level 4
Joined
Jan 8, 2004
Messages
1,249
Helped
321
Reputation
640
Reaction score
277
Trophy points
1,363
Location
England, UK
Activity points
12,982
That sounds familiar...

I had just such a project on the back burner, for several years, and never got around to actually finishing it. I had even sourced (all very cheaply over the years) an industrial PC backplane with PCI-X expansion slots, a range of data acquisition cards, output cards, rack enclosure, etc. I was planning a front end system programmed in LabView, or just completely custom.

As technology rapidly improved and things got smaller, my project began to look more and more archaic. I could buy, from Chinese sellers on the auction site, all of the functionality I was thinking of for a less money (by the time I added up all the little expenses in the project) and considerably less desk space. Such is life.

It's still a nice idea, and certainly would be an excellent learning opportunity. If you have a spare PC and the space for it, go for it.

In addition to using a soundcard as a low frequency oscilloscope, it would be quite inexpensive to add a general measurement 'gadget' based on a PIC or similar, and talking to the PC through a serial, or even USB, port. Then you could have an accurate on-screen voltmeter, perhaps with multiple channels...
 

bmandl

Full Member level 4
Joined
Feb 26, 2010
Messages
207
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
Slovenia
Activity points
2,965
Fantastic! I will order one as soon as possible and try to make my embedded project! But now, unfortunately, school is at it's maximum momentum.
 

FoxyRick

Advanced Member level 4
Joined
Jan 8, 2004
Messages
1,249
Helped
321
Reputation
640
Reaction score
277
Trophy points
1,363
Location
England, UK
Activity points
12,982
I might even be tempted to try one of those myself. I've avoided the Pi so far, I have too much to do as it is, but we'll see.

I know what you mean. I used to be a science teacher / head of science at a high school!
 

bmandl

Full Member level 4
Joined
Feb 26, 2010
Messages
207
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
Slovenia
Activity points
2,965
I came to new idea. I thought of LabView, because I was using it last year at college. Is there any option for me, to build my own daq card with microcontroller and using it as oscilloscope, function generator, multimeter, thermometer and so on? Is there anything like that already made (I am targeting at home made variant)? I thought if I could make universal data acquisition system, that would just receive input from other device (thermometer for example), if necessary, convert it to digital signals and send those signals over standard RS232 or USB port to PC, where LabView comes into action. Is something like that possible with PI? This would be a great project. I know a little bit, how to use LabView, but I don't know, if it is possible to communicate with outer world through standard protocols (non-national instruments).
 

bmandl

Full Member level 4
Joined
Feb 26, 2010
Messages
207
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
Slovenia
Activity points
2,965
My idea went further, because profesor suggested me an Arduino board. I was surfing internet a lot today and I found this. Now I am in dilemma, because I don't know exactly, how Arduino works. Is there any option, that I make a sketch for Arduino, that will measure voltage or something else, than send that to LabView. Once this works, is it any way to put Arduino away and use a new microcontroller with same code from Arduino in this application, or there must be an Arduino board for communication with LabView?
 

bmandl

Full Member level 4
Joined
Feb 26, 2010
Messages
207
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
Slovenia
Activity points
2,965
I got the Arduino board and I tryed it with LabView. It works and it is easy to use. Now, I was wondering, how to made oscilloscope and function generator with arduino trough soundcard. One way it would be with Raspberry Pi, becouse it has integrated soundcard on it. Now here comes the problem. I do not now nothing about programming on Linux. I will have to write a program, that controls soundcard on Raspberry Pi. Communication between Raspberry Pi and Arduino can be done like this. Now I have a question, is here anybody, that is familiar with Linux programming and can advice me how to write a program on Raspberry Pi to control soundcard and send information over SPI to Arduino? This is my weak point here.
Thank you all for your answers so far, it was verry helpful.
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top