1

I would like to connect a reed switch to the USB port on my HTC evo. I would like to either determine when two of the pins on the USB port are the same potential or, connect a small battery to the switch and read the high and low values. Ultimately I would like to be able to do this with out altering the kernel. If this is not possible, my alternative would be to use the headphone jack. Basically I need a way to read external input. If neither of these options are possible, can you suggest a way to do this. Because of the project, I'll need to use the reed switch, no way to get around that.

Thank you Jim

  • [ADK](http://developer.android.com/guide/topics/usb/adk.html) might just do the trick.. I have not used it myself but you can check the API's see if this is possible or not. – bluefalcon Oct 18 '11 at 13:15
  • Not programming related. Please use http://electronics.stackexchange.com/ for such questions. – Andrejs Cainikovs Oct 18 '11 at 14:24

1 Answers1

0

You probably need to read up on USB a bit. It's a very "intelligent" system, far more so than the old dumb parallel port which seems to be more like what you want. There are only four conductors (pins) in the typical USB port; power, ground, and two differential-voltage signalling lines. You can't "bit-bang" the data lines, that's way (way) too low-level an operation.

I would recommend going with the microphone signal in the headset port, that at least should give you an analog input. You might need to bias or voltage-shift the switch's output to suit the input characteristics of the microphone.

unwind
  • 391,730
  • 64
  • 469
  • 606