PWM Driver 1 0

From RepRap
Jump to: navigation, search

This page describes something which is no longer the most recent version. For the replacement version see: PWM_Driver_1_1

PWM Driver v1.0


<div class="thumb tright">
Cache-1625658717 b6f1e91a9a.jpg

This board is designed to allow you to control high power devices that only have a single polarity. Things like heaters, fans, solenoids, and even motors (you can only turn them in one direction, however.) It takes PWM (pulse width modulation) inputs from a microcontroller such as an Arduino, and amplifies them into high power outputs. It has 3 channels on each board, and can drive up to 5 amps on each channel with the proper heatsinks.

Get It!

Raw Components

  1. Buy the PCB from the RRRF
  2. Buy the components from the list below

As a Kit

  1. Coming soon!


<div class="thumb tright">
Cache-1473670801 2bbd40c3bc.jpg

You can download the release file from SourceForge that has a bunch of helpful files for this board. It contains:

  • GERBER files for getting it manufactured
  • PDF files of the schematic, copper layers, and silkscreen
  • Eagle source files for modification
  • 3D rendered image as well as POVRay scene file
  • exerciser code to test your board.



The PWM Driver has 4 input pins:

Pin Function
PWM1 Send a PWM signal from the Arduino directly to this pin to control channel 1. 0 = off, 255 = maximum. You may also be able to use a digital out pin to control it as on or off
PWM2 Same as above, but for channel 2
PWM3 Same as above, but for channel 3
GND It's recommended to connect this to the ground on your Arduino to share a common ground.
POWER This is a power input connector. We use a polarized disk-drive style power connector found on nearly every ATX power supply in existence. If you want to directly connect your own power, the board requires 12v input.


Each channel is rated to drive up to 5 amps. Whether or not your heatsinks and power supply are up to the challenge is another story. Give it a try and let us know if you can break it!

Pin Function
channels 1-3 This is the output for the respective input pin. Each set of outputs has two pins: a positive and a negative. When you hook up your device, you need to double check to ensure that you have the polarity correct. Not doing so could result in your device going poof.

Circuit Board

<div class="thumb tright">
Cache-1588612963 8a411b277f.jpg

You can either buy this PCB from the RepRap Research Foundation, or you can make your own. The image above shows the professionally manufactured PWM Driver v1.0 PCB ready for soldering. Its also cheap, only $5.00 USD.


<div class="thumb tright">
Cache-1795852536 0efa3d8839.jpg

Refer to the part list generator for information on where to get the stuff you need.

<iframe width='500' height='300' frameborder='0' src=''></iframe>

Known Bugs

These are all the bugs we know about. If you find any, please contact us in the forums.

Silkscreen Oops

We forgot a layer on the silkscreen, and the part values are not present. You'll have to refer to the pictures, the PDF in the release files, or the part ID in the BOM to determine what parts go where. Its pretty simple to figure out though. Make sure you get the resistor colors right.

Build Process

<div class="thumb tright">
Cache-1795855058 7e7554e66f.jpg

Solder R4-R7

These are the 560 ohm resistors. There are 4 of them. They can be soldered in any orientation. Polarity doesn't matter. When you are done, clip the long wires sticking out close to the board.

<div class="thumb tright">
Cache-1795855606 f8e7305160.jpg

Solder R1-R3

These are the 1k ohm resistors. There are 3 of them. They can be soldered in any orientation. Polarity doesn't matter. When you are done, clip the long wires sticking out close to the board.

<div class="thumb tright">
Cache-1795017695 4012ede2e9.jpg

Solder LED1-LED4

These are the LED's to tell you when the power is on, as well as when each channel is active. Simply line up the flat side of the LED with the flat part of the silkscreen and solder away! It is important that you insert them in the proper orientation. They will not work otherwise. When you are done, clip the long wires sticking out close to the board.

<div class="thumb tright">
Cache-1795018673 30148a2cb5.jpg

Solder D1-D3

These are the diodes to protect the circuit when driving motors and such. There is a stripe on one end of the diode which corresponds to a stripe on the silkscreen. Make sure the diode is oriented in the same direction as on the silkscreen and solder it in. When you are done, clip the long wires sticking out close to the board.

<div class="thumb tright">
Cache-1795858548 983228e03e.jpg

Solder C1

This is the yellowish, circle shaped capacitor. Solder it into the rectangular area for it. The polarity or orientation doesn't matter. When you are done, clip the long wires sticking out close to the board.

<div class="thumb tright">
Cache-1795859594 f7462d6114.jpg

Solder C2

This is the cylindrical black and grey capacitor. It has a negative and positive side. The silkscreen has a + sign where the positive side is supposed to go, and the capacitor has a - sign along its negative side. Insert the capacitor accordingly and solder it in. When you are done, clip the long wires sticking out close to the board.

<div class="thumb tright">
Cache-1795021905 ff37f8077f.jpg

Solder the Power Connector

The power connector is the same one as you find on hard drives in a computer. There are angled parts on the inside of the connector that match up to the markings on the silkscreen. Insert the part according to those, and then solder it in.

