### 555 Timer-based PWM Power Control Circuit

##### Written by Siraj Sabihuddin
###### (Created on July 24, 2012 - 9:25pm)

Have you ever wandered the streets wondering, 'Boy o boy! I wish I had more control over my life!'? Well! Wander no more and come into my parlour as I take you through the exciting world of power control. In this article, you'll learn to take control of your life by designing a simple PWM control circuit that drives a MOSFET. Underlying this little circuit is a 555 timer. Adjust the frequency using the capacitors, add a variable resistor - and voila! Power control! I designed this controller for use with a simple hot wire foam cutter.

I've created a schematic for this controller using a simple, yet wonderful, little software called LTSpice. The neat thing about LTSpice is that you can actually simulate your circuit (via SPICE) to see whether it works. You can see this schematic below in figure 1. Essentially this circuit produces a high power pulse width modulated (PWM) output at a specific frequency. There are tons and tons of things to explain - so let's get started!

### Power Supply

The circuit uses a normal wall or laptop DC power supply. In the circuit this is represented by $V_{\:cc}$. This value is set to $15\:\text{V}$ and is used both to drive the low power circuitry of the 555 timer and the high power circuit of the mosfet switch. The NE555 timer's absolute maximum supply voltage is not particularly high ($18\:\text{V}$), so increasing this $V_{\:cc}$ a great deal more is likely to damage the circuit.

There are cases when you absolutely positively need a higher voltage at the MOSFET. If that's the case, we can regulate the voltage down for the 555 timer and its associated circuitry. Be warned, the gate voltage must be high enough and the current supplied by the timer high enough to drive the MOSFET into saturation (fully on). For the IRF530 the gate-source voltage $V_{\:gs}$ needs to be around $10\:\text{V}$ for this to happen.

The power supply should also be capacitively filtered to remove high frequency noise. How essential this is, depends on the wall adapter that you're using. Adapters for laptops typically provide lower noise power output and may not need to be filtered.

### 555 Timer Circuit

The 555 timer provides us with highly configurable square wave function generator features. The circuit shown in figure 1 operates in astable mode. Figure 2 shows the biasing of the timer circuit in astable mode. We can find a detailed explanation of how a 555 timer works in the NE555 datasheet.

Looking at this circuit we can describe the output square wave with the following formulation:

 $$T_{\:high} = 0.693 \cdot (R_{\:1} + 2 \cdot R_{\:2}) \cdot C$$ $$T_{\:low} = 0.693 \cdot R_{\:1} \cdot C$$ $$T = T_{\:low} + T_{\:high}$$ $$f = \frac{1}{T} = \frac{1.44}{ (R_{\:1} + 2 \cdot R_{\:2}) \cdot C }$$

This circuit is taken from an NE555 datasheet. In the case of our oscillator circuit, $R_{\:1} = R_{\:a}$ and  $R_{\:2} = R_{\:b}\:$. In addition to a resistor, we also have two 1N4148 diodes connected to our resistor $R_{\:b}$. But wait. Where is $R_{\:b}$ in figure 1???

#### Variable Resistors in LTSpice

The two resistors, $R_{\:b1}$ and $R_{\:b2}$, in figure 1, actually form our one $R_{\:b}$ resistor.  $R_{\:b}$  is a variable resistor. Currently there's no convenient way to change the resistance dynamically in an LTSpice simulation. So, for simulation purposes, I've separated $R_{\:b}$ into two resistors whose resistance changes over time. This is done by defining the values of each of the resistors such that:

 For $R_{\:b1}$ $$R = {R_{\:bmax}} - {R_{\:bmax}} \cdot K \cdot \frac{TIME}{T_{\:tot}} + {R_{\:tiny}}$$ For $R_{\:b2}$ $$R = {R_{\:bmax}} \cdot K \cdot \frac{TIME}{T_{\:tot}} + {R_{\:tiny}}$$

