Instructables
Picture of Cheap and Easy Arduino Wi-Fi Hack
Layout 2.jpg
Ethernet Module.jpg
Wifi Module.jpg
I was sitting around and messing with my Arduino UNO and an ENC28J60 Ethernet module, and thought to myself it would be cool to have a Wi-Fi shield, when I realized I did not have to buy a shield as I had the components and all I had to do was hook them up together ( pure intense light bulb moment!!).
When I travel carry a small Wi-Fi router to use in hotel rooms (TP-Link TL-WR702N) which is a 150Mbps access point, I remembered that it could be configured as a client among other modes it has.
I reconfigured it as a client and assigned an IP number checked I could access it over my home Wi-Fi network , by plugging into a desktop’s LAN port, also checked that it had  access to the internet .

I then plugged the TP-Link TL-WR702N into the ENC28J60 Ethernet module and the UNO and ran the etherShield web switch example which came with the etherShield library and it worked. The router runs of 5 volts via a mini USB connector which works out well with the Arduino.

I live in mainland China and this whole experiment cost me about US$20 for the ENC28J60 Ethernet module and the wireless router, I checked up on the local prices for an Arduino Wi-Fi shield and it was between US$45 to US$80.
Once I figure out what my final project will be I might splurge and buy a real Wi-Fi shield for it, till then this serves my purpose albeit a bit messy with the wires.

Any and all feedback is appreciated, I will try and answer any questions if any.
janisalnis2 years ago
Like your idea very much.
I tried WR703N and Arduino with USB, saving ethernet shield.
OpenWRT WiFi client config had to do in text editor without webinterface.
http://www.instructables.com/id/How-to-set-up-OpenWRT-on-a-pocket-router-WR703N/
hawth331 year ago
I found this and am trying a wireless setup using the arduino ethernet and the same router. Can you point me to the "etherShield web switch example which came with the etherShield library"? I cannot seem to find it. I guess i am just confused on how to get the arduino to actually connect to a wifi connection once the router is in client mode.
ddoss (author)  hawth331 year ago
Hi, If you look in the examples folder on the IDE ( once you have installed the library ) it's called webserverpde .
Change the ip address according to your wifi router static uint8_t myip[4] = {192,168,0,15};
static char baseurl[ ]="http://192.168.0.15/";



ddoss (author)  ddoss1 year ago
I have mentioned below about an excellent tutorial for the ENC28J60 in 8 parts
http://www.lucadentella.it/en/category/enc28j60-arduino/
IDE21 year ago
Hi ddoss

Thanks for posting this project.

I’m using Arduino Uno R3, Ethernet shield and TP-Link TL-MR3020 (switch at WISP mode). I’m having trouble connecting.

There are 3 types of connections: PPPoE, Dynamic IP and Static IP. Which one did you use? How do you figure out what IP address to use in the Arduino pde program? I’m using the Arduino 23 IDE.

Thanks in advance.
iamseer2 years ago
ENC28J60 is totally unnecessary and it is wasting Arduino's computation power. Just connect your power supply to router and connect USB from WR702 to Arduino will establish serial connection. OpenWRT is the best choice to deal with internet access issues.
Dear @iamseer & @ddoss, can you plz tell how to connect arduino UNO to wireless router directly wothout ethernet shield?.i can not find any USB compatable port in router. I have already http://www.dlink.com/us/en/support/product/di-634m-wireless-108g-mimo-router. Any link or suggestion? Sorry i am new to wifi field. thanks
ddoss (author)  rajusaleem1 year ago
@rajusaleem , Please check Janisalnis's instructables ( http://www.instructables.com/member/janisalnis/ ) he has had luck with the Arduino and serial connections. I do not have any experience with the router you have and checking the link seems dlink stopped support for it in 2008 , as suggested before invest in an Ethernet shield for the Arduino and save yourself a lot of trouble . best of luck on your quest .
thanks ddoss .. i have already ENC28J60 shield and am working on. I just asked for more info., may be if you know about that.. Well i also found an other ethernet shield http://digipak.org/zencart/index.php?main_page=product_info&cPath=5&products_id=170. i think it could also serve this purpose and more than this..
ddoss (author)  rajusaleem1 year ago
Hey Man, If you reread my replies I have given you links to information sources , there are differences in both shields such as the price for starters, the W5100 has a full TCP/IP stack and interface , but the ENC2860J does not and needs you to implement a TCP/IP stack in the software , search the Arduino forums and google it there is a lot of useful information there to help you get your project up and running with either of the Ethernet shields.
ddoss (author)  iamseer2 years ago
I did reply but for reasons unknown it's down at the bottom of this thread.
Apr 30, 2012. 1:28 AM

