Control AC fan speed using microcontroller

controldigital potentiometermicrocontrollermotor controller

I have been trying for a long time to digitally control the fan speed and light intensity of a dimmable LED bulb, but I am not able to. Basically I want to replace the mechanical potentiometer with a digitally controlled resistance. I have tried every possible dimming solution.

  1. Replacing the mechanical pot with LDR and varying its resistance by illuminating it with LED in closed tube. It's not at all a good & stable solution and the arrangement is difficult to replicate (the output fluctuates greatly).(commercially available solution is very costly)

  2. Cutting a portion of AC waves by detecting zero crossing with the help of a micro (ATTiny). It gives a flickering output when a dimmable LED bulb is used.

  3. Thought of digital potentiometer arrangement, but the voltage that comes across the mechanical potentiometer in a triac dimmer circuit is around 180V when the pot's at the highest resistance level of 300KOhm (The AC supply voltage in my country is 240V). It is well above the digital pot's max recommended voltage of 5V (Vdd) across the variable resistance legs. Can anyone suggest a digital pot that can be interfaced with a 5V micro and can withstand the voltage in a triac dimmer circuit. Is there any other solution to digitally control a resistance. I am willing to achieve this within 3$.

Is there any other better way to do it? Please help.

Best Answer

Solution 2 should have worked, I think you've implemented it incorrectly. This is what I would try: Where I live there are dimmers with a rocker switch (a pair of push buttons actually). See if you can get one, open it and check the voltage across the button (be careful). If it's low try to short it with an active device like a transistor. If it works add a micro to control the transistors.