Sound card -> function gen. project

Status
Not open for further replies.

tristanlee85

New Member
I am working on a small project to use an application that generates a square wave frequency and using the soundcard headphone jack to take that frequency and feed it into my oscilloscope.

I am able to adjust frequencies in my application, but the problem is my V p-p is 500mV. I need a voltage of about 5V (I think). I am trying to simulate an RPM frequency for a car and I will be feeding my car's ECU this stimulated RPM. From what I have gathered from a friend, using a audio output transformer from Radio Shack would allow me to achieve this.

https://www.radioshack.com/product/...udio+output&kw=audio+output&parentPage=search

On one side of the coil I have blue, black and green wires. On the other side there is red and white. Assuming this is the correct components, how would I go about wiring this?
 
The square wave coming off a sound card is going to be very NOT square, you get a lot of ringing from them but the car ECU probably wont care. Simply run the audio output through an amplifier capable of about 10 watts into an 8ohm load, that should give you close to 9 volts, then you just use the volume control to adjust it to the 5 volts the ECU needs, make sure you use a diode if the ECU is expecting only a positive going signal.
 
A transformer is like an inductor, and as such will attenuate the high frequencies of a squarewave. End result would be somewhat a sinewave. An op-amp would be the way to go. Perhaps a comparator.
 
Just an addendum.
Powered speakers of lower wattage may work depending on their voltage supply and what they drive. Check the voltage out of whatever you have floating around.
 
The cheap Chinese transformers at RadioShack are over-priced junk.
They might not even work.
 
An amplified external speaker is your best bet. They're designed to do EXACTLY what you're asking, and will do two channels. If you don't want the negative part of the signal a simple diode will take care of it. If it can handle the differential input you only need 2.5 volts either side of ground, just about any piece of junk amplifier out there will do that. The voltage output of a sound card is line out levels, except for very old sound cards they're not designed to drive ANYTHING, even headphone drive is beyond poor. I used to keep an old sound blaster card around because it had an internal amplifier and could actually drive headphones and a couple watt speakers. Modern sound cards generally can only drive the input stage to an amp.
 
AC couple it biased at 2.5V into an op amp running off a 9V battery with a gain of 10.

OR

AC couple it biased at 2.5V into an op amp running off a 9V regulated down to 5V and use the opamp as a comparator with the -in terminal biased to 2.5V. You could also do this with an actual comparator.

Finito.
 
Last edited:

First price a replacement ECU (Engine Control Module?) for your car. This should tell you how carefully to proceed.
If it costs X dollars and you have a 10% of ruining it then you are gambling X/10 dollars each time you mess with it.

Your ECU is a State Machine. If it detects an illegal state, i.e., RPM not agreeing with other engine parameters, it may set an error code which will be hard to remove.

I'd first check what p-p voltage your ECU will accomodate, and what current is flowing into/out of the ECU terminals [this can be done with a series current sense resistor and using your scope in a differential mode (ch1 - ch2).]

Alternately you could check the output voltage and current of the device that normally drives this ECU input.

Xformers will give voltage gain or current gain but not power gain and, as was mentioned, they act as bandpass filters.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…