- #1
yo1dog
- 4
- 0
I am attempting to read two hall-effect flowmeters through the audio-in (mic) port of an Android device. I want to be able to read both flowmeters independently. The audio-in port is a standard headset port so it only has one channel for the mic.
So far I have been testing with my desktop PC. I wrote a Java app that can detect pulses (interrupts?) from the audio-in (mic) port. I am able to hook up a single flowmeter by connecting the +5v from the audio-in port to the +5v of the flowmeter and the ground from the audio-in port to the pulse line of the flowmeter. I don't know if this is the proper way, but it works in that I get a signal from the flowmeter and I can see the pulses like so:
The first problem is the +5v provided from the audio-in port does not have enough amperage (I think?) to run both flowmeters. I figured I could splice into the USB cable that would be powering/charging the android device and use its +5v and ground to power the flowmeters.
The second problem is knowing which pulse came from which flowmeter. I was suggested using an R-2R to mix the pulses into one signal but with voltages (and thus amplitudes) at 25% and 50%. That way, when I read a pulse with my app I know if the pulse has an amplitude of 25% it was from flowmeter A, 50% is flowmeter B, 75% is both.
I tried to put together a circuit that used both of these but I was unable to figure it out. It looks like what I need is for the voltage output from the R-2R to control the voltage from the audio-in port's +5v to ground. But how?
Here is what I put together on my own. I am very new to all of this.
http://www.digikey.com/schemeit/#1fwi
Thanks,
- Mike
So far I have been testing with my desktop PC. I wrote a Java app that can detect pulses (interrupts?) from the audio-in (mic) port. I am able to hook up a single flowmeter by connecting the +5v from the audio-in port to the +5v of the flowmeter and the ground from the audio-in port to the pulse line of the flowmeter. I don't know if this is the proper way, but it works in that I get a signal from the flowmeter and I can see the pulses like so:
The first problem is the +5v provided from the audio-in port does not have enough amperage (I think?) to run both flowmeters. I figured I could splice into the USB cable that would be powering/charging the android device and use its +5v and ground to power the flowmeters.
The second problem is knowing which pulse came from which flowmeter. I was suggested using an R-2R to mix the pulses into one signal but with voltages (and thus amplitudes) at 25% and 50%. That way, when I read a pulse with my app I know if the pulse has an amplitude of 25% it was from flowmeter A, 50% is flowmeter B, 75% is both.
I tried to put together a circuit that used both of these but I was unable to figure it out. It looks like what I need is for the voltage output from the R-2R to control the voltage from the audio-in port's +5v to ground. But how?
Here is what I put together on my own. I am very new to all of this.
http://www.digikey.com/schemeit/#1fwi
Thanks,
- Mike