Point noted , I would have if I could have , the WR702 uses the AR9331 chipset. which is not supported by OpenWrt for one , secondly the onboard USB is only available as the power port for the router.
I will be cracking open the case in the near future to see if I could access the serial port connections
@iamseer, while your tone is annoying, you're almost correct. For anyone else interested in saving a couple extra bones, check out the tl-wr703n (this instructable uses the the tl-wr702n...pay attention *702* vs *703* !!!!)

The cheapest "wifi shield" hack I've found thus far is a Neewer 150M mini Pocket Wireless Router ($17) + the mentioned ENC28J60 (~$6) for an end cost of ~$23. The 703n is closer to $30.

See the OpenWRT wiki page for the 702 to see why it's not supported.
Elac.1 year ago
Really cool instructable.
One question, I have a WR703 on the way with DDWRT firmware pre-installed.
Do I have to flash OpenWRT or will DDWRT work?
ddoss (author)  Elac.1 year ago
Thanks, it should not matter which firmware you have , as long as your device can be configured to a client mode via the firmware ui .
I have no experience using either DDWRT or OpenWRT on the WR703/702
Elac. ddoss1 year ago
Ok, client mode is an option in DDWRT.
Thanks for the reply ddoss.
rajusaleem2 years ago
nice idea.. :) I like it. but can you please tell me will this approach work properly for controlling LEDs/Appliances through wifi from Android Mobile..???
thanks
ddoss (author)  rajusaleem2 years ago
Hi , Yes you can control LED's and Appliances with Wifi /Arduino and an Android device.
Here is a neat starting point for the Arduino and ENC28J60 Ethernet module , well written tutorials in 8 parts , the control is via a webpage from any web enabled device http://www.lucadentella.it/en/category/enc28j60-arduino/

