PWM circuit assistance

Discussion in 'Analog & Mixed-Signal Design' started by fivenine, Nov 8, 2017.

  1. fivenine

    Thread Starter New Member

    Nov 8, 2017
    Could someone please provide me a little explanation of the following circuit I want to use in a project. I'm more software focused normally and lack the electrical knowledge, and would rather understand what is going on, than just buy the components and do it.

    The circuit provided:

    1) From I can see, 220v is applied through a rectifier which converts it to DC? Which is then fed through a series of diodes, resistors and capacitors to pin 5 of an Opto coupler. What is the purpose of this arrangement of capacitors and diodes?

    2) Also, the IRF830, is that doing the actual switching of the lamp? How does it carry this out with the incoming PWM signal?

    3) Are there any other topics or concepts I should read up on regarding this circuit.

    Appreciate your time, thanks.

    p.s this is the Arduino code if it may interest you:

    Code (Text):
    1. intledPin = 3;
    2. void setup()
    3. {
    4. Serial.begin(9600);
    5. Serial.println(“Serial connection started, waiting for instructions…n0 = Offn1 = 25%n2 =50%n3 = 75%n4 = 100%”);
    6. }
    8. void loop ()
    9. {
    10. if (Serial.available()) {
    11. char ser =; //read serial as a character
    13. switch (ser)
    14. {
    15. case ‘0’:
    16. analogWrite(ledPin, 0);
    17. break;
    19. case ‘1’:
    20. analogWrite(ledPin, 64);
    21. break;
    23. case ‘2’:
    24. analogWrite(ledPin, 128);
    25. break;
    27. case ‘3’:
    28. analogWrite(ledPin, 192);
    29. break;
    31. case ‘4’:
    32. analogWrite(ledPin, 255);
    33. break;
    34. default:
    35. Serial.println(“Invalid entry”);
    37. }
    38. }
    39. }
  2. dendad

    Distinguished Member

    Feb 20, 2016
    The bridge recitfier (D2-D5) convert the AC to unfiltered DC so the FET can switch it as it is polarity conscious and cannot switch AC directly.

    D6 passes the "DC" to C2 so there is a 330VDC supply (230V peak) to provide the 10V gate supply via R5/C2 and R3/R4 (2 series Rs to spread the voltage drop and power dissipation), and zener D1. C1 is the 10V filter cap.
    D6 blocks the 330V discharging when the FET turns on.

    PWM from the Arduino turns the 4N35 opto transistor on when the PWM is high. The opto turning on will extend the 10V to the FET gate so it turns on so switching the lamp on.

    Be careful if you build this as there is high powered mains volts there.

    C2 voltage rating would well to be increased. 275V is a bit low.
    fivenine likes this.
  3. fivenine

    Thread Starter New Member

    Nov 8, 2017
    From my understanding, the arduino provides a PWM signal, a DC value which switches on the FET, which is converted back to AC through the bridge rectifier and then turns on the lamp. Is this correct?

    How would I go about calculating the conversion from DC back to AC?
    Also, I'm still confused over the use of a zener diode. Why a zener diode?

    As an aside, been made aware of transformerless circuits and their downfalls and lack of safety which I did not know before, thanks for that. Been reading up on the usage of transformers will see how I can use it in the future.
  4. ScottWang


    Aug 23, 2012
    The control procedure as below:
    Arduino pwm → 4N35(isolation) → IRF830(as switch) → bridge rectifier → Lamp

    The zener was used to protecting the Vgs of MOSFET, the Vgs max=20V, Vgs(on) = 10V, I will suggest you to use 12V zener to make sure the Vgs could get the voltage over 10V.

    Transformersless power supply was used very often, but it was also caused some damaged dangerous cases, so for the safety reason that our forum does not open this topic yet.