6

Ok, so I've never done anything with serial connections before. But...

I just got an Arduino that I am trying to use to remotely launch model rockets. I have a 5 volt relay that I can control with the Arduino's digital out.

Now, I want connect my iPhone's Tx to the Arduino's Rx and vice-versa. I would buy the iPhone breakout board from spark fun so I could connect it to the Arduino. (http://www.sparkfun.com/products/10645) I was thinking something along the lines of: when the phone gets a text or a call from a certain number, or maybe even just a bluetooth signal, it would tell the Arduino. But those are just ideas.

How can I actually send a signal from my iPhone? Are there xCode libraries to do this? My phone is jailbroken, so I am open to other non-apple ways for sending signals. But I am a novice programmer.

Thank you.

P.S. I'm new to Stack Overflow, and I would appreciate if you could help me. The first time I posted a question someone told me it wasn't on the right site. So please bear with me.

EDIT #1: Haha, I just read over this and it sounds like a cell phone bomb from a terrorist movie. I swear that's not what I'm doing. Just look at my avatar.

EDIT #2: I also have a Bluetooth dongle for the Arduino. But I honestly have no idea how to interface that with anything, it was $10 from China, so I thought I would buy it to keep my options open. But, regardless, it would be really cool to plug an iPhone into an Arduino.

dsolimano
  • 8,870
  • 3
  • 48
  • 63
Sponge Bob
  • 1,551
  • 5
  • 17
  • 23

3 Answers3

5

You could buy a Redpark Serial Cable for iOS to connect the iPhone to your Arduino board over RS-232.

This book also seems to be helpful: iOS Sensor Apps with Arduino

EDIT: Redpark FAQ: http://redpark.com/c2db9_FAQs.html

There is a SDK available for this serial cable.

You will have trouble writing communication software when trying to connect directly to the dock connector! The External Accessory Framework wont help you here unless your Arduino board has a special decoding chip for dock connector communication.

Have fun!

Felix
  • 35,354
  • 13
  • 96
  • 143
  • I think I am basically making one of those with the piece from SparkFun, but without the RS-232 head (so I can interface it directly). But the one I will make is about 1/4 the price! Thank you for this link though. Now I know it can be done. – Sponge Bob Jun 19 '12 at 19:16
  • Thanks for the extra info. I will keep that in mind. It sure is expensive though. But I guess you're paying for the SDK just as much as their cable. :( – Sponge Bob Jun 19 '12 at 19:51
  • http://redpark.myshopify.com/products/ttl-serial-cable also found this TTY cable. Still $60, but a little more straightforward for the Arduino... I think. – Sponge Bob Jun 19 '12 at 20:10
3

All I think you need to do is utilize the External Accessory framework. I'm not sure how well it will work for you, the library is meant to communicate with MFi approved accessories. I'd really like to hear how your results went, I am going to be conducting an experiment of my own using a break out board

Dan F
  • 17,654
  • 5
  • 72
  • 110
0

I am in a similar boat as you, and I have successfully built my own serial cable using the podbreakout, and have implemented a serial class that supports reading / writing. I can confirm that I have read working, as I have tested it with my RFID reader. I am in the process of writing code that will send a command to the Arduino from the iPhone, and then have the Arduino perform a task based on the command.

Here is a document I put together on iDevice serial com,

https://docs.google.com/document/d/1Yi9_hcw8XSyYNCG2OJT9oHlTG-dC-Dnuc58VIULa81Q/edit?usp=sharing

and the serial class can be seen in the project I am working on.

https://github.com/ipatch/KegCop

ipatch
  • 3,933
  • 8
  • 60
  • 99