Thursday, August 9, 2012

Industrial Sensing Fundamentals – Back to the Basics: NPN vs PNP



Dscription :
What’s the difference and why should anyone care? If you’re confused by the terms PNP and NPN, then hopefully this post will shed some light on the differences between the two.  In the context of this post, they refer to the construction of a sensor’s transistor and whether it has a p-type or n-type semiconductor.
The “N” stands for “Negative” and the “P” stands for “Positive”.  With respect to sensors, an NPN device is one that can switch the negative side of the circuit while a PNP device switches the positive side.
The next question to ask is, what direction do you want the current to flow?
PNP sensors are sometimes called “sourcing sensors” because they source positive power to the output. NPN sensors are sometime called “sinkingsensors” because they sink ground to the output. 
 The term “load” identifies the device the sensor powers. The load could be a lamp, pneumatic valve, relay or PLC input.


Additional Details:
Types of Discrete Electrical Outputs – The majority of sensors used today use Solid-State outputs, not mechanical relays
The drawing below shows 2 wires for sensor power and 2 for the switch. Most sensors use only 3 wires by having one wire do double duty, carrying both power and output signals. This is similar to a bathroom with only one line caring water to both the sink and toilet as opposed to individual lines for each. Solid-state discrete sensors functions similar to a switch, but current only flows in one direction. Solid-state devices are reliable, economical, small and fast. The only drawback is, that you have to know the direction of current flow. NPN and PNP are technical terms for the type of transistor used to switch the output. The type of transistor determines the direction of current flow.
For additional information about NPN-PNP devices, connections, and working with PLC’s check out the following from the Industrial Electrical and Maintenance forum.

Wednesday, May 9, 2012

Lab 21: Servo motor control


Discription :

