Vous êtes sur la page 1sur 13

Sound Card DC Input Modification Science with your PC Sound Card http://www.daqarta.com/dw_ggnn.

htm If you need high frequency response as well as response down to DC, you can modify an existing sound card by adding the DC Input Adapter circuit discussed here. This avoids the input AC-coupling discussed under DC Measurements. The easiest way to do this is to buy an inexpensive USB card, which can be combined with the DC Input Adapter in an external enclosure, complete with the input connectors of your choice. Alternatively, you can build a compact version of the DC Input Adapter circuit directly into the case of this USB device:

This device is readily available on the Web, with prices typically in the US $20-30 range. Unfortunately, it doesn't have a specific name or model number to search for. Try "USB 5.1 Sound" and look for a matching photo. The device uses the C-Media CM6206 USB Audio I/O Controller chip. It provides 5.1 channel output sound, but here we are only dealing with the stereo Line inputs. (It also has a mono Mic input which won't be used here.) Please note: If you want to use a different USB sound card, you must make certain that it does indeed have input circuitry... many inexpensive USB sound devices are output-only. Some have only a singlechannel Mic input, and no Line inputs. This appears to be true of all the small rectangular devices built onto a USB plug. The following circuit should be generally applicable to most USB sound chipsets. The schematic plus complete 600 DPI board and parts placement layouts suitable for printing are included in the DC_InAll600.PNG file that is installed with Daqarta in the Documents - Daqarta - Circuits folder. You can use the printed layouts directly to create your own circuit boards, with either the laser printer toner transfer method, or with the direct-draw method discussed under Printed Circuit Construction. Alternatively, you can edit the DC_In.PCB file in the same folder to make custom modifications first. ( DC_InBig.PCB is a slightly larger version, if you are not trying to fit it into a tiny space.) See the PCB

Files discussion in Daqarta Printed Circuits for the required software to use this file, and for information on how to submit it to have boards made by a 3rd-party supplier.

Circuit Details

The basic problem that this circuit solves is that the input signal is bipolar, swinging above and below ground (0 V), while the internal chipset (CM6206 here) runs on a single 5 V supply and expects the signal to always be positive, swinging above and below a positive reference (typically about half the supply voltage) instead of about zero. It is thus necessary to add the reference voltage to the input signal, and connect directly to the ADC chip instead of through the AC coupling capacitors. The DC Input Adapter uses three LF353 dual op-amps, although you can substitute other FET-input duals like TL082. It uses a 9 V "transistor radio" battery as a negative supply, and the standard +5 V USB voltage as a positive supply. A 2N3904 NPN transistor (or equivalent) acts as an automatic switch for the 9 V supply, switching on when the USB device is plugged into a USB port.

