How to control a Ceiling Fan? (edit!)

Hi guys,

is there anyone out there who could give me some hints on how to control a ceiling fan with my arduino? For controlling I mean turning it on and off (which could be done just with a simple relay, right?) but also controlling its speed. I am not sure how to handle this, as I've never worked with 220 volts "devices" before..

I just changed the title of the post cause it could have been misleading as I am asking how to do this, not telling it! Please let me know if you have any idea about this. It could may be even not using arduino, I don-t know! Thanks a lot

Are you planning to have a control for you to set the speed? Perhaps a knob you can turn to set the speed with a switch to toggle it on/off?

I've never worked with 220 volts "devices" before

Meddling with 220Vac isn't safe.
You need help from a qualified electrician. If the fan speed can be controlled, they can install a switch with a "dimmer" kind of control that will set the speed. An Arduino, or other microcontroller is not the way to go.

Pete
[edit] P.S. Like your name

it can be done. here is a project that used a PIC, but could substitute an arduino:

(PeterH) Yes, I am planning on controlling the fan speed. The second part of this project will include a iOS app so everything would probably be controllable via a mobile device.. but for now I would just be happy to control it by remote, yes probably with a knob.

(brucethehoon) thanks a lot for the link. that looks really good but I wouldn't know where to start "converting" that to arduino. have you tried something similar yourself?

Also, a friend suggests I could use a Dimmer Rack with a DMX controller.. that's the cheapest I found but yes it's still pretty expensive: DJ Equipment, Professional Audio and Lighting Equipment | UK DJ but it could be pretty easy to interconnect the DMX with midi, so with a computer.

What you guys think about this? I need to decide asap! Thanks to everyone again

i'd use moc and triac! you could then control the fan with simple analog write code aka PWM with speed control and everything. the scheme is really easy too :slight_smile: use a moc3041, and some triac(how much current does the fan draw?) maybe the popular BT139 series?

http://kubuntu.free.fr/wiki/data/fp/moc3041.pdf
http://www.nxp.com/documents/data_sheet/BT134_SERIES.pdf (to see the BT139/138/137/136/135 just change BT134_SERIES.pdf in the line to BT139_SERIES.pdf etc)

scheme: http://www.tradeofic.com/uploadfile/ic-circuit/2009713212017176.gif
or
http://images.elektroda.net/0_1257514629.jpg
they are for a moc3011 but it is the same pinout. one is resistive (like a LED), one is inductive scheme(like your fan)

Thanks to everyone for the help. I am gonna try setting something up during this weekend and I will update the post after hand..

I think you could probably make your own chopper style dimmer, or buy a commercial one, and I don't see why that couldn't be controlled by the Arduino (it'd need somebody cleverer than me to design it, though).

As a low tech alternative, my fans have several speeds selected by a pull cord and I assume there's some sort of switch to connect different combinations of coils in the motor. That sounds like something that would be highly amenable to being controlled by some low tech relays. If you think you could get away with 3-4 distinct speeds rather than continuously proportional, maybe that would be an option?

I've no idea how to control A.C but maybe you can use a servo to manually turn the regulator (The knob which is used to manually set the speed.).
This method is not so feasible, but if you can afford a servo, then maybe it's safer. If you wish to go by this method, then be sure to get a regulator(not sure if it's the right word) which doesn't need much force to turn so that the servo doesn't have problems turning.