I have fan 230 VAC 300 W, Relay SRD-05VDC-SL-C, and RaspberryPi,

what other equipment i would need to be able to control Fan 230VAC with RaspberryPi?

I want to go 0/1 with relay, and in mode:1, be able to control Low/Mid/High Fan Speed.

enter image description here


  • \$\begingroup\$ you need a triac (and snubber) and a zero crossing detector for syncing the waveform. or i guess for a fan you could simply use a zero-crossing integrated SSR and skip entire half-cycles to achieve speeds, so long as the kick noise isn't bothersome. \$\endgroup\$ – dandavis Mar 6 '20 at 21:31
  • \$\begingroup\$ low mid high selection by an external knob or by raspberry pi? \$\endgroup\$ – Jasen Mar 6 '20 at 22:55
  • \$\begingroup\$ Correct me when necessary, So it goes like Raspberry Pi -> OptoCoupler -> ZeroCrossing Detector -> Triac -> Engine \$\endgroup\$ – hkjz Mar 10 '20 at 13:33


simulate this circuit – Schematic created using CircuitLab

The capacitors should be the type used for fans speed controllers (X2 rating) and of appropriate capacitance, the numbers I used are guesses. if you have a four position knob type speed controller you probably already have theses capacitors.

Turing on relay 1 puts C1 in series with the mains for slow speed, turning on relay 2 puts C2 in series for medium speed, turning on both connects L1 directly for full speed.

for the top realy you could use the relay module you have for the bottom relay you need a relay with two switches, (or you could use two more of the same module both connected to the same raspberry pi output)

  • \$\begingroup\$ That is fantastic, exactly as i remember from some AirConditioning Units. Listen Jasen, you wrote NANOFarads. Shoud not that be MICROFarads? Thanks \$\endgroup\$ – hkjz Mar 7 '20 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.