You could if you have a phone that supports external software. Android is the only easy candidate I think about this, because its SDK is fully open - that is, there aren't any restrictions.
On the iPhone there are restrictions as to what apps in the preprogrammed hardware you can access on user apps, and uploading unsigned (that is, not published to the App Store) apps is MUCH more difficult and requires you paying $100/yr. for a dev account (trust me, I'm an app developer for iOS, it thwarts me even).
Android is much more open. You would need a program loaded on the phone to listen to the microphone line and translate it to characters in a string.
The easiest way conceptually is to translate the standard Unicode characters into a range of analog amplitudes, because the microphone undergoes ADC (analog to digital conversion) and could distinguish. In an Arduino, you would do this with a PWM statement, like so:
Code:
// Unicode characters have a value from 0-255 so they fit in one byte of space. This is used to drive the PWM signal, and can be distinguished on the other end:
char buf[ ] = "Some sample text to send";
// (25 characters - 24 letters plus a [I]null terminator[/I])
for (int i = 0; i < 24; i++)
{
analogWrite ( transmitPin, char[ i ] );
// delay for processing on the phone side:
delay(10);
}
That code would, when included in a main loop or such, step through the string array (called 'but') incrementally and use the value of that character at the position to form an analog signal for transmission.
It would have all 24 characters transmitted in about a quarter second.
This has two possible (major) shortcomings:
1. If your cable length is too long from controller to phone, the resistance of the wire will cause degradation of the signal amplitude. Because the letter depends on what amplitude is on the line, this will cause errors.
2. Two letters that are very close together in terms of Unicode value will generate very close PWM signals that may be difficult to distinguish. I want to say this is a null issue, because phones generally have fast, high-resolution PWMs for audio, but hey, knowing all the issues makes one a better builder.
The other method - buff a UART transmit signal (serial) over the microphone line. It wouldn't be hard to set up a serial port class in the Java Android API to, with a little bit of fiddling, declare the microphone connection as a low-speed serial linkup.
If run at moderate baud rates (9,600 or lower) signal integrity wouldn't be an issue, and because it's a digital method of transmission, cable length won't hurt the circuit (within reason).
One could use the USB for the phone as a serial line, this is a well-documented feature, and would be easier. But, I get the feeling that you want to experiment and have a more 'custom' or "hands-on" design, which I sympathize with - I do the same many times.
If you want more information, let me know - again, I'm a phone software developer, so I can help with the code and software aspects of this, I can (and am willing) to help.