HOW I DID IT: I’ve had an iPhone for about a year now, and find it quite indispensable. It’s handy in so many situations, and fits into a lot of nerdy stuff I do. However, it hasn’t fit in perfectly to the main nerdy thing that I like to do: Fly radio control airplanes and helicopters. For that, I use a really high quality piece of
hardware from a company called JR, a JR 9303 radio. It works great. However, one day it occurred to me, how cool would it be to use my iPhone to fly my RC stuff? The answer was “So cool” obviously. I tossed around the idea for a couple of months and ultimately gave up on it because the iPhone doesn’t have a receiver I can put in the airplane to fly it with.
So the idea sat untouched while I learned how to program stuff on the iPhone for other nerdy purposes. My roommate requested I make a chadwick balancer for him using the accelerometers. (For those who don’t know, this is a device they use in real and model helicopters to find out if something is not balanced. Main blades, tail blades, shafts, gears etc…) While I was learning about the accelerometer functions in the iPhone, the idea pinged me again, and I thought, How cool would it be to fly an R/C model using the accelerometers inside the iPhone?! Alas, still no receiver.
IMAC Season came and went, and so did indoor season. I was busy practicing for contests I knew I’d be beat at, and building planes I knew were way to good for me. =) Then, one fateful day, I deleted some PHP program I was working on by accident. This was a LOT of work, and I was exceptionally pissed off about it. I was distracted by some girl in my bed (Don’t EVAR program PHP with a girl(s) in your bed!) and maybe a beer or six in my blood. I was writing a series of test programs for a SOAP interface, and had named one of them 8.php. (The more seasoned nerds among you can probably see where this is going). The program had turned into a complete disaster and was causing “internal server errors”, and I wanted to delete it. While girl was yammering in my ear I typed rm *.php instead of rm 8.php, and hit enter. Deleting every php file in the folder. Hours of hard work gone into the void.
The next day I went and bought a time capsule from Apple so this would never happen again. The side effect of this was that I had a Linksys 54 to play
around with. I always had this grandiose idea of building a WIFI sniffer/jammer. I figured there may have been some people playing around with these routers. And gosh, was I right.
The DD-WRT project is a group of people who have reverse engineered many popular brands of routers and have managed to load a small linux distribution. As soon as I saw that they had independent programs running, it hit me like a bolt of lightning: My planes and helis don’t need a receiver if they are carrying around the server. If I could carry around the router on board, I could fly my stuff.
So I started scheming. There were a lot of problems to be solved, and I am only just so nerdy. I made a list:
- How do I get the router to talk to the servos? How much current can ethernet handle?
- How do I control throttle with no stick?
- What is the latency going to be like from iPhone->Router->Program->Servo?
- What is the range of WiFi? Good enough for RC?
- Can I fly with the accelerometers? I’m a stick banger. BIG time. How does one add expo to this?
- Whose planes can I test this on? >=)
So I had my basic idea down. iPhone joins the Linksys router network. It gets an IP address. Then, I open up my pilot program. The pilot program interfaces with the router via SSH (I couldn’t think of a better way that has redundancy, and speed, and was already buily by someone else). The pilot program interprets what the iphone is doing, and outputs data to one of the ethernet ports of which there are conveniently 4. Rudder, Ailerons, Throttle, Elevator.
Once I had that idea all drawn up, I said “great, I’ll file this in the ‘projects I’ll claim to have come up with once someone else does all the work’” file. However, my friends and roommates kept egging me on, especially as more and more of them got and loved their phones. They wanted to be able to fly stuff too! Just to say they can.
So the first order of business was to come up with a user interface for the iPhone to fly things with. I know how my JR Transmitter works, but it’s a whole different beast: it has sticks and buttons. So, I came up with a simple “flight interface” for the iPhone. It’s sinfully ugly, but brutally functional. It has a couple of things that I felt were important:
- Throttle Lock/Cut
- Visual Throttle Cue so you can see if the throttle is at full and you’re not getting power to the plane. Also, the phone will vibrate depending on different throttle positions. Full throttle gets a hearty shake out of the old girl.
- Network status (Based on ping latency)
- Really difficult to accidentally quit.
- Ability to eventually use more than one engine. (Just in case).
- Cool looking throttle levers like the big boys use.
The program itself wasn’t too hard to make using Xdev, the iPhone/OS X development suite. The interface was pretty easy, but there was a lot of code behind tapping all the accelerometers at once. To further complicate things, how I tilt the phone may be different from how someone else tilts it.
There were some major hurdles. While range testing one night, I received a call from a girl. She was pretty insistent on me going to a party or something. So now I had two huge problems, incoming calls would kill the link to the craft, and I had to figure out if I had any clean clothes without R/C Logos on them to wear out.
The other problem I ran into was that the Linksys router can actually work on a lot of different voltages. Ironically, it’s very happy at nine volts, the max output voltage for the Castle Creations Castle link.
Finally, you may ask how the servos are being driven. Well, routers are used to send bits of information down a series of twisted pair wires usually. Guess what it takes to send packeted information? An IC that would work really well as a PWM! I did some haxoring around on this, and read what other nerds had done on the internet, and the next think you know I have a servo with a Cat5E plug on the end of it. Below is a small video I made of some of the earlier tests, the first real successful flight test, and an interesting near miss at the very end.

