Introduction: Simple (and Dirty) Pulse Width Modulation (PWM) With 555 Timer

Simple circuit for DC Motor speed control (fan speed control, light / LED dimming and etc) using the 555 timer.

Also a good starting point for novices wanting to get their hands dirty with the 555 timer IC. Some would argue that this is not the most efficient approach, but hey (read the title), it's simple, and it works.

Check the video out.
More images and description here.



Pulse Width Modulation (PWM)

Put simply PWM is the process of switching power ON and OFF to a device in pulses at a specific frequency. Same approach used in commercial light dimmers, DC motor speed controller, CPU fan speed controllers and etc.

That's what we seek to achieve here.

Step 1: Part List

Part list

1) 555 timer IC - 1
2) 100K variable resistor - 1
3) 1N4148 Diode - 2
4) 100nF capacitor - 2

The 555 Timer IC

The 555 timer is arguably one of the most popular IC ever made. There are thousands of resources online if you're interested to delve deeper into the subject. I'm just going to give the simple description directly relevant to the build

PIN 1 - Ground
DC Ground

PIN 2 - Trigger
When LOW, it causes the Output pin to go HIGH. Activated when voltage fall
below 1/3 of +V.

PIN 3 - Output
Output is HIGH when Trigger pin is LOW. Output is LOW when Threshold pin is
HIGH. Output is LOW when reset pin is LOW.Output pin is able to source or sink
current.

PIN 4 - Reset
Short to +V when not in use.

PIN 5 - Control Voltage
Grounded through a capacitor when not in use.

PIN 6 - Threshold
When voltage reaches 2/3 of +V, this pin will cause Output to be driven LOW.

PIN 7 - Discharge
Grounded when Output pin goes HIGH.

PIN 8 - +V
DC Power

Step 2: How It Works.

How it works

When the circuit is powered up, the C1 capacitor will initially be in a discharged state. Thus, the Trigger (pin 2) will be LOW, driving the Output (pin 3) to go HIGH. Discharge (pin 7) goes HIGH and goes ground. The cycle begins.

The HIGH Output will cause C1 capacitor to be charged through the R1 and D1 path. Upon C1 voltage reaching 2/3 of +V, the Threshold (pin 6) will be activated and drive the Output (pin 3) LOW. Discharge (pin 7) goes LOW. The time it takes for C1 to charge depends on the position of R1.

Since Output (pin 3) is now LOW, capacitor C1 will start to discharge through the D2 and R1 path. When the voltage of C1 drops below 1/3 of +V, Trigger (pin 2) will be LOW, driving Output (pin 3) to go HIGH, and Discharge (pin 7) to go HIGH and shorts to ground. The cycle repeats itself.

You've probably noticed by now that the circuit is using Discharge (pin 7) to drive the motor, simply by going ground in each cycle. You can add some amount of protection if you're concerned about back EMF from the motor.

Pin 4 and 5 are not used, and pin 1 is simply tied to ground. The circuit can take between +3v to +18v. The Frequency is around 144Hz. Do note that, doubling the value of C1 will reduce frequency to half, tripling will will reduce frequency to 1/3, and so on.

Step 3: That's It

Happy tinkering. Feel free to browse my blog for other stuff

Comments

author
AdamF5 made it!(author)2017-06-05

Great stuff. Thanks! Need to tinker with the component values to get slower speeds.

IMG_1618.jpg
author
GreatScottfan made it!(author)2017-01-14

Hey guys, is the capasitor have polarity or no? Thanks

author
2011saaluc made it!(author)2016-10-20

Hello

Can yours control the speed of a 12 volt dc case fan FROM 0% TO 100%?

author
CkloneS made it!(author)2016-01-07

Made it in electronics class using LEDs instead of motor. It is rudely easy to make, I almost got board while making it, nah, I'll guess I would never get board of electronics.

DSC_0759[1].JPG
author
budhaztm made it!(author)2011-12-06

ok so with the caps do you mean 100 microfarads or 100 nanofarads? im building this for a very large science project which i will post online. thanks for help

author
mvmacd made it!(author)2015-08-09

It is 100nF. The code will be 104 on the capcitor. Other values will work, and will change the frequency. Lower value capacitor = higher value frequency. Try putting a 100uF capacitor (check the polarity), and you should be able to see it blinking!

author
dudeist_funk made it!(author)2015-07-02

It looks as though the 555 is sinking the current, how would you wire a transistor with regards to the ground of the 555 (i.e. would it require a PNP transistor with the base connected to pin 7 on the 555, and would this require a way to drop the voltage going through the PNP between the base and the 555)? Thanks in advance!

Steve

author
mvmacd made it!(author)2015-08-09

