I'm building a microcontroller circuit that feeds its output into a microphone input of an audio recorder. The output is a square wave. (Think old-style 3.5mm Square credit card readers).
What can I use to covert a signal in the range of 0..3V to -1..+1V? I'm looking for something like MAX232, but with lower voltage levels.
I could just use a voltage divider and feed 0..+1V to the audio, but I understand that many audio input circuits use AC coupling and the recorded waveform can have unpredictable DC bias. This is undesirable, since the waveform encodes information in zero-crossings.
The question really is about a circuit that can generate negative voltages without a separate negative supply, but for completeness, I can add a few more details. The application is a kind of old-style telemetry format. The data rate is fairly low (~2,000 zero-crossings/second, or 2kbps). The client audio circuit is usually (though not always) a digital recorder. The client records my input and (usually) saves it as a digital sound file. Clients' expectations are that third-party programs can extract original digital information from these files. Sometimes, instead of recording my signal directly, the client feeds my signal into an audio-frequency radio TX (think walkie-talkie) and records the signal from the RX.
Best Answer
From the comments:
That's a fairly important detail. For one thing it means that the average DC value will be 1.5 V from the micro and that on your audio side the mean DC level will be zero. (This wouldn't be the case in the bitstream example I gave in the comments.) This in turn means that if you could give an adequate lead-in of a string of 1s or 0s that a simple decoupling capacitor would work because any initial DC offset would fade away after a few cycles.
I have never attempted anything like this but something along the following lines might work.
simulate this circuit – Schematic created using CircuitLab
Figure 1. On the first positive or negative pulse the output will be clamped at about +/- 1.5 to 1.7 V. Thereafter it should swing fairly symmetrically around 0 V.
The C1 value is the default in CircuitLab. I didn't do any calculations.
Figure 2. Simulation of C-R coupling and Zener clamping.
TTL
OUT_R
OUT_ZD
The back to back Zeners just means that the pair work symmetrically on positive or negative pulses. Because Zener's work as a regular diode in forward mode we need to reduce the Zener voltage by the forward voltage drop. You're looking for ±1.5 V and Vf is about 0.6 to 0.7 V so I went for 1 V Zeners.