Home > Arduino > WiFi Controlled RC Car with the Arduino

WiFi Controlled RC Car with the Arduino

February 8th, 2011 Leave a comment Go to comments

I haven’t been posting in a long time, but I just haven’t had time to do it. I have been playing around with many different projects, both Freelance projects and my own projects.
Then I thought it would be nice to post some pictures and a video about my latest project about my Hacked/Modded DACKO RC Car.

The WiFi Controlled RC Car


As you can see on the image, I have disassembled the car and then found the controller module. Then I found an RF chip/IC on the board (RX2), and I was lucky to be able to find the datasheet of that.

Closeup of the WiFi Controlled RC Car


Then I soldered some wires to the specific pins for the motor driver circuit, one pin for each direction (forward, backward, left and right).

Then I connected theese wires to the Arduino, made a test program where the Forward and Backward pins was PWM controlled, making it possible to change speed. The left and right pin should just be driven high to turn the wheels.

After some testing, I attached the WiShield WiFi module from Asynclabs, and then I started programming a socket application for the Arduino. I thought it would be fastest and easiest to use the TCP protocol directly, than serving a webpage. After some tests with Hercules SETUP Utility I made myself a controller application in Visual Basic .NET – and off we go!


After a couple of inquiries from people asking for the Arduino and Visual Basic .NET code for this project, I’ve decided to upload it.
You can download the complete project including the used WiShield library, the Arduino code and the VB.NET code, here: WiFi Controlled Car Project