A servo motor is a special geared DC motor equipped with an electronic circuit for controlling the direction of rotation, as well as the position, of the motor shaft. Because servo motors allows precise angular positioning of their output shaft, they are used extensively in robotics and radio-controlled cars, airplanes, and boats to control the motion of their various parts. In this lab session, we will first explore what a servo motor consists of and how it works and then illustrate how to interface it with a PIC microcontroller.
Servo motor control using PIC microcontroller
Theory
A servo motor (or servo) is a little box that contains a DC motor, an output shaft (servo arm) which is connected to the motor through a series of gears, and an electronic circuit to control the position of the shaft. The objective of using a servo is to achieve precise angular positioning of an object.
In order to accomplish a servo function, an instantaneous positioning information of the output shaft is fed back to the control circuit using a transducer. A simplest way of doing this is by attaching a potentiometer to the output shaft or somewhere in the gear train. The control electronics compares the feedback signal (which contains the current position of the shaft) from the potentiometer to the control input signal (which contains information of the desired position of the shaft), and any difference between the actual and desired values (known as an error signal) is amplified and used to drive the DC motor in a direction necessary to reduce or eliminate the error. The error is zero when the output shaft gets to the desired position. The functioning block diagram of a typical servomotor is shown below.
Principle of a servomotor
Servo parts (Source: http://tutorial.cytron.com.my/2011/09/19/how-rc-servo-works/)
The control input to a servo is a pulse width modulated (PWM) signal, generally of frequency 50 Hz. This means the pulse should repeat every 20ms. The width of the pulse determines the angular position of the output shaft. An electronic circuit inside the servo converts the PWM signal to a proportional output voltage which is compared with the feedback voltage from the potentiometer. If a difference exists between the two, the control circuit drives the motor in an appropriate direction until the difference becomes zero. A typical value of the pulse width is somewhere in the range of 1.0 to 2.0 milliseconds (ms). For a standard servo, a pulse width between 1.0 ms to 1.5 ms makes the servo to turn clockwise (CW), between 1.5 ms to 2.0 ms makes it to turn counterclockwise (CCW), and a 1.5 ms pulse width turns the servo motor to its center. However, these values could vary depending on the brand and make of the motor. It is advised to read the datasheet of the servo to find the true values of the pulse widths required for positioning the servo at different angles.
Most servos rotate through 180°. However. there are some that could rotate through a full 360° or more. Servos are widely used as the moving joints in robotic arms for their precise angular positioning. They also finds applications in radio controlled (RC) toys. For example, in RC cars they are used in the steering mechanisms, and in RC boats to control the rudder.
A servomotor has three wires: two are designated for power supply (Vcc and Ground) and the third wire is for the control signal.The Vcc wire is usually red and the ground one is either black or brown. The control signal wire comes in white, yellow, or orange color. The servomotor used in this experiment is from iCircuit technologies and has red, brown, and yellow color wires for Vcc, Gnd, and control signal, respectively. It operates at 5.0 V power supply and provides angular rotation through 180°
A typical servo motor
The pulse width values for different angular positions of this servo are provided in the table below. Remember that the repetition rate of the pulse should be 50 Hz (period of 20 ms).
Servo timing information for different anglular positions
Different angular positions of the servo arm
Circuit
The circuit diagram of this experiment is depicted below. The control input for the servo is derived from the RB1 pin of the PIC16F628A microcontroller that operates at 4.0 MHz using an external ceramic resonator. A tact switch is connected to the RB0 pin to provide user input to control the position of the servo arm. The operation part of this experiment is described in the software section below.
Circuit diagram for servo motor control demonstration
Circuit setup on breadboard
Software
The firmware for PIC16F628A is written in MikroC Pro for PIC compiler. The Timer0 module is operated as timer with prescaler 1:256 to generate an approximate 20 ms gap between the two successive PWM pulses. Keep in mind that the clock frequency is 4.0 MHz, which results into 1 μs machine cycle, thus simplifying the math involved in calculating the delay using Timer0. MikroC provides a built-in library function, Delay_Cyc(), that generates a variable clock cycles delay. This function is used to vary the width of the control pulse from 0.7 to 2.3 ms. When the circuit is first powered up or reset, a 50 Hz PWM signal with 0.7 ms pulse width is continuously generated at RB1 pin. This control signal moves the servo arm clockwise all the way to the end, which is considered as 0 angular position. When the tact switch connected to the RB0 pin is pressed, the width of the pulse is increased by 0.2 ms, which turns the shaft counterclockwise (CCW) by approximately 22.5°. So each time the switch is pressed, the pulse width is increased by 0.2 ms, and the shaft further rotates in CCW direction. After 8 successive presses of the switch, the pulse width becomes 2.3 ms and the shaft reaches the other end (180° angular position). On 9th press, the pulse width is reset to 0.7 ms, and the motor shaft rotates in clockwise direction until it gets at 0 angular position back.
/*
  Lab 21: Servo motor Control using PIC16F628A
  MCU: PIC16F628A running at 4.0 MHz, MCLR enabled, WDT is OFF, Brown out detect disabled
  Written by: Rajendra Bhatt (www.embedded-lab.com)
  2012/03/29
  Description: User input switch is connected to RB0 and Servo Control signal
  is generated from RB1 pin.
*/

sbit SW1 at RB0_bit;
sbit Control at RB1_bit;

unsigned short i=7, delay;

void interrupt() {
  delay = i*10;
  Control = 1;
  Delay_Cyc(delay);  // Generates delay equal to (10*delay) clock cycles
  Control = 0;
  TMR0 = 180;        // TMR0 returns to its initial value
  INTCON.T0IF = 0;   // Bit T0IF is cleared so that the interrupt could reoccur
}

void main() {
 CMCON = 0x07;    // Disable Comparators
 TRISB = 0b00000001;
 PORTB = 0;
 OPTION_REG = 0x07; // Prescaler (1:256) is assigned to the timer TMR0
 TMR0 = 180;        // Timer T0 counts from 180 to 255 to create ~20 ms period
 INTCON = 0xA0;     // Enable interrupt TMR0 and Global Interrupts
 do{
  if(!SW1){         // Change pulse width when Switch is pressed
   Delay_ms(300);
   i = i+2;
   if(i>23) i=7;
  }
 }while(1);
}
Output
After loading the HEX file into the PIC16F628A microcontroller, you can watch the servo controller in action. Watch the demo video at the bottom to see the output of this experiment.

Serial four digit 7-segment LED display module



Discription

Seven segment LED displays are a very popular mean of displaying numerical information and finds application in front panel display boards of microwave ovens, washers and dryers, digital clocks, frequency counters, and many other gadgets. Compared to the LCD displays, the seven segment LED displays are brighter and provide a far viewing distance and a wide viewing angle. However, the downside is they are resource-hungry. It requires at least 12 I/O pins of a microcontroller to drive a standard 4-digit seven segment LED module. Consequently, their use with low pin-count microcontrollers (such as PIC12F series) is not practically feasible. Here’s a solution for that. The following 4-digit seven segment LED module features a serial interface that requires only 3 I/O pins of a microcontroller and provides full control of all digits and decimal points .
Four digit serial 7-segment LED display
Description
This display module is based on the MAX7219 display driver chip from MAXIM. It provides a serial interface to drive 7-segment LED displays (common-cathode type) up to 8 digits. Included on-chip are a BCD decoder, multiplex scan circuitry, segment and digit drivers, and an 8×8 static RAM to store the digit values. The segment current for all LEDs is set through only one external resistor. However, the device also provides a digital control of the display brightness (16 steps from minimum to maximum) through an internal pulse-width modulator.
Finished
The display module is powered with +5V supply applied to its Vcc pin. Data can be transferred to the display module through SPI interface. Connections are available on the board to access the required signal lines (MOSI, CLK, and CS) for communication between the SPI Master (microcontroller) and the MAX7219 chip. Data is sent in 16-bit packets (two bytes) which is shifted into the internal 16-bit shift register with each rising edge of CLK. The 16-bit packet is labeled as D0-D15, where D0-D7 contain the data, D8-D11 contain the register address, and D12-D15 are don’t care bits. D15 is the most significant bit (MSB) and is the first bit to receive. Although the MAX7219 chip can drive up to 8 digits, only 4 digits are implemented here. They are DIG0 through DIG3, arranged in sequence from the right to the left. The 4-bit addresses (D8-D11) of their corresponding digit registers are 0×01, 0×02, 0×03, and 0×04, respectively. The digit registers are realized with an on-chip 8×8 SRAM, and are addressed directly so that individual digits can be updated at any time. The following table lists the complete addressable digit and control registers of the MAX7219 device.
Register address map of MAX7219
Control Registers
The MAX7219 contains 5 control registers: decode mode, display intensity, scan limit (number of scanned digits), shutdown, and display test (all LEDs on).
Shutdown
On initial power-up, all control registers are reset, and the MAX7219/MAX7221 enters into Shutdown mode. In the shutdown mode, the display is blanked. The D0 bit of the Shutdown register (address 0x0C) must be set to bring the display to normal operation. The same bit can be cleared anytime during operation to enter back into the Shutdown mode. During Shutdown, the contents of the data and control registers are unaltered. Shutdown can be used to save power or as an alarm to flash the display by successively entering and leaving the Shutdown mode.
The MAX7219 device can be put in the Shutdown mode by sending two bytes 0x0C (address) and 0×00 (data) in sequence. Similarly, 0x0C followed by 0×01 brings it back to normal operation.
Decode-Mode
The decode-mode register (address 0×09) sets BCD code B (0-9, E, H, L, P, and -) or no-decode operation for each digit. Each bit in the register corresponds to one digit. A logic high selects code B decoding while logic low bypasses the decoder. When the code B decode mode is used, the decoder looks only at the lower nibble of the data in the digit registers (D3–D0), disregarding bits D4–D6. The D7 bit is independent of the decoder and turns the decimal point on if it is set (D7=1). For example, sending bytes 0×02 and 0×05 in sequence sets the DIG1 (second digit from the right) to display decimal 5. Similarly, 0×01 followed by 0×89 displays decimal 9 at DIG0 with its decimal point set. The following table provides the complete list of the code B font.
Code B font
When no-decode is selected, data bits D7–D0 correspond to the segment lines (A-G and DP) of the seven segment display.
No-Decode Mode Data Bits and Corresponding Segment Lines
Intensity control
The MAX7219 allows display brightness to be controlled through software by an internal pulse-width modulator (PWM). The PWM output is controlled by the lower nibble (D3-D0) of the intensity register (address 0x0A) and allows 16 brightness levels. The zero nibble value sets the display intensity to minimum, whereas all nibble bits set to 1 selects the maximum intensity level for the display.
Scan-Limit
The scan-limit register (address 0x0B) sets how many digits are to be displayed from 1 to 8. For a 4-digit display, the scan-limit register value should be set to 0×03.
Display-Test
The display-test register has address 0x0F and allows to turn all LEDs on by overriding, but not altering, the values of the control and digit registers. In order to enable the display-test mode, the D0 bit of the display-test register must be set. The same bit must be cleared to get back to the normal operation.
Interfacing with a microcontroller
The serial 7-segment LED display module can be interfaced with any microcontroller that has 3 I/O pins available. If the microcontroller features a built-in hardware SPI, then the display module can be interfaced as a SPI slave device. In that case the SPI signal lines SDO (serial data out), SCLK (serial clock), and SS (slave select) from the microcontroller can be directly connected to the MOSI, CLK, and CS pins labeled on the display module. CS is active low signal.
In case the host microcontroller doesn’t have a hardware SPI module, the interface can be implemented in software. The SPI communication starts with holding CS pin LOW and then sending 16 bits of data serially (MSB first) over the MOSI pin at the rising edge of CLK signal, and finally pulling the CS pin back to HIGH. The following example illustrates how to write a software SPI routine to drive the display module with three general purpose I/O pins of the PIC12F683 microcontroller. The program is written in mikroC Pro for PIC compiler but can be easily modified for other high-level compilers. The GP0, GP1, and GP2 pins of the PIC12F683 drives the CS, MOSI, and CLK pins, respectively, of the 7-segment display module to create a 4-digit up-counter. The counter counts from 0000 to 9999 and then reset to zero and start again.
// Define Soft-SPI connections
#define CS_Pin       GP0_bit
#define MOSI_Pin     GP1_bit
#define CLK_Pin      GP2_bit

void SPI_Write_Byte(unsigned short num){
 unsigned short t, Mask, Flag;
 CLK_Pin = 0;
 Mask = 128;
 for (t=0; t<8; t++){
  Flag = num & Mask;
  if(Flag == 0) MOSI_Pin = 0;
  else MOSI_Pin = 1;
  CLK_Pin = 1;
  CLK_Pin = 0;
  Mask = Mask >> 1;
 }
}

void MAX7219_INIT() {
  // Disable Shutdown mode
  CS_Pin = 0;              // CS pin is pulled LOW
  SPI_Write_Byte(0x0C);    // Select Shutdown register
  SPI_Write_Byte(0x01);    // Set D0 bit to return to normal operation
  CS_Pin = 1;              // CS pin is pulled HIGH

  // Set BCD decode mode for digits DIG0-DIG3
  CS_Pin = 0;              // CS pin is pulled LOW
  SPI_Write_Byte(0x09);    // Select Decode Mode register
  SPI_Write_Byte(0x0F);    // Select BCD mode for digits DIG0-DIG3
  CS_Pin = 1;              // CS pin is pulled HIGH

  // Set display brighness
  CS_Pin = 0;              // CS pin is pulled LOW
  SPI_Write_Byte(0x0A);    // Select Intensity register
  SPI_Write_Byte(0x0F);    // Set maximum brightness
  CS_Pin = 1;              // CS pin is pulled HIGH

   // Set display refresh
  CS_Pin = 0;              // CS pin is pulled LOW
  SPI_Write_Byte(0x0B);    // Select Scan-Limit register
  SPI_Write_Byte(0x03);    // Select digits DIG0-DIG3
  CS_Pin = 1;              // CS pin is pulled HIGH

 // Enable Display-Test
  CS_Pin = 0;              // CS pin is pulled LOW
  SPI_Write_Byte(0x0F);    // Select Display-Test register
  SPI_Write_Byte(0x01);    // Enable Display-Test
  CS_Pin = 1;              // CS pin is pulled HIGH

  Delay_ms(1000);
 // Disable Display-Test
  CS_Pin = 0;              // CS pin is pulled LOW
  SPI_Write_Byte(0x0F);    // Select Display-Test register
  SPI_Write_Byte(0x00);    // Disable Display-Test
  CS_Pin = 1;              // CS pin is pulled HIGH

}

 void Display_Counter(unsigned int j){
  CS_Pin = 0;                    // CS pin is pulled LOW
  SPI_Write_Byte(4);             // Send thousands digit
  SPI_Write_Byte((j/1000)%10);
  CS_Pin = 1;                    // CS pin is pulled HIGH

  CS_Pin = 0;                    // CS pin is pulled LOW
  SPI_Write_Byte(3);             // Send hundreds digit
  SPI_Write_Byte((j/100)%10);
  CS_Pin = 1;                    // CS pin is pulled HIGH

  CS_Pin = 0;                    // CS pin is pulled LOW
  SPI_Write_Byte(2);             // Send tens digit
  SPI_Write_Byte((j/10)%10);
  CS_Pin = 1;                    // CS pin is pulled HIGH

  CS_Pin = 0;                    // CS pin is pulled LOW
  SPI_Write_Byte(1);             // Send ones digit
  SPI_Write_Byte(j%10);
  CS_Pin = 1;                    // CS pin is pulled HIGH
 }

unsigned short i;
unsigned int counter = 0;

void main() {
  TRISIO=0b00001000;        // GP3 is input only
  CMCON0 = 0x07;
  ANSEL = 0x00;
  MAX7219_INIT();           // Initialize  MAX7219
  do{
   for (counter=0; counter<10000; counter++) {
    Display_Counter(counter);
    Delay_ms(1000);
   }
  }while(1);
}
The PIC12F683 microcontroller runs at 4.0 MHz internal clock and MCLR is disabled. In the picture below, the tiny PIC12F683 board is from iCircuit Technologies.
4-digit UP-counter using PIC12F683
The LED display module can also be interfaced with Arduino board using the LedControl library.
Interfacing with Arduino
Summary
This MAX7219 based LED display module allows you to interface a 4-digit 7-segment LED display to low-pin count microcontrollers using only three I/O pins. It gives you full control of all digits, decimal points, and the display brightness.
This display module is available for purchase as a kit. The price of the kit is $10.99 and includes free shipping (regular USPS) within the continental United States. The payment will be through Paypal. If you want this kit, email me first at admin (at) embedded-lab.com, and I will send you my Paypal information.
The picture below shows what you will get in the kit. A 5-pin male header (straight) is included in the kit. Here are the assembly instructions.
4-digit serial seven segment LED display kit

Tuesday, April 17, 2012

how to repaire motherborad capacitors


Here is a howto on replacing capacitors on a motherboard. It is equally applicable to replacing capacitors on any computer product pcb. I originally wrote this for the FAQ section of badcaps forums.
1. Consider whether the board is a candidate for repair
Before you start work you should consider whether the board is going to be working after you replace the capacitors or whether it is going to need a lot more work and parts which you might not be capable of doing or finding.
Checklist for considering a board :
If your board meets any of the following criteria then it will probably not be a good candidate for recapping.

- Component(s) on the board are looking burnt
- Component(s) on the board are detached or missing (even tiny smt components)
- An essential connector such as HSF clip, ram clip(s), ATX connector are damaged.
- Traces on the board are scratched
Learn the history of the board
It is good to know the history of the board. For instance if the board developed badcaps but was taken out of service early then it is a great candidate for recapping. If the board was left for a very long time and the caps have leaked all over the place then the discharge can probably be cleaned up nice. If the board is now dead having shut down one day then if there is nothing burnt some caps probably failed open and the board is still good for repair. If the board died and there was a burning smell or burnt items on the board then there is a possibility that some caps shorted.
Testing the board - a Warning!
If you are given a board to troubleshoot which does not POST, it just blinks the led on the board and the fan twitches, you must be careful that the board is not in a condition which will damage the CPU that you use to test the board. There is a possibility that the VRM chip is damaged because a FET has shorted and therefore Vcore will be too high. The board will be a CPU killer. Better to test Vcore with a multimeter before you attach your CPU to troubleshoot the board. It is always a good idea to test unknown boards with your worst components anyway.
2. Practice First and Study the Guidelines
It is totally possible for you to repair your motherboard yourself but you must read all the info first and also practice before you start your first repair. Even if you have read all the info soldering and replacing caps takes some practice to do nice. It will be VERY satisfying to see your first recapping boot up but dissapointing if it looks sloppy or doesnt work because you did it wrong.
Get a trash motherboard
The best thing to do will be to get a trash motherboard and practice removing the caps from it. Learn how to do it gently and you will also learn if your soldering iron is going to be hot enough for the real job. It would be good also to get some of the cheapest caps and practice installing them on the trash board.
Learn what is a good solder joint
Learn what is a good solder joint from the following links and practice making one. We guarantee that this will be the most difficult part of the operation but with practice you will learn to do it well.

Elecraft Builder Resources (Click on Soldering Tutorial) 

Apogee Kits Downloads (Click on ApogeeKits Free Illustrated Guide to Electronics Soldering) 

The Basic Electronics Soldering & Desoldering Guide 
3. Plan the job before you begin
Check you have enough caps
The most important thing is to check that you have enough of the right values of caps to complete the job. When you are done you will be eager to see the board boot and you won't want to wait for another order of caps. Check the original caps on the board again to see if you had missed one or made a mistake with the values. It is very easy to do that.
Make a Diagram
Diagram of the board connectors
It is very good practice when removing a motherboard from the case for any kind of job to make a diagram of the case connector positions (Power Switch, Reset, HDD Led etc) also record the position of each coloured wire. Mark also the position of the primary/secondard IDE, floppy disk, recording the position of the red line on the cable. This makes it so much easier and then you dont have to go hunting for the manual of someones obscure board on the internet when you hooked it up wrong later. Or having to open the damn case again cos you had the hdd led backwards etc.
Diagram of the position of the caps
It is very important to make a diagram of the positions and values of the original capacitors on the board. Make sure that you note where the negative lead of each capacitor is on the diagram. The negative lead is marked on the capacitor with a stripe down the side. This stripe matches the white hemisphere around the hole for the negative lead on the board stencil. This diagram is a useful tool also for final checking before you power up the board. It is very important to record the position of the actual negative lead of the original capacitor because the board stencil may be wrong and you want to recheck with the diagram before you install a new capacitor incorrectly. Mark on the diagram the values of the original capacitors and also the values which you will replace each capacitor with if they are different. It is very useful to have this diagram handy during the recapping so you can concentrate on the soldering and not have to think too much or make a mistake
Mark on the actual board the positions where caps were not installed
Because of design changes and revisions there may be positions on the board stencil where capacitors were marked to be installed but were not. It is very important to mark on the board with a thin marker pen an X on these positions. It is not recommended to install caps in these positions unless you are following a tried and tested board mod. It is very easy to make a mistake and install caps in these wrong positions so it is nice to see the Xs marked on the board to remind you.
4. Prepare your workplace and the board
Get all your tools handy
The minimum you will need is the following. Get it all ready and close to hand. It is a pain when you have to get up and search for something during the job. Get your soldering iron heating up while you are preparing the area. You want to set the iron to 450oC and have it heating up for about 10mins before you begin.

- Soldering Station or Corded Soldering Iron (must be grounded! and at least 40w (60w is a good choice)
60w ERSA soldering station. Very important to have a wet sponge to clean the iron when working, whether you get a corded iron or station.
what you thought was good was useless. 40w is the absolute minimum for recapping. short "standard" chisel tips are recommended because they hold more heat

- Solder (60/40, 0.8mm is good)
solder 60/40 0.8mm
- Stainless Steel Sewing Needle or Stainless Steel Dental Pick (see later on in the FAQ)
- Desoldering Bulb (if you like)
- Lead Clippers (Fine Wire Cutters)
pro's kit lead clippers
- Board Holder
- Flux Cleaner Spray
Cramolin Flux-Off spray
- Q-Tips/Cotton Buds (normall used for cleaning your ears)
- Alcohol (95% or best 99-100%) for cleaning electrolyte from the board
- Antistatic Wrist Strap
anti-static wrist strap
For cleaning the lead holes you can use either only the needle/pick or use a desoldering bulb/desoldering braid/desoldering iron (your preference)
Get the capacitors ready
Especially if you are working with several values of capacitors it is good to have each value in seperate compartments of one of those plastic boxes with many compartments for organising screws and stuff. This prevents picking up the wrong value and installing it on the board. You can use one of the compartments to put the removed capacitors in.
Remove all components from the board
It is pretty obvious but it will get said anyway. You must remove the HSF (CPU Heatsink/Fan), CPU, Ram, and all cards from the board before you start. When you are removing the HSF of a socket processor (non P4 etc) you should place a business card inbetween the bottom of the clip that you will put pressure on and the board. This is because it is quite easy to press too hard and damage the traces.
Clean the board
Clean the board of dust on both sides using canned air before you start work.
Get the board holder ready
An easy to find board holder is two wood clamps, the ones which you use to secure wood to the table for safe sawing. There is probably some in your garage. You can attach them to your work desk upside down and then the board fits in between the handles and the metal guides of the clamps. It is important to have the board secure for removing the caps. If you intend to work with the board between your knees or something, it is not recommended and you will probably burn yourself.

You will want the board holder to be at one side of your workspace and then you want a clear flat area to accommodate the board lying on the table for installing the new caps. Your soldering iron must be in easy reach of both areas and comfortable to work with.
5. Removing the Capacitors
Get your safety glasses on
When you are soldering you MUST wear safety glasses or your normal prescription glasses. A spatter of hot flux in your eye can injure you seriously.
Get your antistatic wrist strap on
You must wear an antistatic wrist strap when you are soldering or handling the board. Put it on the hand holding the iron. The best place to connect the wrist strap is to the back of a computer which is plugged in.
Get the board holder ready
The best way for removing capacitors is to put the board on the table with the rear facing up. Then add solder to several caps. Then put it into the board holder to remove the caps. Ideally with the front of the board facing you while you heat from the rear. Otherwise you can hold the board in your knees if you have no board holder.
Add solder to each lead at the back of the board
It is very important to add a little bit of solder to the leads of the capacitor you are to remove, at the position where the lead meets the board. This will assist you in heating all the solder quickly and easily when you remove the capacitor.

So heat up one of the capacitors leads from the rear of the board so your iron is contacting the pad around the hole and the lead. Then apply a touch of solder to the solder already there. Do the same to the other lead.

It is fastest to do this to a row of capacitors and then concentrate on their removal process.
adding solder to the leads of the existing capacitors
solder added and ready for removal.
Remove the capacitor
In order to remove the capacitor, you will heat up one of the capacitors leads from the rear of the board so your iron is contacting the pad around the hole and the lead. Then you will wiggle and push the capacitor towards the other lead while still heating the solder with the iron. Then do the same with the other lead.

You will make your own technique here. Some people like to heat both leads and wiggle them out at the same time. Others like to alternately heat and wiggle each lead until the capacitor is free. Or even get one lead completely out and then work on the other.

It is important to find the best way that removes the capacitor with the least strain. You must make sure that all the solder is nice and hot and dont pull hard but wiggle the lead back and forth a little until it is coming free. If you pull too hard when the solder is not hot enough you can damage the foil of the lead port which runs through the board and makes the connection to the electrical traces. Dont worry just be gentle and you will not harm the board.
Removing the cap
Having Problems to remove the capacitor?
If you are having problems to remove the capacitor then maybe your iron is not hot enough. If it is a 60W then maybe you should try a different sized tip, perhaps the tip is too long and thin and not transferring enough heat from the iron's heater.

Dont forget that if you are working near big traces they suck up the heat from the iron making it difficult to work in that position.

The types of solder used appear to differ with each board manufacturer. Some are easy to heat up, others are not. Older boards are more difficult to work on. Most boards you will have no problem with if your iron is hot enough.

There are different techniques for working on difficult boards. Some like to heat the board with a hot air heat gun or work with hot air pencil. Others like to use large wattage soldering guns for stubborn solder pads. All of these require some experience and knowledge otherwise the board will get trashed.
Clearing the Hole
Once you have removed the capacitor the hole will not be clean unless you are quite lucky. Some people dont bother to clean the hole but position the leads of the new cap against the holes and then push the cap in at the same time while heating the holes on the back of the board. This not such a great method and it is best to clean the hole first before installing the new cap.

Here we will discuss some methods for cleaning the holes. Really you will have to find the method which works best for you. In order to clean the hole it may help you to have the board held by the board holder.
Mechanical Solder Pumps
It is NOT recommended to use a mechanical pneumatic solder pump in order to clean the hole, they really have far too much power. There is a possibility to damage the lead port by sucking it out at the same time as the solder. This would mean that you would have to carefully solder in the new cap, making sure that solder flowed all the way through the hole in order to meet the right traces in the layers of the board. It will be quite difficult so forget about mechanical solder pumps. Additionally the recoil can impact the board and damage a trace or the pump can spray solder debris on the board that can cause a short when you power up the board.
pneumatic solder pumps. not recommended. if you really have to use them then use them half not full cocked. once you learn a good needle or dental pick technique you will forget about them. they are useful though for removing atx/usb/kbd connectors though
Solder Bulb
You could try to clear the hole using a solder bulb which is a device with nozzle and a bulb. The suction is not so powerful as the solder pump but it has enough power to clean the vias. You can use it working with the nozzle on the front of the board and the soldering iron at the back (method 1). Or you could use it working both with the nozzle and the soldering iron at the back of the board (method 2). It is a personal preference again. Some find it difficult to work from both sides of the board at the same time and for that you do need a board holder (others use their knees but you must be careful if you do that). If you were using method 2 you could have the board flat on the table.

(method 1) You place the nozzle flush against the hole on the front of the board while heating the hole with the iron from the rear of the board. You release the iron from the back of the board and then quickly compress the bulb in order to suck the solder out of the hole. You may find this type of desoldering tool useful or not effective.

It is not recommended to use the bulb more than twice on the same hole. If the hole is not then clear after that it is best to proceed to using the dental pick or needle technique. You can also apply a little fresh solder into the hole on the back of the board in order to assist the solder removal process before you use the bulb.
desoldering bulb
Desoldering Wick
Some people like to use desoldering wick which you place on the hole and then heat it with the iron. Solder will then be drawn and stuck to the wick. You then cut off the part with the solder on periodically to have a fresh bit of wick to work with. Some people like using it, some do not find it useful.
Desoldering Iron
If you are doing a lot of cap replacement you may find it useful to buy a desoldering iron from one of the major manufacturers. This will be like a soldering iron but it has a vacuum pump which will suck up the solder through the tip. It will be much easier to work using this type of unit but they are quite expensive.
Dental Pick or Needle
Topcat, the owner of badaps.net developed the solution of using a dental pick to clear the holes. This is not a toothpick, it is the hand tool that the dentist uses to scrape inbetween your teeth. You will have to source this from a medical shop or your dentist! It has the benefit of sinking the heat away from the board also.
perfect sized needle (just bigger than a cap lead) held in part of an electrical block.
Again like the desoldering bulb there is personal preference, you can either work with the pick on the front of the board while heating from the back or like topcat does work with both the pic and the iron on the back of the board.

So what you will do is heat the hole with the iron until the solder is melted. Then you insert the pick into the hole as far as it will go without forcing it until it emerges from the other side. Then you remove the iron and let the solder harden. Since the pick is stainless steel, the solder will not adhere to it. Then you gently spin and wiggle the pick around until it breaks loose and remove it from the hole. You can use a razor knife to scrape the dry solder from the hole but be careful not to damage a trace on the board. The hole should be clear now. If you do not have access to a dental pick you could use instead a stainless steel sewing needle. It may be useful to have two sizes (one small and sharp, one bigger and rounded tip) which you can hold in an electrical block (the common type used to connect two cables together.
helping the needle along on a difficult hole by heating from the front
So you will make your personal choice of how to clear the holes, the intention is to find a method that will clear the holes fastest as when you heat the pads for a very long time you will damage the board. The most important thing is to have a good hot iron so you go in hot and fast.
Checking the hole
It is very useful to have a desk light nearby that you can shine on the back of the board and see if the holes are nice and clean. It is much easier to see that the hole is clean when light is shining through.
holes cleaned
7. Installing the new capacitors
Preparing the capacitor for installation
New capacitors come with quite long leads, it is recommended to trim the leads of a capacitor you are going to install to about 1cm length for both leads. This is not a requirement but it will make it easier for you to insert short leads through the holes rather than unneccessarily long leads. In order to trim the capacitor leads you will use micro clippers not standard wire clippers. This is because the micro clippers cut the wires nicely and do not compress the ends into sharp points like the standard wire clippers.
Remove the board from the board holder
In order to install the capacitor you will have the board flat on the table.
Check for the negative lead carefully before you begin
Look at the front of the board, you will see a white semi-circle or mark at one side of the circle. You must match up the white/silver/gold line that goes down one side of the capacitor with this white mark. This shows the negative lead. Pay attention to this it is important, the capacitor will blow if installed incorrectly when you apply power to the board.
This is where it is useful to refer to the diagram that you made before you started the recapping process. Double check on the diagram the value of the cap to be installed and also double check the polarity. Sometimes the polarity noted on the board stencil is incorrect. Trust the polarity the old capacitor was installed in, rather than the board stencil. Asus for instance indicate positive with the white hemisphere unlike everybody else.

Check also on the front of the board that you have not marked an X to show that a capacitor was not installed in that position. It is easy to get carried away and make that mistake. It is not recommended to install new caps where there were not before unless you are following a tried and tested mod.
Do not force the capacitor leads down the hole
You must bend the leads together slightly so they are going to go down both holes nice, do not force the capacitor, if you have problems bend the leads some more or maybe you will have to clean the hole again but better this time. If you force you may damage the foil around the inside of the hole.
8. Soldering the capacitor in
Put the capacitor in and then put the board flat on the table with the rear of the board facing you. pull the legs of the capacitor to check that it is tight against the board and bend the legs of the cap slightly outwards. not too much, just enough to hold the cap.

You will heat up both the pad around the hole and also the lead with the iron. You will choose to position the solder at a point where there is an obvious space between the lead and the pad around the hole. Have your iron at the other side. Then you will feed solder into the hole. If you have difficulties heating the lead and pad enough you may touch the solder quickly on the iron and then feed down the hole.
soldering the new cap in
The lead port connects the solder pad through the hole to the pad on the other side of the board and on the way also makes connection to the correct traces for that component on whatever layer of the board required by the design. Therefore it is not necessary to get solder down the hole in order to make a good electrical contact. It is good to get a bit of solder down the hole in order to physically hold the capacitor better on the board. However when you are perfecting your solder techniques you will find that wetting the hole with solder and immediately trying to get solder down the hole makes a much better joint than working only on the solder pad which may give an ugly ball solder joint.
nice shiny solder joints is what you need to see. difficult to take a timer photo and make a nice joint. anyway no more solder than that is what you need. if you solder at 450oC like you removed the cap it is difficult to make a pretty joint. it is fine though. for best performance solder in at 350oC
Learn what is a good solder joint
You will probably realise that you needed less solder and time than you imagined. Check with the links below and understand what is a good solder joint and then try to make the next one better. This is where technique is difficult to teach. You must understand a good solder joint and then modify your technique until you achieve it. I think that the 450oC may be too hot to achieve a perfect joint though but it is easier to have the iron the same heat as to remove caps. The perfect solder joint is just enough solder to make a good connection. The solder does not make a ball around the solder pad, it curves from the lead in the middle down to the sides of the pad. Dont worry that you did not make a nice joint, as long as the joint is nice and shiny and the solder went down the hole you will learn to make nice solder joints with practice. Do the other lead now.

It is indicated by the manufacturers that if the solder is immediately melted by the iron then the iron is too hot. It should take 1.5-3 seconds to melt the solder. They do not recommend heating for longer than 3 seconds. But dont worry too much about this, concentrate on making a good solder joint and each time you will be faster to solder the cap on.
Clip the leads
When you have finished you will use a small pair of wire clippers to clip the excess leads. I recommend the 8PK-30D from Pro's Kit which is a great taiwanese company and not very expensive. Big standard wire clippers will not do a good job, you need proper micro clippers, these are also useful if you want to trim the leads of the capacitor before installing. Clip the leads similarly short as other components on the board.
leads clipped
Do not reheat the solder
It is not recommended to reheat the solder you have applied to new caps and then apply more if there is a problem. This may result in a worse joint. Better to do the entire process to remove the cap, clean the hole and start again.
Do not remove and reinstall capacitors an excessive number of times
The more times you do this you increase the danger of damaging the vias on the board. Also if you heat new capacitors excessively you will damage them, so we want to only heat them once when we solder them in and therefore ensure that they will work at their best. One example of such bad practice would be removing old capacitors from a donor board then reinstalling them into the board you are fixing just to test if it posts and then removing them and installing new good capacitors. Best to install new capacitors the first time and minimise the possibility of damaging the board.
9. Finishing the Job - Cleaning the board
When you have finshed you will need to clean the flux from around the solder joints and also the flux splatters which may be around the board. You will need to use a FLUX-OFF spray. I am using one from Cramolin which is called FLUX-OFF and is dimethoxymethane. This will damage plastics and PVC so you will spray a little around the solder joints and manipulate the excess using a cotton bud or Q-tip (normally used for cleaning your ears) so it does not flow down a hole like from the pci slots or whatever to the other side of the board. Then you can rub the excess flux around the joints using the bud. After doing all the joints and checking for ones i have missed i leave the board with a halogen desk lamp (or other hot desk lamp) about a foot from it for 10mins to ensure that all the FLUX-OFF has evaporated. It is highly inflammable so no smoking. The reason you do this cleaning is because some fluxes are mildly corrosive.

If you used solder with no clean flux then you can skip this step.
If you compare the earlier photos you see the brown flux around the solder joints. it looks like the board is burnt but it is not. after cleaning it looks like this.
10. Checking the Board before you apply Power to it
When the recapping is done it is important to check the board very well before applying power to it.
Visually check the board
Check for little pieces of solder or bits of the leads you have clipped that have stuck to the board and may make a short. I also blast the board on both sides with some canned air for the same reasons. Check the solder pads on the back of the board for the caps that you installed to see that they are not connected by solder to a nearby component and will make a short. It is not good to have a short when you power up the board.
Check the board against the diagram you made
See that ALL the capacitors you have installed are the correct values and are installed in the right direction before you apply power to it. Check again that you did NOT install caps in positions where there were not before.
a finished recapping job
Apply power to the board
Connect processor/ram/keyboard/floppy disk and monitor, then power up the board. It is useful to have cpus and ram which are for testing only so you do not fry customers or friends parts if you made a mistake.
If it does not POST
Don't jump to the conclusion that you screwed the board on the basis of the boards leds which show a post error or if you do not get a video signal. Stay calm and check your monitor connections, ram seating, cpu seating before you decide you made a soldering mistake. Check the manual for the board leds to see what is the problem. I guarantee that if you were reasonably careful you will get a boot. The boards can take some soldering abuse. If you burnt or scratched some board traces while you were working or have a short that is another thing though. Sometimes clearing the bios using the jumper or taking the battery out can solve problems.
damaged traces from excessive heating. not good shots because those are after attempted repair but you get the idea.
11. Run test utilities
First I would start off booting a ram test utility disk like http://www.memtest86.com/ and checking for ram errors for a few hours while using known GOOD ram, then you can run some burn in utilities like prime95 http://www.mersenne.org/freesoft.htm also in Windows and you would want to see the board totally stable with no errors after running them for some days. At least run the board overnight if you are in a hurry.
12. Good luck with your new board
DIY will make you very happy and you may go on to some other soldering task such as making a stereo amp kit or something. A worthwhile way to pass the weekend and very rewarding. If you progress to doing nice looking cap replacements then you can start doing your friends' boards as well and make some money. If you can do this work then you have nothing to worry about, many component failures are due to bad caps. You could even progress to buying stuff with bad caps for cheap and repairing it yourself. At least you will never worry about buying components with cheap caps again, you will be able to restore them to longevity yourself.