control wirelessly a light

Hello,

I am new to arduino, and i want to connect an arduino board to a light, so that i can control the light through my wifi network (through my computer and in the future through a mobile application). I saw that there is the Arduino WiFi Shield, but i wanted to ask you guys, just to make sure that it can do the job. The basic functions that i want to have is ON/OFF, dimmer and hourly program.

Also, what can be the switch that will open and close the 220V circuit? Is this another piece of hardware that i must use?

Any advice will be appreciated!

Note that anything involving electronics wired into the mains can be potentially dangerous because any design fault or hardware failure could lead to mains voltages being applied to low voltage circuits. This is the sort of thing that could easily kill you, or some unwary person years down the line. Making it work is not difficult. Making it work without any possibility of danger is much harder.

Wifi controlled plus ON/OFF, dimmer and hourly program.

That's a lot of stuff...

on/off is handled by digitalWrite(), dimmer by analogWrite() (you need to use a pwm-enabled pin), hourly programs need an RTC and a fair bit of coding if you want the user to specify on/off/dim times.

All of this can be implemented and verified just by driving an LED. Moving to an actual 220V lamp can (and IMHO should) be done later.

You can't just PWM mains voltage AC. You need specialised hardware which switches at the correct points in the AC cycle. I suspect you would find more information about this in the Motors, Mechanics and Power section of the forum.

PeterH:
You can't just PWM mains voltage AC. You need specialised hardware which switches at the correct points in the AC cycle. I suspect you would find more information about this in the Motors, Mechanics and Power section of the forum.

Don't they have externally controllable dimmer switches out there though?
http://www.homedepot.com/buy/lutron-maestro-ir-600-watt-single-pole-digital-dimmer---white-mir-600thw-wh.html#.UOG6HazPJyU

Something like that would be the actual light controller. And then your arduino would be used to hack the remote (which actually sounds like a tadbit of fun in and of itself)

This would prevent an inexperienced person from playing with mains power (could just have an electrician come and put the dimmers in) Then he could go to work on the remote itself which is probably a 3v unit. The mains is taken care of. And then he just uses the arduino to tell the remote to dim the lights or turn them off and such.

Thanks a lot for your replies. Sure, it will take a lot of tests before i integrate mains. But my main question still exist: is this board (Arduino WiFi Shield) suitable? Can it handle any task through the wifi network?

tsiros:
Thanks a lot for your replies. Sure, it will take a lot of tests before i integrate mains. But my main question still exist: is this board (Arduino WiFi Shield) suitable? Can it handle any task through the wifi network?

It's sutitable to receive and translate the commands, but you'll still need additional hardware to control the light.

tsiros:
Thanks a lot for your replies. Sure, it will take a lot of tests before i integrate mains. But my main question still exist: is this board (Arduino WiFi Shield) suitable? Can it handle any task through the wifi network?

Yes a wifi shield will do most anything youd want through wifi. however you WILL need an arduino to connect it to, you cant operate the shield just by itself.

ok, thanks!

But my main question still exist: is this board (Arduino WiFi Shield) suitable?

The Arduino WiFi shield can connect to an existing WiFi network, if the encryption/security allows that to happen. The Arduino WiFi shield can not CREATE a WiFi network that other devices can connect to.

An Ethernet shield is far easier to connect to the network, make externally addressable (by any web access device; not just those in your network), and to get functioning. And, it’s cheaper.

Unless you are unable to run an ethernet cable from the router to the Arduino connected to the light, I’d start with the Ethernet shield, to learn about networking, IP addresses, port forwarding, forward facing IP addresses, and client/server architecture, without the hassles of wireless on top of all that.

When you get the light working from any computer in the world, then you can think about making the connection between the router and the Arduino wireless, if you are still sane/interested.

Have you thought about using an existing solution for this? Googling for “X10 light” turns up a large number of hits, and the prices don’t seem exorbitant (compared to Arduinos and shields and whatnot).

If you use a home-brew WiFi based solution you will need to watch out for scalability issues. It’s common for a domestic WiFi access point to only support a dozen clients or so, and some don’t even support that many.

I have done my own light in a similar fashion, just much more simple. First turn the fuse off, so you don't get hurt. The open the switch on the wall. That's quite simple. There's a panel, just prize the panel off with a screwdriver, then you can unscrew the switch. Then unscrew the wires from the switch and attach a relay. You can drive the relay with a transistor or MOSFET.
PS don't forget to add protection diodes just in case.