Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Oscilloscope to sound card buffer

Status
Not open for further replies.
So... I prototyped up the circuit, I used a RC4558P for the Op-Amp instead of the other one I had picked out. It supposedly has a bit more bandwidth. At first I was having some really odd results. I was getting the output slammed to the rail even though both inputs were approximately the same voltage. Thought for sure the OP-Amp was fried. So I swapped out for an new one and same thing??? Was scratching my head wondering what was going on. Turns out I needed to be more careful at taking measurements. I measured the same spot twice apparently. The - and + inputs were NOT at all the same, I had the wires hooked into a different point on the clamping diodes than I should have. Wasted 2 hours tracking that down and finally finding the problem and fixing it. SSDD I guess.

After I got that to work and got the output off the rail, I noticed that there is quite a lot of DC offset on it. Did some checking, just input biasing I think. Need to design a way to fix this maybe. Haven't done anything yet but I know it's there.

So then, everything checked out electronically, no smoke. So it's ready to test... But I don't want to use my more expensive PC for the first test run. So I fire up the old spare P4... and... no thumb drive. Search for that a while, knowing that I could prolly transfer the scope software with the network if I bother to set it up again. Figured finding the thumb drive would be faster, WRONG. It's at a friends house I remember after having searched for it for 3 hours. Decide that I avoided using the network so hard that I might as well keep it up and hobbled my VX10000 into service as a thumb drive. Three hours to transfer 10.3MB is still faster than dialup I guess... :)/)

Anyway, enough ranting. I got the software on the PC, configured the sound card, got it installed, powered the breadboard, hooked up the probes, plugged in the output from the board to the line in on the sound card, and.... It worked!!! Here is the picture of the scope program in action.

View attachment 65430

Note that one probe was touching the metal anti reflection coating of a CRT monitor, and the other was touching... me. I guess I work well as an antenna for 60Hz. Interestingly, the one waveform shows 120Hz. I'm fairly certain the monitor is NOT refreshing at that speed. I rather expect it is some kind of natural harmonic frequency doubling of 60Hz power. The waveforms is not exactly sine either. Looks to have some harmonics of some kind in there. Need a real signal source to figure it all out. guna do that next.

Here is also a picture of the setup all prototyped together and such. After I play around and make sure it all works well, I'll move to a point to point board and metal case.

View attachment 65431
 
Last edited:
I am impressed! ;);)

I noticed the offset in the last simulation.. Forgot to mention it. With the high input impedance the op amp need fairly low offset current. but it's all ac coupled again anyway.

The signal of you looks about the same as me on my scope. Noise doesn't seem to be a problem.. Looks really good. It would be neat to see a lower level square wave..

All this in only 21 posts (inside joke) ;)
 
It would be neat to see a lower level square wave.

Turns out the software has a signal generator, uses the speaker output. I don't know why, but there are significant spikes and ringing in the signal. It could be because (A) the sound card output doesn't like doing square waves. Or (B) the buffer is ringing with a square wave for some reason. A sine wave looked flawless BTW. I will likely make a quick and dirty square wave generator to figure this all out. Also note that the sample rate is only 44100 so the waveform reconstruction is kind of crap at 4k. My better machine THEORETICALLY can go up to 192,000. But the scope software has to allow it and this has to not be marketing misinformation from my motherboard manufacturer. I could get an spare sound card just for doing scope stuff. This would also give me a safety of sorts should this circuit decide to fail catastrophically. But I think it's fairly safe.

Here is a picture of 1k square wave.
View attachment 65456


And here is a 4k Square wave, with a little bit of adjusted time deviation.
View attachment 65457
 
Not bad, The first picture just looks like one of the resistors leading up to the op amp has a little stray capcitance across it - kind of like an overcompensated probe. At he higher frequency it just runs out of gas I guess.
 
I'm "etching" the PCB for a more permanent prototype right now. It was the PCB out of this old netgear switch...
View attachment 65464

And here is what the PCB looks like as I'm etching it.
View attachment 65465

I say "etching" but what I really mean is I'm just removing all of the copper from the old board with PCB etchant. This gives me an insulating board to put my parts on that I know will fit the case perfectly, since this is where it came from. Also, all of the holes and spots for the power jack and such are already drilled. Should give semi pro results. Then I can have my breadboard back. ;)