The CM6206 uses a +2.25 V reference voltage (VREF) which is provided on pin 28. Unlike some other chips, it is not buffered, so U2A provides buffering. U2B inverts the reference to -2.25 V before feeding it to inverting summer U1B for the Left input, and also to U3B (not shown) for the Right. U1A buffers the Left input before feeding it to inverting summer U1B. The output of U1B is thus +2.25 V plus an inverted version of the input. (You will use Daqarta's Full-Scale Range controls to correct for the signal inversion during calibration.) This composite signal is then supplied directly to the chip input (LINL, pin 25), omitting the input AC coupling capacitor. Ideally, all 100K resistors should be 1% tolerance for best results, but 5% parts should be fine for most applications. Any small gain or offset errors can be corrected in Daqarta via the External Gain and/or Zero Manual controls. (See, however, the discussion of offset error versus input range in the Calibration and Performance section below.) The diodes across the feedback resistors of U1B and U3B act as clamps to prevent large negative voltages from reaching the CM6206 in case the signal input is more positive than +2.25 V. These diodes are probably not essential... the original USB device had no protection other than that built into the CM6206 itself.

Construction Details: Remove the two screws that hold the rear panel onto the USB device, and push gently on the big black SPDIF dummy plugs to slide the circuit board and connectors out the back of the case. The board has a cutout that is just big enough to hold the internal version of the DC Input Adapter circuit board:

Note: If your board is not identical to this, you may want to download the CM6206 data sheet from the Web so you can make absolutely certain you are connecting to the proper locations. Otherwise, note that the CM6206 pins are numbered counter-clockwise, starting from the beveled corner of the chip. If you use a USB device with a different chip, you will need its data sheet to find the corresponding pins. It is strongly recommended that you not attempt to solder directly to the pins of the chip. Instead, use some other point that is connected to the given pin. For the USB device shown, there are convenient +5 and ground connections near the USB connector. The other connections can be made to the solder pads of conventional electrolytic capacitors... there is no need to solder to tiny surface mount parts. After installing the DC Input Adapter, the finished result will look like this:

Note the removal of AC coupling electrolytics C17 and C18 at the upper center, next to the blue Line In jack. C17 formerly connected between the Right input jack contact and the LINR pin of the CM6206. Now the negative pad (solid white half-circle on board) is wired to the input of U3A (white wire), and the + pad is wired to the output of U3B (brown wire). Similarly, the negative C18 pad from the Left input is connected to U1A (orange wire), while U1B (yellow wire) connects to the C18 + pad that runs to LINL of the CM6206. You may also want to remove surface mount resistors R20 and R21, located between C17 and C18, which limit the input resistance to 47K. This will allow the 1 Meg input resistors on the DC Input Adapter to set the input resistance. If you do this, surface mount capacitors C19 and C29 can also be removed. The VREF connection is on the bottom side of the board, not visible in the photo. It connects from the + pad of C16 (just right of the CM6206 in the photos) to the input of U2A. Note: The DC Input Adapter in the photo uses sockets for the 3 dual op-amps. These were used here only to allow for easy testing with different op-amp types in this prototype... otherwise, sockets are not needed and not particularly recommended. Also note that this internal Adapter board requires that R3, R4, R10, R11, and both diodes be mounted vertically. There are no output pads on the Adapter for the LINL and LINR outputs of U1B and U3B. Instead, you insert R3 and R10 so the body is standing over the right resistor pad (connecting to pin 6 of U1B or U3B), and the wire lead is bent from the top of the body down to the left resistor pad (pin 7 of

U1B or U3B), which is also the output. That vertical lead is then used as the output connection to the + pad where C18 or C17 were removed from the USB board. The 9 V battery leads (grey for ground, violet for -9 V) are knotted as a simple strain relief where they will pass through a small notch made in the black plastic rear cover of the USB device. (The battery connector was made from the top of a discarded battery.) The battery then sits on top of the device, held in place by rubber bands around the sides of the case. The rubber also serves to reduce skidding, since there are no rubber feet on the standard case. The DC Input Adapter board is held to the USB device board by hot glue. If you don't have a hot-glue gun, you can use silicone sealer or "5-minute" epoxy instead. But an inexpensive hot-glue gun is a good investment, with many other uses. The USB device slides into small tracks in its aluminum case. The DC Input Adapter board should line up appropriately to allow this. Note that the outside edge of the board holds a ground trace and resistor pad that could contact the metal case. This is not likely to be a problem; the main USB board also has bare ground connections that could touch as well. But it doesn't hurt to wrap a thin strip of electrical tape around that edge to prevent spurious ground contacts.

Calibration and Performance: Important: If you normally use Daqarta with a different sound card, you will need to change the Sound Card Device Selects in Edit - Start Preferences. Changes don't take effect until the next start-up, so you need to plug in the USB device, start Daqarta, change the Device settings, then exit and restart Daqarta. You can make device changes much simpler by creating a desktop icon for each device... see Managing Multiple Devices. The following calibration procedures will involve changes to Full-Scale Range and External Gain in the Calibration menu. When you later exit Daqarta, you will be prompted to save calibration changes. The default filenames are Daqarta0.ATN and Daqarta0.EGN, but you should change the 0 in both of these to another numeral or letter (such as U for USB) which you will use as the N: parameter ( N:U) when invoking Daqarta from the special desktop icon. (Again, see Managing Multiple Devices for details.) The Input Line Level calibration of the internal attenuators is unaffected by the DC Input Adapter. If you have already performed an Auto-Calibration on this USB device, this should be OK. If not, do it now. Be sure to include the Duplex Delay option when you do this. The useful full-scale range is about +/-1.5 V before clipping when the Input Line Level is low (-180 or below). When the Level is maximum (0), full-scale range is about +/-40 mV. The input frequency response, of course, now goes down to DC. The upper frequency response is unaffected, and is cut off by the CM6206 anti-alias filter above about 20 kHz. To calibrate Full-Scale Range, you will need a DC voltage source that is about 1 V... less than a standard 1.5 V alkaline battery. (You need to be sure that the input isn't clipping, and a 1.5 V battery may be above the clip voltage.) A 1.2 V NiCd or NiMH battery will usually be OK for this use.

Alternatively, you can make a 1 V source using a simple voltage divider. The bottom resistor should be no greater than about 10K, and the top can be whatever you need to divide the DC source you do have (such as a battery) down to 1 V or so. With the divider output connected to the DC Input Adapter Left input, measure the voltage across the input with a DMM. (An inexpensive model is fine.) With the Daqarta Input button on, and having already done Auto-Calibration, make sure the main Input button is on, as well as both Left and Right Input channel buttons. Set the Left and Right Input Line Levels to step -180, which will insure that the 1 V input doesn't clip. But first, without the 1 V source connected, short both inputs to ground. Make sure you are in waveform display mode ( Spectrum and Sgram off), and open the Zero control dialog. Toggle the Data Zero Manual button on, then use the Null LI and RI buttons under it to automatically adjust each (Left and Right) baseline to zero. (Note that if you ever wish to repeat Auto-Calibration you should also repeat the above Zero Manual operation with both Input Line Levels at -180.) You should see yellow (Left) and red (Right) flat lines on the trace, possibly overlapping to show only red. Both solid and dotted cursor readouts will be set by default to read the Left trace, so click the small yellow button next to the dotted vertical readout to toggle it to red. Then go to the Calibration menu and open the Full-Scale Range Dialog. To calibrate, connect the 1 V source to both channels. Divide the true meter-measured input voltage by the Left vertical readout value, then multiply by the existing Full-Scale Range (default 1.00) and enter it as the new Range value. (You will need to enter it as a negative value to account for the inversion of the DC Input Adapter.) However, note that this represents the level of an input that will just produce a full-scale response on the most-sensitive range. In this case, it will be around -40 mV, or -0.040 V. Since Daqarta only maintains this value internally with about 5 fraction digits, you can improve the resolution by entering -40.00 here, and setting External Gain to 1000. Do this even though the computed value isn't exactly 0.040, and then adjust External Gain to compensate (see below). This keeps a nice round Range value, with fine adjustments in External Gain. Starting with the External Gain for each channel at 1000 as noted above, the cursor readouts will now be close to the true measured input voltage. Divide the Left readout value by the true voltage (the inverse of what you did for Range) and multiply by the existing value of 1000 to get the new Left External Gain value. Repeat for the Right channel... it will probably be slightly different. Calibration is now complete. Note that you may not be able to use the upper (near 0) Input Line Levels, if your DC Input Adapter has too much inherent offset voltage. The offset voltage is boosted by the gain of the CM6206 input mixer just as if it were a valid signal. Consider that if the Adapter produces (say) 45 mV of offset and the Input Level is set to a 1.5 V range (Level = -180 or so), the offset represents only 3% of full scale and is easily corrected in software by Data Zero Manual. But on a 40 mV range (Level = 0) that same offset would be greater than full-scale... with no way to correct via software. Even if the offset is still nominaly within range and corrected, the remaining useful range may be greatly reduced. For example, that same 45 mV offset on an 80 mV range would mean that only 35 mV of the range could be used before the total exceeded 80 mV, and was thus clipped by the analog-to-digital

converter in the CM6206. You would not get any warning of this, since the clipping point (due to the Zero Manual correction) would be at 35 mV... only part-way up the trace, not at the top of the screen. So, if you want to use these more-sensitive ranges, you should make sure your full input signal range will actually fit when the offset is included. If you know the signal range, add the Zero Manual value and check that the total is less than the range shown on the Y axis. If it's greater, reduce the Input Level until it fits.

See also External DC-to-AC Modulator, DC Measurements

External DC-to-AC Modulator Although a standard Windows sound card can not handle DC or very low-frequency inputs, you can add an external circuit that converts them into AC signals it can easily handle. This doesn't require any modification to your existing sound card... you just connect your DC signals to the circuit, and plug the circuit outputs into the normal Line In jack on the card. The drawback of this approach is that it limits the upper frequency range to a few kHz at best... typically only a few hundred hertz. This is not likely to be an issue for most slow-changing measurements like temperature or pressure. (If you really need high frequency response as well as response down to DC, you will need to modify a sound card.) The basic concept here is that a DC input signal is switched on and off ("chopped") by a square wave modulator that runs at a frequency the sound card can easily pass, such as 1 kHz. The result is a 1 kHz square wave whose amplitude is the same as the DC input level, and can be measured with the sound card. The exact frequency of the square wave is unimportant, only its amplitude. This approach will work fine for DC signals that are always positive or always negative, but it can't distinguish one from the other. A square wave that alternates between zero and a positive level will be converted by the sound card's AC coupling into one that is half above and half below zero... exactly the same as if the original switched between zero and a negative level. To get around this, the Signed Modulator circuit below has four switching states instead of two: A positive reference voltage, then an inverted version of that reference, then the raw input voltage, then the inverted input. This 4-state cycle repeats continuously, with each state lasting 1 msec. The reference level is chosen to be greater than any valid signal, allowing Daqarta's Decimate Signed option to deduce which phases are which, and thus to infer the correct polarity of the input signal.

