# PWM circuit assistance

#### fivenine

Joined Nov 8, 2017
2
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.

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

Code:
intledPin = 3;
void setup()
{
Serial.begin(9600);
Serial.println(“Serial connection started, waiting for instructions…n0 = Offn1 = 25%n2 =50%n3 = 75%n4 = 100%”);
}

void loop ()
{
if (Serial.available()) {

switch (ser)
{
case ‘0’:
analogWrite(ledPin, 0);
break;

case ‘1’:
analogWrite(ledPin, 64);
break;

case ‘2’:
analogWrite(ledPin, 128);
break;

case ‘3’:
analogWrite(ledPin, 192);
break;

case ‘4’:
analogWrite(ledPin, 255);
break;
default:
Serial.println(“Invalid entry”);

}
}
}

Joined Feb 20, 2016
3,591
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

Joined Nov 8, 2017
2
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.

#### ScottWang

Joined Aug 23, 2012
6,926
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?
The control procedure as below:
Arduino pwm → 4N35(isolation) → IRF830(as switch) → bridge rectifier → Lamp

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?
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.

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.
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.