Counteracting Sound Card AC Coupling for Reading Digital Data
The easiest way to overcome the AC coupling is to convert your DC signals to AC. Seems logical, doesn't it? 

One simple method is simply chop your input signal at some nominal frequency. Somewhere between 500 Hz to 1 KHz seems reasonable. 

What you wind up is an AC signal (square wave) of whatever amplitude your original DC signal was. 

There are several simple ways to do this. 

1) The simplest method is to use a CMOS 555 timer such TLC555. I'm not at my computer right now but I'll enter in a schematic when I get home. But a verbal description follows:

Connect pins 2 &amp; 6 together and to your timing capacitor. Timing resistor connects between pins 2/6 and pin 3.  Pins 4&amp;8 go to your power supply (5-15 Vdc). Pin 1 goes to ground. 

Connect your input DC signal through a 4.7k resistor to 555 pin 7.  This pin also feeds the analog input on your computer. 

Pick the timing RC network for your desired frequency. 

Done. . . 

There are other chopper methods but this one is really simple and inexpensive. 

[Edit]

Upon re-reading the original question and the subsequent comments and answers - I'm going change my answer slightly.

Because you are sending pulses (not DC levels) of varying amplitude to the smartphone / PC, I'm going to suggest that you want to treat the chopping signal as a carrier.  You would therefore set that chopping frequency to be quite high - above 10 KHz but below 20 KHz.  I don't know how sharp the anti-aliasing filters are in modern computer / smartphone analog inputs but I think that you want to be well clear of them.  Maybe you can get the chop frequency up to 16 or 18 KHz - I honestly don't know.

Then simply do an envelope detection scheme in software to recover the original DC signal amplitudes.

Here is the schematic that I promised earlier.  Note that this works well with a CMOS 555 timer - not one of the original bipolar parts.  TLC555 is my standard 555 timer.

Pin 7 works for chopping the input signal because it is an open-drain output.  We take our timing feedback from the output pin (Pin 3) - this works well because Pin 3 is a symmetrical CMOS output with Vout-HI level about equal to Vdd and Vout-LO level about equal to Vss.

Neither of these features is possible if using an original bipolar 555.







simulate this circuit &ndash; Schematic created using CircuitLab