<div class="thumb tright">
Cache-1795022811 b88a4680a7.jpg

Solder X1-X3 (output headers)

These are the output headers that you'll plug whatever device you want to power. Solder the headers with the tabs facing towards the inside of the board. The silkscreen has a top-down representation that should help you if you are confused. Insert the part, and solder it in.

<div class="thumb tright">
Cache-1795025089 be0bec3d0c.jpg

Solder Q1-Q3

These are the power transistors, and they are what turn the signals from your microcontroller into high current to power your devices. Solder them with the flat heatsink tab facing outwards. After you are done, you can either bolt a strip of aluminum to the heatsinks, or you can fold them over to meet the board and bolt them down there. During soldering they may come out of alignment, so it could be sort of tricky.

<div class="thumb tright">
Cache-1795025829 abeee07d35.jpg

Solder input wires

Take about 2 feet of the wire from a Cat6 ethernet cable, and take 2 twisted pairs from that. If you want to use the official color scheme, take the orange and brown pairs. Strip about 1/4 inch from the ends of each wire, and solder them into the input holes. You will want to match them up like so:

Color Input
White/Orange PWM1
Orange PWM2
White/Brown PWM3
Brown Ground

When you are finished, twist all the wires into a single cord to keep things tidy.

You have now completed soldering your PWM Driver Board! Do a happy dance and get ready to see if it works.

Test Your Board

<object type="application/x-shockwave-flash" width="400" height="300" data=""> <param name="quality" value="best" /> <param name="allowfullscreen" value="true" /> <param name="scale" value="showAll" /> <param name="movie" value="" /></object>

Now we have to test the board. Its very easy, and consists of a few steps.


  • Always turn power supply off before making/breaking connections.
  • Always turn your power supply off before plugging it in. It won't fry things most of the time... but all it takes is once to damage things.
  • Its a good idea to ground yourself before touching components. You don't want to fry anything.

Wire up test devices

I prefer using a computer case fan (preferably with LED's) but any sort of DC device you can find laying around will do: motor, light, etc. You could even make do with a resistor and a LED. You'll need 3 of these to test it easily, but you can make do with one if you feel like swapping it to test the other channels.

Once you have your devices, wire them each up individually to a channel. Make sure you get the polarity right. In the example of our fans, they probably just won't turn, but if you use a different object it might not like it, so be careful. (eg. destructo)

Connect PWM Driver to Arduino.

This part is very easy. Strip 1/4" from the end of the input wires (You used Cat6 ethernet innards right???) Now, insert the end of each input into the correct pin on the arduino, and then connect the Ground pin to Ground on Arduino. Use the table below to determine what pins to hook up to what:

PWM Pin Arduino Pin
PWM1 9
PWM2 10
PWM3 11
GND Ground

Upload Firmware to Arduino

Now, feel free to turn on the power to your power suppply. Next, open the Arduino software, and copy/paste the code below into it. Upload the code to your Arduino.

Once the program is compiled and uploaded, the Arduino will restart and run the exerciser code. The basic execution of the exerciser code goes like this:

  • Gradually take all 3 channels up to maximum, then back down again.
  • Gradually take each individual channel up to maximum and back down again.
  • Repeat.

int pwm_a = 9; int pwm_b = 10; int pwm_c = 11; int i; void setup() { pinMode(pwm_a, OUTPUT); pinMode(pwm_b, OUTPUT); pinMode(pwm_c, OUTPUT); Serial.begin(9600); } void loop() { // //fade all channels up and down. // Serial.println("Fading all pwm channels up to max."); for (i=0; i<=255; i++) { analogWrite(pwm_a, i); analogWrite(pwm_b, i); analogWrite(pwm_c, i); delay(100); } Serial.println("All pwm channels at max."); delay(1000); Serial.println("Fading all channels to 0"); for (i=255; i>=0; i--) { analogWrite(pwm_a, i); analogWrite(pwm_b, i); analogWrite(pwm_c, i); delay(100); } Serial.println("All pwm channels at zero."); delay(1000); fade_channel(pwm_a); fade_channel(pwm_b); fade_channel(pwm_c); } void fade_channel(int channel) { Serial.println("Fading pwm channel to max: "); Serial.println(channel); for (i=0; i<=255; i++) { analogWrite(channel, i); delay(100); } Serial.println("pwm channel at max."); delay(1000); Serial.println("fading down."); for (i=255; i>=0; i--) { analogWrite(channel, i); delay(100); } Serial.println("pwm channel at 0."); delay(1000); }

Test Power on PWM Board

Simply take your hacked PC power supply and plug a power connector into PWM board. Once you turn the power, the power LED indicator should come on.

If all goes well, then you should see all the devices turn on in unison, then each device will turn on independently. This will show you that all channels are working, and that there are no shorts.


First, if the LED lights up and the fan does not, then check the orientation of the fan. If there are still problems, you will need to check your soldering, double check component placement and orientation, and finally if all else fails, post in the [forums for help and we'll try our best. If you can post pictures of your boards and setup, that will help us out tremendously.