How do I use a phones headphone jack as an I/O port?

I am thinking about making a device which would essentially be an IR led connected to a cell phones headphone jack and function as an IR remote. I am also planning on having a separate IR receiver that could record signals from a remote.  This isn't so much a question of pin-outs, as it is a question of supporting components and code. This is a two part question. 
1. Would it be possible to connect the LED straight to the headphone jack and have it function correctly. What I mean is do the Hz match, is there enough power to the led to get it to work, etc. or would I need some sort of IC between the LED and Headphone jack. I know that I need a chip with the receiver.
2. How would I get the whole thing to work along the lines of the code. Could I just record an audio file with the IR receiver and play it back with the IR LED? I am wondering how to to this without a bunch of supporting components.


sort by: active | newest | oldest
I guess your looking to use an much older phone.
  1. No. Best case scenario you're able to record the signal from a remote in an audio format. But you will need an amp to boost that signal enough to light the IR LED.
  2. You will need supporting components no matter what. You will also need to build a receiver specifically for recording the IR signals from a remote and storing them as an audio file.
GenAap (author)  mpilchfamily4 years ago
I am planning on using a newer android phone with this, and having an app do as much work as it can with storing audio files and playing them back. I will plan on having to use an amp with the LED. What sort of amp should I use? Would an op amp work fine?
Also, for the receiver, would something like work?
Have you looked around for pre existing IR transmitter options for Android phones. There are some out there and they have apps to run them.
Kiteman4 years ago
Isn't the USB port better-suited to a task like this?
GenAap (author)  Kiteman4 years ago
Yes and no. Yes in that it is meant for data transfer with more than just an audio, but making a USB accessory from scratch (especially one with few supporting components) and dealing with the USB protocol is not something I have the stamina for when there is an easier solution. Still, thanks for you're suggestion!
iceng4 years ago
I feel my ear burning