Edit: I'm fairly sure I had a better square wave yesterday than whats above. One channel of the sound card on this motherboard is blown out already from other experiments I have done and could easily be misbehaving today. A Faraday cage and better layout might shed some light on this. And I will be able to make a real square wave generator when I get my protoboard back.
 
Last edited:
i hope that's not a multilayer board.... if so it will have two or more layers of copper sandwiched inside it, usually power and ground layers.
 
Appropriate warning. However it's not ML. Double sided with vies, but not ML.

I will need to go get a real PCB bit or two though because it *IS* FR4. Not that I didn't know any of these facts before I started. Whats neat is the PCB standoffs are so short that I could hypothetically use the bottom of the metal case as a solid ground plane. Would be a bit hard to solder and install the board into though. I don't anticipate this circuit having any serious problems without one either.

Edit: Hardware store is closed today :(
 
Last edited:
those are very small bits, not sure if you're going to find them in a hardware store. seem that i remember a drill size of #70 which would be something like 0.010" or 0.25mm
 
Thinking of just ordering 10 X 0.8mm PCB bits on 1/8th inch shafts for about $10 on ebay. Hardened tungsten carbide, ships for China though with a 10 day wait :)/).

The auction is called 10 PCB Print Circuit Board Drill Bit 0.8mm High Quality.

Deal or not?
 
Yeah. They really should only be used in a CNC drill press... instead of a hand drill duct taped to some 2x4 contraption. Not that I'm going to practice what I preach. Now... were did I see those wood screws last?
 
from experience: use a relatively new dremel tool... a dremel tool with worn motor bushings will wobble and break the bit. also, i use water to cool the bit and keep it from churning up fiberglass dust from the pcb.
 
OK, had some stuff to do but I'm back on this project now.

I finished the board. It's.... the UGLIEST work on the inside, but it's covered with a some what decent case. It functions for the most part. It has terrible resolution on waveforms. At around 8khz it drops off to looking something like a fluctuating stock graph. It's pretty much for sure the ADC res of 44khz. It certainly isn't from the OP amp, which is now the RC4558 instead of the 1458. The RC4558 has 3Mhz to unity gain as opposed to 1Mhz. I made some other last minute changes other than the OP-AMP also. I added a three pin liner regulator with low ESR filter/transient caps, and tuned it to EXACTLY 10.00v (As exact as my meter anyway) making the split +5.00 and -5.00 now. Also added a decoupling cap or two, more on this soon. Changed the value of some choice resisters. Made the 1x-10x switch a pot also, for more exact tuning of the gain.

I also had some problems in the circuit that I needed/still need to fix. First, I had MASSIVE noise at 17khz, the software could see it, but it would not show a waveform, which is odd I know. Turned out the OP-AMP was oscillating. A ~100uF decoupling cap cleared that right up. Then, When I flip the 1x-10x switch to 1x mode, I noticed that what ever wave I had on one probe, was showing up on the other probe inverted. Then it struck me that, the way I did the 1x-10x switch, leaves the feed back resistors connected together for each channel. So the output of the one channel, was driving the negative(-) input of the other channel. Also, as expected, sharp waveforms get rolled off. Square waves look more like clipped sawtooth. Still need to fix this stuff.

Finally... It's all in a box and stuff. Which completely surrounds the circuit in metal, So the received noise should be low. Though there is no ground plane to speak of, so ground loops are still a possible problem. But if it can't perform over 8Khz... I'm not worried. Would make an OK front end for a faster ADC though, which is the biggest problem right now. Going to try it on my 192Khz sound card sooner or later. Hopefully the software can do that.

Anyway, when I get around to it I will update this thread with some pics. Over all I'm not to impressed, but it will work for primitive circuitry analyzing.
-()blivion
 
Last edited:
i'd try a TL072 or something a bit faster... the 4558's slew rate is dismal, which is why you get sawtooth waves above 8khz. the 4558 is not much of an improvement over a 1458
the 1458's slew rate (SLOW rate is more like it) is 0.5V/us, the 4558 is faster at 1.7V/us, but the TL072's slew rate is 13V/us.
 
Ah! Your right, that's crappy.

The only Op-AMP's I have ATM are 4558's and 1458's. It's one of those or I try and use comparators (lol) and it gets really really bad.




