Arduino-->FSK--->Iphone (OpenframeWorks)

Hi i've been looking for any simple examples of FSK used with Arduino, to send out serial data via a wired connection to be processed by an iphone app built with OpenFrameworks. There seems to be tons out there, but I cant find the simple example/best approach I'm looking for. Any pointers would be gratefully received i.e. recommended chips to handle serial-FSK (or home grown approach), or useful Software libraries with hardware instructions would be great. Cheers Tom

I thought I might as well add links that I've found relating to the subject.

Arduino DDS Sinewave Generator Arduino Sine wave Generator using the direct digital synthesis. They describe how to generate sine waves with an Arduino board in a very accurate way. "Also in telecommunication the DDS Method is useful for instance in frequency of phase modulation (FSK PSK)"

Code for arduino-iphone-shield Tantalising code labled with "1200bps fsk transmission" though no hardware notes.

The Tin Can app Takes advantage of the iPhone's audio ports to send and receive messages using sound. This app points the way to jailbreak-free hardware solutions for the iPhone.

iPhone Keyboard - no Jailbreaking required, using FSK Used a Cypress PSoC microcontroller to emulate a simple modem, and then expanded it to detect an infrared signal or read from a USB host controller, which converts this signal to FSK for transmission to an iPhone. So this ones not arduino specific.

Connecting Arduino to iPhone/iPod serial On this forum, there's mention of FSK but no actual examples.

So with all this info -which approach should I take?

How are you coming along on this project?

I'm interested in doing the same thing, but making it communicate with a Windows Mobile phone.

Here is a schematic for the iPhone-PSOC hardware. It's probably not much different for the arduino-iPhone interface.

This is the blog of the guy that wrote the iPhone-Arduino FSK code.

If its a windows mobile don't you have access to standard serial tx/rx?

As for my progress, i've been busy with other stuff, but found this:

which includes a schematic (below) and links to a softwareModem library for arduino as well as iphone code....

One question - whats the blue thing in the image? On the schematic, I think its the item marked R6 a/r/s AIN1

whats the blue thing in the image? On the schematic, I think its the item marked R6 a/r/s AIN1

That is a potentiometer (pot), just a variable voltage divider. It appears to be an adjustable voltage reference inputted to a input pin. What it's function is would have to be determined by examining the software.

Most Windows Mobiles have a mini USB port, but very few are USB Hosts, which is apparently what is needed if you want to connect the device to another USB Device. Most portable devices are USB Devices.

Also, not all Arduinos have serial built-in. I really like the size of the Arduino Pro Mini so would like to make this work with it.

From what I understand a potentiometer is basically an adjustable resistor. In this video you can see the guy adjusting his and it affects the volume of the audio.!

Ok now we are getting somewhere thanks for heads up about the pot (I really must get better at reading schematics!) i found this in the translated blog (by arms22) regarding it use.

“audio signal from the iPhone through C1, R1/R2 connected to pin 6 at 2.5V over bias. Threshold for the analog voltage is applied to pin 7. Arduino to iPhone from R3/R4 to split the signal, C2 connected to the terminal through the iPhone microphone. IPhone resistor R5 is needed to be aware that the microphone is connected. R6 is VCC / 2 250mV to adjust the voltage to be much lower.”

And in the code we have:
#define SOFT_MODEM_TX_PIN (3)
#define SOFT_MODEM_RX_PIN1 (6) // AIN0
#define SOFT_MODEM_RX_PIN2 (7) // AIN1

So it looks like the pot is used to adjust the level of the signal for receiving a FSK signal, though i’m still not completely sure what value range the pot should be.

Translated blog entry describing the build
(its surprisingly easy to read).

Arduino softmodem library

Iphone application code

Sample ardunio Sketch

# Include <SoftModem. H> / / include the library 
  # Include <ctype.h> 

  SoftModem modem; / / SoftModem create an instance of 

  void setup () 
  Serial. Begin (57600); 
  modem. begin (); / / setup () call to begin with 

  void loop () 
  while (modem. available ()) (/ / iPhone verify that data received from 
  int c = modem. read (); / / 1byte Reed 
  if (isprint (c)) ( 
  Serial. Print ((char) c); / / PC sends 
  else ( 
  Serial. Print ("("); / / Hex printable characters are displayed in 
  Serial. Print (c, HEX); 
  Serial. Print (")"); 
  while (Serial. available ()) (/ / PC ensure that the data received from 
  char c = Serial. read (); / / 1byte Reed 
  modem. write (c); / / iPhone send 

(sjbotha) AFAIK all arduinos have tx rx pins for serial communication, its that not all of them have built in USB connection, such as the Pro Mini you mentioned. Its a pain that the windows mobile devices don’t let you connect directly to tx/rx directly.

Did anyone try/succeed with the solution above? Is it possible to use to audio in/out connections in the dock connector?

Its certainly possible. I installed the iphone app outlined above & played sound files from the computer & the iphone app managed to read data from the soundfiles.

I then built the arduino hardware, but the iPhone software didn't recognise the audio being generated, so it would be a matter of examining the frequencies being generated which is a little bit laborious without a scope (though I could record the output & examine it that way). Anyway, I went away and haven't had a chance to look at it again, this is one of those projects that I only get a chance to work on once a month or so.

[edit] I just noticed you specifically meant the doc connector. In which case I don't know if you are able to use that.