Connecting an XBee to an iOS Device
Now that we’ve tested things between our Arduino board and our Mac, what do we need to do the same thing between our Arduino board and our iPhone?
XBee to RS-232 Serial
The first thing we need is an RS-232 adaptor. Fortunately SparkFun sells the XBee Explorer Serial for $29.95 (see Figure 5-11).
I don’t know of any others on the market that are as easily available, although if you don’t want to purchase the SparkFun adaptor, it should be moderately easy to breadboard an adaptor using your RS-232 to TTL serial adaptor that we’ve been using up till this point.
However, if you do that, you should remember that the XBee module runs at 3.3 V and the Redpark cable is at 5 V. You’ll need a voltage level shifter between the 3.3 V RX and TX of the XBee module and the 5 V of the TTL serial adaptor.

Figure 5-11. The SparkFun XBee Explorer Serial
Go ahead and unplug the XBee that was originally attached to your Mac and plug it into the serial adaptor. Then plug the serial adaptor into your Redpark cable, and that in turn into your iPhone. Attach a power supply and turn it on; you should get something like Figure 5-12.

Figure 5-12. Everything connected and working
Congratulations, you’ve successfully connected your Arduino and your iPhone via an XBee serial pass-through ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access