getting the 2V output of a modified (DC coupled) soundcard to be 0V? - Page 1
Forum section: electronics / beginners

author: dentaku
author_rank: Frequent Contributor
timestamp: January 25, 2014, 01:28:30 am
content: I finally decided to do an experiment with a soundcard so I could send DC out of it.I removed the two 470uF caps from the output of an external USB soundcard my brother got for free and just soldered jumper wires in their place.If I play a sound that's basically an extremely slow square wave so that it's UP for a very long time I can use it as a control voltage signal that modulates the pitch of a VCO by simply modifying the volume coming out of this soundcard.The problem is that while it's just sitting there doing nothing (not playing any sound at all) I get about 2V from the output all the time. When the signal is all the way up I get about 3V so that's just a 1V swing from high to low which isn't terribly useful.Question: How can I get this 2V signal from the soundcard to be at 0V when no sound is coming out of it?THEN what's the easiest way to make the voltage swing from 0V to maybe 7V or 8V instead just 0 to 1V?

author: Rerouter
author_rank: Super Contributor
timestamp: January 25, 2014, 04:03:12 am
content: you could use an op amp in a differential configuration (with a 2V reference supplied from a divider off the cards 5V rail)this same op amp can amplify that to your desired DC level,

author: fcb
author_rank: Super Contributor
timestamp: January 25, 2014, 02:42:02 pm
content: I agree with Rerouter.Don't just use any old 2V for the other side of the differential amplifier though, I would look into the datasheet for the DAC and see what it uses to generate it's internal offset (most likely it will have a potential divider inside that is linked across the Vcc - but some don't.

author: dentaku
author_rank: Frequent Contributor
timestamp: January 25, 2014, 04:35:37 pm
content: That's good to know. Now I have some terms to search for and new stuff to learn about.

author: dentaku
author_rank: Frequent Contributor
timestamp: January 29, 2014, 03:50:15 pm
content: I like your suggestion. I've found the datasheet for the C-Media CM6300http://www.hardwaresecrets.com/datasheets/CM6300.pdfand after probing it a bit the VREF pin seems to be at exactly the same voltage what's coming out of the TRS connector when no sound is being played (which is what I'm trying to cancel out).First I went an learned how a differential amplifier is set and up simulated in software then I tried a simple test (not with the soundcards output yet) on a breadboard and a TL074CN. The real-world experiment works just like the simulation I didI see that I could subtract that 2V offset so the output of the opamp will now sit at 0V instead BUT be inverted.After that it's easy to just use an inverting amplifier to flip it upright again AND amplify it to something closer to +7V or so (or as close to the + rail as I can get it).I found the DIFFERENCE AMPLIFIER example in the old Forrest Mims - Op Amp IC Circuits Engineer's Mini-Notebook. Those old books are quite useful no mater how crude they lookI guess tonight I'll have to try it out with the actual signal from the soundcard and solder a bit of wire to a point on the card that's putting out 2V so I can use it in my circuit instead of trying to create my own 2V with a voltage divider or something like that.Quote from: fcb on January 25, 2014, 02:42:02 pm

author: fcb
author_rank: Super Contributor
timestamp: January 29, 2014, 06:39:09 pm
content: Just buffer the Vref from the chip (it might be safest) and feed it into the inverting input of of your diff. amp, then feed the audio out into the non-inverting input - job done. Your output will now be the correct phase and centered on 0v.

author: dentaku
author_rank: Frequent Contributor
timestamp: January 29, 2014, 08:27:15 pm
content: I was wondering about buffering it. It's good you mentioned this because I wasn't sure if it was something worth doing. I have free opamps on the TL074 anyway.As for feeding the audio into the non-inverting I thought about that too and was going to look into that just to simplify things.At least I wasn't going completely off in the wrong direction.In the end I'm hoping to use this as a MIDI -> AUDIO (well, if you can call a sample with a horizontal line all the way to the top audio) -> Control Voltage to modulate pitch and cutoff/resonance of synth VCOs and VCFs.It works quite well right now even at the small range of voltages it can create so it should be nice once it's amplified.Thanks for the input.Quote from: fcb on January 29, 2014, 06:39:09 pm

author: dentaku
author_rank: Frequent Contributor
timestamp: January 30, 2014, 12:40:17 am
content: Would something like this work in real life? I know... "just try it" but I'm still gonna ask the question here anyway.Greenis Vref from the soundcard (I'll probably buffer it first)Bluerepresents the volume of the signal coming form the soudcard being swept up and down between +2V and about +3VRedis the final output of the OpAmp with the signal sitting at 0V and going all the way to a bit over +7V

author: dentaku
author_rank: Frequent Contributor
timestamp: January 31, 2014, 12:47:45 am
content: Well, I tried it tonight with the non-inverting circuit I posted earlier and it seems to work.It doesn't sit exactly at 0V but is a tiny bit higher so I still have some adjusting to do.At least now it starts at roughly 0V and can sweep up to quite a few volts (somewhere around 7V I think).Since I'm using this to control the pitch of a VCO I want to be able to span across as many octaves as possible.I haven't tried buffering the voltage coming from Vref yet, just connected directly so maybe it'll make a difference.

author: sync
author_rank: Frequent Contributor
timestamp: January 31, 2014, 01:08:25 am
content: How much it differs from 0V? A few mV aren't critical. With the standard 1V/octave the semitones are 83.3mV apart. And your VCOs will drift anyway.

author: fcb
author_rank: Super Contributor
timestamp: January 31, 2014, 02:53:24 pm
content: Quote from: dentaku on January 31, 2014, 12:47:45 amTweak it in software & move on!Quote from: dentaku on January 31, 2014, 12:47:45 amIncrease the gain of the differential amplifier (involves changing two resistors), more span.

author: dentaku
author_rank: Frequent Contributor
timestamp: February 01, 2014, 03:09:37 am
content: Tonight I did some measurements and lowered the size of the resistor going into the inverting input from 27K to 23K and now it's sitting at -0.007V.That's close enough for me.It was 0.3V off last night.Here's what it looks like controlling a breadboarded saw wave VCO I built a while ago. The Control Voltage is not tuned an any particular way. I just wanted to test it out by sending rising and falling voltages to it.https://app.box.com/s/mxatkyqh6fqcz04572z9The next step is to get it in tune. I can do THAT in software OR I guess I could bulid an exponential converter of some sort.