# Need advices on an AC fan control circuit

I've setup a small system where I can control an AC Fan by a data-acquisition board's DAC. Here is my final schematics(please left-click to enlarge it):

The first issue was to hack the manual speed controller which powers and controls the speed of the AC fan. And thanks to @transistor, I could achieve it by soldering an LDR in parallel to the potentiometer and optically varying LDR's value by varying LED lights. I experimentally made it work which means I was able to control fan's speed by adjusting LEDs current by a power supply. Here was the relevant question: Controlling a single phase AC fan with a 0-10V DC input

But then the second issue was that the DAC was not able to deliver enough current to LEDs(this DAC can output max 5mA current in 0 - 10V DC range). This issue was solved by adding a voltage follower and a transistor as seen in the above schematics. Now I was able to control the speed of this fan via the DAC.

And finally the problem was that this type of fan and controller was not able to totally stop rotating unless someone manually switched it of from the controller's mains switch. Therefore I decided to add a solid state relay and set it up such that under around 400mV DAC output it should switch the speed-controller hence the fan off. You can see this under the Comparator in the schematics.

Speed_controller circuit and the AC_Fan parts of the schematics is irrelevant to my question and they are just representative since they are complicated to draw and I have no schematics of these units.

When I simulate I can see the behavior I want from the system. The comparator switches to around 11V when the DAC signal is more than around 400mV and the relay turns on; and since now the speed controller is powered, the fan speed can be controlled by the LED current.

My questions are:

1-) Is my non-inverting comparator good enough? I mean do I need some extra caps around any nodes? R2 and R3 sets the threshold, but are they okay in values? Do I need a pull-up resistor from the output to the Vcc?

2-) I haven't experiment the final circuit and haven yet bought the relay. Do you have any suggestions regarding inrush currents, decoupling caps or any safety issues or anything related?

3-) And finally, is there a way to separate AC neutral and GND in LTSpice? You see in my circuit it doesn't represent the real life scenario since AC neutral is ths same with GND in my schematics.

I would be very glad to have your opinions before I set it up for use.

## Info about the components and the equipment:

Two LM324 is used for voltage follower and a comparator

Transistor is an NPN BC547B

Green LEDs

A 300k LDR

This is the relay I'm going to use: http://uk.rs-online.com/web/p/solid-state-relays/0346895/

The data.acq board: Controlling a single phase AC fan with a 0-10V DC input

edit:

• One minor suggestion: Since you have 12 volts available for the LEDs, why don't you put them in series instead of parallel? If the diode drop of the three do not match, they will not share current evenly, and the one with the lowest voltage-drop would hog the current. With them in series, they would also consume one third of the current for the same brightness. You also don't need the 220 ohm resistor because the current is regulated by your opamp. – Mark Apr 29 '16 at 20:41
• I would choose U2008B circuit, it is made for phase angle control of motor (or lamp,..). The setpoint can be transmitted from MCU with PWM over opto coupler. – Marko Buršič May 1 '16 at 10:22

1-) Is my non-inverting comparator good enough? I mean do I need some extra caps around any nodes? R2 and R3 sets the threshold, but are they okay in values?

You need power supply decoupling capacitors, 100 nF, close to each chip. Those reference resistor values look fine.

Do I need a pull-up resistor from the output to the Vcc?

Figure 1. LM324 innards showing both a pull-up and pull-down transistor.

A quick look at the LM324 datasheet shows that it has strong pull-up to V+ by Q6 and a strong pull-down to V- by Q13. It doesn't need a pull-up resistor. Note, by the way, the Q5-Q6 Darlington arrangement: this can never pull closer than two diode drops away from V+. The arrangement around Q13 is different and the datasheet says Large Output Voltage Swing 0 V to V +/−1.5 V.

2-) I haven't experiment the final circuit and haven yet bought the relay. Do you have any suggestions regarding inrush currents, decoupling caps or any safety issues or anything related?

You'll need a transistor to drive the relay. The LM324 won't be able. Put a snubber diode across the relay coil to prevent switch-off voltage transients blowing the transistor.

3-) And finally, is there a way to separate AC neutral and GND in LTSpice? You see in my circuit it doesn't represent the real life scenario since AC neutral is the same with GND in my schematics.

I have no idea.

And finally the problem was that this type of fan and controller was not able to totally stop rotating unless someone manually switched it of from the controller's mains switch.

Did you try adjusting the MIN speed pot on the controller? You may be able to set it low enough to stall the motor. Watch out for higher than expected stall current but I don't think you'll have a problem with a triac controller as at minimum speed it will be giving very brief pulses of low current to the motor.

Congratulations on getting it all to work.

• Here is my updated schematics: i.stack.imgur.com/8nSR5.png I added decoupling capacitors from power rails to GND as you suggested. Do I really need decoupling caps from GND pin of the opamps to GND? And does it matter the type of cap? Another thing is are you sure I need a transistor after LM324 to the relay input? This relay: uk.rs-online.com/web/p/solid-state-relays/0346895 requires 12mA. And do I really need a snubber diode for this relay? Here in their demo they dont use an extra flyback diode: youtube.com/watch?v=bzrsE4tTJP8 – user16307 May 1 '16 at 14:09
• (1) Your suspicions are correct. You don't need GND-GND capacitors. (I can't see how you read that from my answer.) (2) Any 100 nF should do for this application. (3) Table 6.5 shows max source current is 20 - 40 mA and Fig. 11 shows that output voltage will drop 2 V at that. You'll probably be OK at 12 mA if that's enough voltage. (4) It could work for years without it. I'd put it in. – Transistor May 1 '16 at 14:23
• thanks I will update and write you back in a few minutes for final adjustment – user16307 May 1 '16 at 14:26
• Here I added an NPN transistor as you suggested at the output of LM324 comparator: i.stack.imgur.com/NYhzP.png And I added two diodes D4 D5 after the SSR between line and neutral. Is this configuration for snubber diode is right? If so what type of diode do I need? – user16307 May 1 '16 at 14:43
• (1) Q2 should work OK as the LM324 is able to source current better than sink. (2) I'm sorry, I read S1 as a relay with a coil despite your "Solid State Relay" label. The diode would go on the coil. Remove D4 and 5. They're doing nothing. (3) If POT 100 is a real pot then just watch the current through it. Read the max power dissipation and, from that work out the max current allowable from $P = I^2R$. Try and stay below 50% of max for reliability. – Transistor May 1 '16 at 16:35