Steve, excellent question. To drive a NPN transistor with this circuit, all you need to do is use pin 3 as output (even though it's already connected to a potentiometer, it will still work!). Give it a try!

Don't forget a resistor between the NPN's gate, unless it's a mosfet.

author
mvmacd made it!(author)2015-08-01

Also, what's the best way to control a NPN transistor with the ground output? Would one need to drive the NPN transistor with a PNP transistor?

author
jagzi made it!(author)2011-12-04

Hi,
We are connecting a motor to the circuit, shouldn't we attach a protective diode for taking care of the back EMF ? Please clarify.
Thank you in advance .
Jagzi

author
DerpS made it!(author)2015-05-14

Yes there should be a diode, but as it says in the title this is just a simple and dirty circuit. I make circuits with motors a lot, while only using protective diodes sometimes, and I have never had a component damaged, so it is not a huge risk.

author
Ploopy made it!(author)2015-05-05

Cool!

author
hrayhan made it!(author)2014-12-27

nice instructables!

I already make the pcb one, check out my instructables:

https://www.instructables.com/id/Pulse-Width-ModulationPWM/

PWM INS R.png
author
ChronoX5 made it!(author)2014-08-24

Nice!! It took me a while to figure out that my 555 couldn't pass enough current so eventually I used a PNP Transistor (TIP127) connected to Pin 7 to power a little dc water pump. It works perfectly now!!

author
simeoudakis made it!(author)2014-12-17

same here, thanx

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
OSR251 made it!(author)2014-11-06

Thnak you sir.......

author
BG79 made it!(author)2011-04-19

Hi. I tryed to make this, but instead of reduce or increase leds brightness it just turns it on and of with a little delay. Any bet where I went wrong?

And is there a way to make this PWM outputs ~ 500mAh? I´m trying to use it into a superled, but 200mAh is too low. Tkz.

author
ianni made it!(author)2013-12-04

Ad a transistor (mosfet or bipolar - doesn't matter). Depending of the power you want to handle with the PWM circuit look in the transistor datasheet to be sure that the transistor power is higher than your load needs.

In the link below you have an example, make abstraction of the uC and the LED driver. You will get your PWM signal in the transistor and drive as many LED's you want (or a "big" one), but be careful with the transistor power, load power and heatsinks.

Happy experimenting!

http://www.maximintegrated.com/images/appnotes/4472/4472Fig01.gif

author
Chein made it!(author)2012-02-17

Something like Fritzing http://fritzing.org/ may help you a bit i think.. It has a pretty neat breadboard view feature

author
Homepwner made it!(author)2012-02-17

I've been checking out some other schematics that I found easier to comprehend.
yours is different then the ones I'm used to and I think that is part of my problem.
Thanks for the link! it sounds awesome.

author
jamesjamesjames made it!(author)2009-07-26

what is the advantage of this over just a motor and a pot?

author
Poppy_Ann made it!(author)2010-01-13

using a motor and a pot when you slow down the motor the extra power is just turned into hear in the pot using this when you slow the motor you are just turning it off and on very fast and dont wast the extra power

author
solaralternatives made it!(author)2011-12-05

Paul meant to say (waste) heat.

author
mnova made it!(author)2011-03-03

I only have a 20K pot but the circuit still works if I give the motor an initial spin.

How can i increase the power output on this circuit?

author
solaralternatives made it!(author)2011-12-05

Use it to drive a cheap power transistor

author
revhead made it!(author)2008-10-21

does any one know what the max voltage and current is that i can pass through this circuit??

author
fallenspirit123 made it!(author)2008-10-23

I believe max voltage is 18v not sure sorry I dont know about current though

author
camservo made it!(author)2011-11-16

the 555 timer spec says up to 15v, maximum 18v (basically just know that you're pushing it by feeding anything over 15).

author
Chein made it!(author)2008-10-27

It can pass up to 200mA current

author
nseguin made it!(author)2011-08-06

Hi, I'm new to electronics and have given a shot a building this. Unfortunately my local Source didn't have the exact list of what I needed. I used 2 100uF capacitors, 2 1N4001 diodes and a 3W pot. When I try and control a small motor, no success. I'm using a 12V battery. Any ideas or suggestions?

author
camservo made it!(author)2011-11-16

I'm also new. I built this circuit and noticed that, while I had a 12v source, the output was only in the realm of 1v. Not sure where the drop came from. Might be a mistake I made, might be part of the design.

author
simonrc made it!(author)2011-10-15

Hi and thanks for the instructable! I would like to add a photoresistor in order to modify pwm speed by light intensity, but I'm not quite sure where to put it - in between IC pin 3 and center of pot? I would be most grateful for help! thanks!

author
btdzimba1 made it!(author)2011-08-27

I tried simulating the circuit before i built it and noticed that the 100k pot doesnt seem to do anything

About This Instructable

225,480views

167favorites

Bio: Made the kessel run in less than twelve parsecs.
More by Chein:The Fixed Soldering Iron Method - Solder Wires And Components EasilyStepper Motor Basics - 6 Wires Unipolar / Bipolar Motor Stepper Motor Basics - 5 Wires Unipolar / Bipolar Motor
Add instructable to: