Sound-Card Signal Generator Interface Adds Variable Offset Control
A common PC sound card can be used as a sine/square/triangle function generator, but the output suffers from limited rail-to-rail swing, plus its zero-centered has no DC offset. This circuit overcomes these constraints by using the second channel of the sound card to develop a PWM waveform that is filtered and then added to provide offset.
A personal computer (PC) sound card can be the basis for a readily available signal generator for testing electronic circuits. The usefulness of these signal generators is limited, however, because their outputs are AC coupled and restricted to ±2 V.
This circuit takes advantage of the two channels provided by the sound card by using one channel to output the sine/square/triangle waveform with a fixed gain while setting up a 441-Hz pulse-width modulated (PWM) square wave on the second channel. This PWM waveform is converted to ±8 V, then averaged and summed with the first channel, to provide an adjustable DC offset that is controllable by the duty-cycle setting.
The circuit provides a variable offset of typically ±5 V at the signal generator output (Fig. 1). It is powered from the PC’s USB +5-V supply, which is converted by the capacitive voltage generator within dual driver/receiver IC U1 to ±8 V (typical) to power the low-power dual op-amp U2.
Passive pairs L1/C3 and L2/C8 filter out the ripple on the V+ and V– outputs of U1. The 441-Hz PWM waveform output on the sound-card left-channel is clamped by the C10/D1 combination and fed through R8 to the base of transistor Q1. This produces a TTL-compatible (transistor-transistor logic) square wave at the collector of Q1, which is fed to T2IN of U1.
T2OUT provides a ±8-V PWM waveform that is averaged by filter R5/C11 and buffered by U2B to generate a DC voltage depending on the PWM duty cycle. This voltage is summed along with the sine/square/triangle waveform output on the sound-card right channel by U2A, forming the signal-generator output.
The C9/R4 pair forms a low-pass filter to smooth the quantized signal generated by the sound card. With the values of the components shown, the right channel is amplified by a fixed gain of +5.5 and the DC offset variation is typically ±5 V.
The 75% duty-cycle PWM input signal is converted to typically ±8 V at T2OUT and, when averaged, produces approximately 4-V DC at pin 7 of U2B (Fig. 2). The 0.5-V sine wave is amplified and offset by the inverting summing amplifier U2A to form the signal-generator’s output.
PCB Pricing: https://jlcpcb.com/quote
News on theme: