In this instructable I am going to show you how to control your Arduino over WLAN. I am currently using it to control my room lights. This instructable is similar to my previous one.
I choose to use my WLAN because I want just people connected to my network to be able control my Arduino. It is possible to implement a way to give different control access to people depending on their mac address or their user name through user authentication system (I won't talk about it in this instructable).
The materials I used were:
- 1x Arduino Uno
- 1x Ethernet Shield (w5100)
- 1x Dual Channel Relay (5v)
- 1x Ethernet Cabble
I stored my circuit within an topware, since it is going to be in my bedroom and I don't want to take any risks. =)
Step 1: Getting WLAN or LAN Data
In order to run the sketch we need to get some data from your LAN router. I will show how to do it in windows OS:
1. open windows command prompt (search for "cmd" on your windows search bar and hit ENTER)
2. type ipconfig /all (exactly like I wrote it) and hit ENTER
3. some info will be printed, scroll up and look for your Wireless LAN settings (or your LAN settings if your are connect via LAN)
4. take note of your DHCP server ip, it usually looks like something like 192.168.x.x, mine is 192.168.0.1.
Step 2: Download, Change and Upload
You will find the sketch I used attached, it uses an Ethernet Shield (w5100) but you may be able to change the coding to whatever communication your Arduino might have with the internet.
1. Download the sketch
2. In line 13, change the gateway to your DHCP IP from step 2, mine is 192.168.0.1
3. in line 12, change the ip based on your DHCP IP from step 2, changing the last number after the last periods. I used 192.168.0.55
4. upload the sketch to Arduino and plug everything in
NOTE: to change the gateway and ip fields use commas and not periods
Further more, I will put my web page online so I can control my room lights from around the world. I will show you how to do this in another instructable.
Step 3: Playing Around
Once the sketch is upload and everything is set, you are good to go.
In your smartphone or computer open a web browser and type the Sketch's IP in the navigation bar, in my case it's 192.168.0.55, it will load the web page and you can control your things. In my case I am controlling the lights and the lamp in my room.
Hope you like it!