Submission: 555 PWM Oscillator

Thread Starter

Wendy

Joined Mar 24, 2008
23,415
Status: WIP
Illustrations: WIP
Experiments: Pending
****************
555 PULSE WIDTH MODULATION OSCILLATOR


PARTS AND MATERIALS

  • One 9V Battery
  • Battery Clip (Radio Shack catalog #270-325)
  • Mini Hook Clips (soldered to Battery Clip, Radio Shack catalog #270-372)
  • One 555 timer IC (Radio Shack catalog #276-1723)
  • Q1 - 2N2222 (Radio Shack catalog #276-1617 15 Pack or equivalent)
  • CR1-3 - 1N4001 (Radio Shack catalog #276-1101 or equivalent)
  • D1 - Red light-emitting diode (Radio Shack catalog #276-041 or equivalent)
  • D2 - Green light-emitting diode (Radio Shack catalog #276-022 or equivalent)
  • R1,R2 - 1 KΩ 5% 1/4W Resistors
  • R3 – 10 KΩ Potentiometer, PCB Style (Radio Shack catalog #271-282 or equivalent)
  • R4 - 10 Ω 5% 1/4W Resistor
  • R5 - 470 Ω 5% 1/4W Resistor
  • C1 - 0.1 µF Capacitor (Radio Shack catalog #272-1069 or equivalent)
  • C1 - 100 µF Capacitor (Radio Shack catalog #272-1028 or equivalent)
  • C2 - 220 µF Capacitor (Radio Shack catalog #272-1017 or equivalent)
  • M1 - 7.5 VDC Motor (Radio Shack catalog #276-046 or equivalent)

CROSS-REFERENCES

Lessons In Electric Circuits, Volume 3, Chapter 3, Section 12, Special-purpose diodes, Light Emitting Diodes
Lessons In Electric Circuits, Volume 3, Chapter 11, Section 1, Pulse Width Modulation



LEARNING OBJECTIVES

  • How to use a Schmitt Trigger for a simple RC Oscillator.
  • How diodes can be used to steer currents.
  • How to have two RC time constants with one RC.
  • Learn one of many 555 timer astable multivibrator configurations.

SCHEMATIC DIAGRAM

Here is one way of drawing the schematic:


1.PNG


As mentioned in the previous experiment, there is also another convention, shown below:

2.PNG




ILLUSTRATION

3.PNG



INSTRUCTIONS

This is one of the most basic of PWM generators a 555 can make. It works, but it has some minor problems. One of them is the frequency is not completely stable. It also varies between 5% to 95%, the edges are not clearly defined due to the diodes dropping voltage and having some internal resistance. Within its limitations it works pretty well though, so it is a popular design.

I have two different capacitors in the design so you can see how the circuit works using LEDs, and for one of the more common uses, that of a motor controller. Start with the 100µF capacitor in the circuit for C1. This will bring the frequency to approximately 0.7 Hz, which humans can easily see.

As you vary R3 over it's range you should see the length of time for each LED vary, and you will also note that the longer one LED is on the shorter time the other LED stays on. This is core to PWM. Ideally the frequency will stay the same, only duration of on/off time changes.

Replace C1 with the 0.1µF capacitor. This will increase the frequency one thousand times, to approximately 700Hz. You might be able to see some flicker from the LED, but nothing more. The on/off ratios of the output will be the same as with the slower flash rate, and at higher frequencies this flicker will disappear entirely. The LEDs intensity will appear to vary in a linear way. This is an important use for PWM, since LEDs are not very linear devices. Yet, we now have two LEDs acting as if they were linear.

The motor will also do something interesting. You may want to fold a piece of tape over the shaft to get a good view of what is going on. You can now vary the speed of the motor from very slow to full speed with fair precision. You are doing this without a gear box, only with electronics, which has many significant implications. Again, a system that is not very linear is acting as if it were.

A motor can be thought of as a specialized inductor. When power is cut off abruptly it can generate a high voltage spike. Given that there is also internal switching going on with any conventional DC motor it will be generating a lot of spikes just turning over. These spikes can damage solid state electronics such as Q1. To prevent this CR3 has been added, when the spike of voltage (which is a different polarity than the power supply) the diode harmlessly absorbs this as current, and Q1 is saved.

R4 prevent there being a really low ohmage between the output of the 555 and capacitor C1. When a capacitor starts to charge it resembles a dead short. Without R4 the 555 could actually get hot and be damaged, but the extra resistor brings that under control, in the process also protecting R3, the potentiometer.


Theory of Operation

This circuit is a modified Hysteresis Oscillator, but uses diodes CR1 and CR2 to steer the current during each side of the cycle. Since the total resistance of R3 stays a constant, the frequency is relatively stable. However, the diodes do interact with the circuit, so some variation in frequency does occur. If the diodes had no voltage drop this would not be the case.

When the output is high the current goes through the left side of R3 and CR1 to charge C1. This sets the length of time the output stays high. When the upper 2/3 set point is reached the output is switched low.



The capacitor C1 discharges through the right side of R3 and CR2. This sets the length of time the output stays low. When the lower 1/3 set point is reached the output is switched high, and the process repeats.
3.PNG



LEDs are not linear to current, but this PWM circuit will make them appear so, which is one of the reasons PWM is so popular controlling LEDs.
 
Last edited:

Thread Starter

Wendy

Joined Mar 24, 2008
23,415
Not for a single chip on a battery. I will recommend it in the text, but there is no need to add to the parts count unnecessarily. Baring smoke escapes this one should be done in a week. If you look at the zip file you'll find I've added a motor to show how it can be a variable speed device, I haven't had time to post the revised graphics yet.
 

Dcrunkilton

Joined Jul 31, 2004
422
The purpose of this document, in particular attachment tutorial.pdf, is to show how Bill Marsden's images will look in the final HTML and PDF. The two images are repeated twice. There is no difference in the image pairs in looking at the HTML. (It is probably a waste of time looking at the attached tutorial.html file and associated image files.) The scaling built into the scripts is only applied to images converted to PDF. This is related to photos and other images being too wide ( greater than 4.8 inches in PDF, 600 pixels in .png ) for the PDF book page. One image of the pair is scaled smaller in the attached tutorial.pdf so it does not exceed the boundaries of the approx 6 in. page. Only this smaller image will appear in the final 555 .pdf Tony has set 4.8 in. (600 pixels) as the maximum image width. Such an image will fit both HTML and PDF. (Attachment tutorial.pdf has a sample image at the end of the 4.8 inch, 600 pixel image.) In looking at the PDF, we see that really wide images cannot be accomodated at all. However, I can scale them down in the PDF only to an acceptable size. Since a PDF document is zoomable, the small image may be enlarged. More information on Tony's image specification is at http://www.allaboutcircuits.com/l_graphic.html .

As for the width of the images in the HTML version, it is not nearly as bad as for the pdf. The images are too wide by Tony's standard. However, it is not really a factor in any html at http://www.openbookproject.net//electricCircuits/ , which is not page width constrained. However it may be an asthetic problem in the HTML at AAC. To get an idea of what an oversize image will do to the AAC version see the periodic table of elements http://www.allaboutcircuits.com/vol_5/chpt_10/2.html. The attached tutorial.html does NOT show this. We probably need to discuss with AAC management, how they feel about oversize images. Are they acceptable? Or, to be avoided.

If we violate Tony's image width specification, I can scale images down for the PDF book. However, scaling is not an option for the HTML. It is possible to display a too-wide-image in the HTML. It is just an asthetics issue as in the case of the periodic table.

Brief description of Image processing: Most images in the volumes are .eps sources-- schematics and equations in postscript produced by Xcircuit schematic capture. These .eps source images are converted to .png for the html version of the volumes. There are a lesser number of photographs in .jpg format. The source file is the .jpg file and this is converted to.eps for the LaTeX/PDF. Similar to the .jpg is the screen captures, such as SPICE plots. These are .png sources, which get converted to .eps for LaTeX/PDF.

The point to be made is that each image has two files, an .eps and a .png (or .jpg). It is not practical to edit two files. There is one editable source file in all cases. The other file is automatically produced by a script. The source for most schematics, drawings, and equations is .eps ; for photos the souce is .jpg, for screen captures the source is .png .

If you read Tony's image file specification at http://www.allaboutcircuits.com/l_graphic.html , there is no provision for schematic diagrams or drawings in anything other than .eps (postscript), coming from Xcircuit. However, in Bill Marsden's ESD section at http://www.allaboutcircuits.com/vol_3/chpt_9/1.html , the drawing is treated like a .jpg (it is a .png) photo image. It is by this round-about process that I can grudgingly accept drawing and schematics in .png instead of the prefered .eps.
 

Attachments

Thread Starter

Wendy

Joined Mar 24, 2008
23,415
Thanks Dennis,

I am moving this discussion to the E-book Developers Forum, under the thread "Graphics Standards". This thread will be used for this submission.
 
Last edited:

Thread Starter

Wendy

Joined Mar 24, 2008
23,415
Not to mention the Theory of Operation, the links and a dozen other things. :D

I had to write an article on PWM, it wound up in motor controls in the AAC book. :( But now I have something to refer to in the book for the article. Seems very strange from here.

Volume III
Chapter 11: DC MOTOR DRIVES
 

Russel

Joined Mar 6, 2011
9
I take it that CR1, CR3 and CR3 should all be 1N4001 diodes?

What transistor should be used for Q1?
[...]
Oops! I guess I need to pay more attention. The first post lists CR1 - CR3 as 1N4001 and Q1 as a 2N2222.

The parts list needs:
R4 10Ω
R5 470Ω

In order to get the circuit to work I had to change the breadboard from the illustration in the 1st post. Please take a look at the attachments.

Also, I would like to thank you for the great content of allaboutcircuits.com. I'm learning and having lots of fun!
 

Attachments

Thread Starter

Wendy

Joined Mar 24, 2008
23,415
Thanks for the corrections, both of you. I kinda let this one drop, I'm having trouble staying motivated, but this needs to be finished and published.

Some of the corrections were made after your first post, and I suspect you are using an uploaded image (though one of the issues is still there). It will be fixed. Thanks again.
 

Thread Starter

Wendy

Joined Mar 24, 2008
23,415
The corrections have been added, I think I'll add two illustrations for the Theory of Operation. I need to run the experiment to verify the text (sometimes something unexpected crops up), but this article is getting very close to completion.
 

magnet18

Joined Dec 22, 2010
1,227
Should there be a small cap from pin5 to ground? or is that omitted for simplicity?

[EDIT]
Sorry, nevermind, I just saw bertus' comment.

However, if using the alternate capacitor, I don't thing the other jumper needs to be there.
 

Attachments

Last edited by a moderator:

Thread Starter

Wendy

Joined Mar 24, 2008
23,415
While it is not needed for the 0.1µF, it does provide a reference between drawings. I don't think it affects the operation, the experiments are forthcoming.

There is also the distinct possibility a experimenter will switch back and forth several times between capacitors to compare modes.

Even unfinished, this has been a popular article.
 
Top