I'm trying to make PWM Signal Generator with Arduino Uno. I'm trying to control 230V 50hz "NRG118" combi boiler fan. The fan powered by AC and have 3pins for PWM control. "vcc,gnd,pwm" Wired them to arduino "5v, GND, 11" pins.

I can control the card on the arduino "0to100% with a simple code below but I can't turn it off. I tried digitalWrite nothing changed. Tried different pins 5-6-9-11 nothing changed. Tried to wire gnd+vcc to outsource powersuply nothing changed.

Also I have a simple PWM generator "HW-723 XY-LPWM PWM Signal Generator Module". The "HW-753" can control the fan without any other component but it may have builtin special component like a NPN but im not sure about it.

In description I found this and maybe its a requirement but I have no idea about electronic components: "The PWM output pin on the microcontroller drives an NPN MMBT3904 type transistor which in turn drives the PWM output pin of the module. The transistor has a series 1K resistor tied to VIN+, so the PWM signal will swing between ground and the module supply voltage on the VIN+ pin."

With the HW-753; at startup the fan is not running but when I wire to my arduino it starts with 100% power and when i set "analogWrite(x, 0)" dutycycle reducing but fan still running at %1 speed and I read 0.07volt with multimeter on "PWM+GND" pins.

Most people can not run, I cant stop.... It's killing me people...
What am I doing wrong?

void setup() {
  pinMode(6, OUTPUT);
void loop() { //the code only for test. Using loop is dumb. 
  //digitalWrite(6, LOW); 
   analogWrite(6, 0); 
  • Can you look at the PWM signal with a scope when driven by the HW-753 and when driven by the Arduino? What happens when you wire PWM and GND together? – Edgar Bonet Oct 23 '20 at 9:09
  • I can't. I'm just a developer who has nothing about electronics. I have only a Multimeter.:) I didn't wire PWM and GND together. What is the logic behind this? – Morphinz Oct 23 '20 at 9:35
  • If you short PWM and GND (remove PWM from any Arduino pin!), you make sure that you have the lowest possible value. Now check how your fan is doing. – the busybee Oct 23 '20 at 10:52
  • Thanks I will try that. Also I figured out that if the PWM pin is not using it means 0 volt but the fan works with highest speed. So PWM pin shouldn't be 0volt. Maybe I need to give a special voltage to stop it? In this diagram it looks 0.8-2volt. allaboutcircuits.com/uploads/articles/… – Morphinz Oct 23 '20 at 11:41
  • So to stop the motor I need to give special PWM voltage. I think analogWrite(6, X); the X should be between 50-100. How can I learn what PWM output needs the fan to turn-off? – Morphinz Oct 23 '20 at 11:43

If you are working with the AC motor, then it is probably works even PWM cable is not attached. In this case there is no reason to use "analogWrite(PIN, 0)". It will not work.

"An external resistor divider connected to the VMIN input sets the minimum fan speed by fixing the minimum PWM duty cycle (1.25V to 2.65V = 0% to 100%, typical). It depends on controler card manufacturer. check datasheet"

If you cant find datasheet like me then check how others do. There is diagram of "HW-753 Signal Generator Module" below. As you can see between VIN+ and PWM there is 1k Resistor and both wired to an NPN, also the mid leg of NPN passing 1k resistor while going to pwm to protect the card. Also 3rd leg is wired to gnd. So it is not the same thing I was doing before. If you work with AC then you must always consider that and just forget what people say. Do not drown like me. I hope it will helps someone.

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.