AC PWM Dimmer/Fan speed controller - Page 1
Forum section: electronics / beginners

author: FrankT
author_rank: Regular Contributor
timestamp: June 11, 2015, 08:56:02 pm
content: I need an AC fan speed controller/dimmer that I can control from a microcontroller (PWM).This (https://www.tindie.com/products/thewp122/ac-60hz50hz-phase-controller-dimmer-board-arduino-compatible-2/) would be ideal, but no stock.First question - does anyone know of another similar product - isolated, control of 230vac? Mains voltages scare me so I'd rather not play with AC if I don't have to.Otherwise, I was going to build my own, based onhttp://playground.arduino.cc/main/ACPhaseControlcircuit to detect zero crossings and control a triac.My question is about driving the LED in the zero crossing detection part - the current limiting resistors will dissipate a lot of heat. Is there a better way of doing this? If not, when calculating the current limiting values, do I use the AC RMS value of V, or the peak value?Thanks,Frank

author: PSR B1257
author_rank: Frequent Contributor
timestamp: June 12, 2015, 02:56:22 pm
content: QuoteWhat type of motor?What nominal power?QuoteR1 and R2? Well, about 1W each isn't terribly much I guessQuoteOf course! Power will never be calculated of some peak value.QuoteDig In and Dig Out are obviously swapped in the schematic.

author: Richard Crowley
author_rank: Super Contributor
timestamp: June 12, 2015, 03:38:01 pm
content: PWM is a great way to control DC power. It is not really suitable for controlling AC.But a specialized form of "PWM" called "phase control" is ideal for controlling AC.The Arduino page shows the basic circuit and code for proper AC phase-angle control.The amount of power dissipated in the zero-detect current limit resistors seems like a non-issue.In order to make everything safe and avoid dealing with mains power/voltages, I would use a solid-state relay (SSR).Note that most SSRs have built-in zero-crossing sensors and cannot be used for phase-angle control.So you need to be sure to get a "random-fire" SSR which will turn on at any point through the cycle.For example....http://www.ebay.com/itm/Dual-Solid-State-Relay-SSR-4-15VDC-Input-280VAC-40A-D2440D-10-Random-Turn-On-/291022957824

author: Richard Crowley
author_rank: Super Contributor
timestamp: June 12, 2015, 03:41:38 pm
content: Quote from: PSR B1257 on June 12, 2015, 02:56:22 pmWell, it depends on which end you are viewing it from.The labels are correct from the POV of the circuit.As shown, a digital output from the Arduino would connect to the "Dig In" of that circuit.And the "Dig Out" would connect to a digital input on the Arduino.

author: LukeW
author_rank: Frequent Contributor
timestamp: June 12, 2015, 04:27:23 pm
content: Here's an example of a zero-crossing detector.http://www.dextrel.net/diyzerocrosser.htmI think you've got the right approach - build a zero-crossing detector circuit that is safe and galvanically isolated from the mains, with appropriate creepage gap under the optocoupler on the PCB, etc.Then build a triac-firing controller, using a power triac, a MOCxxxx optical-fired triac, etc, again using sensible layout so it's safe and galvanically isolated.Then, bring the isolated "cold side" signal from the ZCD optocoupler output into your microcontroller board (eg. Arduino, or whatever you like, which is a completely safe extra low voltage domain, isolated from the mains) as well as bringing the triac control signal out to the optoocoupler LED in the triac control circuit. Then have a muck around writing software for phase-angle control

author: Zero999
author_rank: Super Contributor
timestamp: June 12, 2015, 06:18:46 pm
content: PWM for AC is not suitable for motors. When PWMing AC, the minimum on time is half a cycle, which means if you want to control the power in steps of 1%, the PWM frequency will need to be 1Hz for 50Hz mains. PWM is only suitable for heating when the thermal inertia for the heating element smooths out the variations in power.You need phase control. For safety sake it needs to be isolated from the mains. It's best to power it from a transformer, that way the lower voltage AC can be used for zero crossing detection.

author: FrankT
author_rank: Regular Contributor
timestamp: June 12, 2015, 09:29:50 pm
content: Thanks for the replies.This is for ac fan speed control - 40W. I don't know the exact motor type.I should have been clearer with the PWM description - I meant PWM into a microcontroller to define the % AC output - then get the microcontroller to do the phase control - like the schematic I linked to, but with the micrcontroller as part of the module.Do I need to put a cut in the circuit board to isolate the AC? I'll be using DIP packages - are their pins far enough away to not need a cut?

author: LukeW
author_rank: Frequent Contributor
timestamp: June 13, 2015, 06:48:35 am
content: If you have a DIP optocoupler, and you have no tracks under the optocoupler at all, no pours, and you have the PCB traces that come in from the outside on each side and stop when they reach the optocoupler that's probably a good start, that much creepage distance is probably acceptable.If you're professionally fabricating PCBs, adding a milled slot under the optocoupler "boundary" may add nothing in terms of cost, so you might as well - need to check your design rules and requirements for that particular board house though.

author: TJ232
author_rank: Frequent Contributor
timestamp: June 13, 2015, 11:41:29 am
content: Quote from: FrankT on June 12, 2015, 09:29:50 pmIf is a small 40-50W one, might worth to take a look here:MAINS Power Dimmer/Switch module explained

author: Zero999
author_rank: Super Contributor
timestamp: June 13, 2015, 01:36:29 pm
content: This kit should be able to work from PWM. It's designed to be controlled from a variable DC voltage but there's a low pass filter on the input which would convert PWM to DC.http://www.apogeekits.com/advanced-electronic-kits/dc-light-dimmer-k8064.htmhttp://www.apogeekits.com/PDF_Files/Light_Dimmer_Manual.pdf

author: dgdimick
author_rank: Newbie
timestamp: June 14, 2015, 08:46:37 am
content: Frank,Are you thinking about a variable speed controller, or something with like a Hi, Med, Low, and off?Also what are you trying to cool with the fan?-Denis

author: FrankT
author_rank: Regular Contributor
timestamp: June 16, 2015, 02:18:37 am
content: Quote from: dgdimick on June 14, 2015, 08:46:37 amFull PID control to keep an air-compressor-in-a-box cool (sound proofing). Two fans blow air over the motor and pump. Multiple thermometers to watch motor, pump and box temp. Current sensor to determine when the motor is running to monitor run time and next scheduled service. Arduino + LCD. Display only - I can't think of anything that I need to control.

author: picandmix
author_rank: Frequent Contributor
timestamp: June 16, 2015, 08:36:40 am
content: Before going to the trouble of building your own opto/triac circuit why not try the fan on one of the household light dimmers you can buy from any diy store for a few dollars.Find they work ok on some fans but not others...If that does not work, then why not use some DC fans instead, much easier to control with pwm.

author: johansen
author_rank: Super Contributor
timestamp: June 16, 2015, 08:46:28 am
content: Quote from: picandmix on June 16, 2015, 08:36:40 amand so much more efficient and quieter.

author: FrankT
author_rank: Regular Contributor
timestamp: June 16, 2015, 08:26:22 pm
content: Quote from: picandmix on June 16, 2015, 08:36:40 amYes, that was the first thing I tried. All good.DC would have required a separate DC power supply, and I'd have to buy some beefy DC fans - I got the AC ones cheap from a surplus store.