Circuit Details The circuit is powered by a 9 V "transistor radio" battery. A "ground splitter" at bottom left uses an opamp (half of a TL082) that buffers voltage divider R9 and R10 to create a pseudo-ground at at half the supply, effectively giving +/-4.5 V supplies for other op-amp stages. Another TL082 section (middle left) buffers voltage divider R7 and R8 to provide a positive VREF reference voltage at approximately 2.25 V above the pseudo-ground.

At the top, a buffered 4 kHz clock from three NOR gates (CD4001) is divided down by two flip-flop stages (CD4013) to produce a 2 kHz INV output plus complementary 1 kHz REF and SIG outputs that control three analog switches (CD4016) per channel. (The top-left NOR allows an optional unsigned mode of operation... see below.) First consider the case when INV and SIG are off and REF is on. Looking at the Left channel output stage (middle right), the VREF reference voltage is connected via R6 to the non-inverting input of the op-amp, and also via R4 to the inverting input. (Since SIG is off, VREF is the only input to both.) Since INV is off, this circuit is applying both inverting and non-inverting gains to VREF at the same time. To analyze this we consider each case separately and then combine. The gain for the non-inverting function is (1 + R5/R4) = (1 + 1) = 2. The inverting gain is -R5/R4 = -1. The net result is a non-inverting gain of 1, so the output is VREF. Then after 1 msec INV switches on, which shunts the non-inverting input to ground. Now this stage is a simple inverter, so the output is -VREF. After another 1 msec INV goes back off, and SIG goes on while REF goes off. Now we are back to the non-inverting state, but with SIG instead of VREF going to the output. Finally, another msec later INV goes on and -SIG goes to the output. This holds for 1 msec, then the whole cycle repeats. The timing is shown below. Only INV and REF are shown at the top, since SIG is just the inverse of REF. Below the two timing traces are output waveforms for positive and negative input signals (VSIG). Note that these look fundamentally different.

To decipher these waveforms, Daqarta's Decimate Signed option first determines the largest waveform peak and calls that VREF. (This means that the input signal must never get this large in normal operation.) Next, it determines the polarity of the sound card's input channel; if the positive VREF pulse arrives after the negative, the overall channel is inverting the signal, so Daqarta corrects for that. After the negative VREF level goes off, whatever level comes next is the true input signal, with proper polarity. This is the value that the Signed option reports for the current sample interval. If more than one complete 4-state cycle happens during the sample interval, the individual signal levels from each cycle are averaged together to get the reported sample value. Note that for proper operation, the overall Decimate Rate must be less than the 1 kHz full-cycle rate. The specific rate is not critical, but likewise the simple oscillator here is subject to component tolerances and drift. Thus, it's best to use a safety factor such as setting Decimate Rate to half the full-cycle rate or less. The CTL switch at top left in the circuit diagram allows an optional unsigned mode of operation that is suitable for use with the Demodulate option. When the switch is closed, the SIG line stays high and the REF line stays low, so the circuit just switches between normal and inverted input signal at a 2 kHz rate. The above schematic plus complete 600 DPI board and parts placement layouts suitable for printing are included in the SgnModAll600.PNG file that is installed with Daqarta in the Documents - Daqarta Circuits folder. You can use the printed layouts directly to create your own circuit boards, with either the

laser printer toner transfer method, or with the direct-draw method discussed under Printed Circuit Construction. Alternatively, you can edit the SgnMod.PCB file in the same folder to make custom modifications first. See the PCB Files discussion in Daqarta Printed Circuits for the required software to use this file, and for information on how to submit it to have boards made by a 3rd-party supplier.

See also Sound Card DC Input Modification, DC Measurements, Decimate Signed

Vous aimerez peut-être aussi