Also Janisalnis ( http://www.instructables.com/member/janisalnis/ ) has written some instructables on home automation
You should look into these.

thank you so much for reply... Actually i don't want to use internet connection or GPRS from mobile.. i.e i want to create LAN network from these components that will be free of daily charges to the end users...

More can you plz guide me that how can i use the Wifi functionality of Bluetooth mate gold https://www.sparkfun.com/products/9358
to control LEDs through wifi??... can it be possible ?? i have already used this Bluetooth mate gold to control LED's via bluetooth.. :)
ddoss (author)  rajusaleem2 years ago
Sorry buddy you cannot use your bluetooth dongle as a wifi device.
Thanks sir but the links you provided are little confusing to me. i want to actually find alternate for
http://www.gadgetnate.com/2011/07/03/control-leds-over-the-wireless-network-using-arduino-and-wishield
ddoss (author)  rajusaleem2 years ago
Hi Man,
As much as I would like to help you , I'd suggest you first get yourself an Ethernet module/shield wired or wireless the follow the tutorial on the first link I gave you
( http://www.lucadentella.it/en/category/enc28j60-arduino/ ) the tutorial is written in a easy to understand manner , follow the examples there understand each of the tutorial's before jumping to the next., if there is something that is confusing in the new tutorial go back to the previous one's and re-read them , don't copy and paste the code from the page's ,manually type it into the IDE .
If you still have a problem search the web and on the Arduino Forum http://arduino.cc/forum/
Having said all the above I hope you have understood the basics of an Arduino.
sudopeople2 years ago
FYI, for those trying to get the ENC28J60 to work with a simple(r) library, check out EtherCard on github. It's much more straightforward than the nuelectronics library and it's actively supported - it works with Arduino 1.0+


...another note. I used the Neewer 150 Mini Pocket WiFi router in reverse mode (WiFi switch on the device) and was able to get the Arduino serving a simple web page after a lot of fail trying to make it connect to google.

It's pretty damn convoluted but it works.

I don't recommend this project for beginners...I support and develop the full LAMP stack for a living and I've got a gnarly headache from this undertaking.
As already requested to ddoss I would like use this mini wifi router: http://www.ebay.com/itm/180933254938

It seems identical to the neewer one:
http://www.ebay.com/itm/261062999542

Have you used the latter ? Why it should be so difficult ?

As far as I understand you have to configure the device as client so it gives wireless capability to the ethernet shield (or module, either ENC28J60 or W5100).

Maybe am I too optimistic ?
amaze12 years ago
Hi ddoss
Nice hack !
Do you think ANY wifi router configurable as client will do the job ?
This one for example: http://www.ebay.com/itm/180933254938
ddoss (author)  amaze12 years ago
Hi , I am pretty sure that if configurable as a client ( like a wifi card for laptop would act) it would work.
I looked at your example link and the data there does not suggest it could be a client.
amaze1 ddoss2 years ago
On the photo you can see a slide switch on the side with the "RT-Client-AP" indications:
http://img2.dib-bid.com/gallery/mini-3-in-1-wireless-pocket-router.jpg
but indeed I'm not so skilled on Wifi to understand ...
ddoss (author)  amaze12 years ago
Hi, Theoretically the switch is labeled to allow the module to act as either one of these modes I can't be sure about this in situation, did a quick google on the model and could not find any data sheets , sorry man that's the best I can help you with ....
Noticed that on ebay they are selling the TP-link TL-WR702N on average for about 22$ .
wilsonjc2 years ago
As i understand it theTP-Link TL-WR702N has a serial port inside that if set up right could be connected to the Arduino. another way to connect it to the TL-WR702N would be to install drivers for a serial usb dongle on the router and connect the Arduino to that. that should be cheaper and wont require any Ethernet stack etc software on tha ardurino.

cheers.
janisalnis2 years ago
Your approach using Arduino webserver is more reliable compared to serial communication. I experience problem that after some days of continuous operation Arduino serial port communication to router simply crashes.
diy_bloke2 years ago
interesting article.

Could not help wondering though: why you carry a router to hotels? To use more than one appliance in case there is only LAN and no WLAN?
ddoss (author)  diy_bloke2 years ago
I use multiple devices, a laptop and smartphone. WLAN is available in larger hotels in cities and not in some of the little towns I have to visit.
diy_bloke ddoss2 years ago
Thank you for settling my curiosity
Cool. You can do the same thing with say a computer or a laptop that does not have wireless.
ddoss (author)  Computothought2 years ago
You sure can. you could also have a couple hooked up as repeaters at blind spots around your place.
How did you wire up your ENC28J60 to your Arduino? I've got that exact same shield and I can't get it to do anything more than light up a link light.
ddoss (author)  IOwnCalculus2 years ago
I have attached a jpeg of my wiring which works with the examples which come with the etherShield library http://www.nuelectronics.com/download/projects/etherShield.zip
Ethernet Module Pins.jpg
Thank you so much, I think I had most of those but wasn't sure on whether or not RST or INT needed to be hooked up. Trying to use it to make a box that will ping an address, and if the ping fails, reboot my modem.
ddoss (author) 2 years ago
Point noted , I would have if I could have , the WR702 uses the AR9331 chipset. which is not supported by OpenWrt for one , secondly the onboard USB is only available as the power port for the router.
I will be cracking open the case in the near future to see if I could access the serial port connections .