Making a reliable ceiling fan regulator

Commercial ceiling fan regulators have been extremely unreliable. While the older ones used triacs, the newer ones merely use a combo of capacitors to divide the voltage being supplied to the motor. If the capacitors are not of excellent quality they will fail resulting in poor speed control. This I have observed happening, but never got around to analysing the capacitor failure mode.
In the case of triac speed controllers most use a 600v Peak Inverse Voltage (PIV) rated triac. PIV is the voltage that the triac can withstand without failure. The mains voltage is 325 Vp. Given that an inductive load is being driven, one should expect a substantially higher momentary back EMF, especially if the firing angle of the trigger pulse is 90^o or 225^o. Consequently a higher rated triac would prove to be more reliable. Also the triacs used seem to be of dubious origin.
Additionally a major irritant is the fan running at a speed set appropriately as per ones comfort and depending on the ambient temperature. As the temperature drops and as our body cools down in the night one often needs to wake up and turn down the speed. this is irritating even during daytime and thoroughly disgusting in the night.

I have long been thinking of making a microcontroller based fan controller. Adding a temperature sensor would be a great boon. I had made a regular triac controller in my old home that worked for 14 odd years, until we left that house.
After the umpteenth failed controller I finally got around to designing one.

2 Likes

Here is the schematic pdf.
FanControl.pdf (40.4 KB)
Metastudio does not allow .sch, .pcb, .net, .gbr, .drl files. Lets flag the admins and see if we can change that. @admins

1 Like

image
Here is a screen shot of the schematic.
The powersupply consist of a ironcore transformer T1, D1 bridge diode, U2 78L05 linear regulator C1 and C2 capacitors. I have to add 2 ceramic caps to filter out high frequency noise.
The transformer is bulky. Cheap mains powered control circuits use a capacitive divider to reduce costs and bulk. However this is poor practice due to no isolation from mains for the micro and rest of the electronics, it is also a electrocution hazard. Two additional diodes D2 and D3 alongwith the internal diodes of the bridge form a zero crossing detector with transistor Q1. When input voltage is below .6V the transistor stays off. This happens near the zero crossing point. When the voltage rises above .6V the transistor conduct and the collector will go low and remain low until the next zero crossing point. Thus we get a series of high pulses at every zero transition of the AC mains. This pulse is fed to PB3 (pin2 of the Tiny13). The pin is configured as an interrupt pin and will generate an interrupt every 10 ms.
R9, RV1 and R10 provide speed control. The wiper of the pot is connected to pin3 the ADC of the micro. The firing angle will be determined by the position of the pot. LM35 is connected to pin 2 also configured as ADC (error in schematic). This will change the speed depending on the temperature. An over ride button needs to be added. A few LEDs to indicate on and override would also be needed.
The trigger pulse is fed to MOC3020 opto triac . This is an optically isolated triac that is triggered when the internal led is turned on. This is connected to gate of Q2 BT136. R5, R6 R7 and C3 form the snubber circuit to quench high voltage spikes generated when the firing angle is not at 0^o. 3 resistors are used because the resistors are rated for probably 125 volts. A single resistor will arc and fail as the peak mains voltage is 325 volts.
Phase angle control waveforms
image
Image from https://www.philadelphia.edu.jo/academics/mlazim/uploads/chapter05.pdf with a whole lot of interesting information.

A second technique to control speed is integral cycle control. In this method we turn on the power a few cycles then turn it off for a few cycles. The fan speed will vary as per the ratio of the on time to the cycle time t_{on}/t_{on}+t_{off}. If we take 10 mains cycles as our total period our speed will change by 10% per cycle. The advantage of this method is that we can switch the triac on /off at the zero crossing point. This results in nearly zero Radio Frequency Interference due to there being no steep rise or fall in current and voltage. This steep rise/fall is denoted by {d_i/d_t} for current and {d_v/d_t} for voltage.
The circuit in the previous post remains the same. Only the software will change. We could also use a zero crossing opto triac which will simplify the code a wee bit.
We should take care to switch off only on even number of zero crossings. Ie if our triac turn on is considered the zeroth zero crossing pulse we will switch off at either 2, 4, 6…18. Remember we have 2 zero crossing pulses per cycle - 20 pulses for 10 cycles. If we switch off on an odd pulse, we will have a half cycle ie 325 VDC. Having a DC component in an AC motor appliance is bad. It will damage the appliance. In our case it will result in heating of the fan and eventual failure. Integral cycle control does produce a small residual DC even when the above condition is met, however it is below 1.5%.
image
Image from https://www.philadelphia.edu.jo/academics/mlazim/uploads/chapter06.pdf. This link provides a very detailed explanation with a whole lot of trigonometry for those interested in knowing all the maths in a humble ac motor.

3d rendered view
FanContro-3d

Board layout
FanControl-brd

Now to make the pcb. Either by toner method or by ye old hand drawn on copper clad.
Then write the code.

1 Like