Ok… I totally want this for my eFlight 400!
That is so awesome!
Great job
Great work.
You’re not far from a big defense contract:
1. altimiter, airspeed and attitude indicator running telemetry back through the linksys router to the i-phone
2. Camera mounted on the underside of the aircraft on a swiveling bezel sending pictures back to the i-phone
3. port your i-phone app to OS-X.
4. Tidy up the hardware & packaging
5. Set up a company, patent the design
6. Contact the department of defense to sell them your low-cost web-controlled recon UAV.
This is quite possibly the best iphone app of all time…
This is a joke right ? you can’t get that heli to fly around with a router mounted to the landing skids !!! it is too heavy ! am i right.
Did you see the ad with the F1 car over iphone, is this a joke too ?
what is the distance on the router ?
Sight correction: there’s no such thing as “Xdev”, at least not from Apple. Presumably, you meant “Xcode”.
For an encore, how about getting a camera on board the aircraft, and feeding the video to the iPhone?
Also, to solve the incoming call problem, you could use an iPod Touch instead of the iPhone.
-jcr
Very cool. Love the spirit.
does this transmit in a frequency I can bind to my mCX (Spektrum) receiver? I’ve got one of the Dx6i transmitters that’s under recall and I’m grounded for the interim.
This would be loads of fun for a “drone” app that allows the iPhone to handle other navigation duties-GPS positioning perhaps, or reception from a camera on board the aircraft.
Course you’ll have to get this app up on the App Store so those of us who can’t violate our warranties can try it.
Very exciting project. I can see how this can be applied to many facets of the RC realm. Specifically, implementing this to additional types of aircraft. I’ve been (passively) working on a project to interface a Logitech Sidewinder 3D Pro joystick with an external atmel programmable USB controller to take the place of using my stock remote. I will then be attaching one of those cheapy 2.4GHz cameras and have the output of that on my computer screen. It will be like a flight simulator, but with real airplanes.
Your idea is much sexier. Now i’m starting to think of ways to bypass the atmel chip and use the iphone to control the plane. Even sexier, have the camera’s output display on the iphone. That would be tricky.
I heard in the video you were concerned with the range of the equipment. with no obstructions, the fresnel zone of an 802.11 access point can be several hundred yards (line of sight)or much more. this would be an ample radius for your helicopter; definitely feasible for a plane, too.
it was nice reading about your work. i’ll be checking back to see if you’ve made any further developments. this was a nice distraction to take me away from studying for final exams.
I approve of this tutorial.
Nice work! Love it. I totally have all the hardware to build a version. Publish code!
Oh, and check this thread:
http://www.helifreak.com/showthread.php?p=1287759#post1287759
Can you provide more information or links on how you managed to do the Ethernet to PWM for the servos.
That is really cool. Could you do an article on how the servos are being driven via ethernet?
Would love to turn my iphone into something similar to what your doing.
And then UAV land
anyone can do that ?
I thought you had actually done something cool ?
like actually re-use the 2.4WIFI chips in the iphone
looser….
Just wanted to say that this was a really well written article. Unlike most articles, I didn’t skim a bit.
Dude… that is severely cool. Those of us who are not smart enough to do it ourselves need to know what the range is! Can I use two of them (I’m thinking a phone in each hand) to fly my 40% carden?!?!? I could simply run back and forth at the pilot station, actually acting out each maneuver. Next, I need to operate throttle with the mic. – as the airplane noises I’m making get louder, throttle increases!!!! Yup, IMAC might look a bit goofier, but I betcha’ I’d score better…
Fantastic, I’ve never seen better use of the accelerometer.
Wow nice work dude.. if you add a flybarless system NOT HEAD it would fly a lot easyer!
Wow neat idea Josh.
Excellent Engineering work. Thats pretty impressive.
Congrats
Troy Newman
awesome project! 2 questions – any source you can share? also, can you delete the “girl” bravado? (makes you sound like a complete douchebag who wears antler helmets & goose steps everywhere blowing snot rockets at squirrels while singing toby keith)
Pretty cool, do I understand correctly that the Linksys is in the plane? How about some pictures or a video explanation of how you connected all this. Where is your source code? How did you get this into the iPhone? Is it an appstore app? How many hours did you spend on this project? seems like a pretty involved thing to do.
Well done! That’s quite impressive. : )
Dude, this is awesome!
I can see merit in setting up the plane to go into a broad shallow turn on loss of signal.
Can you add direction finding to it? Move the antenna to the wing tips, and do phase comparison on the two carriers. This way you can tell it to come home. (Often you can detect a carrier at levels where data can’t be reliably found.) This may be done by an entirely separate circuit.
How about a camera in the nose so you can fly from a pilot’s perspective?
GPS chip so you know where to look for the wreckage.
Replace the router with a cell phone using a data link. Fly further from
home.
Man, this is awesome. KEEP GOING. I am astonished at the innovative things being done with iPhones and this easily makes the top 10 for most astounding.
This genius!
Awesome! Nice work Josh. That’s some cool stuff you had there. Keep it up!
Please keep us posted with updates
Very cool! I’d love to stay updated on your progress with this. While flying regular aircraft might be out of the question because of wifi range, small park flyers or indoor would work. One problem there might be the weight of the router and associated parts.
Anyhow, you mentioned that an incoming call would stop the program. One could use an iPod Touch and get the same functionality without the concern of incoming calls.
Nice work!
Keep working on it. Its a great app. maybe even commercial worthy after sdk 3.0
this is really funny blog and movie, but guys you have lot of wholes in your story and movie is really for 3% of people who doesnt understand all nessesary rules in heli fly
good luck and study more
))
I’d love to see some more technical details of how you pulled this off. In particular, I didn’t really understand how you ended up driving the servos using the ethernet jacks in the router. Could you post some more in-depth stuff perhaps in a follow-up article?
Josh can you give me more details, links, etc on the interface between the Linksys and the servos ? You mention a chip and PWM ??? Can you expand on the part of the interface.
Great job and great idea.
Lee
very intresting … now i wonder if this could be used in land based rcs that would be cool
nice job man. If you wanted to take it a bit further it would be easy to replace the router with a much lighter arduino microcontroller and a wifi module. There’s plenty of code and tutorials around for it. awesome work.
It can be done, but this is a fake. He did not show anything but a movie. He did not put any details of how can be done. Anybody can fake it.
he is not saying how did he connect the servos to the router and what program did he use to pass the command to the servos. SSH by itself does nothing. Would you please show the code and the real info as the guys in this link
[LINK DROP FAIL]
Let’s see if he erase my entry because I can not see any thing that verify that it can be done the way he described it.
Gives more info. I do not see the details. There are a lots of missing parts in here
Stop trying to drop links to your business in my blog, and maybe I’ll let your comments through. I went ahead and approved your comment and took the link out, indicating a fail.
=)
This is really kool! i like it!
Hey why u delete my post ?
U suck because it big fake !!
Dearest Andrei–
I deleted your post because you’re personally attacking me on my own website. Attack the project all you want. When you say I suck, or I’m stupid, I get a little miffed. So, there is your answer.
Your friend,
Joshua
aside from talking about girls like you just discovered them, i think ur idea is pretty cool. i think putting a router on an RC plane is overkill – they make small wifi chips u can integrate pretty easily nowadays. you can setup your iphone to connect as an adhoc network.
So,finally you’ve done it.Great.A year ago I was thinking how can I move a satellite from it’s orbit using my iPhone,you know,just for fun.
Very Cool! Keep up the good work.
What a liar! A girl in his bed. lmao. good one!
it look’s very good
impossible!!!!but it is real~~~~exciting!!!
Exiting project.
why not change out the linksys router with a asus wl-500g deluxe or something like that. I has linux firmware but also has two usb ports. You could use a 3g usb modem to control it when getting out of range, and use the other usb port for a webcam.
Sound like so much fun.
sweet idea, too bad wifi is so short range, i like it and hope that i see you on cnn one day showing the world how it works
Hey OP Just add a Raven X( sierrawireless.com) to the router and it would be abled to be controlled anywhere the raven x gets signal from the cell towers. check it out at
Yay – i’m not the only crazy one
Nice Job!
Here is my project controlling flying things with cell-phones:
http://www.mikrokopter.de/ucwiki/en/DUBwise
Very nice work so far.
I’d like to pose a couple of questions:
How is the yaw controlled? The acc sensors cover pitch n roll, the bar on screen controls throttle/collective pitch, but how do you control the yaw?
Is that a T-Rex 450SE or a 600?
Do you employ an electronic stabilizer like HeliCommand, etc?
Could you post another video in time which shows the movements you apply to the iphone and the reaction of the heli (picture in picture, maybe?)? It’d be interesting to see how fast and precise the commands are executed.
Greetz – Mat
MIND BLOWING…