Edit: Actually... no wait. I get ramping of square waves at even as low as 40Hz, which doesn't sound like a slew rate thing to me. I thought it was capacitance until you said it could be slew rate. So now I'm back to thinking it still could be capacitance for the reasons stated above.

What I meant when talking about the 8Khz upper limit is that, waves lose there definition above 8Khz. It gets harder to tell one wave from another because there are not enough sample points per cycle to remake the wave's shape properly. Point of fact, the waves actually get MORE square the higher the frequency gets. Which farther supports that capacitance is what's to blame. I *MAY* increase the input cap some and see what happens.

I'll get some pictures with annotations soon and you can better see what I am dealing with.
 
Last edited:
OK. Here are some pictures of the device as is now.

This is the total package. Including the box, the wall adapter, two probes with ground gator clips, and one headphone to headphone cable. You of course have to have a PC to use this, but your most likely looking at these pictures with a PC now... so good on the PC by default.
View attachment 65718


Here are (crappy) pictures of the back and front. I may sand, fill, then paint it eventually to make it look a bit nicer.
View attachment 65719View attachment 65720


Here are pictures of the circuit board it's self. I know it looks awful. The end result would not have been any better with a better build practice I'm afraid. Plus it's all hidden in the case, so I'm not that concerned about it as long as it works. Note that I used THICK enamel coated "magnet wire" for a lot of connections. The thickness was to lessen parasitic inconsistency's as much as possible, the enamel coating should prevent two wires from becoming shorted do to melted insulation.
View attachment 65721View attachment 65722View attachment 65723


These pictures show you that I carefully adjusted the voltage regulator and the rail splitter to as precise as my multimeter would read out. There is some drift, and the software adjustments are relative values anyway. For these reasons and more, there was little point in trying to get very much precision out of this device in reality. The idea amused me though, so I did it anyway.
View attachment 65724View attachment 65725

Waveforms.
Here are pictures of some choice waveforms at various frequency's. They were generated by the scope software's waveform generator, and output on a standard sound port. They were captured with the probes in low impedance mode and the 1x-10x switch on 1x. And although my sound system does 192Khz sample rate, the software appears (for now) to not be able to do this. After I do a bunch more tests and figure out if this is genuinely true, I *MAY* try to contact the author and see if he can fix the issue. A 192Khz sample rate in stead of 44Khz would be a significant improvement in this projects performance to be sure.

Order is: [Square | Saw | Sine | Triangle]
300 hertz
View attachment 65768View attachment 65766View attachment 65767View attachment 65769

3Khz waveforms
View attachment 65726View attachment 65727View attachment 65728View attachment 65729

8Khz waveforms.
View attachment 65730View attachment 65731View attachment 65732View attachment 65733
 
Last edited:
!!!!TRIPLE (POSTING) RAINBOW !!!! (LOL, anyway.)


Just dug in some of my stuff and found some Motorola MC14577's. They claim to have a 10Mhz bandwidth and ~6db of gain at 4.4Mhz. There is no slew rate data, but bandwidth is directly tied into slew rate, and these are much higher bandwidth, so much faster slew rate. I personally don't think it's going to matter what OP-AMP I use at this point. I'm certain this circuit is limited by the sound card sample rate, not the OP-AMP slew rate. But I can install them anyway and try it out if someone thinks it's worth a shot?
 
looks like you have some oscillation at about 10khz or so, which will really mess things up. if you are using x10 oscope probes, that will mess up the frequency response, since they are made for a 1Meg/30pf input in most cases.
 
Updated pictures in post 36.

looks like you have some oscillation at about 10khz or so

Yes and no, except not no... so to sum it up.... yes, yes I do.

I'm getting ringing for some reason, most likely from stray capacitance, possibly stray inductance. Without a signal there is no significant frequency peeks at 10khz though, so it's not instability, just ringing. The software has a "Frequency Analysis" tab that does a pretty good job at telling me what frequency's are on the line, and is quite flat with no signal on the probe, which is a good thing of course. Interestingly, the Frequency Analysis section can sense signals higher than the 8khz limit of the scope window. So at least the hardware is working past 8Khz. The scope window can display them, but not in a way that you can tell one waveform from another. Which makes this device nothing more than an over glorified frequency counter for 8Khz < 20Khz.

Need to get the software to use the higher sample rate to make this project more useful.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top