Interactive electronics resource

PWM Generator Kit Instructions

Build, understand and experiment with the PWM Generator Kit. This resource brings the original kit material into the current MitchElectronics format with the schematic, circuit explanation, component and PCB information, construction guidance, troubleshooting and practical ideas where available.

PWM Generator

Introduction

Pulse width modulation involves taking a square wave and changing the duty cycle of the wave to convey information. But this explanation is too complex for those who do not know what PWM actually is or have never used PWM signals. So let's start with the basics, the duty cycle!

The graph below shows a square wave with a frequency of f (the actual value does not matter). Two times are shown, Ton and Toff. Ton is the time for which the wave is at its maximum and Toff is the time for which the wave is at its minimum. The time period, t, of the wave is Ton + Toff.

pwm 1

Now the frequency is determined by the time period so therefore the frequency is also dependent on the Ton and Toff values. But realise one thing, the frequency is determined by the sum of Toff and Ton and NOT the individual values.

This means that the frequency can be kept the same BUT the values of Ton and Toff can be changed. This is the basics of PWM and now a new term comes to play, duty cycle!

pwm 2

Schematic

PWMGEN

How does the PWM generator work?

The Main Components

The core of the PWM Generator is a triangle wave generator which is fed into a comparator as shown in the simplified diagram below.

pwm 3

The potentiometer sets the PWM duty cycle by feeding a voltage into the positive pin of the comparator while the triangle oscillator provides the comparative voltage to create a square wave. This can be seen in the graph below more clearly.

How The Potentiometer Adjusts The PWM Frequency

In the graph above, the red line represents the voltage being created by the potentiometer RV1, and after a few seconds the potentiometer is turned to output a lower voltage (as shown by the drop in the red line). This lower voltage from the potentiometer output will result in a smaller duty cycle.

pwm 4

If the triangle wave is larger than the potentiometer voltage the comparator outputs a low voltage. This is because V- is larger than V+. If the triangle wave is smaller than the potentiometer voltage then the comparator will output a high voltage because V+ is larger than V-. That's it! Nothing else to it!

The PWM Generator not only has a potentiometer to adjust the duty cycle but also has a second potentiometer to adjust the frequency (RV2). Adjusting the frequency potentiometer changes the frequency of the triangle generator and thus changes the output frequency of the PWM signal.

Project ideas

Motor Speed Controller

One excellent use for PWM signals is controlling motors without using linear devices (such as voltage regulators and transistors in their active region). Not only does the PWM signal result in an average voltage output (which directly adjusts the speed of the motor), but the fast switching reduces energy losses in the switching device (such as a large MOSFET). motor

LED Brightness Controller

Just as PWM signals can be used to adjust the speed of a motor, they can also be used to adjust the brightness of an LED by turning an LED on and off quickly. If an output switching transistor is used to provide power to LEDs, the PWM signal will adjust the LED brightness, and just like in the motor controller the switching device will experience very little energy waste. led display

Basic Synthesiser

PWM signals are not only excellent for controlling power to devices, but they also produce some interesting sounds. We all know what a square wave sounds like (anyone who has used an ancient games console will know this sound), but PWM square waves have an interesting saw-tooth-like component to them. If this kit replaces RV1 with an external exponential converter (Google this and 1V/Octave Keyboards), you can make a pretty snazzy sound system! synth

Try it yourself

Circuit simulation

Not available in mobile view

What you need

Component List

ComponentQuantityPCB Reference
8 DIP Socket2U1, U2
LM3582U1, U2
100nF Capacitors3C1, C2, C3
47K Resistor1R2
100K Resistors3R1, R3, R4
100K Potentiometer2RV1, RV2
Red Wire1VCC
Blue Wire1PWM OUT
Black Wire2GND
PWM Generator PCB1

Inspect the board

Interactive BOM

Not available in mobile view

Board reference

PCB & assembly

The PCB silkscreen and component references should be checked against the component list before soldering each part.

PWMGEN

Before applying power

  1. Check every component against its PCB reference.
  2. Confirm the orientation of all polarised components and ICs.
  3. Inspect for solder bridges, unsoldered pads and clipped leads that could cause a short.
  4. Check that no loose wire or solder debris remains on the board.

Build with confidence

Construction tips

Recommended build order

A reliable way to assemble PWM Generator Kit is to work from the lowest-profile components to the tallest. This keeps the PCB easy to access while you solder.

  1. Fit resistors, links and other low-profile components first.
  2. Fit small capacitors and diodes, checking polarity where applicable.
  3. Fit IC sockets and small semiconductors, observing the orientation markings.
  4. Fit larger capacitors, potentiometers, switches and other controls.
  5. Fit LEDs, connectors and the remaining taller components.
  6. Insert socketed ICs only after soldering around the socket is complete.
  7. Inspect every joint and check for solder bridges before applying power.

Electronics construction guidance

If you are new to kit construction, use the Soldering Guide alongside these instructions. Identify each component before fitting it and compare its reference with the component list and PCB silkscreen.

When it does not work

Troubleshooting

Nothing happens when power is applied

  • Confirm the supply is connected to the correct input and with the correct polarity.
  • Check that ICs, diodes, LEDs, transistors and electrolytic capacitors are fitted in the correct orientation.
  • Compare component values and positions against the component list and PCB reference.
  • Inspect for missed joints, dry joints and accidental solder bridges.

The circuit powers up but does not behave as expected

This kit is intended for adjustable pulse-width modulation generator. If the output is stuck, unstable or outside the expected behaviour, use the schematic to trace the circuit a stage at a time rather than replacing several parts at once.

Check the components around the part of the circuit responsible for the output or timing first. A misplaced resistor, reversed semiconductor or poor connection can allow a circuit to power up while preventing it from operating correctly.

The circuit works intermittently

Intermittent behaviour is often caused by a marginal solder joint, a loose connector or a component lead that has not been fully soldered. Gently inspect the board with power removed and reflow any joint that looks dull, cracked or incomplete.

If the fault remains, compare the assembled board with the schematic and PCB reference one connection at a time.

Ready to test and experiment?

If combined with a few external circuits, this can be converted into a basic switch-mode power supply! We won't tell you how, but a hint is to think about how you can use negative feedback from the output 😉 Connecting a resistor ladder network to the input can turn this PWM generator into a digitally-controlled PWM source You can use this kit to control micro servos commonly found in RC projects. They require a pulsed input, but these are PWM signals representing analogue values!

Once the board is working, compare its behaviour with the schematic and the explanation above. Try changing only one input, control or permitted component value at a time so you can clearly see what effect that change has on the circuit.