Categories: Arduino Tags:
  1. August 3rd, 2011 at 14:16 | #1

    Did you use a H-bridge for the motors. Or did you use the IC?
    what ic did the RC car have? TX-2 or a RX-2?

  2. August 7th, 2011 at 21:31 | #2

    @Karthikeyan
    I just connected directly to the IC on the RF receiver board – though I know this isn’t the best idea, as the IC is running too, so I could end up damaging it.
    Sorry I can’t remember what it said on the chip 🙁

    Thomas

  3. August 20th, 2011 at 23:03 | #3

    I liked your article is an interesting technology
    thanks to google I found you

  4. Christian
    December 20th, 2011 at 16:28 | #4

    Hello.

    I am beginning a project of building a remote controlled Quadrocopter based on the Arduino Mega and would like to control it using the wifi connection from my phone (Samsung Galaxy S2).

    I would like to be able to connect the two devices directly without the router/access point (Not a nice thing to have to carry to the park), and the Galaxy S2 does support both WiFi-Direct (although apparently only to other WiFi-Direct compatible devices) and can be turned into a portable hotspot.
    However i cannot find any WiFi-Direct compatible breakout board for the Arduino, and i do not know if the portable hotspot functionality allows for communication between the phone and the device or if it simply sends the internet signal directly through.

    Do you have any thoughts on this? (I have never tried to make something like this before and would greatly appreciate any advice you are willing to offer 🙂 )

    Christian

  5. December 23rd, 2011 at 17:50 | #5

    @Christian
    Dear Christian.
    I haven’t heard about this WiFi-Direct thing.
    But the WiFi module I’m using, the WiShield, supports two different modes: Infrastructure and Ad-Hoc.
    The Infrastructure mode is used when connecting to some kind of accesspoint, like a router or a mobile hotspot. The Ad-Hoc mode is used when you want two WiFi devices to be connected together when they don’t support the hotspot feature.

    I know Android devices are capable of making a WiFi hotspot which will be accessible by the WiFi shield, just like a normal accesspoint. So you would definitely be able to use this for your project, as long as your phone can make a hotspot.

    Best Regards
    Thomas Jespersen

  6. George
    December 25th, 2011 at 08:16 | #6

    Hello,

    Great Article,

    I was starting on a similar project but run into some trouble. i was looking at our your source code and have a question about it. I was wondering why port 1000 to connect to the arduino from the PC application?

    I ask because i was trying to use your application to control a R/C car over wifi. but when i used port 1000 i could not connect to the arduino using the application, however, when i used port 80, it would connect with ease but could not remotely control the R/C car.

    Can you please help me out?
    thank you very much.

    Goerge,

  7. George
    December 26th, 2011 at 10:18 | #7

    Got it to work. Thanks anyways. 🙂

    George,

  8. December 26th, 2011 at 15:41 | #8

    @George
    It doesn’t matter which port you chose – though port 80 is used by HTTP internet, so I wouldn’t use that for this purpose, but it is indeed possible to use it.
    Glad it worked out for you.

    Thomas

  9. January 7th, 2012 at 01:40 | #9

    Hello Ive been looking at similar projects and ive never worked with arduino at all or visual studio but i have tried to teach my self about many different aspecs of programming and electronics tho still consider myself pretty much a newbie I have a desire to become a good proggramer. I just have to know how did you learn to use arduino and was is complicated? How long did it take to learn and how did you learn to develop your program? and last would it be possible to make a website to control this? by the way props for the great project one of the best ive found and seems to be one of the simplest too great job and keep up the good work! cant wait to here from you

  10. January 9th, 2012 at 18:54 | #10

    @Josh
    Hi Josh.
    The Arduino is a great starter development board for electronics newcomers.
    It doesn’t require much hardware knowledge, and with a bit of programming knowledge you can find a lot of good examples and tutorials on the Arduino homepage to get started with.
    Because I also had a good basic understanding of the electronics and hardware development, it wasn’t actually that difficult to trace which pins I should connect the Arduino to, to control the RF Car.

    But I would recommend you to start with the Arduino as it is and then get a feeling of the LED example, the serial port, and maybe go to some of the advanced examples with PWM or Analog readings.

    I wish you luck.

    PS. Yes, it is possible to make a simple website and control the robot thru that, fx by WiFi.

    Best Regards
    Thomas Jespersen

  11. Tan Thoi
    January 11th, 2012 at 00:42 | #11

    Hi,
    Your work is pretty cool! I am doing the same project with you, but instead controlling the car used the computer, we have to keep the controller like it is used in RF mode. I am thinking that both car and controller will be applied the wishields used the ad-hoc mode. Do you think it is possible to do it? I read on the internet that the ad-hoc network works fine on the range of 100 meters in the free space and 20 meters in the building. So is the ad-hoc network a good choice?
    Thank you so much!

  12. January 11th, 2012 at 22:19 | #12

    @Tan Thoi
    Well, I think I would rather use an RF-module instead of a WiFi module for the transmission.
    Are there any purpose or requirement that you should use a WiFi module?

  13. Tan Thoi
    January 12th, 2012 at 23:16 | #13

    the purpose of this is to prevent the interference between the cars using the same frequency. so I wanna to replace the RF module by the wifi module.

  14. January 14th, 2012 at 10:58 | #14

    @Tan Thoi
    Well, then I understand the purpose – but still why do you want to use WiFi?
    Have you had a look at the Xbee modules fx? These are also using 2.4GHz for the radiotransmission, though they better suits a project like this, as they just use normal Serial communication.
    The great thing about the Xbee modules are their support for multiple connections, having a master (your controller fx) connected to multiple slaves.

  15. Tan Thoi
    January 16th, 2012 at 08:06 | #15

    As I know when the Xbee works on the wireless world which mostly use 2.4GHz, the sending package will drop and Xbee will not work. Therefore, I think Xbee will also cause the interference when 2 or more cars using the Xbee which operating at 2.4GHz.

  16. January 16th, 2012 at 17:05 | #16

    @Tan Thoi
    No that’s actually the great thing about the Xbees.
    They are very configurable so you can change sub-frequency and channel individually, making it possible to use many modules in the same room.

  17. Alexandar
    January 27th, 2012 at 03:32 | #17

    How do I connect the wires? whether it is -2 RX chip?

  18. Alexandar
    January 27th, 2012 at 04:18 | #18

    I have RX-2 chip !!!

  19. January 27th, 2012 at 21:58 | #19

    @Alexandar
    Dear Alexander.
    According to page 3 of the datasheet I connected the Arduino to the Forward, Backward, Left and Right pins of the IC.
    These pins are going to the DC Motor driver circuitry on the board, which includes some power transistors or MOSFets, so you don’t have to worry about drawing too much current on the Arduino pins.

    Though be aware that this is a very dirty hack as I connect to the IC output pins, while the IC is still mounted and therefor would be able to control the pins too (output a high level etc.)

    Best Regards
    Thomas Jespersen

  20. Pojanart
    February 3rd, 2012 at 17:48 | #20

    I,m not understand code. Have you code for control car through wifi-shield ?

  21. February 4th, 2012 at 22:57 | #21

    @Pojanart
    Yes I have. By using the WiFi shield connected to the Arduino I was able to control the car remotely (thru WiFi) using an application on my laptop/PC.

    Thomas

  22. Pojanart
    February 5th, 2012 at 17:03 | #22

    Is code through webserver?

  23. February 9th, 2012 at 20:45 | #23

    @Pojanart
    No. The application running on the PC connects directly to the WiShield module thru a UDP socket connection.

  24. another joshua
    March 2nd, 2012 at 09:59 | #24

    is it possible to control this robot over long distances with a wireless internet connection. IE a smartphone or other wireless internet connection? (like 4g or clearwire) for longer distance applictations?

  25. March 2nd, 2012 at 11:38 | #25

    @another joshua
    Yes sure.
    If the wireless internet connection allows incoming socket connections to be established this project wouldn’t actually require any changes at all, you should just change the connection IP-address in the VB.NET app.

  26. budz
    March 5th, 2012 at 20:46 | #26

    hi. can you send me the source code off arduino?
    thanks…

  27. Lauszus
    March 5th, 2012 at 20:51 | #27

    @budz
    The code is provided in the .zip file in the bottom of the post. Here is the link for the file: http://blog.tkjelectronics.dk/wp-content/uploads/WiFi_Controlled_Car.zip

  28. hydrgen
    March 16th, 2012 at 07:54 | #28

    Hi may i know how u connect the wishield and arduino together as in what pin from the wishield connect to what pin of the arduino

  29. March 16th, 2012 at 08:33 | #29

    @hydrgen
    The WiShield is just a shield that connects on top of the Arduino.
    But to be specific the WiShield uses the SPI periphiral of the Arduino, which is the following pins:
    – Clock (SCK) : Arduino pin 13 (port B, pin 5)
    – Master in, slave out (MISO) : Arduino pin 12 (port B, pin 4)
    – Master out, slave in (MOSI) : Arduino pin 11 (port B, pin 3)
    – Chip select (CS) : Arduino pin 10 (port B, pin 2)

  30. Gladwin
    April 9th, 2012 at 16:31 | #30

    When I Compiled The Code I Came Up With A Error…
    Can You Help Me:
    Error:
    WiFi_Controlled_Car:15: error: conflicting declaration ‘const prog_char ssid []’
    C:Projectarduino-0023librariesWiShield/config.h:44: error: ‘ssid’ has a previous declaration as ‘char ssid []’

  31. April 9th, 2012 at 19:17 | #31

    @Gladwin
    What the error actually says is that the SSID variable has been defined somewhere else in the code, before the “const prog_char ssid[]” declaration.
    So you should look before that line and see if you can spot another ssid definition.

    I will also remind you that the WiShield library doesn’t work with the recent version of Arduino IDE, v1.0, as some major changes has been made in the internal libraries.
    Please download and have a try with version 0023 instead.

    Advanced hint
    If you know GitHub well you should be able to download this Pull request which hasn’t been merged: https://github.com/asynclabs/WiShield/pull/3
    This code enables you to use the WiShield library with Arduino 1.0

  32. Gladwin
    April 15th, 2012 at 07:27 | #32

    Thanks For The Reply Thomas Jespersen.
    I Directly opened The .PDE file On The Downloaded .zip File.
    So, I never edited The Code.
    The Only other Declaration with ssid:
    unsigned char ssid_len;
    I tried With Both Arduino 1.0 and Arduino 0023.
    I Got Similar Errors..
    When I Tried The Example Programs Too? I Got Similar Errors With SSID?
    Do I Have To Change Any Of The Settings in The computer.
    Thanks In Advance..

  33. April 15th, 2012 at 10:06 | #33

    @Gladwin
    Dear Gladwin.
    I have no problems compiling the code with Arduino 0023.
    Have you remembered to type in your routers SSID and Passphrase in the appropriate places like ssid[] and security_passphrase or wep_keys.
    You should also remember to change the security_type to what matches your router settings.

    Thomas

  34. Dai anh Tai
    April 26th, 2012 at 00:41 | #34

    Help me repair this error . Thankyou:

    In file included from socketapp.c:46:
    socketapp.h:51: error: conflicting types for ‘uip_tcp_appstate_t’
    e:arduinoarduino-0022arduino-0022librariesWiShield/webserver.h:43: error: previous declaration of ‘uip_tcp_appstate_t’ was here

  35. Jim
    April 26th, 2012 at 06:20 | #35

    Hi,

    Really nice project. I was working on a similar project until I stumbled accross yours. One thing is puzzling me though. I can get PWM to work at max speed i.e. 255 for the motors using Wifi. When i lower the PWM to around 100 i have excellent control and everything works fine. But why when i set it to 200+ the motors start spinning endlessly and i somewhat loose control. This is not specific to your code. It is the same issue when I use a C# program as the controller. Is it something to do with the arduino or wifi?? Any advice would be much appreciated.

  36. Jim
    April 26th, 2012 at 06:22 | #36

    Sorry i meant to say “I can’t get PWM to work at 255” in the previous comment.

  37. April 26th, 2012 at 11:00 | #37

    @Dai anh Tai
    The socketapp.c file should not be opened inside the Arduino IDE – it should just be located next to the PDE file.

  38. April 26th, 2012 at 11:05 | #38

    @Jim
    Dear Jim.
    Hmm, that sounds a bit odd. I haven’t experienced this yet, but it might be a problem with the Visual Basic .NET app.
    Could you please try a UDP terminal application and see whether or not you can get it working by simply sending the moving commands/speeds.

    You could use the Hercules application fx: http://www.hw-group.com/products/hercules/index_en.html

    Also which version of the Arduino IDE are you currently using?
    The WiShield is currently not well supported in the latest version 1.0. Instead you should be using Arduino 0022 or 0023.

    Best Regards
    Thomas Jespersen

  39. Saulius
    May 16th, 2012 at 11:49 | #39

    Hello Thomas,

    This robot is really nice 🙂 I am interested in making such a robot. But when I try to compile/upload your given code, compiler says:” ‘WiFi’ was not declared in this scope”. Error is shown in this statement: WiFi.init(); And it is not declared anywhere in that code.. :/

    I am looking to hearing from you here or to the email. Thank you 🙂

  40. May 23rd, 2012 at 14:41 | #40

    @Saulius
    Dear Saulius.
    This project uses the WiShield from Asynclabs and therefor relies on the WiShield library
    You should install this library in the Arduino library folder to be able to compile the project.

    Please also have in mind that the current version of the WiShield library isn’t supported in Arduino 1.0 – instead I recommend you to use Arduino 0023.

    Regards Thomas

  41. Sandar
    May 23rd, 2012 at 23:53 | #41

    Saulius :
    Hello Thomas,
    This robot is really nice I am interested in making such a robot. But when I try to compile/upload your given code, compiler says:? ?WiFi? was not declared in this scope?. Error is shown in this statement: WiFi.init(); And it is not declared anywhere in that code.. :/
    I am looking to hearing from you here or to the email. Thank you

  42. May 25th, 2012 at 16:07 | #42

    @Sandar
    Dear Sandar.
    I can see that you have simply quoted Saulius’ question. Do you have the same problem as him?
    Have you seen my reply to Saulius and are you still unable to get it working?

    Best Regards
    Thomas Jespersen

  43. adi
    June 15th, 2012 at 16:14 | #43

    In file included from socketapp.c:46:
    D:downloadarduino-0023librarieswifly1/socketapp.h:52: error: conflicting types for ‘uip_tcp_appstate_t’
    D:downloadarduino-0023librarieswifly1/webserver.h:43: error: previous declaration of ‘uip_tcp_appstate_t’ was here

    how can i fix this problem?

  44. June 17th, 2012 at 22:26 | #44

    @adi
    Which library are you using? It seems like the folder is named WiFly?
    Please have in mind that I am using the WiShield from Asynclabs, which this code is made for.

  45. Alexander Monico
    June 29th, 2012 at 06:57 | #45

    I’m in a similar project, and I just want to get the wifi shield library , and the code of from Visual. I opened your project and the arduino softwere can not open it.

  46. July 1st, 2012 at 16:30 | #46

    @Alexander Monico
    Dear Alexander.
    As explained in a previous comment too this Arduino project and the WiShield library isn’t supported in the new version 1.0. Instead you should download the old version 0023 to be able to compile the project.
    You should also remember to download the WiShield library from the Asynclabs page: http://asynclabs.com/wiki/index.php?title=WiShield_library

  47. Derrick Davis
    July 4th, 2012 at 03:05 | #47

    Can give as a easy example of wifi shield, just turn on a LED in visual basic and send us the code from both (Arduino with the parameters and the visual with the complete code.). I have been triying and i can’t. Please.

  48. July 4th, 2012 at 08:20 | #48

    @Derrick Davis
    Dear Derrick.
    Please have a look at our Ardulyzer project and let me know if that is what you like to achive.
    Ardulyzer – Arduino IO Controller
    Regards Thomas

  49. Derrick Davis
    July 5th, 2012 at 02:24 | #49

    I just want a simple example of the communication between Wifi shield & Arduino. Sending signals from Visual.Net or VBasic to the shield. N matter if is a LED ON and TURN in off.

  50. July 6th, 2012 at 10:53 | #50

    @Derrick Davis
    Well then maybe our Ardulyzer is a bit too advanced to start with.
    Have a look at this tutorial. Hopefully it will get you started.
    Control Arduino Through Serial Connection (USB) VB Visual Basic program

  51. Derrick Davis
    July 7th, 2012 at 01:14 | #51

    Good post 🙂 but i need to use the wifi, with the (wifi shield). Because i have a poject for Arduino and i bought the cupperhead wifi shield so i need to control it trough the computer via wifi.

  52. July 7th, 2012 at 22:13 | #52

    @Derrick Davis
    Well then you should make the communication thru TCP or UDP instead.
    The WiFi shield comes with a numerous examples to get you started. In this project with the RC car I used the UDP protocol as it is the fastest but doens’t have the same level of package tracking (checksum, error checking etc.)
    It will for sure be possible to combine the tutorial I mentioned with the UDP example from the WiFi shield library, to get a project with your requirements.

    Regards Thomas

  53. Alexander Monico
    July 11th, 2012 at 00:42 | #53

    As I told you in a past comment I’m in a similar project, i done the communication through the Visual and Arduino using serial port(To check my sketch ) My problem is with the shield i can’t program it and i have not time so I don’t know if you can help me. Please i will appreciate so much http://www.mediafire.com/?yy9nv7wj4o9vc97 . PLEASE HELP ME TO USE THE WIFI SHIELD

  54. MrExtra
    July 19th, 2012 at 17:21 | #54

    Hi, very nice post. I am trying to compile your arduino codes but it failed to do so.

    I have also downloaded the WiShield Library. I am suspecting that the WiShiled Library that I have downloaded is not the correct one. Is it ok if you share with me your Library?

    Also what version of Arduino IDE are you using? I am using Arduino 0022.

    One more question, is this WiFi connection adhoc? Meaning the BlackWidow creates it’s own WiFi instead of tapping on another existing Wifi connection.
    Thanks a lot!

  55. MrExtra
    July 19th, 2012 at 17:45 | #55

    I have tried Arduino 0023, and downloaded the Library from the link u gave: https://github.com/asynclabs/WiShield

    I am getting this error:

    WiShielduip.c.o: In function `uip_process’:
    C:UsersMyPCDocumentsarduino-0023librariesWiShield/uip.c:776: undefined reference to `webserver_appcall’
    C:UsersMyPCDocumentsarduino-0023librariesWiShield/uip.c:815: undefined reference to `webserver_appcall’
    C:UsersMyPCDocumentsarduino-0023librariesWiShield/uip.c:1570: undefined reference to `webserver_appcall’
    C:UsersMyPCDocumentsarduino-0023librariesWiShield/uip.c:1597: undefined reference to `webserver_appcall’
    C:UsersMyPCDocumentsarduino-0023librariesWiShield/uip.c:1674: undefined reference to `webserver_appcall’
    WiShielduip.c.o:C:UsersNoelDocumentsarduino-0023librariesWiShield/uip.c:1755: more undefined references to `webserver_appcall’ follow
    WiShieldstack.c.o: In function `stack_init’:
    C:UsersMyPCDocumentsarduino-0023librariesWiShield/stack.c:77: undefined reference to `webserver_init’
    Can you confirm again that this Library works? If not, is it possible for you to share with us the library that you are using? Thank you so much for your time…

  56. July 25th, 2012 at 14:58 | #56

    @Alexander Monico
    Hi Alexander.
    The WiFi Shield is very different from using the Serial port on the Arduino. It requires some extra code where I recommend you to take a look at the examples sketches that comes with the board.

    We can of course also help you with specific things in the project or doing the whole project for you at a small fee.
    If you are interested in this do not hesitate writing to us at: mail@tkjelectronics.dk

  57. July 26th, 2012 at 22:50 | #57

    @MrExtra
    Hi.
    I have seen many users reporting to me that they can’t get this code to work on their computer whatever they try. The WiShield has been updated a bit since I used it for this project which might be the reason for the compiler errors.

    So to make it easier for you to try the project I have uploaded the complete project source code including the used WiShield library (has to be put into the Arduino libraries folder). For this project I used Arduino 0022.
    The complete project can be downloaded here: WiFi Controlled Car Project

    Let me know if it works for you.

    Best Regards
    Thomas Jespersen

  58. MrExtra
    July 30th, 2012 at 17:14 | #58

    @Thomas Jespersen
    Hi there, I have managed to get it to work before your post. I found out that we need to modify the config-app.h header file. Thanks so much, you are very helpful. Other than just controlling the RC car, my project requires me to mount a camera and display the video stream on my Android phone too. xD Currently I am finding ways to implement this.
    Thanks again!

  59. July 30th, 2012 at 17:28 | #59

    @MrExtra
    Great you managed to get it working.
    For the camera and video I would recommend you to get an WiFi IP camera which would be controllable by a phone. Another solution but very slow, would be to attach a serial camera or maybe a parallel one with FIFO to the Arduino, and then let the Arduino handle the images too.
    The last proposal though wouldn’t give you more than maximum 2-4 FPS.

    Regards Thomas

  60. MrExtra
    August 29th, 2012 at 05:29 | #60

    @Thomas Jespersen
    Thanks for your reply. I will let you know which brand of Network camera works for me when I have tried it out.

    MrExtra

  61. JimG
    October 3rd, 2012 at 16:09 | #61

    Hello,

    I am trying this project but i am using a slightly different method. I am going to use the arduino ethernet shield and directly wire it to the router on the car. Im going to be putting a camera and a few sensors on it a bit later. I was wondering what it would take to convert this code to work with the ethernet shield. I am doing the same design and the protocol is the same so it should be easy to modify the code? Please help.

    Thanks!

  62. October 8th, 2012 at 18:37 | #62

    @JimG
    Dear Jim.
    It wouldn’t require much effort to make this code work with the Ethernet shield.
    The Ethernet shield already comes with a “UDPSendReceiveString” example sketch which demonstrates the UDP functionality of the library. By using that example sketch as a reference you should easily be able to convert our code.

    Regards Thomas

  63. Nick
    October 11th, 2012 at 09:22 | #63

    Hi there!

    Can anyone help me with UDP Packet programming? I am running a windows computer, so I’m not able to compile the sample code on the asynclab webpage. I am able to compile the arduino sketch and .c. I tried to find the UDP server from the Hercules software, but I can’t find any device. Can some1 enlighten me in this problem?

  64. MrExtra
    October 11th, 2012 at 15:41 | #64

    D-Link DCS-930L IP Camera worked for me.@MrExtra

  65. Gilbert
    October 11th, 2012 at 16:37 | #65

    Hi Thomas Jespersen, I have just sent you an email regarding the Project Details
    Hope to get your reply soon as possible 🙂

  66. hendra
    October 16th, 2012 at 15:42 | #66

    i’ve a project using arduino
    i’m using DFRobot wifi shield v2.1 but i can’t configure my wifi shield
    any one can help me to config my wifi shield?

    please 🙁

  67. November 6th, 2012 at 19:52 | #67

    @Nick
    In UDP mode you can’t talk about having servers and clients. In UDP mode both devices opens a listening port and the connects to the other parts listening port.
    With Hercules you can do this in the UDP tab and then you should be able to test it with the Arduino Asynclabs example provided.

    But why can’t you compile the Asynclabs Webserver example? I’m on a Windows computer too and I have no problems!

    Regards Thomas

  68. November 6th, 2012 at 19:53 | #68

    @MrExtra
    Nicely done.
    Any pictures or video of the “rover” in the field?

  69. November 6th, 2012 at 19:56 | #69

    @hendra
    The DFRobot Wifi Shield works in another way than the Asynclabs.
    You have to communicate with the board thru the Serial interface and then use AT commands to connect to the internet or make a sever application.
    But the easy setup is just to make a UDP loop-thru that redirects all the UDP traffic to the Serial port and opposite, as demonstrated in the tutorial: http://www.dfrobot.com/wiki/index.php?title=WiFi_Shield_V2.1_For_Arduino_(SKU:TEL0047)

    Regards Thomas

  70. JD
    November 27th, 2012 at 20:43 | #70

    @MrExtra
    Hey .. sounds great what you guys are conversing about .. I’ve taken a look at the code posted here; but also, would you mind uploading your code for WiShield w/Librairy .. and also Android App ? I had one that is giving me the blues. It was supposedly tilt sensitive to control the rc (via motor shield) but either I need re-wire some connections or re-program altogether :/

  71. Shaun
    December 14th, 2012 at 04:17 | #71

    I have enjoyed this tutorial and like all of the functionality it gives, however I am wanting to do the exact same thing except through tethered ethernet instead of through WiFi. Can anyone give me a direction to go in order to do this? I have tried everything I can think of and searched the Internet like crazy but have not found what I am looking for.

  72. December 23rd, 2012 at 15:37 | #72

    @Shaun
    Hmm, I guess you have not searched well enough 😉
    The keywords is the UDP protocol I’m using for sending the direction parameters.
    Please have a look at the following tutorial where the Arduino Ethernet shield is used: Sending and Receiving String via UDP

    Merry Christmas
    Regards Thomas

  73. Martin
    January 20th, 2013 at 19:51 | #73

    nice project, but i can controll the rc car with bluetooth module ?

  74. February 3rd, 2013 at 21:18 | #74

    @Martin
    Yes indeed. This would simply be a question of changing the communication parameters and not to use the WiShield and UDP project and the RC control command parser.

    The most simply way to do it would be to add an inexpensive Serial Bluetooth module to the Serial pins of the Arduino. Then you would be able to connect with your PC of cell phone and control the robot.

  75. Angel
    April 18th, 2013 at 05:16 | #75

    nice work man, jusy a couple of things i need to know :S

    1.- Which program did you download to the Arduino Board?
    2.- when you run Hercules, it auto log with the arduini wishield?

    if you can answer me it would be awesome, thnx

  76. April 18th, 2013 at 19:18 | #76

    @Angel
    Hi.
    The code that I uploaded to the Arduino board can be found in the ZIP file, also linked to in the blog post: http://blog.tkjelectronics.dk/wp-content/uploads/WiFi_Controlled_Car.zip
    I have only been using Hercules for UDP and TCP protocol testing. When I control the robot it is done thru a Visual Basic .NET application I have made.
    Regards Thomas

  77. Angel
    April 19th, 2013 at 00:35 | #77

    @Thomas Jespersen

    thnx man :D, another doubt i foun today was that im using the Wifi Shield from Arduino instead of your wifi shield model, an when i run the net app, it encounter a problem with the port integred(?

    did i need to make a new application?
    similar but a new one?

  78. Kakaya_Raznitsa
    May 18th, 2013 at 20:35 | #78

    Hi – I use this code, but i can’t complete, anybody can give me working code pls :)))

    In file included from C:UsersÐ?акая РазниÑ?аDesktoparduino-1.0.4-windowsarduino-1.0.4librariesWiShieldrequest.cpp:32:
    C:UsersÐ?акая РазниÑ?аDesktoparduino-1.0.4-windowsarduino-1.0.4librariesWiShield/WiServer.h:198: error: conflicting return type specified for ‘virtual void Server::write(uint8_t)’
    C:UsersÐ?акая РазниÑ?аDesktoparduino-1.0.4-windowsarduino-1.0.4hardwarearduinocoresarduino/Print.h:48: error: overriding ‘virtual size_t Print::write(uint8_t)’

  79. May 19th, 2013 at 16:03 | #79

    @Kakaya_Raznitsa
    Just change it from

    virtual void write(uint8_t);

    To:

    virtual size_t write(uint8_t);

    In WiServer.h at line 198 and change

    void Server::write(uint8_t b) {

    To:

    size_t Server::write(uint8_t b) {

    WiServer.cpp at line 212.

  80. segap
    May 23rd, 2013 at 19:44 | #80

    se puede con cualquier otro modulo wifi??

  81. June 5th, 2013 at 12:05 | #81

    Hello there,
    within our time at university we created a RC-car controlled by an android mobilphone. But the mobil phone is working as communication station to give us all the power for the usage of a camera, an accelerometre and usb-connection. You would be able to connect to the android application with another java app at a pc. Maybe you will enjoy it and youâ??re going to take a look. But if u want to see it in action, there is a video taken by interessted programmer: http://vimeo.com/67519531
    Best regards
    https://code.google.com/p/carduinodroid/

  82. areesha
    July 8th, 2013 at 01:14 | #82

    heloo
    i need ur little help
    i am thinking to make an RC plane controled throu an android app bt the transmission is though wifi as u did the plane is quite big .. its one wing is 161cm . i was advised to not use use it as a fuel tank plane
    bt the think that is worrying me is m a comuter engineering student n i want to implement hardware in the plane and software in the android app bt if its fuel tank how shld i use the circuit hardware implementation in any way… plz help me!! il be greatful for ur reply… nice work!

  83. areesha
    July 8th, 2013 at 01:19 | #83

    heloo
    i need ur little help
    i am thinking to make an RC plane controled throu an android app bt the transmission is though wifi as u did the plane is quite big .. its one wing is 161cm . i was advised to not use battery bt use a fuel tank plane bcz the battry can fly the plane for a longer span.. plus the plane is big ther4
    bt the think that is worrying me is m a computer engineering student n i want to implement hardware in the plane and software in the android app bt if iv used a fuel tank in the plane how shld i use the circuit to perform operations send through android app shld i use micro processor or wat to build a circuit ie-hardware implementationâ?¦ plz help me!! il be greatful for ur replyâ?¦ nice work!

  84. Raheel
    August 21st, 2013 at 17:18 | #84

    Hi, I got to know about your project thru youtube searching. It is very interesting and I believe quite easy to understand as well. I am also on a journey of similar assignment but I am not using the toy car which you have shown here. I am gona use the Tamiya tracked chassis vehicle (http://www.amazon.com/gp/customer-media/product-gallery/B00061HHTK/ref=cm_ciu_pdp_images_0?ie=UTF8&index=0) which is very simple one with basic chassis structure. I have already constructed the vehicle and would like to connect this to arduino board for very basic (rev / fwd) movement as first thing.

    Can you guide as how to achieve this?

    R.

  85. August 31st, 2013 at 22:48 | #85

    @Raheel
    To control that vehicle with an Arduino in terms of controlling the DC motor you will need a motor driver circuitry, an H-bridge as an example.
    Depending on how much current the motor draws (I guess less than 1A) you should be able to use this module connected to an Arduino: https://www.sparkfun.com/products/9457
    Another option would be to use this shield: https://www.sparkfun.com/products/9815

    When you have got control of the motor with your Arduino the next step is to add the wireless control, either by WiFi, Bluetooth or any other kind of simple RF control.

    Good luck.

  86. alejandro
    September 6th, 2013 at 08:04 | #86

    not very good with TouchOSC wanted aserlo I appreciate with wifishield

  87. alejandro
    September 6th, 2013 at 08:05 | #87

    haha sorry I do not speak English use the translator, very good tutorial

  88. ahmad
    October 7th, 2013 at 06:50 | #88

    like the project
    can you contact me please

  89. dullawa
    October 9th, 2013 at 17:52 | #89

    nice project, i like this project.

  90. Amjad
    November 27th, 2013 at 18:52 | #90

    nice project 🙂

    but the download link of (WiFi Controlled Car Project) is not working 🙁

    so .. if u can re-uplod it ..

  91. eljo francisco
    January 10th, 2014 at 05:44 | #91

    Sir I just want to ask, we do something like this RC car but we have use arduino YUN but the problem is only one command at a time the rc car do it cannot execute 2 commands at the same time example is right and forward or left and forward etc.

  92. access
    January 17th, 2014 at 17:24 | #92

    hello.. I find your project very helpful.. but every time i click the link of code you give, it says “The requested URL /uploads/WiFi_Car_Project.zip was not found on this server.” why is that?

  93. January 18th, 2014 at 10:55 | #93

    @eljo francisco
    It is definitely possible to extend the system to support multiple commands at the same time – you simply just have to expand the command set using a “bit” in the transmitted bytes to indicate what you want to do.
    Fx bit 0 could be forward, bit 1 being backwards, bit 2 being left and bit 3 being right.
    Sending 0x09 will then make the car drive forward and right because of

    0x09 = 0b00001001

    Regards Thomas

  94. syed
    January 20th, 2014 at 14:07 | #94

    Hi Thomas…
    I’m new to this project and i don’t know anything about programming…will it work if i download and load it on my arduino…or else what i have to do…

  95. January 23rd, 2014 at 18:13 | #95

    @syed
    If you have an Arduino Duemilanove or Arduino UNO and especially you need to have the WiShield, then yes it will work.

  96. René
    February 9th, 2014 at 05:57 | #96

    thomas good day, I wonder if you have a tutorial on how to use the wishiel of asynclab with UDP mode, or as an access point, thanks

  97. February 13th, 2014 at 23:10 | #97

    @René
    Hi Rene.
    Sorry we don’t. We haven’t been using the WiShield for quite a while, and unfortunately Asynclabs has stopped manufacturing them as well.
    I can recommend you to have a look at this guide though, where the Arduino Ethernet shield is used: http://arduino.cc/en/Tutorial/UDPSendReceiveString

    Regards Thomas

  98. Alparslanyk
    February 16th, 2014 at 18:34 | #98

    Hi when ? try to compile your code witch ? downloaded here gives me these errors. What can ? do to make it work. ? am using arduino uno r3, cuhead wifi shield v2.0 and arduino IDE 1.0.5

  99. Alparslanyk
    February 16th, 2014 at 18:35 | #99

    In file included from socketapp.c:46:
    E:Programlararduino-1.0.5librariesWiShield/socketapp.h:52: error: conflicting types for ‘uip_tcp_appstate_t’
    E:Programlararduino-1.0.5librariesWiShield/webserver.h:43: error: previous declaration of ‘uip_tcp_appstate_t’ was here

  100. Alparslanyk
    February 16th, 2014 at 18:52 | #100

    I search and solve it but now gives this error.

    E:Programlararduino-1.0.5librariesWiShieldclock-arch.c:44:20: error: wiring.h: No such file or directory

    I am using your wiShield library.

  101. February 16th, 2014 at 18:56 | #101

    @Alparslanyk
    The errors you are getting are caused by the apps-config.h file. You have to make sure that the only line being uncommented it #define APP_SOCKAPP and the errors should disappear.
    The wiring.h error you are experiencing is due to the updated Arduino version, where they changed the header file inclusion.
    You should change the #include ?wiring.h” to #include ?Arduino.h? in the clock-arch.h file.

    Regards Thomas

  102. Alparslanyk
    February 16th, 2014 at 20:37 | #102

    Thank you very much. ? did what you said and it worked now ? will try it. and if it succes ? will write and c# aplication and sent you to puplish it in your name if you want because of your help [:

  103. Puja Setiawan
    March 6th, 2014 at 13:36 | #103

    I like your project, I want to ask you,
    1. what program do you use to run the car?
    2. how can I get the program or the application
    3. how to connecting laptop with WIFI shield Arduino?

    please your answer via my email

  104. March 8th, 2014 at 19:37 | #104

    @Puja Setiawan
    To control the car I made a Visual Basic .net application that can be downloaded as it is found inside the WiFi Controlled Car Project zip file (see the bottom of the blog post).
    The car itself is connected to an Arduino Duemilanove that takes care of controlling the proper signals to control the car.
    A WiFi shield for the Arduino, such as the one we are using from Asynclabs, can be used to connect your device to your local area network or even the internet. In our case we just communicate between the PC and the WiFi shield using a TCP port.

    Regards Thomas

  105. mannour
    April 21st, 2014 at 17:58 | #105

    hi nice project but i cant download the vb source

  106. April 24th, 2014 at 22:23 | #106

    @mannour
    Please download the complete project including the used WiShield library, the Arduino code and the VB.NET code, here: WiFi Controlled Car Project
    Regards Thomas

  107. choi teemo
    May 9th, 2014 at 07:20 | #107

    Did you use WIFI module supporting ad-hoc mode?

    I can’t get it. How did you connect to shield? With AP router or Without AP router.

    Thank you.

  108. May 10th, 2014 at 23:01 | #108

    @choi teemo
    I use an accesspoint which the WiFi shield connects to.
    Regards Thomas

  109. June 11th, 2014 at 04:27 | #109

    Would it be possible to create that same program, but through Microsoft Visual Studio C++ windows form? If So how. Also I can’t seem to locate the VS file in the zip folder.

    Thanks,

    Demetri

  110. June 11th, 2014 at 17:11 | #110

    @Demetri
    Hi Demetri.
    Apparently the Visual Studio folder was removed from the zip file when both the Arduino and VB.NET project was combined.
    I have now reuploaded the full zip-file, so please try and redownload and you should find the VB.NET project.

    If you have in mind that this is VB.NET it should be portable to C++ as we don’t use a lot of .NET specific features.
    As long as you can get a direct TCP port opened and working for writing it should be easily ported.

    Regards Thomas

  111. vhan
    September 5th, 2014 at 12:01 | #111

    I like this project. can you help me how to do it?
    please pm me if you see this message. This is my email regasavhan@gmail.com
    i need to learn how to do this and how it work.

  112. September 13th, 2014 at 23:36 | #112

    for resolve the erro ” conflicting types for ?uip_tcp_appstate_t?”
    use the Arduino 1.0.1 and Wishield with changes for arduino 1.0 https://github.com/jcmuller/WiShield

    One question:
    How i can connect to tcp server with wishield…. only sample of the tcp socket server and not client socket

  113. yudha
    October 20th, 2014 at 14:44 | #113

    hi sir , would you like to guide me to make something use wiShield?
    I want to make, server use wishield and vb.net.
    there are several questions that will I ask to you.
    may you give me your e-mail address?
    many thank’s

  114. October 23rd, 2014 at 20:28 | #114

    @yudha
    Hi. You would need to be a bit more specific of what you are trying to achive with the WiShield.
    The WiShield together with an Arduino can indeed act as a server, hosting a webpage or keeping a UDP or TCP port open for communication.
    Regards Thomas

  115. yudha
    October 27th, 2014 at 15:17 | #115

    @Thomas Jespersen
    Hi sir, thanks a lot
    in my project, I want to make communication between arduino + wishield (as client) and laptop as server(Controller).
    this I give you a sketch what will I do.
    http://prntscr.com/509cpb
    the first I would like to make server using VB.NET like your project.
    Maybe you have idea for my project ? In server side, better using vb.NET or webserver ?
    thank you sir 🙂

  116. November 8th, 2014 at 23:02 | #116

    @yudha
    I have replied to your email. Please see me answer and proposal in there.
    Regards Thomas

  117. arian
    January 8th, 2015 at 06:19 | #117

    I am just curious im not so familiar with all the coding and etc. in short I suck in programming.
    My question is where is the code for the arduino software because you have to code first at arduino software right before making a controller at the visual studio which is already given. I am just curios
    where is the arduino codes for assigning the pins plss help… sorry if I sound like a novice but I am hehehehe hope you can read this and make a reply asap. Thank a lot in advance

  118. January 17th, 2015 at 22:56 | #118

    @arian
    Hi Arian.
    No problem with your question, please feel free to ask 🙂
    The Arduino source code is also provided in the downloadable ZIP file. Inside the ZIP file it is within the folder called ‘Project’ and the Arduino project file is named WiFi_Controlled_Car.pde
    Be aware this is an old Arduino code file format/ending so the latest versions of Arduino IDE’s might complain!
    Regards Thomas

  119. Enamul
    January 27th, 2015 at 06:58 | #119

    Dear, Please give me diagram . How attach all parts and how i use arduino and Visual Basic?
    Please help me. My email: enamulok@gmail.com

  120. February 3rd, 2015 at 14:42 | #120

    @Enamul
    I have no diagram of how to attach it. It depends a lot on the RC car you have, where to connect it and how to wire it up with your Arduino.
    I would start off by opening your RC car and find the control wires for the steering. Afterwards simply select some digital output pins on the Arduino to use.

  121. Suvam Mohanty
    March 21st, 2015 at 17:15 | #121

    Suvam Mohanty :
    I like your Project very much : but i just want to know that:-
    1. HOW does a arduino WiFi shield get connected to a WiFi ( after all connections are done) ?!
    2. What is the use of a TCP Port???
    3. After I start your ziped application i.e Form1.vb[design] , It gives an error that Socket Exception was unhandled ?! ( i have VS Premium 2012).
    4. How to import the application code or the Arduino code into the Arduino ckt ?!

    Looking forward for your earnest reply
    Thank You.

  122. david
    April 14th, 2015 at 22:55 | #122

    Arduino: 1.6.1 (Windows 8.1), Board: “Arduino Uno”

    In file included from g2100.c:38:0:

    config.h:44:1: error: unknown type name ‘prog_char’

    extern const prog_char ssid[];

    ^

    config.h:46:1: error: unknown type name ‘prog_char’

    extern const prog_char security_passphrase[];

    ^

    config.h:51:1: error: unknown type name ‘prog_uchar’

    extern prog_uchar wep_keys[];

    ^

    config.h:53:1: error: unknown type name ‘prog_char’

    extern const prog_char webpage[];

    ^

    config.h:54:1: error: unknown type name ‘prog_char’

    extern const prog_char twitter[];

    ^

    Error compiling.

    This report would have more information with
    “Show verbose output during compilation”
    enabled in File > Preferences.

    plz help

  123. April 15th, 2015 at 21:16 | #123

    @david
    As mentioned in a previous comment please be aware this the project is in an old Arduino code file format/ending so the latest versions of Arduino IDE?s might complain!
    Therefor I recommend you to download an older version of the Arduino IDE and try to compile the project again.

  124. david
    April 16th, 2015 at 02:05 | #124

    any interest in updating the code as im sure alot of us will have question concerning newer versions?

  125. April 16th, 2015 at 20:29 | #125

    @david
    That would require a newer WiFi shield, as the one used in this project is no longer supported nor updated.
    But yes, whenever I get hold of a new WiFi module I might make a similar project to this, adding WiFi for robotics control applications.
    Thanks for your suggestion.

  126. Scott
    September 24th, 2015 at 16:15 | #126

    Great application.

    Have you thought about doing this on a drone? What about the Yun or Nano?

  127. Nitesh
    February 18th, 2016 at 07:42 | #127

    hi Thomas,

    great project and this is what i was looking for many days.
    I have a some questions:-

    1. can we scale same thing to larger model.
    2. did u calculate the power consumption.
    3. what is the response time between the keypress on laptop and driving of car.
    4. will it be secured and how can be make it sure that no other hack it in local wifi

    i have some ideas to make the car which can carry items from one place to another but need it to control with wifi and also i want to test it out and put this thing in my organisation, not for sale but just to save some precious time.

    waiting for ur reply.

    Thanks,
    Nitesh

  128. February 20th, 2016 at 17:44 | #128

    @Nitesh
    Hi Nitesh.

    Thank you for your comments.
    The project could indeed be scaled to both smaller or larger models. But as this project has mainly been meant as a proof of concept neither power consumption, response time or security has been investigated.
    Though with the current implementation the response time from PC over WiFi to action on the car is atleast 500 ms. But this could be greatly optimized, though for performance and response time critical applications I would probably not use WiFi!

    Regards Thomas

  129. kojah
    March 2nd, 2016 at 05:10 | #129

    hello, in my country the wifi shield if not on sale. however, there is the nrf module. can it work instead of the shield. if so, then please elaborate.

    regards.

  130. March 3rd, 2016 at 00:21 | #130

    @kojah
    Yes, you can change the project to support the nRF24 module, but you would need to specify your own communication protocol and also add an nRF24 module to the PC, eg. over USB.
    Actually I think you would probably even get a better latency and reliability with an nRF24 module.

    If you are thinking about the nRF WiFi modules you would simply have to change the code to support the library made for this module/shield.

  131. SOHRAB GHAFURI
    May 23rd, 2016 at 15:10 | #131

    HI sir, can i get a step by step instruction on how to build and also the list of requirements with their model which has been used in this project? please, sir!
    here is my email sir! sohrab.khamosh@yahoo.com

  132. Abdallhameed
    February 26th, 2017 at 20:31 | #132

    Hi Sir
    your project is Fantastic and i like it,
    i have a project that is rc car and control on a car by using the glove and we have 2 weeks a go looking for an idea for making a connection between two arduino one the car and other on the glove and our problem is a connection.
    what i want to say we have an idea to make the connection by two RF module one is the transmitter and other is a receiver and if you can give me a short note about this connection and short note how it work if you can please sir.
    Thanks.

  133. March 4th, 2017 at 22:58 | #133

    @Abdallhameed
    Do you only need to transmit data in one direction? If so and if the data rate is slow (amount of data and refresh rate), then I will recommend to use a simple RF transmitter/receiver solution running in the MHz band. These would allow you to use eg. a Serial port for transmitting the data.
    Otherwise you can consider to use the inexpensive nRF24L01 modules running in the 2.4 GHz band. The requires an SPI connection for configuration and data transmission but will work fine with an Arduino for which you can also find existing libraries.

  134. Waseem Tahir
  1. July 5th, 2012 at 04:40 | #1