$R_{\:b}$ is actually a $100\:\text{K}\Omega$ variable resistor. The above two formulae are input as values for $R_{\:b1}$ and $R_{\:b2}$ via LTSpice. This sweeps through all values of the resistor, $R_{\:b}$, for the time period over which the simulation is running. $R_{\:bmax}$ is the actual value of $R_{\:b}$, $100\:\text{K}\Omega$. I used a total running time for the simulation $T_{\:tot} = 10\:\text{s}$. The variable, $TIME$ is the current simulation time. If resistance ever reaches a zero value the results of some computations can become undefined. To prevent this from happening, I've added an extra tiny resistance, $R_{\:tiny} = 1\: \mu \Omega\;$ for simulation purposes. Lastly, the value $K$ is a boolean used so that the variable resistor behaviour of$R_{\:b}$ can be disabled, if needed.

#### Trigger, Threshold and Discharge

Pin 2 is the trigger and acts as a start signal to get the timer running. The trigger is active low and so starts the timer when the voltage on the drops below one-third of the supply voltage, $V_{\:cc}$. When the trigger value goes low, the output on pin 3 goes high. The trigger pin monitors the voltage at capacitor $C$.

Pin 7 is called the discharge. This pin is used to discharge an external capacitor, $C$. This capacitor combined with $R_{\:a}$ and $R_{\:b}$ control the timing of the waveform. During discharge the discharge pin sinks current through $C$ and $R_{\:b2}$. Thus the combination of these two components determines how long it takes for the trigger input to reach a low value and hence a high output.

Pin6 is called the threshold. The pin monitors the voltage on the capacitor, $C$. When this voltage rises above two-thirds of $V_{\:cc}$ the threshold pin causes the output on pin3 to go low.  The capacitor, $C$, is charged through resistors $R_{\:a}$ and $R_{\:b1}$ in figure 1. So the combination of these three components controls how long it takes for the threshold input to reach a high value and hence a low output.

Changing the values of $R_{\:a}$, $R_{\:b}$, $C$ will also change the frequency of our wave form. We use opposite ends of the variable resistor $R_{\:b}$, with the centre lead connected to $R_{\:a}$ for this reason - we don't want a resultant frequency change when we vary the resistance. We can however control the frequency by change the capacitor, $C$ or $R_{\:a}$. Now the problem with changing $R_{\:a}$ is that it also has some effect on the duty cycle - ideally it should be kept as small as possible.  As we'll see in figure 2, this resistor is the reason we can't quite reach a full 100% duty cycle or full 0% duty cycle. Instead our duty cycle varies from around 10% to around 90%. One question that might pop into your head, then, is: "Why use $R_{\:a}$ at all?". Well, I'm not really sure. But I'll hazard a guess. Since the discharge pin sinks current, you want to make sure that there is a limit to the amount of current - the discharge pin is the collector end of an internal NPN transistor and the transistor needs to be properly biased.

### High Power Switch

I'm using an IRF530 n-channel MOSFET to act as my high current switch. This MOSFET can be replaced by any range of other MOSFETs, as long as the current in the resistive load $R_{\:load}$ doesn't exceed the specs. Another MOSFET worth considering is the IRFZ44. This MOSFET has a much lower resistance between its drain and source meaning that it will remain cooler during operation and thus can tolerate much higher currents of upto $60\:\text{A}$ absolute maximum. The IRF530 can only manage around $14\:\text{A}$ absolute maximum.

### Simulations

So what happens when we actually try to simulate this circuit? Well, the figure below shows the output of the circuit MOSFET when connected to a $26\:\Omega$ resistive load.Notice that the duty cycle in the below circuit varies over time - that's because the variable resistor $R_{\:b}$ is setup to go over its entire range from $0\:\Omega$ to $100\:\text{K}\Omega\;$ over the runtime of the simulation.

Notice that there are some voltage spikes at the output. The actual pwm signal input into the high power switch does not contain the spikes. I don't really know why these high frequency spikes are there.

The next figure (figure 3) shows what happens at the threshold and trigger pins during the course of the simulation. Again, the lengthening of the waveform is a result of the variable resistor's value changing over the course of the simulation. In reality, this resistor would be fixed at a specific value and so no changes would occur over time and the duty cycle would remain constant.