Mar132009

Wrtilty

(or The iPod car with an awkward name)

Last summer I worked at a software company, Green Hills Software in Santa Barbara, California. I like software, but I also like to be involved in the hardware. So I decided to take on a hardware/software project which had been bouncing around in my mind for a while: control a rc car with my iPod Touch over Wifi.

Theory of operation:

The iPod touch reads values from its onboard accelerometer and sends them over wifi (UDP) to my wrt54g (dd-wrt firmware) router. The router then reads the values in the packets and sends those values out the UART. A microcontroller attached to the UART reads commands from the router and creates a PWM signal to control the motor speed and a varied pulse width to control the steering servo.

Implementation:

I looked around for a good car to build on. Radio Shack’s selection isn’t nearly as awesome as it was when I was a kid and the high-end RC kits i looked at the local hobby store were out of my price range. I decided to have my parents mail me my old Blue Shark remote control car that they gave me for christmas when I was 10. When I got it, I took it apart, wiping off the years of dust as I went. I decided to gut the original servo which was just a potentiometer and a motor (all the control logic was on the board). The main motor was driven by some big TO-220 BJTs (transistors). I decided to scrap the original servo and retrofit a standard hobby servo to make it easier on myself later.

For the car-side wifi I decided to use the WRT54g router which I had previously modified to have a serial port (see iSwitch). This router runs linux (dd-wrt). At Green Hills Software I was learning a lot about development on and for Linux which helped emboldened me to learn the necessary tcp/ip and serial port programming.

The iPod is an iPod Touch 16gb. When I made my first implementation of the iPod software, the 2.0 firmware was not officially released and I didn’t have a mac. So I went about building the dev-team toolchain for iPod development on iPod 1.1.4 from Linux. This felt like fumbling around in the dark and ultimately I just got the helloworld example to work and then dropped in c posix code for the network code. It didn’t look like anything, but it worked. iPhone/iTouch programming is in ObjectiveC, which is a superset of c/c++. It is also a language Apple (and few others) uses a lot. The second implementation was built on the Apple SDK one night at my friend’s appartment. It still doesn’t look like much, but it works on the 2.0 firmware.

To interface the router with the servo and the motor, I grabbed a piece that I and a few others had built for a project for Dr. Jonathan Valvano’s EE345M class (sidenote: go to the University of Texas and take his classes). This part contained a motorola HC12 microcontroller, an L293 H-Bridge IC, a RS232 serial port with DB-9 connector, a 3-pin connector for the servo. Here is the schematic. This was an ideal starting point except that the L293D h-bridge only supports .6A continuous / 1A peak through each of its two H-bridges. The Blue Shark’s motor peaks around 7 and continuously pulls about 2 on even terrain. So I hacked together a first prototype by wiring a couple L293Ds in parallel on a breadboard. That worked ok for a few days then burned up. Then (I really wanted a quick prototype) I soldered 4 on top of eachother and that worked for a week or so; this was plenty of time to demonstrate my project before I left Santa Barbara.

My current implementation of this piece uses Mosfet transistors which are rated to 18A although some kind of heatsink would be good if you were going to use that much. In the resources selection below you can find the schematic for this board. The h-bridge specifically has a few places I could improve, but this implementation works pretty well. A picture of my current implementation H-Bridge board is below

Video:

Here is a video of my first implementation (before I laid out a PCB).

Resources: (download .zip file)

  • AVR code for H-Bridge board
  • (old) HC12 code for first implementation of H-Bridge
  • PCB / SCH Eagle files for H-Bridge Board
  • POSIX code for dd-wrt router
  • iPhone code for iPhone / iPod

Contact:

Shoot me an email at johnaboiles [at] gmail [dot] com if you have any questions about this. I’m glad to help.

Thanks / Credit:

  • Yasha Okstein did this first with the wrt54g and his palmtop
  • This site for a mosfet h-bridge design that I took and modified
  • All the people like Daniel Imfeld and Peter Newman who I asked about linux tcp/ip and serial stuff and just generally listened to me talk very excitedly abou the project.
  • Dr. Jonathon Valvano go to UT and take his classes
  • My roomates last summer Ryan Pangrle, Philip Miller, Evan Danaher; you guys are brilliant. A big part of my motivation for this project was to keep up with you.
  • Mom and dad for buying me the Blue Shark when i was 10

Note: sorry for posting this information so late, an entrepreneurial friend of mine invested some money to see if we could get this protected and marketed. I’d love to release things to the community right off but if I could somehow make a living working for myself building things like this I’d be real happy.

Write a comment


If you have trouble reading the code, click on the code itself to generate a new random code.
 
Showing comments 1 to 10 of 12 | Next | Last
Comment Isabel Marant Boots on : Tue June 11, 2013, 08:07:16
Posts tagged with bagI need a new courier bagMy Bag of Holding is falling apart after almost 4 years of daily use. This thing is constantly stuffed, so I need something that's just as, if not more spacious. Does anyone have any recommendations for a respectable courier-style replacement? Requirements: vegan-friendly materials, must have a gajillion pockets to store all of my doodads and whirlygigs. Hopefully some of these pockets will be easily accessible while the bag is closed. I tend to carry my laptop, a lot of writing implements as well as notebooks, a kindle and texts. Sometimes a change of clothes will be squeezed in. A cellphone holder/clip on the strap would be fantastic. If it's got some special thingy for putting in a water bottle, even better. Maybe an extra comfortable shoulder strap, too? Should look awesome/geeky. Am I asking for too much in a courier bag?We purchased a precooked turkey for Thanksgiving from Zabar's. We are getting ready to heat it up. The turkey is wrapped tightly in an open weave netting type bag which is tied shut. It is then has a clear plastic bag over it. The instructions say: Do not remove from oven proof bag. We are several idiots in disagreement about whether the plastic bag is the oven proof bag. Is there someone here (preferable who has ordered from Zabar's) who can clarify? [url=http://engineeredco.com/isabel.asp]Isabel Marant Boots[/url]
Comment ???? ????????? on : Wed June 05, 2013, 03:14:45
????????????????????????????? ????????????????????????????????????? [url=http://abercrombiefitch.omiki.com/]???? ?????????[/url]
Comment Karen Millen on : Tue June 04, 2013, 16:45:24
Your place is valueble for me. Thanks!? [url=http://www.century21powers.com/karenmillen.asp]Karen Millen[/url]
Comment Isabel Marant on : Tue June 04, 2013, 00:44:54
Conceptually speaking you define a fixed and common order among all possible trigrams. Remember the order has to be the same for all sentences. If the number of possible trigrams is N, then for each sentence you obtain a vector of dimensionality N. If a certain trigram does not occur, you set the corresponding value in the vector to zero. [url=http://www.century21powers.com/isabel.asp]Isabel Marant[/url]
Comment ?????? ?? on : Mon June 03, 2013, 14:02:47
???? ??????|??????????????????? ??????????????????????????????????????????????????| ????????| 4 4???? ????????????|?????? ????any???????? [url=http://prestigeboardingkennel.com/feed.html]?????? ??[/url]
Comment ?????? ??? on : Thu May 16, 2013, 21:06:36
???????????????? ?????????? [url=http://prestigeboardingkennel.com/feed.html]?????? ???[/url]
Comment viagra on : Fri December 28, 2012, 06:39:39
iswotfmv http://znxcsw.com/ <a href="http://sohccp.com/ ">meelac</a> [url=http://pmnvbq.com/]meelac[/url]
Comment sxoeoupm on : Fri December 28, 2012, 01:48:42
hxqbmjzz
Comment kjpdjqzpwit on : Tue December 27, 2011, 05:38:01
4JxDGn , [url=http://lgwqztaoxnbk.com/]lgwqztaoxnbk[/url], [link=http://tfcmgjelvyee.com/]tfcmgjelvyee[/link], http://drdccdselgiy.com/
Comment Taron on : Mon December 26, 2011, 03:44:50
I could read a book about this without finding such real-world approchaes!
Showing comments 1 to 10 of 12 | Next | Last