A continuation of this question.
I am attempting to read two flow meters through the mic port of a phone/tablet. The flow meters' pulse pins toggle between +0V and +5V as their pinwheels rotate. I use an R-2R to combine the pulses from the flow meters. My first attempt was to simply send the digital output from the R-2R straight into to mic port like so:
This worked great on my PC. I was able to look for edges in the signal and (based on the magnitude of the amplitude change) determine which flow meter the pulse was sent from. Here is a screenshot of my program detecting pulses on my PC:
Raw signal read from PC mic port:
As you can see, the program is successfully identifying flow meter state changes; smaller amplitude changes are caused by flow meter 1 and larger amplitude changes are caused by flow meter 2.
The problems start when sending the same signal to my Galaxy Note 8 Android tablet. This is what the signal looks like when one of the flow meters is spinning and changing state, read through my PC's mic port:
Here is what the same signal looks like when read through the tablet's mic port:
Because of the (stronger?) AC-coupling in the tablet's sound card and the noise cancellation and other processing done to the signal, it is not possible to use the same edge detection method.
I was suggested by @DwayneReid to not try to force a digital signal through. Instead, I should convert the digital signal to an analog one and pass that through. He suggested this schematic for converting the digital signal into an analog one:
I combined this schematic with mine and came up with:
As far as I understand it, a constant analog signal should be generated by the 555 timer and sent to the mic port. Voltage changes caused by flow meter state changes should cause frequency changes in the analog signal. I will then be able to read the frequency changes of the analog signal and know when a pulse occurs, and based on the change in frequency, which flow meter the pulse came from.
This is what the signal now looks like when one of the flow meters is spinning and changing state, read through my PC's mic port:
As you can see, there is a now a slight oscillation present in the signal. However, the overall signal is unchanged and none of my expectations are met. The constant analog signal is so slight it could be considered noise. Changes in voltage seem to effect the signal no differently than before.
Where is my schematic wrong? How can I get a generate a constant analog signal that changes in either amplitude or frequency when the combined voltage from the flow meters changes?