PIC Microcontroller DIY

        Introducing PIC Microcontroller projects

 

Written by Lim Siong Boon, last dated 20-Oct-09.

 

 

PIC Microcontroller

 

 

References:

Microchip dsPic 30F Programming reference guide

microchip dspic quick reference guide

 

www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller

Singapore Customized, custom made Electronics Circuits & Kits

 

Development Tools History

 

 

PIC microcontroller Development Board

(Completed on 2006-10-28)

The ultimate PIC Microcontroller development board. After years of programming PIC microcontroller, I have finally design my super development board to program PIC microcontroller firmware. The automatic programming mode select and the 40 bits LED light bar display have ease my programming process and increase debugging speed by 10 times. I can easily do troubleshooting because of the 40 bits LED display. The LED allows display for 5 bytes of variables using only 3 bits of any output port. I used to allocate PORTD to display one byte of the memory. Debugging used to be slow and tedious. This board also features automatic select to programming mode when the board is powered down. This means that there is no need to do manual switching. The ICSP interface allows the firmware to be loaded to the microcontroller without inserting/removing IC chip.

Features

-Development for 18, 28, 40 pins DIP PIC microcontroller

-Serial Communication RS232, with Tx/Rx transmission activities indicator.

-Changeable microcontroller Crystal Clock

-ICSP programming pins

-Automatic switch to programming mode when board power is turned off.

-Proper labels and easy to view LED bar display, buffered from all the ports. Output pins from all the ports.

-Serial to parallel data latching to extend more output bits from 3 output pins. Output pins with easy to view LED bar display.

-Adjustable dc-dc power supply using LM2576-ADJ IC to cater for 5V and 3.3V power supply system.

-Features 74HC series logic family and Max232 IC for operating on 3.3V power supply. (see logic family selection guide)

-Fuse protection.

 

     

Click on the image for Circuit Schematic

For more information for extending microcontroller I/O (input/output) ports using “serial to parrallel” or “parallel to serial” circuit, you can refer to More Circuit Schematic.

 

The development board uses the following logic IC:

74HC595, serial to parallel with output latched

74HC244, octal logic buffer

MAX232, RS232 to TTL tranceiver

LM2576-adj, DC-DC voltage regulator

 

For more information on how to select logic family, see “Logic Selection Guide” from Texas Instrument.

Introduction: AUP, CBT-C, CB3T/Q, SSTU, VME, AUC, SSTV, GTLP, Little Logic, AVC, TVC, ALVT, CBTLV, ALVC, CBT, LVC, LV

Mature: AHC/AHCT, LVT-A, ABT, FCT, AC/ACT, HC/HCT, BCT, CD4000

Obsolescence: 74ALS, 74F, 74AS, 74LS, 74S, 74xx (oldest)

 

PIC microcontroller Programmer

(Completed in the year 2005)

My first own build programmer system. Spent quite a lot of time designing and fabricating the plastic box chassis. It works, but I never really work much with it after I brought myself a commercial version.

 

Microcontroller DIP IC Adaptor

(Completed in the year 2002-05-xx)

This is a interface board for fitting various model of PIC microcontroller to the programmer. The programming pins numer is different for every PIC microcontroller model. This interface board eliminate the need to build a new programmer board for different PIC microcontroller model.

 

PIC Programmer & Development board

(Completed in the year 2002-05-xx)

This board is design to be function as a multi purpose PIC microcontroller development board. I have build specially to trial run the microcontroller firmware I wrote. Bi-directional digital buffer are used, to protect the microcontroller from external device during interfacing. After working with microcontroller for some time, I find that this buffer interface is not necessary. Microcontroller I/O ports do not damage easily. When interfacing microcontroller with high powered or unknown devices, opto-coupler can be used instead. Opto-coupler provides maximum isolation as well as protection between the microcontroller and other devices.

Attached to the main PCB is a smaller PCB board. It consist of a MAX232 converting computer RS232 to microcontroller TTL serial signal. This small board also include a charge pump circuit that generate 12V from a 5V source for the purpose of programming the PIC microcontroller. This programmer design “Toolkit TK3 PIC programmer” was taken reference from my favourite hobby magazine “Everyday Practical Electronics“.

 

Development Board schematic & PCB layout

Programmer Board schematic & PCB layout

Microcontroller Essential Test Tools

(Completed in the year 2002-05-xx)

Input switches and Output LED test board interface. It is very useful when doing microcontroller project, because it can help to indicate if the firmware is running correctly inside the microcontroller. A must have kit when doing digital project.

 

 

PIC microcontroller selection references.

table updated in 26 May 2007

Number of Pin PIC16F series PIC18F series alternative
14 PIC16F688  
18

(all  models, not pin compatible)

PIC16F88, PIC16F648a, PIC16F628a, PIC16F84a PIC18F1320, PIC18F1220, PIC18F1330, PIC18F1230
28 PIC16F876a PIC18F2620, PIC18F2525, PIC18F2420
40 PIC16F877a PIC18F4620, PIC18F4525, PIC18F4420
40 USB supported Best features PIC18F4550

 

 

 

 

Microchip Microcontroller Common Function Pin Out.
The following table provides a quick overall view the various essential pins of microchip microcontroller, to allow the use of alternative part no., and allowing PCB design to suit the most common pin out.

  Specification ICSP pin out Vcap pin out OSC pin out UART fixed pin out  Preferred I/O use Comment
Microcontroller part no. Package /Pin no. Volt !MCLR Vdd (+) Vss (-) PGD1 PGC1 PGD2 PGC2 PGD3 PGC3 Vcap DisVreg OSC1 OSC2 TX1 RX1 TX2 RX2 Input Output  
                                             
64 pins                                            
PIC24HJ256GP206A TQFP/64 3V – 3.6V 7 10
19
26
38
57
9
20
25
41
18 17 47 48 16 15 56   39 40 33 34 32 31      
44 pins                                            
PIC24FJ64GA004 TQFP/44 2V – 3.6V 18 17
28
40

16
29
39

21 22 8 9 41 42 7 6 30 31             EEPROM
PIC24FJ64GA104 TQFP/44 2V – 3.6V 18 17
28
40
16
29
39
21 22 8 9 41 42 7 6 30 31              
PIC24FJ64GB004 TQFP/44 2V – 3.6V 18 17
28
40
16
29
39
21 22 8 9 19 20 7 6 30 31              
PIC24F32KA304 TQFP/44 1.8V – 5.5V 18 17
28
40
16
29
39
21 22 8 9 41 42 7   30 31 3 2 21 22      
PIC24FJ32MC104 TQFP/44 3V – 3.6V 18 17
28
40
6
16
29
39
21 22 19 20 33 34 7   30 31              
dsPIC30F2023 TQFP/44 3V – 5.5V 18 7
17
29
40
6
17
30
39
44 1 34 35 41 42     32 33 20 15 34 35      
dsPIC33FJ128GP804 TQFP/44 3V – 3.6V 18 17
28
40
16
29
39
21 22 8 9 41 42 7 6 30 31              No EEPROM
dsPIC33FJ32MC104 TQFP/44 3V – 3.6V                                        
dsPIC33FJ128MC804 TQFP/44 3V – 3.6V 18 17
28
40
6
16
29
39
21 22 8 9 41 42 7   30 31              
dsPIC33FJ16GS504 TQFP/44 3V – 3.6V 18

17
29
40

6
16
30
39
44 1 34 35 41 42 7   32 33              
dsPIC33EP128GM304                                           8x input capture, 12x PWM, 4x UART, 3x SPI, 18x ADC
Microcontroller part no. Package /Pin no. Volt !MCLR Vdd (+) Vss (-) PGD1 PGC1 PGD2 PGC2 PGD3 PGC3 Vcap DisVreg OSC1 OSC2 TX1 RX1 TX2 RX2 Input Output  
                                             
28 pins                                            
PIC24F16KL402 SOIC/28 1.8V – 3.6V 1 13
28
8
27
4 5 21 22 14 15     9 10 16 6 4 5      
PIC24F32KA302 SOIC/28 1.8V – 5.5V 1 13
28
8
27
4 5 21 22 14 15     9 10 16 6 4 5      
PIC24FJ64GA002 SOIC/28 2V – 3.6V 1 13
28
8
27
4 5 21 22 14 15 20 19 9 10              EEPROM
PIC24FJ64GA102 SOIC/28 2V – 3.6V 1 13
28
8
27
4 5 21 22 14 15 20 19 9 10              
PIC24FJ64GB002 SOIC/28 2V – 3.6V 1 13
28
8
27
4 5 21 22     20 19 9 10              
PIC24FJ32MC102 SOIC/28 3V – 3.6V 1 13
28
19
27
4 5 2 3 11 12 20   9 10              
dsPIC30F2010 SOIC/28 2.5V – 5.5V 1 13
20
28

8
19
27

17 18             9

10

 

17 18 11 12      
dsPIC30F2020 SOIC/28 3V – 5.5V 1 13
20
28
8
19
27
17 18 11 12 14 15     9 10 17 18 11 12      
dsPIC30F2012 SOIC/28 2.5V – 5.5V 1 13
20
28
8
19
27
17 18





9 10 17 18 11 12


dsPIC30F3010 SOIC/28 2.5V – 5.5V 1 13
20
28
8
19
27
17 18             9 10 17 18 11 12      
dsPIC30F3013 SOIC/28 2.5V – 5.5V 1 13
20
28
8
19
27
17 18             9 10 17 18 21
11
22
12
     
dsPIC30F4012 SOIC/28 2.5V – 5.5V 1 13
20
28
8
19
27
17 18             9 10 17 18 11 12      
dsPIC33FJ32GP102 SOIC/28 3V – 3.6V 1 13
28
8
19
27
4 5 2 3 11 12 20   9 10              
dsPIC33FJ128GP802 SOIC/28 3V – 3.6V 1 13
28
8
19
27
4 5 21 22 14 15 20   9 10              
dsPIC33FJ128MC802 SOIC/28 3V – 3.6V 1 13
28

8
19
27

4 5 21 22 14 15 20   9 10              
dsPIC33FJ09GS302 SOIC/28 3V – 3.6V 1 13
28
8
19
27
17 18 11 12 14 15 20   9 10              
dsPIC33FJ16GS502 SOIC/28 3V – 3.6V 1 13
28
8
19
27
17 18 11 12 14 15 20   9 10              
Microcontroller part no. Package /Pin no. Volt !MCLR Vdd (+) Vss (-) PGD1 PGC1 PGD2 PGC2 PGD3 PGC3 Vcap DisVreg OSC1 OSC2 TX1 RX1 TX2 RX2 Input Output  
                                             
20pins                                            
dsPIC33FJ12MC201                                           Quite mature product.
PIC16F18344
PIC16F18345
PIC16F18346
SSOP/20
1.8V – 5.5V 4 1
20
19
18








19
18




***new
Same series as PIC16F18325
                                             
18pins





















dsPIC30F3012 SOIC/18 2.5V – 5.5V 1 14, 18
13, 17 11 12





6 7 11 12



Mid number of I/O, operating at 5V.























14pins                                            
PIC24F04KA200 TSSOP/14 1.8V – 3.6V 1 14 13     3 2 6 7     4 5 11 12     10  

EEPROM
Code Protection
Warning!!!-> very very little memory, 4K only. Not enough for comfortable protocol processing. Please take note.

(Don’t use this in future. Use alternative PIC16F1825)

PIC24F08KL200  TSSOP/14 1.8V – 3.6V 1 14 13     3 2 6 7     4 5 11 12     10  

Compatiable to PIC24F04KA200, with more memory.
Face problem dealing with UART on its revision A0.

(Don’t use this in future. Having problem using the I/O pins as input (RA4, RB4, RA2, RA3), no access to AD1PCFG to enable digital input. Use alternative PIC16F1825)

PIC16F1825 TSSOP/14 1.8V – 5.5V
4
1
14
13
12






2
3
13
12
6
5


Wide voltage range for a middle size chip. 12x I/O pins. Internal weak pull-up don’t work too well as voltage starts to drop when too many pull-up gets loaded (better design with external pull up).
Not suitable for high speed signal processing (for <10us switching speed).
PIC16F18323
PIC16F18324
PIC16F18325
PIC16F18326
TSSOP/14 1.8V – 5.5V 4 1 14 13 12







13 12



***new
– EEPROM
Same series as PIC16F18345
                                             
8 pins                                            
PIC16F18313
SOIC/8 1.8V – 5.5V 4 1 8 7 6             2 3 7
6



compatiable to the 16F1832x, 34x series SOIC footprint.
PIC12F1840
(consider using cheaper PIC16F18313)
SOIC/8 1.8V – 5.5V 4 1 8 7 6             2 3 7
6         UART
PIC12F1822 SOIC/8 1.8V – 5.5V 4 1 8 7 6             2 3 7 6         UART
PIC12HV615 SOIC/8 2-15V 4 1 8 7 6             2 3             2-15V
PIC12F508 SOIC/8 2-5.5V 4 1 8 7 6             2 3             low cost
Microcontroller part no. Package /Pin no. Volt !MCLR Vdd (+) Vss (-) PGD1 PGC1 PGD2 PGC2 PGD3 PGC3 Vcap DisVreg OSC1 OSC2 TX1 RX1 TX2 RX2 Input Output  
                                             
6 pins                                            
PIC10F322 SOT23/6 1.8V – 5.5V 6 5 2 1 3             3           4, 6 1, 3 most powerful
PIC10F200 SOT23/6 2V – 5.5V 6 5 2 1 3                         4, 6 1, 3 low cost

Legend

Product Identification System (example)

dsPIC 33 FJ 16 MC1 02 T E / SP – XXX
—– — — — — — – –   —   —
1     2  3  4  5   6  7 8   9    10

1 – Microchip Trademark
2 – Architecture
    10 – 
    12 – 
    16 – 
    18 – 
    24 – 16-bit Microcontroller
    30 – 
    33 – 16-bit Digital Signal Controller
3 – Flash Memory Family
    FJ – Flash program memory, 3.3V
    F  – Flash
    EP – Enhanced Performance
    HJ – Flash program memory, 3.3V, High-speed
4 – Program Memory Size (Kbyte)
5 – Product Group
    GP? – General Purpose family
    MC1 – Motor Control family
    GS? – Switch Mode Power Supply (SMPS) family
6 – Pin Count
    01 – 18-pin and 20-pin
    02 – 28-pin and 32-pin
    04 – 44-pin
    06 – 64-pin
    10 – 100-pin
7 – Tape and Reel Flag
       – Standard packaging (tube or tray)
    T  – Tape and Reel
8 – Temperature Range
    I  – -40ºC to +85ºC  (Industrial)
    E  – -40ºC to +125ºC (Extended)
    H  – -40ºC to +150ºC (High)
9 – Package
    P  – PDIP  (Plastic Dual In-Line)
    SS – SSOP  (Plastic Shrink Small Outline)
    SP – SPDIP (Shinny Plastic Dual In-Line)
    SO – SOIC  (Plastic Small Outline)
    SN – SOIC  (8-Lead)
    SL – SOIC
    ML – QFN   (Plastic Quad, No Lead)
    MR – QFN   (Thin Quad Flatpack)
    MG – QFN   (Micro Lead Frame)
    MM – QFN-S   (Plastic Quad, No Lead)
    MV – UQFN
    PT – TQFP  (Plastic Thin Quad Flatpack)
    PF – TQFP  (Plastic Thin Quad Flatpack, 14x14mm)
    ST – TSSOP
    TL – VTLA  (Very Thin Leadless Array)
    MF – Micro Lead Frame (DFN)
    MC – DFN
    OT – SOT-23
10- Pattern
    QTP, SQTP, Code or Special Requirements

It is a headache trying to maximise the pin compatibility with a wider range of microcontrollers and applications,
such that firmware changes can be minimised.
The following are suggesting pins use for reference, base on the following microcontroller:

Microcontroller part no. Package /Pin no. Volt !MCLR Vdd (+) Vss (-) PGD PGC OSC1 OSC2 TX1 RX1 TX1
Ctrl
TX2 RX2 TX2
Ctrl
Output
Indicators
Input
Switch
Input
Analog
I/O PWM        
                                                 
44 pins                                                
PIC24FJ64GA002 TQFP/44 2V – 3.6V 18 17
28
40

16
29
39

21 22 30 31 44 1 3 8 9 10 33, 34, 41 21, 22 19,20 15, 14, 11, 10          
PIC24FJ64GA002 SOIC/28 2V – 3.6V 1 13
28
8
27
4 5 9 10 17 18 16 21
11
22
12
23 11, 12, 14 4, 5 2,3 26, 25, 24, 23          
PIC12F1840     4 1 8 7 6 2 3 7 6         7, 6 4, 7, 6 3, 5            
PIC10F322     6 5 2 1 3                 1, 3 6, 1, 3 1, 3, 4 4 1, 3        

 

 

 

 

 

www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller

Singapore Customized, custom made Electronics Circuits & Kits

 

 

PIC10F206 Microcontroller Schematic

source code:
2011-11-30 mini RGB microcontroller (c).zip
2011-11-30 mini RGB microcontroller (asm).zip


 

 

 

Microchip MPLAB microcontroller startup troubleshooting guide.

2009-10-08

Getting my “hello world” firmware loaded into my new hardware design pose the most difficult part of the process. Time consuming doing debugging, and it can takes from half a day to two. The most difficult part, to spent those precious engineering time in debugging. Debugging what I thought I should be good in since I have done so many microcontroller project. Till this day, I still have the problem every time I start microcontroller project after a few months break. The reason I have this guide written. To provide myself possible solution, that can help me, if I encounter the same issue again.

 

 

Setting up the environment for project using MPLAB v8.70

1) Create a project folder. Open the MPLAB IDE software.

2) Open a new Project. Project>New… and enter in a name for the project.

3) Select the microcontroller that is use in the project. Configure>Select Device… and select the microcontroller for your project.

4) Check the configuration mode ‘Release’. Project>Build Configuration>Release

5) Select the correct toolsuite for your project. Project>Select Language Toolsuite… for typical C lanaguage implementation, choose “MPLAB” C30 C Complier (pic-30-gcc.exe) v3.24

6) Add in the search path for your microcontroller’s header file. Project>Build Options…>Project>Directories>Include Search Path, choose add to add in the directory that contains the microcontroller’s header files. For my example, the header is located in the directory “C:\Program Files (x86)\Microchip\MPLAB C30\support\dsPIC33F\h”

7) Add in or create all the *.c & *.h files, to start your programming.

 

 
I use PICkit2 most of the time, because it is a small and compact programmer. Today, I tried out PICkit3. Well I am quite impress with the changes from PICkit2. I hope to get that one day. As for this article, the error messages is meant for PICkit2 use on the IDE Mplab version 8.36.

I do not have much problem doing the compilation of my C programs. The frustration comes during the loading of my hex codes into my newly design prototype circuit. Most of the time is due to human error, because my prototype board are mainly hand soldered, pin by pin.

On the left is the typical error message I encounter. I am scare of them to be frank. I see them almost every time.

 

Initialisation of PICkit2 when connected to Mplab

Initializing PICkit 2 version 0.0.3.63
Found PICkit 2 – Operating System Version 2.32.0
Target power not detected – Powering from PICkit 2 ( 3.30V)
PKWarn0003: Unexpected device ID:  Please verify that a PIC24FJ32GA004 is correctly installed in the application.  (Expected ID = 0x44D0000, ID Read = 0x0)
PICkit 2 Ready

Every time when I press the shortcut key Alt+G, G to program the controller, PICkit will attempt to read the device ID of the microcontroller. The microcontroller used in this example is PIC24FJ32GA004.

As you can see in the error on the right. PICkit is expecting the microcontroller with device ID 0x44D0000. The read by PICkit detects a ID of 0x0. In fact this same error is identical as if the PICkit programmer is not inserted to the ICSP programming pins at all.

This is a hard evident that the microcontroller is not wired properly or evenly not wired at all.

 

Error Encounter using PICkit2 version 2.63, MPLAB version 8.36

Programming Target (10/8/2009  4:37:06 PM)
PKWarn0003: Unexpected device ID:  Please verify that a PIC24FJ32GA004 is correctly installed in the application.  (Expected ID = 0x44D0000, ID Read = 0x0)
Erasing Target
Programming Program Memory (0x0 – 0x23FF)
   PE Error: Using ICSP
Verifying Program Memory (0x0 – 0x23FF)
   PE Error: Using ICSP
PK2Error0027:  Failed verify (Address = 0x0 – Expected Value 0x40200 – Value Read 0x0)
PICkit 2 Ready

 

1) The first thing to check if your hardware. It is most of the time the source of the problem. Check if the ICSP programming pins are wired correctly

ICSP pin out

Pin 1: !MCLR

Pin 2: Vdd (3.3V or 5V, depends on the device)

Pin 3: Vss (ground)

Pin 4: PGD (data line)

Pin 5: PGC (clocking line)

Pin 6: unused

 

Attached on the left is the basic schematic of the microcontroller PIC24FJ32GA004 if your wiring is exactly the same as what is shown, PICkit2 should be able to load the hex file into your controller without any problem.

An advise to you, don’t assume that your wiring is correct. Check 2 or more times to ensure. This is often one of my major mistake make. The schematic is typically correct, but because of the confident doing many similar project, the checking is often the lacking part.

For PIC24FJ series controller, there is a pin Vcap & DISVREG. Make sure that there is the capacitor there. !MCLR pin to be pull up to Vdd using a resistor about 10kohm.

The following pins are to be connected to PIC24FJ32GA004, in order for the ICSP programmer to download the *.hex files onto the microcontroller. Improper connection will definitely generate programming error messages.

 

Pins connection

Pin 18 connect to !MCLR
Pin 17, 28, 40 connect to Vdd (3.3V)
Pin 6, 16, 29, 39 connect to Vss (Gnd)
Pin 21 connect to PGD
Pin 22 connect to PGC
Pin 7 connect to as Vcap

 

Socket holder for PIC24FJ32GA004 TQFP-44 prototype board

Front

Back

 

TQFP-44 Prototype board or adaptor

This sub-board adaptor helps to convert small smd components to 2.54mm pitch for mounting onto pcb. The larger 2.54mm pitch will be easier to work with when doing prototyping. The board is available from PIC-CONTROL part no. PIC-200

pic-control smd adaptor http://www.pic-control.com/product/index.htm

 

 

2) Check if the header file declare in the source code is correct
#define    __PIC24FJ32GA004__
#include “p24fxxxx.h”

This actually informs the PICkit programmer what type of device it is going to encounter. This is also why the error message indicates the expected ID of 0x44D0000, which is the device ID for PIC24FJ32GA004 microcontroller.

Some example of other device ID for PIC24FJ series microcontroller.

Microcontroller          Device ID

PIC24FJ16GA002     0x00444

PIC24FJ32GA002     0x00445

PIC24FJ48GA002     0x004466

PIC24FJ64GA002     0x00447

PIC24FJ16GA004     0x0044C

PIC24FJ32GA004     0x0044D

PIC24FJ48GA004     0x0044E

PIC24FJ64GA004     0x0044F

You might double check if the microcontroller device is selected correctly under the menu “Configure”. It is probably not necessary as the device select is base on what is written with your source code.

 

 
3) Check if you have included the correct linker file for the microcontroller PIC24FJ32GA004. The file name goes something like this, “p24FJ32GA004.gld”. The file is available under the C30 folder “C:\Program Files\Microchip\MPLAB C30\support\PIC24F\gld”, after you installed the C30 compiler for your Mplab.

 

 
4) Do not solder capacitors on PGD, PGC pins. PGD PGC can be use for programming as well as I/O during operation. Due to the programming use, I will usually design this pin as an input during operational. This feature do free up the controller pins for other uses. Using it as an input, it does not have any load to worry about. There is one time I added capacitor across the input and ground, thinking that it may filter any switching noise from the switch input. The capacitor turns out to cause problem to the PGD PGC pins. It results in a slow slew rate causing data error during program loading.

 

Check out the following notes when designing ICSP on your microchip microcontroller.
Click to enlarge.

5) Ensure that your circuit is powered from it’s own power source. This is especially needed if you have a big load of components on our board. The PICkit programmer might not be able to support all those power. Sometimes the PICkit doesn’t provide the power. There should be a settings that allows your PICkit to supply the power.

 

 
Another similar error occur. This time round, the device ID is read as 0xFFFF0000. I found the problem and it happens that the ICSP pin 4 (PGD, data) and pin 5 (PGC, clock) has been wire wrongly. They are swapped. Programming Target (10/8/2009  6:13:18 PM)
PKWarn0003: Unexpected device ID:  Please verify that a PIC24FJ32GA004 is correctly installed in the application.  (Expected ID = 0x44D0000, ID Read = 0xFFFF0000)
Erasing Target
Programming Program Memory (0x0 – 0x23FF)
   PE Error: Using ICSP
Verifying Program Memory (0x0 – 0x23FF)
   PE Error: Using ICSP
PK2Error0027:  Failed verify (Address = 0x0 – Expected Value 0x40200 – Value Read 0xFFFFFF)

 

When the PICkit2 has sucessfully loaded the hex file into the microcontroller chip, you should see the message on the right. PICkit2 program loaded into microcontroller sucessfully

Programming Target (10/9/2009  10:30:46 AM)
PIC24FJ32GA004 found (Rev 0x3003)
Erasing Target
Programming Program Memory (0x0 – 0x23FF)
  (Using Programming Executive)
Verifying Program Memory (0x0 – 0x23FF)
  (Using Programming Executive)
Programming Configuration Memory
Verifying Configuration Memory
PICkit 2 Ready

   

 
   
   

 

Error Message Encountered Solution:

Error encountered while loading codes onto the chip:

“You are trying to change protected boot and secure memory. In order to do this you must select the “Boot, Secure and General Segments” option on the debug tool Secure Segment properties page. Failed to program device”

To program a chip that is code protected, need to set PICkit3 into a special mode.

go to project property>Conf:[default]>PICkit 3>Option categories>Secure Segment>Segments to be Programmed>Boot, Secure and General Segments

Try re-program the chip again. The new code should be able to over-write the old codes on the chip.

Alternative old solution method:
Solution: Goto Programmer > Settings > Secure Segment. Then do a “Earse Flash Device”


 

 

Useful C30 compiler pre-processor  
   

#define FIRMWARE_DATED __DATE__

//microcontroller dsPIC33FJ128GP804
#include “p33fxxxx.h”

#define CRYSTAL_MHZ 8
//#define CRYSTAL_MHZ 20

#define XBEE_BAUDRATE _115200bps

#define NUM_OF_LOADCELL 4
#if NUM_OF_LOADCELL == 4
   #define XXX
#elif NUM_OF_LOADCELL == 3
   #define XXX
#elif NUM_OF_LOADCELL == 2
   #define XXX
#elif NUM_OF_LOADCELL == 1
   #define XXX
#else
   #define XXX
#endif

//Features Check
#ifdef __HAS_EEDATA__
   #define XXX
#endif
   #define XXX
#ifdef __HAS_DSP__
   #define XXX
#endif
#ifdef __HAS_5VOLTS__
   #define XXX
#endif
#ifdef __HAS_CODEGUARD__
   #define XXX
#endif
#ifdef __HAS_DSP__
   #define XXX
#endif

#warning Testing only      //print warning message during compile time
#error “No Size 4”      //print error messageduring compile time

//Useful symbols which can be use to load the file name, code line and date of the code compilation
//__FILE__, __LINE__, __DATE__, __TIME__, __FUNCTION__ or __func__

 

 

 

Useful C30 codes  

Important, what to put in a header *.h.
macro definitions (preprocessor #defines)
structure, union, and enumeration declarations
typedef declarations
external function declarations
global variable declarations

Configuration Settings Reference

PIC18 Configuration Settings Addendum, 51537a.pdf

Configuration bits generator.
1) Open MPLABx, go to Window > PIC Memory views > Configuration Bits
2) A Configuration Bits section will be shown. Setup the configuration bits accordingly.
3) After the setting is done, click on the button “Generate Source Code to Output”
4) Copy and paste the configuration code to your source code.
List of interrupts

For XC8

void __interrupt(high_priority) Interrupt_ISR()


For XC16

void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _DefaultInterrupt(void)

Note: Be careful when implementing the “DefaultInterrupt”, as all interrupt vector may point to this rountine. (2016-02-05)


void __attribute__((__interrupt__,auto_psv,__shadow__)) _U1RXInterrupt(void)
void __attribute__((__interrupt__,auto_psv,__shadow__)) _U1TXInterrupt(void)
void __attribute__((__interrupt__,auto_psv,__shadow__)) _U2RXInterrupt(void)
void __attribute__((__interrupt__,auto_psv,__shadow__)) _U2TXInterrupt(void)

void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _IC1Interrupt() //input capture interrupt
void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _IC2Interrupt() //input capture interrupt
void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _CNInterrupt() //input change interrupt
void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _INT0Interrupt() //external interrupt
void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _INT1Interrupt() //external interrupt
void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _INT2Interrupt() //external interrupt
void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _INT3Interrupt() //external interrupt
void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _INT4Interrupt() //external interrupt

void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _T1Interrupt(void) //timer 1 interrupt
void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _T2Interrupt(void) //timer 2 interrupt
void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _T3Interrupt(void) //timer 3 interrupt
void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _T4Interrupt(void) //timer 4 interrupt
void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _T5Interrupt(void) //timer 5 interrupt
void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _T6Interrupt(void) //timer 6 interrupt
void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _T7Interrupt(void) //timer 7 interrupt
void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _T8Interrupt(void) //timer 8 interrupt
void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _T9Interrupt(void) //timer 9 interrupt

void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _SPI1Interrupt(void);


Data type structure. Useful in creating access for data bits, byte or word. This helps saves memory space and data handling codes.

//Settings for individual channel

#define NUMOFCHANNEL 8
#define LED_CH_DATASIZE 8

typedef union
{
unsigned int words[LED_CH_DATASIZE]; //array arranged from low byte to high byte
unsigned char bytes[LED_CH_DATASIZE*2]; //array arranged from low byte to high byte
struct
{
//LSB
unsigned currentlimit:12; //set the absolute Led current rating. If value is 0, it means that current is allowed to shot to the max.
unsigned posEdge:1; //0-positive, 1-negative edge or level trigger
unsigned mode:3; //operating mode
unsigned pulsewidthlimit:16; //max pulse width permitted. (for pulsing mode use)
unsigned retriggerperiod:16; //periodic auto trigger of the pulse. (for pulsing mode use)
unsigned current:12; //current
unsigned stepNum:4; //number of steps before reset
unsigned pulsedelay:16; //the delay before pulse on the LED after a trigger. (for pulsing mode use)
unsigned pulsewidth:16; //pulse width of the pulse. (for pulsing mode use)
unsigned current_null:12; //calibrated current value.
unsigned unused:4; //unused
unsigned unused2:16; //unused
//MSB
};
}LED_CHANNELPROPERTIES;
LED_CHANNELPROPERTIES ledCh[NUMOFCHANNEL];        //creating a variable “ledCh” base on the data type structure LED_CHANNELPROPERTIES.

//Accessing data on the Data structure
ledCh[ch].mode = 0b001;        //accessing the bits (a group of 3 bits) under the variable member “mode”, without affecting the rest of the data in the structure.
ledCh[ch].posEdge = 0b0;        //accessing the bit under the variable member “posEdge”, without affecting the rest of the data in the structure.
ledCh[ch].words[0] = 0x0000;
ledCh[ch].bytes[0] = 0x00;

———————————————————–

//another example of a data type structure

typedef union
{
unsigned int words[NUMOFWORD_PERSTEP_PERCH];        //array arranged from low byte to high byte
unsigned char bytes[NUMOFWORD_PERSTEP_PERCH*2];        //array arranged from low byte to high byte
struct
{
//LSB
unsigned current:12;
unsigned enable:1; //on/off. 0-not in use, 1-in use
unsigned unused:3;
unsigned pulsedelay:16;
unsigned pulsewidth:16;
//MSB
};
}INTRIGGER_CHANNELPROPERTIES;
INTRIGGER_CHANNELPROPERTIES inTrigCh[NUMOFCHANNEL][MAX_NUMOFSTEPS][NUMOFCHANNEL]; //inTrigCh[input trigger channel][step no.][output LED channel]

//accessing the data structure
inTrigCh[inputCh][stepNum][outputCh].enable = 0b1;        //accessing the enable bit, without affecting the rest of the data in the structure.

 

———————————————————–

typedef union
{
//reset variables for dsPIC33FJ128GP804
unsigned int resetStates;
struct
{
unsigned POR :1; //Power-on Reset Flag bit
unsigned BOR :1; //Brown-out Reset Flag bit
unsigned IDLE :1; //Wake-up From Idle Flag bit
unsigned SLEEP :1; //Wake From Sleep Flag bit
unsigned WDTO :1; //Watchdog Timer Time-out Flag bit
unsigned SWDTEN :1; //Software Enable/Disable of WDT bit
unsigned SWR :1; //Software RESET (Instruction) Flag bit
unsigned EXTR :1; //External Reset (MCLR) Pin bit
unsigned LVDL :4; //Low Voltage Detection Limit bits
unsigned LVDEN :1; //Low Voltage Detect Power Enable bit
unsigned BGST :1; //Bandgap Stable bit
unsigned IOPUWR :1; //Illegal Opcode or Uninitialized W Access Reset Flag bit
unsigned TRAPR :1; //Trap Reset Flag bit
};
}RESET;
volatile RESET reset; //storage for configuration flags status

———————————————————–

typedef union
{
unsigned long reading[4]; //decimal reading value
unsigned char bytes[4][4]; //storage for data

// readingXXX.reading[0] = 0x00000123;
// readingXXX.reading[1] = 0x00004567;
// readingXXX.reading[2] = 0x000089AB;
// readingXXX.reading[3] = 0x0000CDEF;

//print seq 00 00 01 23 00 00 45 67 00 00 89 AB 00 00 CD EF
// uart1TX(readingXXX.bytes[0][3]);
// uart1TX(readingXXX.bytes[0][2]);
// uart1TX(readingXXX.bytes[0][1]);
// uart1TX(readingXXX.bytes[0][0]);
// uart1TX(readingXXX.bytes[1][3]);
// uart1TX(readingXXX.bytes[1][2]);
// uart1TX(readingXXX.bytes[1][1]);
// uart1TX(readingXXX.bytes[1][0]);
// uart1TX(readingXXX.bytes[2][3]);
// uart1TX(readingXXX.bytes[2][2]);
// uart1TX(readingXXX.bytes[2][1]);
// uart1TX(readingXXX.bytes[2][0]);
// uart1TX(readingXXX.bytes[3][3]);
// uart1TX(readingXXX.bytes[3][2]);
// uart1TX(readingXXX.bytes[3][1]);
// uart1TX(readingXXX.bytes[3][0]);

}DATAREADING;
DATAREADING reading;

———————————————————–

//Complex data union, data struct example

typedef enum
{
    CONFIG0=0,
    CONFIG1=1,
    CONFIG2=2,
    CONFIG3=3,
    CONFIG4=4,
    CONFIG5=5,
    MASK=6,
    RUN=7,
    Dianostic=8
}A4963_REGISTER;

typedef struct
{
    unsigned CL:1;
    unsigned CH:1;
    unsigned BL:1;
    unsigned BH:1;
    unsigned AL:1;
    unsigned AH:1;
    unsigned :1;
    unsigned VS:1;
    unsigned :1;
    unsigned LOS:1;
    unsigned OT:1;
    unsigned TW:1;
    unsigned WR:1;
    unsigned REG_ADDR:3;
}REG_DIAGNOSTIC;

typedef union
{
    //array arranged from low byte to high byte
    unsigned int words[9];       
    struct
    {
        //LSB
        struct
        {
            unsigned DT:6;
            unsigned BT:4;
            unsigned RM:2;
            unsigned WR:1;
            unsigned REG_ADDR:3;
        }config0;
        struct
        {
            unsigned VT:5;
            unsigned VDQ:1;
            unsigned VIL:4;
            unsigned IPI:1;
            unsigned PFD:1;
            unsigned WR:1;
            unsigned REG_ADDR:3;
        }config1;
        struct
        {
            unsigned PW:5;
            unsigned DGC:1;
            unsigned SH:2;
            unsigned CP:4;
            unsigned WR:1;
            unsigned REG_ADDR:3;
        }config2;
        struct
        {
            unsigned HT:4;
            unsigned HD:4;
            unsigned CI:4;
            unsigned WR:1;
            unsigned REG_ADDR:3;
        }config3;
        struct
        {
            unsigned SS:4;
            unsigned SD:4;
            unsigned SP:4;
            unsigned WR:1;
            unsigned REG_ADDR:3;
        }config4;
        struct
        {
            unsigned PA:4;
            unsigned SMX:3;
            unsigned SPO:1;
            unsigned SI:4;
            unsigned WR:1;
            unsigned REG_ADDR:3;
        }config5;
        REG_DIAGNOSTIC mask;
        struct
        {
            unsigned RUN:1;
            unsigned DIR:1;
            unsigned BRK:1;
            unsigned RSC:1;
            unsigned DI:5;
            unsigned ESF:1;
            unsigned CM:2;
            unsigned WR:1;
            unsigned REG_ADDR:3;
        }run;
        REG_DIAGNOSTIC diagnostic;
        //MSB
    };
}A4963_DATA;
volatile A4963_DATA a4963_data; //storage for configuration flags status

a4963_data.config0.DT = 0;
a4963_data.config1.VT = 0;
a4963_data.config2.PW = 0;
a4963_data.config3.HT = 0;
a4963_data.config4.SS = 0;
a4963_data.config5.PA = 0;
a4963_data.mask.CL = 0;
a4963_data.run.RUN = 0;
a4963_data.diagnostic.CL = 0;

———————————————————–

 

enum

Example1 of how to use enum. (see better example2)

Create a header file for Enum “Enum.h”, and place the following enum defintion,

enum BOOLEAN
{
    FALSE=0,
    TRUE=1
};

————————————————————–

For each of the *.c file that you want to use the enum BOOLEAN, include the header file “Enum.h”.

1) declare a enum variable
enum BOOLEAN flag = FALSE;

2) declare a function
enum BOOLEAN isDone()
{
    return(flag);
}

————————————————————–

For header *.h file that you want to use the enum BOOLEAN,

extern enum BOOLEAN;
enum BOOLEAN isDone();

####################################################################################

Example2 of how to use enum. (betterexample)

Create a header file for Enum “Enum.h”, and place the following enum defintion,

typedef enum
{
    FALSE=0,
    TRUE=1
}BOOLEAN;

————————————————————–

For each of the *.c file that you want to use the enum BOOLEAN, include the header file “Enum.h”.

1) declare a enum variable
BOOLEAN flag = FALSE;

2) declare a function
BOOLEAN isDone()
{
    return(flag);
}

————————————————————–

For header *.h file that you want to use the enum BOOLEAN,

(have problem here with enum. Prototype declare in the header cannot have the enum as data type.)

extern BOOLEAN;
BOOLEAN isDone();

enum PORTIN
{
CH1=0,
CH2=1,
CH3=2,
CH4=3,
CH5=4,
CH6=5,
CH7=6,
CH8=7,
IN1=0,
IN2=1,
IN3=2,
IN4=3,
IN5=4,
IN6=5,
IN7=6,
IN8=7
};

enum LED_MODE
{
CONTINUOUS=1,
SWITCH=2,
PULSE=3,
};

enum EDGE
{
POS_EDGE=0,
NEG_EDGE=1
};

//define enum type “EDGE”
typedef enum
{
POS_EDGE=0,
NEG_EDGE=1
}EDGE;

//declare a variable “myEdgeVar” of type EDGE
EDGE myEdgeVar = POS_EDGE;

//passing type through function
EDGE myFunction(EDGE myVar)
{
}
 

void initOscillator()
{
// Configure Oscillator to operate the device at 40Mhz
// Fosc= ((Fin/N1)*M)/N2, Fcy=Fosc/2
// N1=4, M=32, N2=2, Crystal = 20MHz
// Fosc= ((20M/4)*32)/2
// Fosc = 80Mhz for 20MHz input clock
// Fcy = Fosc / 2 = 40 MIPS

#ifdef dsPIC33FJ256GP506A
#ifdef FOSC_80MHZ
PLLFBDbits.PLLDIV = 30; // M=32
CLKDIVbits.PLLPRE = 0b00010; // N1=4
#endif
CLKDIVbits.PLLPOST = 0b00; // N2=2
OSCTUNbits.TUN = 0; // Tune FRC oscillator, if FRC is used
RCONbits.SWDTEN=0; // Disable Watch Dog Timer
while(OSCCONbits.LOCK!=1) {}; // Wait for PLL to lock
/*
#elif dsPIC33FJ128GP804
#ifdef FOSC_80MHZ
PLLFBDbits.PLLDIV = 38; // M=40
CLKDIVbits.PLLPRE = 0b00000; // N2=2
#endif
#ifdef FOSC_40MHZ
//Config for 40MHz temporary instead
PLLFBDbits.PLLDIV = 38; // M=40
CLKDIVbits.PLLPRE = 0b00010; // N2=4
#endif

CLKDIVbits.PLLPOST = 0b00; // N1=2
OSCTUNbits.TUN = 0; // Tune FRC oscillator, if FRC is used
RCONbits.SWDTEN=0; // Disable Watch Dog Timer
while(OSCCONbits.LOCK!=1) {}; // Wait for PLL to lock
*/
#endif

//PLL module, Fosc = Fin*(M/(N1*N2))
//= Fin * ((PLLDIV+2)/((PLLPRE+2)*2*(PLLPOST+1)))
//= 8Mhz * ((38+2)/((0+2)*2*(0+1)))
//= 8Mhz * (40/(2*2*1))
//Fosc = 80Mhz

//PLLPRE==2, PLLPOST==0, PLLDIV==78
//= 8Mhz * ((78+2)/((2+2)*2*(0+1)))
//= 8Mhz * (80/(4*2*1))
//Fosc = 80Mhz

//PLLDIV==37
//= 8Mhz * ((37+2)/((0+2)*2*(0+1)))
//= 8Mhz * (39/(2*2*1))
//Fosc = 78Mhz

}

//*************************************************
// IoPinMapping
//*************************************************
//local defination—————–
//define inputPin Function=RPxx pin number
//Input Peripheral pin
#define inputPIN_INT1 RPINR0bits.INT1R
#define inputPIN_INT2 RPINR1bits.INT2R
#define inputPIN_T2CK RPINR3bits.T2CKR
#define inputPIN_T3CK RPINR3bits.T3CKR
#define inputPIN_T4CK RPINR4bits.T4CKR
#define inputPIN_T5CK RPINR4bits.T5CKR
#define inputPIN_IC1 RPINR7bits.IC1R
#define inputPIN_IC2 RPINR7bits.IC2R
#define inputPIN_IC3 RPINR8bits.IC3R
#define inputPIN_IC4 RPINR8bits.IC4R
#define inputPIN_IC5 RPINR9bits.IC5R
#define inputPIN_IC7 RPINR10bits.IC7R
#define inputPIN_IC8 RPINR10bits.IC8R
#define inputPIN_OCFA RPINR11bits.OCFAR
#define inputPIN_OCFB RPINR11bits.OCFBR
#define inputPIN_U1RX RPINR18bits.U1RXR
#define inputPIN_U1CTS RPINR18bits.U1CTSR
#define inputPIN_U2RX RPINR19bits.U2RXR
#define inputPIN_U2CTS RPINR19bits.U2CTSR
#define inputPIN_SDI1 RPINR20bits.SDI1R
#define inputPIN_SCK1IN RPINR20bits.SCK1R
#define inputPIN_SS1IN RPINR21bits.SS1R
#define inputPIN_SDI2 RPINR22bits.SDI2R
#define inputPIN_SCK2IN RPINR22bits.SCK2R
#define inputPIN_SS2IN RPINR23bits.SS2R

//define RPxx pin number=outputPin Function
//RP pins
#define RP00 RPOR0bits.RP0R
#define RP01 RPOR0bits.RP1R
#define RP02 RPOR1bits.RP2R
#define RP03 RPOR1bits.RP3R
#define RP04 RPOR2bits.RP4R
#define RP05 RPOR2bits.RP5R
#define RP06 RPOR3bits.RP6R
#define RP07 RPOR3bits.RP7R
#define RP08 RPOR4bits.RP8R
#define RP09 RPOR4bits.RP9R
#define RP10 RPOR5bits.RP10R
#define RP11 RPOR5bits.RP11R
#define RP12 RPOR6bits.RP12R
#define RP13 RPOR6bits.RP13R
#define RP14 RPOR7bits.RP14R
#define RP15 RPOR7bits.RP15R
#define RP16 RPOR8bits.RP16R
#define RP17 RPOR8bits.RP17R
#define RP18 RPOR9bits.RP18R
#define RP19 RPOR9bits.RP19R
#define RP20 RPOR10bits.RP20R
#define RP21 RPOR10bits.RP21R
#define RP22 RPOR11bits.RP22R
#define RP23 RPOR11bits.RP23R
#define RP24 RPOR12bits.RP24R
#define RP25 RPOR12bits.RP25R

//Output Peripheral pin
#define outputPin_NULL 0
#define outputPin_C1OUT 1
#define outputPin_C2OUT 2
#define outputPin_U1TX 3
#define outputPin_U1RTS 4
#define outputPin_U2TX 5
#define outputPin_U2RTS 6
#define outputPin_SDO1 7
#define outputPin_SCK1OUT 8
#define outputPin_SS1OUT 9
#define outputPin_SDO2 10
#define outputPin_SCK2OUT 11
#define outputPin_SS2OUT 12
#define outputPin_OC1 18
#define outputPin_OC2 19
#define outputPin_OC3 20
#define outputPin_OC4 21
#define outputPin_OC5 22

/*
void ioPinMapping()
{
//__builtin_write_OSCCONL(OSCCON & 0xbf);
// Unlock Registers – MUST be in asm due to strict timing reqs
asm volatile( “MOV #OSCCON, w1 \n”
“MOV #0x46, w2 \n”
“MOV #0x57, w3 \n”
“MOV.b w2, [w1] \n”
“MOV.b w3, [w1] \n”
“BCLR OSCCON, #6 “);

#ifdef ETHERNET_COMMUNICATION
//map UART1 pins
inputPIN_U1RX=16; //link input U1RX =Pin no.
RP02=outputPin_U1TX; //link output Pin RP17= U1TX
AD1PCFGLbits.PCFG6=1; //ADC config, disable ADC on the pin for input. Input will be digital input instead of the default analog. Output is digital by default, therefore no ADc config on RX pin
AD1PCFGLbits.PCFG4=1; //ADC config, disable ADC on the pin for input. Input will be digital input instead of the default analog. Output is digital by default, therefore no ADc config on TX pin
#endif
#ifdef RS232_COMMUNICATION
//map UART1 pins
inputPIN_U1RX=18; //link input U1RX =Pin no.
RP17=outputPin_U1TX; //link output Pin RP17= U1TX
AD1PCFGLbits.PCFG8=1; //ADC config, disable ADC on the pin for input. Input will be digital input instead of the default analog. Output is digital by default, therefore no ADc config on RX pin
AD1PCFGLbits.PCFG7=1; //ADC config, disable ADC on the pin for input. Input will be digital input instead of the default analog. Output is digital by default, therefore no ADc config on TX pin
#endif

//map UART2 pins
// inputPIN_U2RX=18; //link input U1RX =Pin no.
// RP17=outputPin_U2TX; //link output Pin RP17= U1TX
// AD1PCFGLbits.PCFG8=1; //ADC config, disable ADC on the pin for input. Input will be digital input instead of the default analog. Output is digital by default, therefore no ADc config on RX pin
// AD1PCFGLbits.PCFG7=1; //ADC config, disable ADC on the pin for input. Input will be digital input instead of the default analog. Output is digital by default, therefore no ADc config on TX pin

//map SPI1 pins
inputPIN_SDI1=9; //link input SPI1 data IN =Pin no.
RP22=outputPin_SDO1; //link output Pin = SPI1 data OUT
RP08=outputPin_SCK1OUT; //link output Pin = SPI1 clock output
//RP08=outputPin_SS1OUT; //link output Pin = SPI1 slave select output

//config for input capture
inputPIN_INT1=1; //use input capture as an input1
inputPIN_INT2=21; //use input capture as an input2
inputPIN_IC1=19; //use input capture as an input3
inputPIN_IC2=20; //use input capture as an input4  

//__builtin_write_OSCCONL(OSCCON | 0x40);
// Lock Registers – MUST be in asm due to strict timing reqs
asm volatile( “MOV #OSCCON, w1 \n”
“MOV #0x46, w2 \n”
“MOV #0x57, w3 \n”
“MOV.b w2, [w1] \n”
“MOV.b w3, [w1] \n”
“BCLR OSCCON, #6 “);
}
*/

Clock frequency defination
FOSC – clock frequency (final system clock frequency)
FCY – instruction cycle clock (usually = 1/2 FOSC)
FP – clock frequency source to peripherals (usually = FCY)
Pointer to function.
(Callback function)
Callback structured the *.c file such that they provide services and not access another *.c for services. *.c calling each other can make the code very messy. Service providing class providing services and allow callback will means that calling of functions will allows be from the other class, and not the service providing class.

The example on the right shows a timer interrupt service. Other classes that need to use this interrupt class will register itself and waiting to get called from the registered callback. This means that the interrupt class coding can be written in a generic manner without referencing or calling other classes.
void (*timer1Callback)();             //declare variable for function callback

//register the function for timer callback
void registerTimer1CallBack(void (*f)())
{
    initTimer1();
    timer1Callback = f;
}

void __attribute__((__interrupt__, __shadow__, __auto_psv__)) _T1Interrupt(void)    //timer 1 interrupt
{
    if(timer1Callback != NULL)
        (*timer1Callback)();          //call the registered function.
    IFS0bits.T1IF=0;
}

void initTimer1(void)
{
    T1CONbits.TCKPS=0b11;   //1:256
    T1CONbits.TCS=0;
    T1CONbits.TGATE=0;      //disable TGATE
    T1CONbits.TSYNC=0;      //does not sync with external clock input
    T1CONbits.TSIDL=0;      //continue in idle mode
   
    //PR1=0x023F;             //set period for timer (set to 10ms timer interrupt)
    PR1=0x0039;             //set period for timer (set to 1ms timer interrupt)
 
    //set timer interrupt priority to level 1
    IPC0bits.T1IP=1;
    //clear timer interrupt flag T3IF bit
    IFS0bits.T1IF=0;
    //enable timer3 interrupt
    IEC0bits.T1IE=1;
    //starts the timer
    T1CONbits.TON=1;
}

//———————————————————–
//from another file doing the registration for interrupt to callback

#define RUN_TIMER_COUNT 100

void initRunTimer()
{
    registerTimer1CallBack(timer1msCallBack);     //function registrating a function which can be call back from the interrupt function.
}

void timer1msCallBack()
{
    //interrupt at 1ms interval
    static int runTimerCount = RUN_TIMER_COUNT;
   
    runTimerCount–;
    if(runTimerCount<=0)
    {
        runTimerCount = RUN_TIMER_COUNT;
          indicatorToggle(RUN);
    }
}
Accessing PORTB bits dynamically
Quoted from http://tutor.al-williams.com/pic-detail2.html

First, the I/O pins are tied to the PORT registers, as you’d probably guess. However, on reset, all port pins are set to inputs. If you want to use a port pin as an output, you’ll need to change the corresponding direction bit from a 1 (the default) to a 0. So to prepare PORTB pin 0 for output you might write:

	bsf status,rp0  ; rp0=1 - select bank 1
bcf trisb,0 ; port b direction bit 0 = 0
bcf status,rp0 ; rp0=0 - select bank 0

It is good practice to reset the bank to 0 as soon as you are done accessing another bank. So then if you wanted to set the output to 1 you might write:

        bsf portb,0  

The other quirky behavior is the interaction between INDF and FSR. INDF isn’t like an ordinary register. Instead, it mirrors another register indicated by the address in FSR. For example, location 0x6 is the PORTB register. Suppose you write:

        movlw 6     ; W=6
movwf fsr ; FSR=W

Now the INDF register is really an alias for PORTB. So you might write:

        bsf indf,0  ; set bit 0

 This instruction doesn’t really set bit 0 of INDF, it sets bit 0 of PORTB. Since FSR is an 8-bit register, it can contain a complete address from bank 0 or bank 1 (just treat bank 1 addresses as ranging from 0x80-0xFF). To access bank 3 and and bank 4 using FSR/INDF, you have to set the IRP bit in the STATUS register. RP0 and RP1 don’t apply to INDF access!


Preserving stack memory using inline
void main();
inline void init();
inline void loop();

void main()
{
    initPinMapping();       //peripheral pin select
    getResetType();
    init();
   
    INTCONbits.PEIE = 1;    //enable peripheral interrupt
    INTCONbits.GIE = 1;     //enable global interrupt
   
    while(1)
    {
        loop();
    }
}

inline void init()
{
    initIndicator();
    initProtocol();
    initAudioIn();
}

inline void loop()
{
 
}
Microchip software reset function
for XC16 compiler
asm(“RESET”);

for XC30 compiler
Reset();
Watchdog function
for XC30 compiler
ClrWdt();

 

 

 

 

 

www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller

Singapore Customized, custom made Electronics Circuits & Kits

 

 

Crystal Selection for Microcontroller’s UART
Common Baud Rate
2400bps
4800bps
9600bps
19200bps
38400bps
57600bps
115200bps
230400bps
2014-03-08 Today I realised something about the UART in microcontroller that I am not aware about, even many years of firmware programming. I was troubleshooting the UART in my microcontroller. The data that are sent or received are corrupted. The first char is always received correct. I realised that it could be that the microcontroller baud rate is having the problem. I have been using this 8MHz crystal for many of the project, but this time the data corruption is too serious to be ignored. I was using PIC24FJ64GA004 microcontroller.
From the UART peripheral datasheet (DS70000582E), I managed to recompute the baud rate and its error. The error is too high. I have no idea why that baud rate was peviously selected.

UxBRG = (Fp / (4 x Baud Rate)) – 1
Calculated Baud Rate = Fp / (4 x (UxBRG + 1))
Error = (Calculated Baud Rate – Desired Baud Rate) / Desired Baud Rate x 100%

I wanted to find out which clock frequency can provide the least error. To speed up the computation, I have create a spreadsheet using OpenOffice Calc (similar to excel spreadsheet).
2014-03-08_baudrate_computation_microchip.ods

When I try to input the other common crystal that I have on hand, I realised 7.3728MHz is computed to have an error of 0%. It is a perfect score. This makes me curious to find out more other crystal that is able to provide a 0% error for UART. It turns out that those crystal that have a multiple of 2400, will be able to provide the UART with a 0% error. The 2400 figure comes from one of the commonly use RS232 baud rate 2400bps which is the common denominator for all the commonly used baud rate. Crystal that have a frequency that is multiple of 2400 will be the best for the UART peripheral.

The following provides the commonly available crystal frequency that is suitable for UART peripheral operation.

Recommended Crystal for Microchip UART
3.6864 MHz
7.3728 MHz
11.0592 MHz
14.7456 MHz
14.74546MHz
18.432  MHz
22.1184 MHz
Quite close to perfect for UART
36.0 MHz
48.0 MHz

 

Keyword: Microchip PIC microcontroller prototype development, PIC programmer, Max232, ICSP programming interface, output buffer, LED indicator, 74LS595 74HC595, 74LS244 74HC244, DC-DC power supply, 40pins 28pins 18pins DIP IC

PIC18F4550, PIC18F452, PIC16F877a

PIC18F252, PIC16F876a

PIC16F88, PIC16F628a, PIC16F84a

Analog Electronics

Your reference guide to analog electronics for your electronics projects.

Edited by Lim Siong Boon, last dated 06-Jul-08.

 

Short cut to your reference guides and charts

  1. Op-amp
  2. Capacitor for Signal Filtering
  3. Transistor Switching

 

 

 

 

Op-amp  

Op Amps for Everyone, by Bruce Carter and Ron Mancini from Texas Instruments.

op amps for everyone (Texas Instrument).pdf

op amps for everyone third edition 2009 (Texas Instrument).pdf

op amps for everyone

 

Op-amp application notes from National Semiconductor,

An applications guide for op-amps.pdf

 

Single rail op-amp design from Texas Instruments

single power supply design.pdf

 

Various precision op-amp rectifier design.

http://sound.westhost.com/appnotes/an001.htm


From National Semiconductor and Texas Instruments
op_amp_circuit collection_AN-31.pdf
snla140a, Op Amp Circuit Collection.pdf

Others
op-amp awith offset (bias).pdf
Single Supply Op Amp Design.pdf
CH9 Paul Smith notes.pdf




Type of Op-amp circuit


1) Non-Inverting amplifier
2) Inverting amplifier
3) Unity Buffer amplifier (Voltage follower)
4) Differetial amplifier
5) Suming amplifier
6) Instrumentation ampilfier
7) Oscillator
8) Comparator
9) Threshold detector
10) Zero Level detector
11) Schmitt trigger
12) Integration
13) Differentiation
14) Rectifier
15) Logarithmic output
16) Exponential output

1) Non-Inverting amplifier

Vout = (1+ R2/R1) Vin
– high input impedance
– low output impedance
– higher bandwidth
– minimum gain of 1

A resistor R1||R2 = (R1 x R2) / (R1 + R2) is inserted just before the +ve terminal will keep the input current better balanced.
The added voltage divider has introduced a voltage offset to the output signal Vout.
   

2) Inverting amplifier

Vout = -(Rf/Rin) Vin
– gain can be less than 1

 

When analysing the op-amp as an amplifier (ideal op-amp), the +ve and -ve is to be having the same voltage potential.

A resistor Rin||Rf = (Rin x Rf) / (Rin + Rf) is inserted just before the +ve terminal will keep the input current better balanced.

The added voltage divider has introduced a voltage offset to the output signal Vout.
The voltage divider provides a voltage level which the amplification will be based from. Signal with the same voltage level will not be shift in position, while the rest of the voltage level will be amplified.
   

3) Unity Buffer amplifier (Voltage follower)

Vout = Vin
– high input impedance
– low output impedance

   

4) Differetial amplifier.

– Poor input impedance

Voltage follower added in the front of the input to improve the input impedance. This is also similar to an instrumental op-amp.

Instrumentation amplifier.

 

Op-amp Selection

Brand Part no. Power Supply Spec1 Spec2 Spec3 Comment Price
MAXIM MAX4242 1.8 to 5.5V (single rail) Precision 1
-40 to 85°C clean analog signal (best) X
intersil ISL28276 2.4 to 5.0V (single rail) Precision 2
-40 to 125°C clean analog signal X
Analog Devices AD8629 2.7 to 5.0V (single rail) Precision 3
-40 to 125°C

ok. Can be use for precision analog.(used for Hall sensor project)

X
Analog Devices AD8572 2.7 to 5.0V (single rail) Precision 4
Input Offset 1uV
  -40 to 125°C Seems better and cheaper than AD8629 X
Analog Devices AD8602 2.7 to 5.0V (single rail) Precision
Input Offset <0.5mV
  -40 to 125°C (used for LED controller project) ok
Analog Devices ADA4665-2ARZ 5 to 16V, ±2.5 to ±8V

Precision (CMOS)
Input bias current <1pA,Input offset 1-6mV

  -40 to 125°C (used for LED controller project) Fair
intersil ISL28218 3.0 to 40V (single rail) Precision
-40 to 125°C
Texas Instruments OPA2374 2.3 to 5.0V (single rail) Precision
-40 to 125°C X
Texas Instruments TLC272 4 to 16V (single rail) Precision Output will not reach ±Vcc 0 to 70 °C, -55 to 125°C

general use

ok
intersil CA3260 4 to 16V, ±2 to ±8V Normal
-55 to 125°C single/dual supply application X
National Semiconductor LM321, LM324 3 to 32V, ±1.5 to ±16V wide supply voltage
-40 to 85 °C single/dual supply application ok
National Semiconductor

LM158, LM258, LM358, LM2904

3 to 32V, ±1.5 to ±16V

Normal Output will not reach ±Vcc 0 to 70 °C, -55 to 125°C single/dual supply application. Encountered input offset issue. V+ < V- may result in a positive Vout ok
Texas Instruments TLV2402 2.5 to 16V (single rail) Normal
0 to 70 °C, -40 to 125°C general use X
Microchip Technology MCP6L02 1.8 to 6.0V (single rail)

Normal 1
Input Offset <1~5mV

Near full swing Vout -40 to 125°C

general use. Encountered input offset issue. V+ < V- may result in a positive Vout.

ok








Texas Instruments TL061 ±2V to ±15V Normal Output will not reach ±Vcc -40 to 85 °C, -55 to 125°C   ok
Texas Instruments TL071 ±4V to ±15V Normal Output will not reach ±Vcc -40 to 85 °C, -55 to 125°C   ok
intersil CA741, LM741 ±5V to ±15V Normal Output will not reach ±Vcc 0 to 70 °C, -55 to 125°C   ok
Texas Instruments LMV722IDR 2.2 to 5.5V (single rail)
Near full swing Vout -40 to 105 °C

On Semiconductor MC33202DR2G ±0.9V, 0V to 12V
Near full swing Vout -40 to 105 °C, -55 to 125°C

National Semiconductor LMP2022MA 2.2 to 5.5V (single rail) Precision
-40 to 125°C unable to it make operating
On Semiconductor MC33072 3 to 44V
Output will not reach ±Vcc -40 to 85°C, -40 to 125°C

 

(cheap precision op-amp)

Precision usually means a low input offset voltage, which is quite important for voltage comparator, or amplifying small differential input signal.
Input offset <0.5mV will be consider as precision op-amp.
Input offset guide from Analog Device “MT-037, Tutorial Op-amp Input offset voltage.pdf

   

 

 

www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller

Singapore Customized, custom made Electronics Circuits & Kits

 

 

Capacitor for Signal Filtering

 

The following article is a simplied understanding of signal filtering. Basic knowledge of signal filtering is still required before reading this section.

 

 Other references for signal conditioning / filtering
Analog Sensor Conditioning Circuits – An Overview – 00990a.pdf (from Microchip)

The simplest signal low pass filter (LPF) is presented on the right consist of a resistor and capacitor. It is commonly known as RC filter.

This RC layout is applied to circuit with low impedance input, high impedance output. The resistor will be required to complete the filter function. Signal oscillation may occured is the resistor is omitted.

One example would be LPF filtering at the output of the op-amp amplifier circuitry, where filtering is applied to the varying input signal/voltage.

The cutoff frequency of this RC filter
fc = 1/(2πRC)

R will need to be significantly small compare to the load. If the load impedence is high (infinity), then the value of R becomes not very important. If the load impedence is finite, R should be smaller than 1/10 of the load.

Click here for the calculator for the LC filter. frequency and time domain results are on the fly.
http://sim.okawa-denshi.jp/en/CRtool.php (generate freq/time domain graph on the fly)
http://www.2pif.com/high-low-pass-filter.php (simple calculator)

RC filter, the simplest low pass filter.

Another way of looking at the same RC filter.

Ideal analysis of the circuit
The signal in the DC or lower frequency signal can be fully transfered to the high impedence (open circuit) output, while the high frequency signal will be absorbed on the resistor (R) components.

What the high frequency signal will see:
AC signal see resistor as a load, capacitor as a short circuit, while inductor as an open circuit. High frequency signal is able to see the capacitor (C) component as a short circuit. The voltage potential of Vout is seen to be the same as the ground reference. This means that the AC signal will be completely absorbed by the resistor R component. High frequency component will not be available at Vout. They are filtered by the RC filter.

What the low frequency signal will see:
DC signal see resistor as a load, capacitor as an open circuit, while inductor as a short circuit. Low frequency signal is unable to see the capacitor (C) component well. The point Vout is seen to have a very high impedance load. This means that the DC signal will be completely transfer to the open circuit output load at Vout. The R component will be seen as small as compare to the open circuit output load. Using the voltage divider concept, most of the low frequency signal will fall on the output Vout. The low frequency signal managed to pass through the RC filter.

Please note that the above explaination is a simplfied analysis of a filter. Ideal analysis helps us to understand the circuit topology (function) at a glance without the need for detail computation. In reality, the open/short circuit represent the degree of attenuation faced by the signal. The degree of signal attenuation is dependant on the frequency of the signal and the capacitor’s capacitance.

 

This is another low pass filter consist of only a capacitor. This type of filter will work for current source input. Vin = Vout.

One example would be the capacitors that are found on typical dc power supply filtering at its input or output. Decoupling capacitors (100nF) that are normally found near the power input of an IC is also another example.

 

A capacitor as a low pass filter.
This is a simple high pass filter (HPF) using resistor and capacitor (RC) components. The ideal analysis is similar to the LPF as anaylzed eariler, allow high frequency signal to pass through while low frequency signal are attentuated. RC filter, the simplest high pass filter.

Capacitances required to attenuate or suppress signal of certain frequency. Please note that this formula and the table presented on the right is an approximation for filtering noise from a DC signal.

 

Xc = 1 / (2π f C)

C = 1 / (2π f Xc )

where Xc is the reactance of the capacitor. Xc of 1.0 for the capacitor (open circuit) is possible with lower fequency signal or lower capacitance. To attenuate the AC signal of a particular frequency, Xc has to be low with the correct capacitance implemented.

 

Example:

To attenuate a 50Hz signal by 10 times.

C = 1 / (2π x 50Hz x 1/10) = 31,830uF

This means that to attenuate the 50Hz component by 10 times requires about 33,000uF capacitor connected from the signal to the ground line. This capacitor will filter any frequncy >50Hz on the line.

The table on the right is a simplified guide, which recommend the capacitance to use as a low pass filter for attenuating a particular frequency.

Frequency to Attenuate
Attenuating Factor (Xc)

1/√2
1/2
1/10
1/100
50Hz
2200uF
6800uF
33000uF
330000uF
500Hz
220uF
680uF
3300uF
33000uF
1KHz
113uF
330uF
1600uF
16000uF
10KHz
11uF
33uF
160uF
1600uF
100KHz
1.1uF
3.3uF
16uF
160uF
1MHz
113nF
330nF
1.6uF
16uF
10MHz
11nF
33nF
160nF
1.6uF
100MHz
1.1nF
3.3nF
16nF
160nF
1GHz
113pF
330pF
1.6nF
16nF

 

Max frequency for capacitor (taken from “Op Amps for Everyone”)

Capacitor type Max Frequency
Aluminum Electrolytic 100 KHz
Tantalum Electrolytic 1 MHz
Mica 500 MHz
Ceramic 1 Ghz

 

The table on the right summeries the typical capacitor value available commercially. Standard Commercial Capacitor Value:
pF pF pF nF nF nF uF uF uF uF uF
1 10 100 1 10 100 1 10 100 1,000 10,000
1.1 11 110 1.1              
1.2 12 120 1.2              
1.3 13 130 1.3              
1.5 15 150 1.5 15 150 1.5 15 150    
1.6 16 160 1.6              
1.8 18 180 1.8              
2.0 20 200 2.0              
2.2 22 220 2.2 22 220 2.2 22 220 2,200  
2.4 24 240 2.4              
2.7 27 270 2.7              
3.0 30 300 3.0              
3.3 33   3.3 33 330 3.3 33 330 3,300  
3.6 36 360 3.6              
3.9 39 390 3.9              
4.3 43 430 4.3              
4.7 47 470 4.7 47 470 4.7 47 470 4,700  
5.1 51 510 5.1              
5.6 56 560 5.6              
6.2 62 620 6.2              
6.8 68 680 6.8 68 680 6.8 68 680 6,800  
7.5 75 750 7.5              
8.2 82 820 8.2              
9.1 91 910 9.1              
                     
                     
                     

Active filter with op-amp

For flat frequency response, use Butterworth filter

For a sharp cutoff frequency, use Chebyshev filter

For linear phase, use Bessel filter.

 

 

www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller

Singapore Customized, custom made Electronics Circuits & Kits

 

 

Transistor Switching  
 

I didn’t realised that transistor switching speed can be so important until I had encountered a problem using it for SPI communication. The data communication gets corrupted. Go through all the codes, and eventually found that the transistor switching speed was slow. The current batch of transistor is different from my previous batch; and I always thought that all BC817 npn transistor is the same. I am wrong, it is not. The problem might have been due to my design as well, unable to discharge the base signal in time, to turn off the transistor.

Ch1(yellow) shows the signal input through a 1kohm resistor to the base of the npn transistor. Ch2(blue) is the output at the transitor’s collector terminal, with a pull up resistor of 560ohm. The is

The following present the various BC817 transistor’s switching digital speed.

Switching speed of my original transistor.

delay of about 0.7us.

using npn BC846

delay of about 2us.

using npn BC817

delay of about 2.5us.

BC817-16LT1G

delay 2us

MMBT4401LT1G

delay 4.5us

MMBTA05LT1G

delay 0.25us

   
Effect of the signal switching without a resistor across the Vbe terminal of a npn transistor BC817.

Effect of the signal switching without a 10kΩ resistor across the Vbe terminal of a npn transistor BC817.

There is a slight improvement in delay, but not very noticable.

Effect of the signal switching without a 10kΩ resistor across the Vbe terminal of a npn transistor BC817.

More than 100% improvement shortening the delay, of the inverted signal by about 1us.

 

 

 

 

 

 

Keyword: op-amp, buffer, inverter, amplifier

 

SMD Soldering

Your reference guide to soldering with surface mount devices

Edited by Lim Siong Boon, last dated 06-May-09.

 

Short cut to your reference guides and charts

  1. Introduction to SMD soldering

  2. SMD soldering (prototyping board)

  3. SMD soldering (prototyping PCB socket 2.54mm pitch)

     

 

1. Introduction to SMD soldering  
SMD IC stands for surface mount device integrated circuit, or commonly known as SMT surface mount technology. Why go into SMD? Small in size, light in weight. This is the advantage of smd. Being small, engineer is able to design small electronics gadget that people can carry around. It is quite obvious that people prefer small mobile phone.

The ultimate advantage will be lower cost to consumer. Being small in size, the printed circuit board (pcb) can be small, meaning low cost. Transportation cost can be reduce because it is now lighter and more products can be packed into the same box. Space required is less, meaning cost saving on the warehouse storage. PCB board is easy to route without the through hole. Better signal integrity. Easily assembled by machine. There is too much advantages. Going SMT is certainly the way forward.

Technology evolution, from big to small.

A phone small enough to carry around.

 

 

Smaller mobile phone

Even smaller phone

 

Mobile phone as thin as biscuit.

 

 

I used to build circuits using dual in-line package (DIP or DIL) IC only. I hardly thought of using surface mount device/component (SMD) because I have great doubt that I can solder the fine legs of the IC chip. The pitch for the older DIP IC package are 2.54mm. Pitch is the distance between adjacent pins as illustrated in the picture. Most IC comes with a variety of packages. The IC that I know of, offer both the SMD and DIP packages. I thought that I will never ever need to use smd packages until one day, I have no more choice. I managed to pick up new circuit designs, and discover more and more new IC chips. Most new IC chips design do not have DIP packages. You can hardly find one. I realised that in order to implement better circuits, I need to learn to use new IC chip. In order to use the new chip, I have to find ways to solder smd components. That’s where I venture into the world of smd.

Nowadays people prefer to use smd, because they are small in size, which turns out to be cost efficient fabricating small PCB. With smaller PCB, space & weight is saved, resulting in lower cost for the transportation/distribution and storage.

Research and research, I got to know from other electronics guru that smd is in fact easier to work with than through hole. I try it out and from that day onwards, I am in love with smd components. Small to solder, but it save me the effort to cut the lead for through hole component. I managed to store my component using minimum box and space. There are many many advantage to work with smd.

Many people might think that you need special tools like a rework station or fine tip iron to solder the small smd components with small pitches. With the correct technique, you can use your soldering iron to do the soldering. In fact my 60W goot TQ-95 soldering iron has quite blunt tip. So thick that most people think that it is not possible to solder smd IC with fine pitches. Fine tip iron is easy to reach the fine lead, but I find that it is not as hot as the same iron with blunt tip. If you prefer fine tip, I will recommend hotter soldering iron or those which can allow you to adjust the temperature, they can be hot. I managed to solder smd package TQFP, SSOP QSOP with pitch as small as 0.5mm. Width of the lead of about 0.3mm.

Dealing with SMD components do not necessary requires you to fabricate a professional pcb board. You can also mount smd components on low cost prototyping board. To start off implementing smd components, you might like to try using the soic package. Quite common at this point in time, but may just phase out as what has happened to the dip packaging. SOIC has a pitch of 1.27mm, which is exactly half of DIP packages. This size is great because I can solder the IC to the same old 2.54mm pitch prototyping donut padded board. What I usually do is to cut the donut pad into half. Soldered onto each pad is two pins 1.27mm apart.

You can refer to the following article, for further illustration.

SMD soldering (prototyping board)

Through hole packages

DIP – 8 pins

resistor

capacitor

inductor

diode

 

SMD packages

SOIC – 8 pins

TQFP – 44 pins

resistor

capacitor

inductor

diode

 

With so much advantage there is indeed a disavantage. SMD IC comes with many type of packages with different pitches. Unlike DIP IC, the pitch is typical 2.54mm. I can easy purchase a prototype board with 2.54mm, and almost all the DIP will fit to the board. SOIC package can still be mounted onto the 2.54mm prototype board. The rest of the SMD IC chip has quite a wide range of completely different packaging. This make them difficult to start with, without having to fabricate a PCB.

There are actually solution to this. Most IC company usually introduce their IC chip together with a prototype board for the IC.

Another solution will be to use a pre-fabricated prototyping board that allows mounting of various smd footprint. You can search for the various names such as

– prototype adaptor

– chip adaptor

– smd prototyping board

– smd to dip adaptor

– smd socket

– smd adaptor

– smd to 2.54mm converter

– SMD to DIP converter

– chip carrier

You can refer to the following article, for further illustration.

SMD soldering (prototyping PCB socket 2.54mm pitch)

 

Various distributor for the prototyping adaptor

 

In prototyping with DIL IC, pcb mount IC socket is usually used, so that the IC can be removed easily if damaged. Some sockets are designed for programming used where the chip can be inserted and remove easily for programming purpose. To remove the component, you need not have to do de-soldering. Like DIL package, smd also comes with their own IC socket. There are many variety of smd packaging, and getting the socket for your smd components is not going to come cheap & easy compare to DIL. Therefore I usually built prototype without any sockets for smd design. After numerous attempts designing and building of circuits, you will definitely attain a certain level of confident on your design without considering IC socket. Without the socket, cost and space are saved significantly.

SMD IC sockets:

 

DIL IC sockets/ holder.

Turn pins designs is of better quality.

 

 

 

 

 

 

 

 

Various distributor for SMD socket

 

 

 

The headache will come when you really need to removed the smd IC. How do you remove the IC from the PCB? For de-soldering of smd component more than 3 leads, you can add in more solder to connect up the IC pins heat pins on all the sides of the IC and eventually pull out the component. It is easier to use the rework station or IR heater to de-solder smd components. The rework station uses hot sir to melt down the solder on the board. You will need to aim the hot air at the solder joint.

Rework Station

If you do not have the lurxy of getting the rework station, another possible method might be to use a special solder that has lower melting point. LowMelt® DeSolder Wire. A lower melting point means that the solder will takes a longer time to cool down to a solid. This allows you more time to remove the IC after heating up the solder. The solder is flooded onto the pins of the IC. The pins are heated up together using a soldering iron and the smd IC can then be removed easily with a tweezer.

Low melt solder wire

 

 

 


Various type of smd packaging
* SOT, SC
* SOIC, ExposedPad™
* SSOP, ExposedPad™
* TQFP, ExposedPad™
* TSOP
* TSSOP, ExposedPad™
* PLCC 
* LQFP, ExposedPad™
  * LGA
* PBGA
* PSOP
* Dual Row MicroLeadFrame®
* LQFP PowerQuad®
* MicroLeadFrame® (MLF®)
 * MQFP PowerQuad®
* PSvfBGA
* SuperBGA®
* TapeArray® BGA
* tsCSP
* Ultra CSP™
* CABGA, CTBGA, CVBGA

 

 

 

www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller

Singapore Customized, custom made Electronics Circuits & Kits

 

 

2. SMD soldering (prototyping board)

 
   

The prototype board above has pad with 2.54mm pitch and is designed for DIL and through hole components. The board is easily available from local store. Dealing with smd components on this 2.54mm pitch board is not difficult as well. I have been using this board to solder quite a number of surface mount components.

– SOIC

– DPAK

– SOT23-6, SOT-3

– TO-263

– PSOP

 

High pin count component with pitch less than 1.27mm will not be suitable to mount onto this board. For passive smd component like resistor, capacitor or inductor which only have 2 pin, mounting is simpler. Size is not an issue soldering onto the board.

 

Align the SMD IC to the position on the pad. Mark out the pad for the cutting to be done.

Use a penknife to cut the donut pad into half. Ensure that the half pad does not short circuit using your multi-meter. Sometimes the cut may not be deep enough or conductive reside between the gap resulting in a short circuit. Remember to ensure that each is proper cut before you start to solder.

Align the smd with your finger or tweezer and begin soldering one of the pin. Check if the IC is still properly align after soldering the first pin. If not, heat up the soldered pin and realign again. After the ICis align, solder all the rest of the pin. If the solder bridge across to the adjacent pin, use a soldering sucker to remove the excess solder.

The cut between the pad usually make the solder harder to bridge across the adjacent pin. Bridging is still possible, and it is quite easy to have it removed.

SMD ribbon cable connector being soldered onto the 2.54mm pitch prototype board.

Example of building the circuit using surface mount component on the prototyping board with 2.54mm pitch pads. As shown above, the pins are being wired by fine wire wrapping wire. The single core wire is very flexible and comes in a variety of color, making it easy to identify the type of signal being carried by the wire.

 

 

 

 

 

3. SMD soldering (prototyping PCB socket 2.54mm pitch)

 

What you need…

 

List of items:

– Surface IC chip (TQFP package)

– Surface mount IC adaptor or converter

– Soldering Iron

– Tweezer or Pincer

– Solder with flux core

– Soldering Flux

– Stick for coating flux

– Wiping paper

– Tinner

 

PIC-200 smd to 2.54mm pitch adaptor

from .

Holding onto the side view of the

QFN package IC.

 

INTRODUCTION

In this setup, I am going to solder a surface mount microcontroller (TQFP 44 pins) onto a smd adaptor. The adaptor will then be used on the commonly available prototyping board, so that I can try out my new design for circuit control.

TQFP, QFN and SOIC are quite some common footprint for prototyping smd microcontroller from 18 to 64pins. This prototyping adaptor pic-200 (on the left) that I have is an ideal adaptor for my microcontroller. Converting the smd device into 2.54mm,  I can easily mount the smd unit onto my 2.54mm pitch prototyping board. It is available locally.

   Prototyping board with 2.54mm pitch donut pads.

The pic-200 smd adaptor originate from PIC-CONTROL and is well documented. Commonly used smd footprint can be found on either the top or bottom side of the pcb adaptor. These are some of the smd packages that can be mounted onto pic-200 adaptor.

IC Front Back
TQFP-44
QFN-44
SOIC-28
SOT-3

 

 

With a wide range of smd components that can be mounted, it is easier to stock up this pcb adaptor for future prototyping use.

The following article is about getting my smd microcontroller PIC24FJ64G004 soldered onto this board. After which I will be on my way to do prototyping for my new control circuit.

This smd adaptor origined from PIC-CONTROL. For other type of adaptors, you can also refer to other manufacturer as mention above.

 

 

<Step 1>

Before soldering, ensure that the soldering pad on the PCB is free of oxidation. PCB is usually tinned to protect the copper surface from oxidation. In cases where the surface is oxidized, you can try cleaning the surface with a contact cleaner. Apply the solution with tissue paper or toothbrush to clean up the contact. This solution make the PCB board rather oily, which I don’t quite appreciate.

Contact cleaner.  

Let us start our smd soldering here. Soldering surface mount component. The first important thing to introduce would be the solder.

There are many type of solder. Choosing the correct solder takes a bit of some knowledge too. Leaded or lead free solder? The industries is moving towards Pb free components & PCB, calling for unleaded product. Lead is toxin and not environmental friendly. I would advise ou to wash your hand after soldering or handling pcb board. A soldering fume extractor to vacuum the smoky fume would be quite comfortable for your soldering. The smoke is quite choking and a health hazard if you breath that in.

soldering fume extractor.

Solder also comes with a variety of metal alloy combination. Nowadays it is common in solder core to contain flux. If the solder do not have the flux in the core, the flux have to be manually applied onto the metal surface before the soldering beginning. The flux cleans up the soldering surface, and also make the solder flow rather smooth like liquid. One of the important ingredient to make a good solder joint lays in the soldering flux.

Solder wire also comes in a wide range of diameter to choose from. Generally I use 0.8mm soldering wire roll with flux at the core. Smaller diameter solder wire allows you a better control of the amount of solder to apply. For soldering larger pins or connector component thicker diameter wire will be preferred. Wire too thin  is rather troublesome, because you need to feed in a longer length of solder in order to solder the large surface/lead. For general purpose PCB board soldering 0.8mm wire fits somewhere in the middle. Not too thick nor too thin. For smd components, diameter smaller than 0.8mm is preferred. Using 0.8mm for smd soldering is not of any issue.

Solder wire 2mm

1.2mm

1.0mm

0.8mm

0.5mm

 

<Step 2>

One of the pad being tinned.

 

Align smd IC to the respective pad.

 

IC being fixed in position

 

Checking if alignment is correct.

 

Flooding the pins with the rest of the solder.

 

Pins flooded with solder

My microcontroller TQFP package has 44pins around the square package. To secure the package to the adaptor, I will need to solder one of the pin to the board first. It is important to solder only one pin. In case of mis-alignment, we can correct it easily. If more pins are soldered, it will be more difficult to correct any alignment.

Pin 1 of the adaptor pad is  first tinned with a layer of solder. A tweezer is then used to align the IC chip on the pad. The IC is secure to the board with a slight touch from my soldering iron, soldering the IC pin to the pad.

The important factor to consider would be the heat generated by the iron. I prefer to use a 60W iron, which still works well in air-con room. A lower wattage or fine tip iron will not heat up that well in colder environment.

 

         Goot TQ95 60W

If you prefer a fine tip, perhaps the soldering station will be more suitable. The iron temperature can be adjusted to a higher or precise temperature for the component that you want to solder. Component with thick metal contact like connector, heat sink, for thick cables should be solder with a higher temperature. The iron should be held on longer, in order to have the component fully heated up before any solder is applied.

Solder Station

For soldering the IC pin to the pad, you can start off by heating up the pad. Then while heating up the pad, touch the IC pin and apply the solder wire directly to the pad or IC pin, allowing the solder to flow like liquid. The IC pin is heated last to minimize the chance of over heating the pin. If it doesn’t flow very well, you can manually some flux to the joint. The solder wire should not touch the iron directly, because this will vaporize the flux, and solder flow will be restricted.

Heat up the lead and pad longer allows the solder to flow and form a good joint. Not for too long as it can also damaged your IC. You should be able to see the solder flow eventually onto the lead & pad. With a bit of practice, you will see the difference between a quick solder touch and another one with lead & pad heat up a little bit longer. It takes a number of practice to get a good joint with minimum amount of heating time.

The soldering iron that I use has rather thick tip, but that does not matter when I do soldering for the smd microcontroller. All we do is to flood the pins with solder. They can be be suck up later.

There is a technology  known as ultrasonic soldering. The soldering iron tip has this micro vibration which helps the solder to flow more easy without much use of flux. It can also solderthose difficult to solder material. The following is one article that I found that describe about it. – Soldering the unsolderable.

 

<Step 3>

I have applied more flux at this stage. It should have been applied before flooding the pin, but it doesn’t matter too much. The flux will make the solder rather liquid so that it is easier to suck up the excess solder.

solder flux paste

Baker Soldering Fluid

<Step 4>

The flooded solder is being heated up, and the excess solder are being sucked up.
<Step 5>

Each pins is being touch up, ensuring that the pin is solder to pad and that they are not bridged across to the adjacent pins.

Now we have got our smd component soldered onto the board.

<Step 6>

 

The flux helps a lot in doing a good solder but it often leaves the board with tiny dots of transparent strain, a bit sticky, also known as grease or flux residue. The board looks untidy with these tiny bits of grease.

These are the various recommended cleaning solution for pcb.

– 50% Alcohol + 50% Water

– Thinner

– Flux remover

– Multicore Prozone MCF800

– Solvent-> Bromopropane; propane, 1-bromo-; propyl bromide (Chemical Formula: C3H7Br)

 

Alcohol MSDS (Material Safety Data Sheet)

Thinner MSDS (Material Safety Data Sheet)

Electrolube, FLU Fluxclene Cleaning Solvent, pdf file

MG Chemicals 413B Heavy Duty Flux RemoverBrush for the crush

Flux Remover

Multicore Prozone MCF800

 

Besides using chemical, or after using chemical, there may still be some white blur stain. Those are flux spread dry up on the surface. Using a hot air blower, or heater on the surface can melt the dry up flux, and recover the smooth shiny PCB board surface again. Clean away the melt flux immediate after the heat.


Using alcohol is strongly recommended. Thinner is not suitable for certain plastic/material. Care is required when using thinner for cleaner. Using thinner on the PCB, copper pads and soldering joint isn’t a problem. When use on plastic, you are advise to do a trial to ensure that the material is able to with stand thinner solution. Flux remover is commercially ready mixed solution. From what I learn in the manufacturer website, they are non-flammable chemical solution.

 

Alcohol & thinner has a lower flash point, and catch fire easily. You have to be extremely in handling and storing these flammable chemical. Do not store or work on the chemical near electrical appliances, hot area or things that can cause spark. Keep your windows open to allow air to circulate while working with these chemical. They may cause headache, dizziness and uncomfortable when inhaled.

 

 

Chemical comes in different level of grade. A slight different in the chemical concentration or purity can results in a large difference in cost. Alcohol can be  expensive. For pcb cleaning purpose, request for technical grade alcohol. Higher grade alcohol is typically used for consumption or lab experiment purpose. Since we are using it for cleaning, there is not much advantage in using high quality chemical which is expensive. Dickson chemical is specialized in high graded chemical for laboratory use. They do sell lower cost technical grade alcohol. They are not suitable for consumption but is ok for cleaning application.

   Dickson Chemical selling Technical grade alcohol

You can easily buy thinner from your local hardware. Typically used for cleaning your brushes after all the wall painting works.

   Non-flammable Flux remover

 

 

 

 

These are other recommendation in the web. After researching further, I would advise not use them. These chemical are of health hazard.  Exposure will have severe adverse health effects.

– 50% isopropanol + 50% water

– Trichloroethylene

– Carbon tetrachloride

 

Isopropanol (true chemical name) is also known as Isopropyl alcohol or 2-propanol. 2- is refer as Iso. Other chemical may starts with 1- refer as N. These are some jargon used in the chemical industrial. I managed to learn a few of the terms from the vendor.

Trichloroethylene (true chemical name) is typically used for degreasing the metal. It is an extraction solvent for oil. Another name for Trichloroethylene is Trielin. Based on some read up, they can cause cancer.  

http://www.answers.com/topic/trichloroethylene

 

Carbon tetrachloride can harm our environment, producing CFC which deplete the earth’s ozone layer. http://en.wikipedia.org/wiki/Carbon_tetrachloride

 

Initially I tried using contact cleaner to clean the stain off. I use cloth or tissue but the fabric is often tear by the component sharp edges. Most corners are not easy to reach. Later on I tried using a toothbrush, the result is better.

For mass cleaning job, you can try using the ultrasonic pcb cleaner. It is a deep metal container for the solution, using micro vibration to shake off the dirt. I have never tried on it before, and I believe it is the same machine people used for cleaning their jewelry. Basically, you will need to dip the pcb board into the solution, and the ultrasonic will be activated to do it’s job. The solution used is the same as manual cleaning, requiring 3-5 minutes of cleaning.

   Ultrasonic cleaner

Ultrasonic jewelry cleaner

 

 

 

There is also a flux that does not leave residue on the PCB. I found it on the internet, and have not try it before.

INTERFLUX, IF 2005M No-Residue™ flux, pdf file

 

Article relating to removing flux residue:

pcb cleaning – Aqueous Cleaning Process.pdf
pcb cleaning – Flux Removal, nuxx.pdf
pcb cleaning – pcb cleaning article.pdf
pcb cleaning – PCB Cleaning, Printed Circ.pdf
pcb cleaning – pcb washing chemical composite.txt
pcb cleaning – remove solder flux.pdf
pcb cleaning – Solvent washing PCB boards.pdf
pcb cleaning – washing the board using alcohol.pdf
pcb cleaning – PCB cleaning article Inventec_S24_03.pdf

 
 

<Step 7>

A close up view of the clean and neatly soldered surface mount IC on the prototyping adaptor. Soldering smd components is simple and fast with a bit of practice. Small and easy to clean up. There are too many advantage in working with surface mount, compared to through hole components.

This is the end of the short demonstration on smd soldering. I hope these article can provide you some insight and confident to start experimenting circuits using surface mount components.

 

Video available. Please click here,

smd soldering.mpg (25MB)

smd cleaning pcb.mpg (5.5MB)

 

Article on smd soldering.

2010-07 How to Solder Surface-Mount Devices.pdf

 

 

 

 

www.pic-control.com, Singapore Circuit Design & PCB fabrication

Singapore Customized, custom made Electronics Circuits & Kits

 

Various Chemical Reference:

Alcohol 70% + Distill Water 30%
MDX4-4159
7MHFE-71DE
Cyclohexanone
Methylethylketone
ethylacetate,
Silicon Wacker
Wacker M4503, General purpose mould making silicon (Using Two Part Silicon Mold Putty to Make Molds)
http://www.kirkside.com.au/, Mould Material Specialist

Propanol, used to clean PCB. (close to white electric oil)
Acetone, remove away ink printed on PVC stickers
n-Hexane (white electric oil)

smd glue for surface mount component mounting / soldering use
Seal-glo NE series, NE3000S, NE8800T, more Seal-glo

 

 

Keyword: surface mount soldering, smd adaptor, smd to 2.54mm convertor

 

DIY Home PCB Fabrication

DIY — Fabricate your own PCB board at home

Written by Lim Siong Boon, last dated 08-Dec-09.


 

PCB is the abbreviation for Printed Circuit Board. Some may refer it as PWB which stands for Printed Wiring Board. The board consist of copper tracks connection printed on the surface of a non-conducting material. Your designed circuit connection will be contained within this board. This method of fabrication is an efficient method for reproducing a circuit. The circuit quality can be more consistent and the reproduction can be faster. This makes it suitable for manufacturing large quantities of electronic circuits.

Are you thinking of building your own PCB board at home? Do you have an electronics project in mind? Then you have come to the right site. This is a step-by-step guide to building your own PCB boards, complete with photos and video illustrations.

 

Home DIY PCB board finished product

PCB Fabrication Overview
  1. PCB board design
  2. Printing Artwork
  3. Exposure
  4. Developing
  5. Etching
  6. Cuting and Drilling
  7. Tinning and Masking
  8. Other method of PCB making

 

The following project will introduce you to the basic steps in fabricating a circuit board at home. For low quantity fabrication, this method can save you some time and help you stay within your budget.

For a simple prototype circuits, I would recommend point-to-point wire solder. While this process is tedious and takes time, your project cycle will be shorter than making a PCB which is more or less permanent. Individual wire connection are soldered directly onto the component leads or pins. The wiring makes modification quick and easy.

This photo is an example of a point-to-point wire wrap circuit. The leads are soldered into place. The colored wiring helps keep things organized, but the back side of the project still looks like “spaghetti”. Constructing a board in this manner requires proper planning of your component positioning for minimum wiring work. You may be constantly flipping the board over from front to back to double-check the connections. It can be quite fast if you are used to visionlizing the components from the back side.

 

Come, join in, as we walk through the process of PCB fabrication. We will proceed step-by-step. It’s as easy as ABC and you will soon be the proud owner of your own custom printed circuit board.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

At this time, you might be aware of an alternative. It is possible to have your designs produced by professional companies that specialize in PCB board fabrication.

Professional PCB board fabrication

PCB fabricating machine is more efficiency for mass production. For professional looking PCB board, you may outsource the task to a PCB design house or manufacturer. Well established PCB manufacturer normally ask for higher fabrication volume. There are manufacturer that can do PCB fabrication in lower volume for your prototype. Some accept a few pieces, and even provide you with software for drawing your PCB design. Lead-time is typically a week or 2, while some manufacturer may offer express PCB fabrication service. If you are looking into high volume professional PCB board, China can offer a more competitive price. More reference to these manufacturer and PCB fabricating machines is available on this website.

Various professional PCB manufacturer.

San Francisco Circuits San Francisco Circuits

                      

       

                

prototype pcb – The PCBs from Seeed Studio Fusion is short delivery time, competitive price and high quality.”

In order to have your PCB boards professionally fabricated, the factory will need your design in a format called a “gerber” file. These gerber files are a list of mechanical instructions for fabricating the PCB. See the DIY steps in the section that follows to learn how to generate your own gerber files. The factory will usually charge a setup fee for each fabrication job. The cost per piece is usually low.

Most of the time you may only have the circuit designed on a piece of paper. You can also engage a professional to draft and generate the manufacturing gerber files. Be sure that your circuit is a working design and you have the connection drawn correctly before submitting to them for drafting. I don’t think they verify your design. You also need to prepare the component datasheets or sample, so that they can draw out the component’s soldering pad or footprint that your circuit is using. If the footprint is wrong, you will not be able to solder your component onto the board probably. Any requirement, example- the placement of the component, you should also indicate them clearly.

The design should also indicate the type of connector you want to use. I usually forgot to draw out the connector component. You can seek for their recommendation on those connector or other components that may not be critical to your design.

The computer drafted schematic and pcb layout will be sent for your final verification. Once you acknowledge the design, they will then generate the gerber files for your pcb fabrication submission.

Various Schematic Capture & PCB Layout Vendor

            http://www.shinmark.com

  

Of course, if you do not have the complete circuit designed, you will have to engage a circuit designer to design a circuit for you. Designing services can be quite expensive.

 

If you want to fabricate the professional looking green board for a smaller quantity, you can try PIC-CONTROL. The gerber files are submitted to them for pcb fabrication at a reasonable price. However the delivery lead time is slower. About 2 times longer as compare to the typical manufacturer who can deliver the fabricated board in 1-2 weeks times.

They also do electronic circuit design, custom made controller kit, drafting, programming, engineering and reverse engineering stuff, mainly in the area of electronics.

 

A computer aided design for the schematic capture and pcb gerber file is usually a major cost. I usually DIY, drafting out the design on my own. It save me quite a lot by generating my own gerber files. I can understand why the charge for the design drafting is usually high. There is quite a lot of work in drafting out the design file. It is a time consuming task.

   

 

 

www.pic-control.com, Singapore Circuit Design & PCB fabrication

Singapore Customized, custom made Electronics Circuits & Kits

 

 

1.   PCB board design

Material and Equipment

  • electronics schematic design

  • computer

  • Protel DXP or PCB design software

        

 

 

software for

drawing PCB board.

 

 

 

 

  

Protel DXP software enviroment.

 

component layout & traces diagram.

 

new Protel DXP version (2005).

1.1 PCB design introduction

 

Before any PCB fabrication can be done, we need to design PCB electrical pads for component placing and trace for component connectivity. It can be draw by hand but if your design is very complex, the PCB software will be very helpful. The software have ready to use components footprint, and modification can be easy done, saving you a lot of time and effort as compare to manual drawing.

There are various brand of software for designing and drawing PCB, and most of them can generate gerber file (*.gbr) which is a common file format used for PCB fabrication in the local industries.

Professional PCB software such as CADSTAR and PROTEL can easy cost above thousand of dollars. Simple and basic PCB software such as Eagle or Easy-PC is slightly lower in cost, in the range of about $500 to $1200. They are cheaper in cost, but features can be limited. Limitation can be in the form of limited board size, number of board layer or the number of component’s pin allowed in the design. Professional PCB software has a lot more sophisticated features to make the PCB design process more efficient. Software trials are available from most of these PCB vendors, for user to evaluate.

 

Various electronics schematic & PCB design tools.

Easy-PC from Number One Systems

 

CADSTAR from Zuken

Eagle from Cadsoft

 

 

 

 

 

 

Alternative you can engage professional help for the PCB design work, to relieve yourself from the extensive software training. With the experience and expertise from a PCB design specialist like Quantum CAD, you can be sure that your project can be in time and well taken care of. Demanding layout design for analog or any high frequency circuitry, would seems like a breeze in your development work.

 

 

 

 

In this fabrication trial, Protel DXP is used to aid schematic design and PCB layout. It is quite user friendly and technical support is strong in terms of user group and tutorial documentation.

Gerber file is not used in this home fabrication, instead a pictorial format save in *.pdf file. *.gbr gerber file is normally use in local fabrication house. The component layout and traces generated are save onto the *.pdf file.

The PCB artwork is now in *.pdf format and is ready for printing.

For more information on Protel DXP, you may refer to the following website, http://www.altium.com/

 

 

A good electronics design is not stop at the schematics. You may have a very good circuit schematic but it can still create problems for you if the components & traces are not place properly. This is especially important for analog circuits. Understand how to place components and route the power/signal pcb trace is also very important. Understanding radio frequency and high frequency theory will help a lot. I have a delicate page specially for PCB trace.

 

I have also started a website to document some common surface mount component footprint for references.

     

More PCB footprint references here. Footprint

 

 

 

Here is a reference on PCB design guideline that I got it from a website. Quite a useful information to guide you into design a proper PCB board.

Board Design Guidelines 2003 Rev-A.pdf

 

Also another good reference from Texas Instruments about PCB layout recommendation is available in the section Analog Electronics.

op amps for everyone (Texas Instrument).pdf

 

The following are some of the advance topics that you may like to research further into, if you are interested to find out more about PCB design. http://www.ipc.org

 

– IPC Designer and Advanced Designer Certification,

– IPC-T-50 Terms and Definitions for Interconnecting
and Packing Electronics Circuits,

– IPC 2222, Sectional Design Standard for Rigid Organic
Printed Boards

– IPC 2221, Generic Standard on Printed Board Design

– IPC-D-325 A, Documentation Requirements for Printed
Boards, Assemblies and Support Drawings

 

Layout

– Characteristics of Grid Systems

– Purpose of Tooling Holes

– Feature Formed in Copper

– Through-Hole Land & Tolerance Requirements

– Design Differences for SMT vs. Through-Hole

– Interrelated Considerations for Design

– Printed Boards & Assemblies Viewing Principles

 

Electrical considerations

– Schematics/Logic Transformation for Component Arrangement

– Schematic and Logic Symbols

– Functional Electrical Characteristics

 

Materials

– Copper Clad Laminates

 

Component requirements

– DIP & SIP Components

– Clinched & Unclinched Leads

– Point-to-Point Wires

– Axial & Radial Lead Mounting Differences

– DIP & Chip Carrier Sockets

– Edge-Board Connectors

– Characteristics of a bus bar

– Jumper Wires

– Purpose of Stiffeners

– Purpose of eyelets

– Differences between Automatic & Manual Placement

– Non-standard Parts Information

 

 

 

 

 

Assembly requirements

– Differences Between Manual & Pick-and-Place SMT Placement

– Considerations for Component Mounting

– Legend & Polarity Markings

 

Board fabrication

– Board & Assembly Panelization

– Hole Types & their tolerances

– Coating & Markings Used on Printed Boards

 

Physical board characteristics

– Thermal Management for Assemblies

– Thermal Management for Boards

 

Documentation

– Tolerancing Methods

– Datum Features & Location Principles

– True Positioning Dimension Techniques

– Conductive Pattern Location to Datum References

– Plated-Through-Hole Dimensions & Grid Location

– Tooling Hole Location Documentation

– Datum Symbols and Hole Description

– Documenting Fastening Hardware

– Minimum Drawing Requirements

– Master Drawing Hole & Conductor Description

– Minimum Requirements for Master Drawing

– Artwork Acceptance Criteria Inspection and test

– Testing & Techniques & Procedures

 

Reliability

– Reliability Terms & Design Issues

 

High Speed Design

 

RF Design

 

Design for EMC


(updated on 2016-07-28)
After your PCB layout design is completed, and gerber file is generated, you may like to check the generated gerber if the PCB layer is generated correctly. Mistake can be found through visual inspection of your gerber layers.

The following is a free online gerber viewer that you can use,
http://www.gerber-viewer.com/

For free off-line gerber viewer, you can download the gerber viewer software from,
Viewmate (http://www.pentalogix.com/viewmate.php)
gerbv (is a free open source gerber viewer. Some presentation error detection, so use with care. Look out for the improved version if any)
GraphiCode GC-Prevue (free gerber viewer for a limited period of time)
 

www.pic-control.com, Singapore Circuit Design & PCB fabrication

Singapore Customized, custom made Electronics Circuits & Kits

 

 


 

 


2.   Printing Artwork

 

Material and Equipment

  • PCB artwork

  • paper

  • printer

  • transparency

  • laser printer or photo copier

material for the making of the transparency film.

 

a closer view of a printed PCB pad and traces photocopied onto a transparency.

 

2.1 Artwork introduction

 

The PCB layout can be printed from a normal home printer onto a white piece of paper. The printing will be photocopied to a transparency. The transparency will be use for photo-resist PCB board exposure in the next stage.

A laser printer is prefer for sharper trace, especially if the traces are very close to each other. The laser printer can also print directly to transparency.

The transparency is cut to PCB size 15x10cm. Five PCB artwork are squeeze and arranged to maximize board usage.

 

There is also another popular DIY call the tone transfer method. Basically, it is using a laser printer to print your art work on a piece of paper. The toner print out is then iron onto a piece of copper plated board. This forms the etch resist layer on top of the board which can be send to the etching process.

The following link provide further information on this method. http://www.fullnet.com/~tomg/gooteepc.htm

The advantage of tone transfer is that it is simple, fast and does not require special positive acting presensitized (photo sensitive) PCB board.

 

The following step presents the traditional photo exposure method. The etch resistance layer can be formed on the photo sensitive board after the exposure.

 

 

 


 

 


3.   Exposure

 

Material and Equipment

  • ultra violet lamp

  • a box

  • Positive Acting Presensitized PCB board

  • transparency with PCB artwork printed

  • scotch tape

ultra-violet lamp (left) to expose the photo-resist coated Kinsten PCB board (right).

3.1 Exposure introduction

 

A typical Ultra Violet UV lamp for exposure on a Positive Acting Presensitized Kinsten PCB board.

 

   Where to buy them locally???

The ultra violet UV lamp is available in most lightings shop. I brought it at a electrical shop along kelantan lane (near Sim Lim Tower). The Kinsten PCB board, I brought in from Bell System, #03-12, Sim Lim Tower. It is also available in another shop Sunlight.

 

peeling off the protective film from the PCB board.

 

3.2 Preparing PCB board for exposure

 

Tear off the white/black protective film on the photo-resist board. Place the transparency artwork on top of the PCB board. Secure the artwork position with scotch tape.

 

laying film on PCB.avi (3.2MB)

 

Alternative you can buy a bare copper board and spray on the photo resist chemical which will be similar to the ready product photo-resist board that I have brought.

3.3 Exposure setup

 

If you have a piece of glass, place it on top, to make a good contact between the artwork and the PCB board. Close proximity should be maintain to make sure that trace are not expose to the UV light. I actually make this box out of a shoes box to prevent over UV exposure to the PCB board.

 

PCB setup in the exposure box.avi (1.5MB)

ultra-violet exposure

 

3.4 PCB exposure

 

Turn on and expose the PCB board for 90 seconds for ultra violet lamp, or 6-10 minutes for normal fluorescent lamp.

The above reference is base on the guideline of the lamp of about 5cm distance away from the artwork PCB. If the distance is far from the typical one, the exposure time should increase proportionally.

 

exposure to ultra violet light.avi (0.9MB)

 

 

A quick reference guide to the typical type of PCB material/substrates

There following introduce you to the various PCB substrate that you might consider before fabricating your PCB board. For typical applications, FR2 or FR4 board will be more than sufficient for your project. For delicated projects, you may consider the reference for the type of PCB material suitable for your appliation.

Various type of PCB materials

 

CEM-1 (Composite Epoxy Material):

CEM-1 specification

 

FR-1 Paper/phenolic (Flame Resistance-1): Room temperature punchable, poor moisture resistance

FR-1 specification

 

FR-2 Paper/phenolic (Flame Resistance-2): low cost pcb material usually found in high volume consumer products. Suitable for single sided PCB consumer equipment, good moisture resistance.

94VO material

 

FR-3 Paper/epoxy (Flame Resistance-3): Good of mechanical and electrical properties.

 

FR-4 Fibreglass (Flame Resistance-4, Glass cloth/epoxy): Excellent mechanical and electrical properties. Fibreglass pcb material offers a strong substrate than FR-2. The specification for a typical FR-4 board would be of thinkness 1.6mm, 1oz copper track, green solder mask, white silkscreen, double sided, etc…

FR-4 specification

tg135-tg170 material

 

FR-5 Fibreglass (Flame Resistance-5, Glass cloth/epoxy): High strength at elevated temperatures, self-extinguishing.

 

G10 Fibreglass (Glass cloth/epoxy): High insulation resistance, highest bond strength of glass laminates, high humidity resistance.

 

G11 Fibreglass (Glass cloth/epoxy): High flexural strength retention at high temperatures, extreme resistance to solvents.

 

Flexible PCB: thin and flexible pcb, typically design with movable component.

 

Ceramic/Metal/Aluminium substrates/base: provides better heat dissipation. Often used component that dissipate a lot of heat. Example: high power LED component, power transistors, etc…

 

Radio Frequency, Rogers PCB: low dielectric plastics suitable for high frequency applications.

Other PCB laminate materials name,
– CEM-3
– CEM-5
– BT-Epoxy
– Cyanate Ester
– Polyimide
– PTFE, Polytetrafluoroethylene (Teflon)

References:

http://www.trianglecircuits.com/substrates.html

 

 

 

 


 

 


4.   Developing

 

Material and Equipment

  • Sodium Hydroxide or Developer solution

  • distill or plain water

  • gloove

  • glass, plastic, wooden rod or old chopstick

  • container slightly bigger than the PCB board

  • exposed PCB board

  • container with water for washing

Sodium Hydroxide NaOH, and a pair of Gloves.

4.1 Developer introduction

 

Sodium Hydroxide is used as a developer. Correct proportion is necessary as too much will destroy the photo-resist coating instantly, while too little will have no effect in developing the PCB.

Commercial developer solution (pre-mixed with distill water) might work better since mixture is in the correct ratio for PCB developing.

Silicate Based Product make a better developer as less likely to be over-developed. Higher concentration will increase the developing speed.

I have seen on other website that the chemical NaOH is used as the drain pipe cleaner.

 

   Where to buy them locally???

You can buy alternately pcb developing solution from Bell System, #03-12, Sim Lim Tower. Or visit the local chemical store in Singapore

 

 Visit Dickson Chemicals,

the local chemical store in Singapore

Dickson Chemicals

www.dicksonchemical.com.sg

Tel: 6280 0468

Fax: 6281 1082

30 Shaw Road #05-05,

Singapore 367957

 

 

 

 

mixing solution, NaOH chemical with water.

4.2 Developer mixture

 

I have used a old ice-cream container to mix the solvent. The solvent composite for making the developer consist ratio of about

 

1unit of Sodium Hydroxide is to

 

20 unit of Water.

 

The solution must be of uniform concentration. Stir the mixture until NaOH is fully dissolved in the water. If the chemical is not fully dissolved, the region with concentrated NaOH can destroy the photo-resist coating instantly.

Use a glass rod when working with chemical if possible. Glass material is less reactive with most chemical.

 

mixing NaOH developer solution.avi (3.4MB)

 

When mixing NaOH to water, heat will be produce. Stir the water solution constantly while adding in NaOH slowly.

 

 

Various Developing Chemical

 
Sodium Metasilicate

(msds)

Sodium Hydroxide NaOH

(msds)

PCB developing. washing away photo-resist coating that are expose to the ultra-violet in the earlier stage.

4.3 Developing PCB board

 

Developing PCB board by dipping into the chemical solution. For this setup, I am also using ice-container.

During the developing process, the chemical board should be agitate constantly until the board is developed.

 

developing PCB board.avi (3.6MB)

 

The board is fully developed when the PCB traces appear green in color. This green layer is the photo resist layer which protect the copper surface underneath during the etching process. The region to be etched away later will be expose and is brown in color. The brown color is the actual color of the copper. There is no photo-resist coating to protect the surface.

Rinse the developed PCB board with running water after developing.

 

picture of a developed PCB board.

4.4 Over and under developed board

 

The left portion of the board is developed fairly. Notice that there are still some unwanted fade green coating on the copper surface. The board has been soaking in the developer solution for quite some time but the green photo-resist coating is still not remove. This is probably due to inadequate UV exposure time. The UV exposure for this board is exactly 60 seconds. The UV exposure should be 90 seconds instead. It is better to over exposed during the UV lighting process.

There is no attempt to dip the board for a longer period or using stronger solution to remove the fade green coating. It may just cause the dark green pattern to be washed away as well.

The photo-resist layer on the right portion of the board is being washed away. The board is dipped into the solution, without dissolving the NaOH chemical completely. The strong concentration of the chemical have wash away the coating instantly. This example serve as a reminder to stir and dissolve the mixture well before any attempt to develop the PCB board.

mending the circuit trace that are over developed.

This is the marker use in the demonstration. A fine tip oil base black marker from “ZEBRA NAME PEN” made in Japan.

4.5 Repairing over developed board

 

Sometimes, thin traces on the board may be over-developed. The required trace is not protected by the photo-resist coating after soaking for too long in the developer. The trace has to be protected or it will be etch away in the etching process. These broken or missing circuit trace pattern can be corrected and repaired by drawing over the copper surface with a Etch resist marker. The marker ink will cover up the copper region and acts as etch resistance during the etching process.

There are commercial etch resist marker available, however a general purpose oil base marker will be just as good for use as a etch resist coating. It is a commonly available permanent marker, meant for general use.

 

 

   Where to buy them locally???

I am fortunate to test out my zebra name pen marker can actually work as an etch resist shield. You can easy get this type of marker in our local stationary shop. For example, Popular Book shop. If you are looking for a professional etch resist marker, you can buy them from Farnell. They should have it. The tray is actually also a old ice-cream box.

 

 

 Visit Dickson Chemicals,

the local chemical store in Singapore

 

Dickson Chemicals

www.dicksonchemical.com.sg

Tel: 6280 0468

Fax: 6281 1082

30 Shaw Road #05-05,

Singapore 367957

 

over developed PCB board, with all traces wiped away. The NaOH mixture is too strong. The photo-resist layer got wipe out instantly.

4.6 Over developed board

 

The photos show the results of a over developed board. Too much chemical was mix in the solution, resulting in a very strong developer solution. The green photo-resist coating on the board was wiped away instantly. The clear and sharp printed pattern appear immediately when the board is dipped into the solution. When the board is lifted up, the whole photo-resist layer is being wash down from the surface of the solution. Leaving away nothing but bare copper on the board surface.

When PCB trace appear instanly when it is dip into the developer, it can indicate that the solution is too strong. Start off with low NaOH concentration, and increase a bit at a time. Experiment and obtain the correct mixture for the developer. Remember to dissolve the chemical fully when adding more chemical, before dipping the board into the solution.

 

 

 


 

 


5.   Etching

 

Material and Equipment

  • Ferric Chloride powder

  • distill or plain water

  • gloove

  • glass, plastic, wooden rod or old chopstick

  • long container for the etchant

  • a boarder container for boiling hot water below

  • 3 litre of boiling water

  • drilling machine

  • plastic string

  • developed PCB board

  • container with water for washing

  • detergent

Ferric Chloride FeCl3,

SENO 3200 (hexahydrate type)

 

Translated Instruction from German Language found on SENO 3200 iron iii-Chloride.

Long-proven etching agent for printed circuits, copper and high-grade steel, which already corrodes at ambient temperature and is almost for an unlimited period storable also in used condition. In the temperature range of 20-40 it is characterised by a good etching rate and a small under etching. With increase temperature increases both. Copper admission on the average 40-50g/Litre, etching rate 40-3µ/min

Caution: Injurious to health when swallowing. Far of children and food store. Rinse off immediately during contact with the eyes thoroughly with much water and physician consult. Marks with difficulty removable.

 

Content: 230g per pack for 0.5 to 1 Litre of etchant.

 

mixing FeCl3 with water

5.1 Etching introduction

 

Ferric Chloride is use to etch away copper surface on the PCB board. It is a very toxin chemical and is harmful to the environment. Please handle and dispose the chemical waste with care. It is dark yellowish in color and can stain your clothing.

Remember to wear protective gloves while handling FeCl3. Chemical is toxin and will cause skin irritation Wash skin with running water immediately when in contact with skin.

Stronger FeCl3 solution enables etching process to be faster.

When design PCB board, it may be a good idea to fill up with regions of copper. This is to minimise the area of copper surface to be etched away. With less copper to etched, it will also means that the solution can be effectively use to etch more PCB board.

 

 

   Where to buy them locally???

You can buy Ferric Chloride from Bell System, #03-12, Sim Lim Tower. Please do take care of our environment when disposing this chemical. The etching tray is again an old ice-cream box.

 

 Visit Dickson Chemicals,

the local chemical store in Singapore

 

Dickson Chemicals

www.dicksonchemical.com.sg

Tel: 6280 0468

Fax: 6281 1082

30 Shaw Road #05-05,

Singapore 367957

 

 

 

 

 

5.2 Etchant mixture

 

The solvent composite for making the etchant consist of

 

about 1 unit of Ferric Chloride FeCl3 is to

 

3 unit of water.

 

 

or about 1 unit of Ammonium Persulphate is to

 

5 unit of water.

 

Stir the mixture until FeCl3 is fully dissolved with the water.

 

mixing FeCl3 etching solution.avi (3.4MB)

Various Etching chemical

 
Ferric Chloride FeCl3

(msds)

– Ammonium Persulphate

(msds)

– Sodium Persulphate

(msds)

– Peroxy Sulfuric (recyclable chemical)  
– Ammonium Persulfate

(msds)

warming up the FeCl3 solution

5.3 Warming up etchant

 

Warm up the FeCl3 solution on a tray (blue) filled with hot water. Temperature range from about 50°C to 60°C will be suitable to speed up etching process.

 

warming up the etchant solution.avi (3.6MB)

secure PCB board with string

 

or use scotch tape to secure string to the PCB board.

5.4 Board preparation for etching

 

Drill a small hole on the PCB board so that a string can be secure to the board. The string is use to position or pull out the PCB in the toxin solution.

 

or

 

A scotch tape can be used to secure the string to the PCB board.

PCB board etching until the unwanted copper is remove completely by the chemical.

5.5 Etching PCB

 

Immerse the PCB board slowly into the FeCl3 solution. Agitate the PCB by tilting the container to and fro gently, until the unwanted copper layer are properly etched away, leaving only the required region on the PCB. The process may take 15 – 60 minutes to complete. Process duration will depends on the concentration, temperature of the etchant solution.

 

 A video clip is available to help you visualise the process.

 

etching process 1.avi (2.8MB)

etching process 2.avi (2.7MB)

etching process 3.avi (2.9MB)

 

 

Etching method also plays a part in the etching speed. If you leave the board without any agitation, the process may takes hours. There are other method of agitation, for example by using bubble or spraying onto the copper surface. A good agitation equipment helps to speed up the process to merely a few minutes.

The etching effectiveness will be reduce if the solution is re-used for a number of times. Strong FeCl3 concentration and high temperature can increase the etching speed.

testing of different ways to resist copper from being etched by the chemical.

5.6 Testing various etch resist material

 

The photos simulate a developed PCB board masked with some scotch tape, masking tape, and text using oil based marker. The board is over-developed and is used for testing various etch resist materials.

The experiment shows that adhesive tapes and oil base marker can be implemented to perform as a mask to resist from the etchant.







Notes:

For commercial PCB fabrication it is important to leave a minimum spacing between the copper track depending on the PCB copper thickness. This is needed so that it have enough space for the etching to take place.

http://www.pcbuniverse.com/pcbu-tech-tips.php?a=4



Cu Weight         Min Recommended Space between copper features

1oz                     3.5mil (0.089mm)

2oz                     8.0mil (0.203mm)

3oz                     10mil (0.254mm)

4oz                     14mil (0.355mm)

washing PCB with detergent after etching.

5.7 Washing board condemned with FeCl3

 

Prepare a container of detergent solution to wash the PCB board condemned with chemical FeCl3. Detergent contain Sodium Carbonate or Sodium Hydroxide, which can neutralize FeCl3.

removing away the photo-resist green coating.

photo-resist coating removed, however the black marker writing is still on the board

 

 

contact cleaner is apply to tissue paper wiping away the marking.

 

washing chemical content on the board with running water.

 

PCB etching completed

5.8 Removing photo-resist coating and other stain

 

Photo-resist mask or marking of the traces can be removed using the NaOH developer. It is the same developer used during the developing process. Stronger solution can be use this time round as the etching is already completed. The protective coating is no more in use.

A cloth soak with the solution can be use to wipe on the PCB board surface to remove the coating.

For the marker stain, it can be remove using commercial available contact cleaner, alcohol, or thinner solution.

Rinse with water, clean and dry the PCB board.

 

wiping marker ink away from the copper.avi (2.8MB)

 

soaking FeCl3 in detergent before attempting to dispose this chemical waste.

 

 

 

5.9 Disposing toxin chemical

 

Ferric Chloride FeCl3 is a toxin chemical. Please consult your local authority for proper dispose of chemical waste product.

As recommended, detergent (or other baking soda) can be mixed to the FeCl3 solution. The mixture solution can easily produce bubble foam which can grow 10 times in volume. Lay waste paper under the container to prevent toxin overflowing out of the container onto the floor. Leave it to dry before disposing the waste.

 

Sodium carbonate (washing soda) or sodium hydroxide can be added to neutralize Ferric Chloride before proper disposal.

For information on the disposal of Ferric Chloride. Follow this link,

http://www.mgchemicals.com/techsupport/ferric_faq.html

one month after neutralizing FeCl3

semi-dry residue at the wall of the container.

This is the result, one month after neutralizing FeCl3 with detergent. Just taking some pictures of this experiment for the fun of it. The solution smells and strong toxic gas can be felt. There are still little bubbles popping at that time during photo taking. The test copper board has been etched naked after soaking for so long. The wooden stick that I dump into the chemical has become totally black in color. The tissue paper throw in, still looks the same. Plastic rope is still there. To dispose this pool of chemical, they should be left to dry. The dry residues is easier dispose off. Less harmful to the as compare to when FeCl3 is in its liquid form.

 

 


 

 


 

6.   Cutting and Drilling

 

Material and Equipment

  • dot punch or sharp tool

  • drilling machine or hand drill

  • 1mm, 1.5mm drill bits

  • coping saw

  • hand files

  • penknife

  • steel ruler

  • bench clamp or support

Complete fabrication of smaller individual PCB board

6.1 Introduction to cutting and drilling

 

The etching is completed. The original artwork is arrange to maximise the use of the PCB board. 5 small PCB can be fabricated on the 15cm x 10cm board. 3 of the PCB pattern is not formed properly during the developing process, therefore only 2 PCB board can be extracted.

Hole is necessary to mount component (example: resistor, capacitor, inductor, board mount switch, DIP integrated circuit IC etc). Before drilling, a dot punch is used to mark the hole position. This serves as a shallow guide for the drill bit to align easily while drilling. Any other sharp pointed tool can be use to do the marking.

The drill is fitted with a 1mm drill bit. A typical hole size large enough for most components. A 1mm drill bit is thin and can break easily. Hold the drill steady and drill in straight slowly. The hole will be drilled with little force applied.

After the drilling is completed, the board outline is then marked with a steel ruler and a pen knife. Coping saw is used to cut the board out. The board will leave sharp bur edges after sawing the board. Use the hand file to de-bur the sharp edge.

The PCB board making is completed and is ready for use.

 

drilling holes for components.avi (2.8MB)

 

There is a market trend of shifting all electronics to surface mount type. Components are more compact and therefore reduces the overall size. Eventually it contributes to the reduce in cost in almost every aspect of the project. Cost reduce in component, PCB board, transportation, etc… . Although it is fairly difficult to solder, the convenience of making PCB board without the hazard of drilling holes make it very attractive to the home PCB fabrication. Soldering surface mount device (SMD) component is possible and requires some practices.

Talking about soldering SMD component, there is this interesting question I have once raised. Have you ever notice the perfect soldering in the industrial PCB? It took me quite an imaginary journey searching for machine to do a perfect soldered PCB board. In the PCB manufacturing industrial, they are using a grey solder paste/cream instead of the solder wire roll. Similar to a toothpaste it is actually a lot of tiny solid solder balls mixed with flux. The paste is spread onto the PCB soldering pad, where the leads or SMD component will be later place on. The paste should  keep cool when not in use; no refrigiration needed, with an expiry period of about a year.

The whole PCB board is then taken on a conveyer belt ride through the hot oven to melt the solder paste and flowing solder will occur. After melting the paste on the PCB, it is then cool, and the solder harden which results in a perfect soldered PCB board. This re-melting process is know as reflow.

Reflow soldering is very fast, a method suitable for mass production. Unlike using a soldering iron, there is no need to aim on the soldering pad, typical heating through gases. SMD component will align automatic themselves during the reflow. You may be interested in getting a reflow station, or reflow machine for high volume production. For a cheaper reflow solution at home, you can click down to this highly recommended website,

 http://www.sparkfun.com/tutorial/ReflowToaster/reflow-hotplate.htm. They have demonstrated how surface mount component are soldered to PCB using industrial standard. It is a very interesting and educational website. Hope that you will enjoy.

The wave soldering process, is another method used for mass soldering of the circuit. Quite interesting.

http://www.ami.ac.uk/courses/topics/0225_wave/index.html

 

More article on Wave and reflow soldering.

http://www.ibselectronics.com/pdf/pa/walsin/smt_notes.pdf

www.zianet.com/erg/SMT_Soldering.html

mounting of surface mount component.pdf

Reference for smd equipment for soldering production.

smt equip,emt reference.pdf

http://www.faze.co.za/Products.html

 

 

 


 

 


7.   Tinning and Masking

 

Material and Equipment

  • solder flux

  • soldering iron (flat tip is available)

  • soldering stand with wetted sponge

  • solder sucker

 

 

tinned PCB board.

 

 

finish PCB product

 

DTMF decoder circuit using MT8870DE

 

LM2576 dc-dc converter circuit

 

7.1 Tinning the copper surface

 

Copper will oxidize when expose to oxygen environment. Oxidization should be avoided as soldering is difficult on oxidization surface.

A thin layer of solder is coated on the copper surface to prevent oxidization. Apply solder to the copper surface with hot soldering iron and spread the liquified solder across the surface. Covering the copper surface with solder helps protect the copper from oxidization.

 

tinning PCB copper area.avi (3.0MB)

 

 

There are various type of commercial surface finish options for PCB board.

– HASL -Hot Air Solder Leveled (Low$)

– Immersion Tin (RoHS, Low$)

– Lead Free HASL -Hot Air Solder Leveled (RoHS, Mid$)

– ENIG -Electrodless Nickel Immersion Gold (RoHS, Mid$)

– Electroplated Gold (RoHS, Mid$)

– Immersion Silver (RoHS, Mid$)

 

Reference link:

http://www.nciproto.com/info/Surface_finish.htm

 

 

 

7.2 Masking PCB board

Masking can be applied to non-soldering area to protect the board from potential short circuit, oxidization and overflow of solder during soldering. The soldering would also be easier and nicer

It is not really necessary in home PCB fabrication, however if you want to give your board the professional touch, there is masking spray available in the market to lacquer the PCB board.

 

Click here for a short clip on “Apply a solder-resist mask to PCB“.

 

 

 

 

 

 


 

 


7.   Other Method of PCB making

 

<This is an OLD ARTICLE>

Laser printing, iron transfer artwork

Use Etch-resist pen

PCB patter transfer film

Milling PCB

Using etching machines for mass production.

 

If you are interested to know a brief idea of how a professional PCB fabrication process is, please follow this link, http://www.jlc.net/~preid/pcbpro/indexpcb.htm

 

bubble etching equipment

 

bubble Tank accessories for PCB board fabrication.

container to hold the Etching chemical.

A flat plastic container is used for developing the photo-resist PCB. Glass rod should be used to stir and mixed the chemical in distill water, because glass material does not have chemical reaction with most chemical.

air pump to sort of stir the liquid to quicken the etching process.

long stone rod to disperse air bubble

water tank or fish tank heater to warm up the water during etching process.

 

 

 

photo-resist PCB board 15cm x 10cm from Kinsten

 

Old Article:

Written by Lim Siong Boon, dated 03 Dec 2005.

The fabrication process was a failure. Photos was taken on the fabrication process. Unfortunately the photos were lost in the borrowed digital camera. Damn it, the pictures are lost for no reason. Should have retrieve the photos immediately after the photo taking.

The first fabrication was done in a friend’s company, selling and dealing with chemical stuff. He is Chee Keong, my good friend from Singapore Polytechnic. He is my very supportive of my project, and invited me to his company on a fine Saturday evening (Sep 2005) for my board fabrication. The place is great because he have all the chemical, tools and facilities I need to fabricate the PCB.

Sodium Hydroxide NaOH was used to developing the photo-resist board, and Sodium Persulphate was used to etch away the metal. Ferric Chloride is a more common chemical used for etching the board, it is a very toxin chemical and disposal needs careful attention. The chemical is a controlled item in Singapore and requires license to use the chemical. It is this reason that I insist to try something safer, like sodium persulphate. However after the trial, sodium persulphate doesn’t seems to perform. I have not yet figure out the reason, but would like to try out Ferric Chloride for my next trial. It is a dangerous chemical, so some knowledge research or revision is recommended before any attempt to use the chemical.

There are other alternative chemical used in PCB fabrication after some research on the internet.

Bubble etching concept

Trying to heat up the solution with the heater. It is slow and very troublesome. The air pump has to be glue to the bottom as it will tends to float and is unable to keep still. Cleaning is very troublesome because a lot of equipment is required for the etching.

After trying for 2 times, a simpler idea pops out of my mind. Shortcuts are for lazy people like me.

New IDEA

A new and simple etching setup that pops up on my mind.

Hair Dryer will provide the heat and agitation to speed up the etching process.

The flat lying plastic tray will provide minimum amount of chemical to be mixed for etching the PCB board, through means less wastage.

In the end, I ended up using an even easier method by placing the container of etchant solution on a tray of boiling water.

It works and have less minimum setup. Etching quality is just as nice.

   
   

Other PCB making references:

This is a very interesting video that I have found, showing the detail process of making a professional PCB board using manual method.
A very primitive method of fabricating a PCB board.
http://www.youtube.com/watch?v=8-WGaAmpfOU&feature=related

 

www.pic-control.com, Singapore Research & Development R&D

Singapore Customized, custom made Electronics Circuits & Kits

 

 

  Home PCB Fabrication Cost

 

 

Bill Of Materials, estimate to be S$60.00

S/N Tools Cost
1 Container+cover take from home
2 Air pump S$4.00 (2nd hand)
3 Air tubing S$1.00
4 Stone rod S$2.00
5 Photo-resist PCB 15cm x 10cm S$3.00
6 Heater rod S$3.00 (2nd hand)
7 Ultra-violet lamp tube+ballast casing S$14.00
8 A plastic basin S$2.00
9 Etching Chemical S$10.00
10 Gloves S$1.00
11 Water or Distilled water S$1.00
12 Ferric Chloride FeCl3 S$9.00
13 Transparency S$0.50
14 Scotch tape S$0.50
15 Sodium Hydroxide or Developer solution S$9.00
16 Distill or plain water S1.00
17 Gloove S$1.00
18 Chopstick or rod S$0.50
19 Plastic/Nylon String S$0.10
20 Detergent S$2.00

 

 

 


 

 

Keyword: DIY Printed Circuit Board PCB fabrication home, printed wiring board, step by step instruction process PCB making, photos video illustration, Sodium Hydroxide, Ferric Chloride, chemical

 

Reverse Engineering of Electronics Circuit Board. Your Hacking Resources.

Resource to assist reverse engineering of circuit board and IC .


Edited by Lim Siong Boon, last dated 10-Aug-2014.

Topic Discussion Overview

  1. Introduction to reverse engineering of electronic circuit board
  2. Recognizing Components
  3. Mapping out the Traces
  4. Looking at IC chip marking


1. Introduction to Reverse Engineering of electronic circuit board



Reverse engineering circuit board is definitely not a simply one day training lesson. It is not as simple as knowing it all simply from a search engine on the internet. It is a process which harness the years of experience accumulated in electronic design and studying of how other engineers design their circuits. While as tough as I may have describe, it does not means that there is no way to learn this skill.

There are many reason why we need to reverse engineer a circuit board. One reason that I enjoy doing, is to learn something from the board. In the early days of my engineering career, as a fresh graduate who have background about electronics but practically don’t even dare to design a circuit for commercial use. There was just not enough confident in myself to design something for the industries to use. It was also a time when I started to become curious of how a circuit works. As a fresh new hardware engineer in a R&D department, basically I start create circuit solution by copying. Copying design that I find from books, from electronic kits purchase from stores, from internet where many people uploaded for their projects. I was also fortunate to have a colleague who had had retired and was working for this small company that I was working in, who makes me felt like he is nagging, trying his very best to share his knowledge about electronics with me. Standing there listening to him teaching from the very basic, starting from the name of a component. Topic like, how to classify the type of switch SPST DPST DPDT,can seems boring. It can be quite an annoying thing, when he speaks about simple things (which I thought they were). The truth is those simple thing that I thought they were, are actually fundamentally important, I had realized. Over time I started to earn some insight which I didn’t really catch then during my polytechnic and university school days. The topic “Switch” that I wrote in another webpage is one of the simplest and most important topic that I think all electronic hardware engineer needs to know by hard.

Reverse engineering can be like looking at a piece of blank at first. The more newbie you are, the more you do not know where to start understanding the circuit. In this section, I will briefly go through the process of how a circuit board can be reverse engineered in a sequential process.

Circuits can looks like an art where almost every circuit seems so different. The truth is that many circuits are very similar in nature. There is a pattern that you can find in every circuit. Recognizing these pattern is important. The more pattern you know, the faster you are about to decode the circuit. Electronic is physics and physic is the same across the world we are now living in. People use the same knowledge, copy the same knowledge, ends up with circuits that are quite standardize across the design that we can find. First important concept that we can start with, is to know that there is a standard circuits in many of the design. Just like a rubber stamp, people tends not to reinvent the wheel. We design a circuit that works, and keep on using that same circuit pattern. Whenever we trace out the component connection, we will try to match these patterns that we are able to recognizing. As you might have realized by now, the prerequisite to master the skill of reverse engineering, is the skill of designing electronic circuits. Like wise the opposite is also true. Both reverse engineering and circuit design are skills that need to progress hand in hand.

Why Reverse Engineering?
– to learn how things work.
– to do something new or unique.
– test hardware’s specification, security and weaknesses.
– better control of the system.
– identify design failure, weak components due to current, voltage or heat.
– identify how product can be improved.

Method of hacking and doing reverse engineering
– information gathering
– trace hardware components and connection
– firmware reverse engineering
– external interface analysis
– silicon die analysis (reverse engineering at microscopic level)
– communication monitoring, protocol decoding, Serial, USB, Ethernet, I2C, SPI, CAN using oscilloscope, logic analyzer, sniffers, software tools, etc.

reference:
https://media.blackhat.com/bh-dc-11/Grand/BlackHat_DC_2011_Grand-Workshop.pdf
or BlackHat_DC_2011_Grand-Workshop.pdf

Removing Epoxy Encapsulation.
– hot air soften epoxy
– Chemical, MG Chemicals’ 8310 Conformal Coating Stripper (www.mgchemicals.com)



2. Recognizing Components


Recognizing all the components on the circuit board.

The most basic thing you need to recognize is the electronic components that you see on the circuit board. As a new engineer, you may find yourself floated with odd components that you have not seen before. Many newbie may recognize those component symbol that we read from the schematic, but may not be able to recognize them in the actual physical form in a real physical circuit.
The resistor component alone can comes with many sizes, shapes, and color. It is important to recognize them, and understand their differences in characteristic. In school, we usually take resistor as only a ohm value, and don’t bother about the precision of the resistor,  tolerance, and even wattage is often ignored. In a practical circuit design, there are reason why some resistor are bigger or why some are more precision. First thing first, ensure you can recognize each and every component on the circuit. Knowing their names and how they are classified can helps you speed up the time needed to identify them. It is also a reason why through out my other webpages, I try to use photo, and put down the possible names that can be use to identify the components. Identify as much components as you can. Resistor, Capacitor, Inductor, IC chips, fuse, diode, transistors, connectors, PCB board, etc…

Nowadays, modern circuit board uses more IC chips than passive components. All IC chip looks the same black encapsulation with various shape and size. The important thing is to examine the number that is printed on the chip itself. Without it, you will need more brain power and experience to decode the board. It is also a main reason why some manufacturers will find ways to erase the lettering on the IC chips. It is a means to increase the barrier for reverse engineering, which can reduce the probability of their circuit design being copied.

With the lettering on the IC chip, you can search for their datasheet on the internet. If you cannot find them in the search engine, you may like to try again, leaving out some lettering in the front or back in order to increase the probability to get a search hit. The latter section “looking out for the IC chip marking” delicate a section to improve your chance to discover the IC marking and the search for its datasheet.

Most modern circuits are design using surface mount components. They can be small and traditional color band scheme for a component like resistor cannot be use. For these SMD resistors, they are number coded. For bigger SMD resistor, they are number coded, similar to the color band scheme where the first few digit represent the actual digit, while the last digit represent the number of zeros. Smaller SMD resistor which has a smaller printed area print their value using a standard coded system. This standard coding system is known as EIA marking code. There is no way to determine the resistor value easily from the code. Fortunately, we do not have to remember it by hard. With a search through the internet, we just need to extract its value base on the code. There is also this free android apps call “ElectroDroid” which can allow you to key in the EIA code, and return you with the resistance value. The apps also contains many other features which can assist you in your reverse engineering process. For more information about resistors and capacitors classification, click on the respective links.

Recognizing the components is only the first step. Identifying component itself already requires a lot of experience and effort. Even after nearly two decades of working with electronics, I still do find components which I find it difficult to identify. Inductor and transformer is a component which I am still not able to overcome easily. Newer modern components being used in circuits, often curious me. It is a never ending learning process.

STEP 1:

Take a photo of the circuit board (top and bottom), and start to assign a reference designator (label numbering) for each of the components.
pcb-front.jpg  pcb-back.jpg

Use OpenOffice Impress to help you do the component part labelling on the photo of the circuit board (PCB).
pcb-labelled.jpg

For example, all resistor can have prefix R1, R2, R3, R… R46, capacitors C1, C2, C3, C… C56.

Document these parts on a OpenOffice Calc spread sheet with the following columns,

(S/N or component prefix label, Component type, Package, Marking, Part no., Manufacturers)

Try to fill up the columns with information as much as you can.

You can download a template example here.
Component reference designator labelling (*.odp)
BOM list (*.ods)

Check out

STEP 3:

Copy another PCB bottom and extract only the trace or copper area.
pcb-back-trace.jpg
Flip the PCB bottom, and size it to be the same size as the top.
The PCB bottom trace adjust the Red & Blue by 50%, so that the trace color can be differentiated from the top pcb trace.
Overlay the PCB top over the PCB bottom. Adjust the transparency of the PCB top to 60%.
pcb-overlay.jpg
This overlay can help you trace the connection without flipping the circuit board physically.

STEP 3:

Build a schematic, laying out the component parts base on those on the BOM list.

STEP 4:

Trace out the connection on the circuit board onto the schematic that you are building.

STEP 5:

This step requires your experience from the circuits that you have seen. It is sort like a jigsaw puzzle, using your brain pattern recognition skills, matching component’s connection forming the typical circuits layout that was used.
Arrange the connected components in their typical function configuration layout.
For example the connection may represent a typical
– transistor switch configuration
– input switch and pull-up resistor
– voltage regulator
– amplifier
– output
– etc…






reverse engineering electronic circuit board solution




3. Mapping out the Traces


Mapping all the traces, the connection on the circuit board.

This is the most tedious part of the reverse engineer process. It is to map out how the components that you have identified earlier are connected. Component by component, we map out all the connection (known as traces).

Before starting the tracing process, it is important to recognize the PCB board type. I classify them as single layer, double layer and multilayer board.

The simplest board is the single sided PCB where one side of the board is consist of only the PCB trace routing, while the other side is the electronic components. Typically consist of mostly through holes components. Fairly simple to trace out the connection.

The second type is a double layered PCB board where traces can be found at both side of the board. Most of the time, through hole components are found on one side of the board while the surface mount component is found on the other side. Very often, traces are routed below through hole components and IC chip. This makes it impossible to trace out the connection using only our vision. Multi-meter’s function “continuity” is required to aid us to identify a connection (sometimes also known as the continuity tester). Basically is will buzz when the probes touch two points which is connected by a trace. You can also use a ohm meter function which reads a 0ohm when a connection is probed. I prefer the buzz, because while I focus my attention tracing the circuit, I do not have to look up in the multimeter screen to check for a connection. The buzz sound is much more convenient. Although it is a productive feature to use to trace connection, it is important to note how the “continuity” feature works. Depending on the multimeter, the buzz is set to sound at a certain ohm threshold. This means that a 10ohm resistor between two point, can cause a buzz from the multimeter, which may mislead you into thinking that the two point is shorted. Do keep this in mind during the probing process. Using visual and the continuity features together should help minimize mistake. Components that you typically need to take note is, sense resistor (usually bigger in size than the rest of the resistor), inductors, transformer, coil and any external connection or wiring to the board. Another common mistake is to probe the circuit without switching off the power supply. Ensure that all connection to the board are disconnected before tracing for connection.

The most difficult board to trace will be the multilayer boards. Typically for a 4 layer boards, most designer likes to allocate the middle layer for power traces like VCC and GND. It is not a definite, but just a high possibility base on the experience of looking at other circuit boards and also some common circuit theory. Doing reverse engineering requires you to think a lot as if you are the designer designing the board that you are hacking. For a multilayer board, it is normally near to impossible to trace the board using visual. Matching of component pins connection is normally done for the whole of the circuit board. Matching one pin to the rest of the pin, one at a time. Sometimes with the understanding of the component, and some experience as a designer, you might be able to shorten the process. There will be zones that you will instinctively that there is no need to try.

Draw out the components position, and how they are connected. Taking a picture of the circuit helps you to trace easier. Sometimes I will superimpose the routed trace with the components in order to see the connection better. Label all the components, and name the trace once you are able to identify its function.

Power supply traces are the simplest to start with. This is because we usually knows where the power line is connected to the circuit. From there we can trace out where the power line goes to. From the power line, we will be able to trace out the next stage which is typically the voltage regulators. For a AC power line, usually a rectifier can be located a before it reaches the voltage regulator. These suggestion assumes typical design, it will be up to you to recognize it yourself because there are just too many variation of circuits designed.

Studying the datasheet of the IC chip on board can also help you to recognize connection. Arrange the component symbol into the standard stamp circuit configuration that you can recognize. Common standard circuit like input circuit, pull up, driver circuit using transistor, relay circuits, voltage regulator, etc… can easily be recognize. Draw them out in a format that helps you to recognize the circuit module functionality.

The process is complex, and it is a never ending topics on reverse engineering. The more you reverse engineer the more you will learn and improve your techniques, finding new ways to decode and learn how other circuits are designed.




www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller




Looking at IC chip marking

Looking out for the IC chip marking

IC chip is getting smaller and smaller. Many small chip can only be coded with only 3-4 letterings only. This is the IC marking which represent a part number from the manufacturer.


References for searching base on the letter/number marking on the IC,
– Database search, http://www.ecadata.de/searchnew/
– smd codes catalog 2012, SMD-codes Active SMD semiconductor components marking codes
– smd marking, http://www.satcure-focus.com/design/page2.htm
http://www.dl7avf.info/charts/smdcode/c3.html
http://www.sos.sk/pdf/SMD_Catalog.pdf

Marking code search from manufacturer’s website
Texas Instruments, http://www.ti.com/general/docs/partmarking/partmarkinghome.jsp
Cross competitor search: http://focus.ti.com/general/docs/searchhome.tsp

Fairchild, http://www.fairchildsemi.com/topmark/

Analog Device, http://search.analog.com/search/default.aspx

NXP, http://www.nxp.com/packages/

Cross Reference next to the search box, type the part number and search: http://www.st.com/web/en/ordering/buy_from_distributors.html?s_searchtype=keyword
Product selector: http://www.st.com/stonline/stappl/productcatalog/app?page=productSelector

Microchip, http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1924&dDocName=en544123
Product selector or Cross competitor search: http://www.microchip.com/maps/search2.aspx

Looking out for the logo on the IC chip.

Analog Devices
Atmel
BI Technologies
Burr Brown
Cirrus Logic
Cypress Semiconductors
Dallas Semiconductor
Diotec
Fairchild Semiconductor
Holtek Microelectronics
Intersil
International Rectifier
Maxim
Microchip
Motorola
NEC
National Semiconductor
NXP
Semtech
STMicroelectronics
Texas Instruments

References for IC manufacturer logos,
http://www.elnec.com/support/ic-logos/
http://www.classiccmp.org/rtellason/logos/semiconductorlogos.html
http://www.advanced-tech.com/ic_logos/ic_logos.htm or pdf
http://web.archive.org/web/20040401171928/http://www.elektronikforum.de/ic-id/

 

 

 

















www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller

 

 

   

 

 

 

 

reverse engineering electronic circuit board solution

 





Keyword: reverse engineering, IC marking code, marking database lookup, footprint, datasheet, Singapore

Energy Audit with a portable power meter

How to save energy at home? Check out this page for my home appliance’s electricity consumption.

Let us begin energy/environment conservation for our planet by first understanding how and where we have wasted our energy.

Edited by Lim Siong Boon, last dated 12-Dec-2011.

Topic Discussion Overview

  1. How much is the electricity tariff rate costing us?
  2. Power Meter
  3. Home Appliances Power Consumption
  4. Lightings

 


   

1. How much is the electricity tariff rate costing us?

The Singapore electricity tariff rate has been rising steadily 18.03¢ (as of Apr 2009) to 27.28¢ (as of Jul 2011) ; A wopping 151% increase in tariff rate. How does this tariff rate relates to the electrical appliances that we are using at home?

The following example show you how to compute the cost of our electricity cost.

 

Assuming a device consuming 10W 24hr per day for one whole month.

Total energy consumption in a single day = 10W x 24hr = 240 Whr

Total energy consumption in a month = 240Whr x 31days = 7440 Whr = 7.44kWh

The bill for 7.44kWh of electricity consumption will be = 7.44kWh x $0.2728/kWh = $2.029632

 

This means that the appliance consuming 10W will cost me $2/mth.

Appliance consuming 20W will cost me $4/mth.

Appliance consuming 100W will cost me $20/mth.

If the tariff rate go up, the cost of electricity per watt will relatively increase as well.

 

What can I do to reduce my electricity bills, at the same time conserve our global energy resource?

First I have to understand my energy consumption in my own house, by doing a simple energy audit.

Being energy conscious will be the very first step to start save energy.

The energy audit of my home shown on this page will be based on the latest tariff rate of 27.28¢ (as of Jul 2011).

 

 

 

Our electricity tariff in Singapore since 2009.

Energy cost: S$0.1803/kWh as on 1st Apr 2009

Energy cost: S$0.1928/kWh as on 1st Oct 2009

Energy cost: S$0.2169/kWh as on 1st Oct 2009

Energy cost: S$0.2287/kWh as on 1st Jan 2010

Energy cost: S$0.2356/kWh as on 1st Apr 2010

Energy cost: S$0.2413/kWh as on 1st Jul 2010

Energy cost: S$0.2334/kWh as on 1st Oct 2010

Energy cost: S$0.2410/kWh as on 1st Jan 2011

Energy cost: S$0.2558/kWh as on 1st Apr 2011

Energy cost: S$0.2728/kWh as on 1st July 2011

Energy cost: S$0.2698/kWh as on 1st Oct 2011

Energy cost: S$0.2759/kWh as on 1st Jan 2012

 

 

References:

http://www.energysave.sg/

http://www.spservices.com.sg/

http://www.ema.gov.sg/Electricity/new/ (more tips to save energy)

Singapore electricity tariff rate Jun 2011

Singapore electricity tariff rate Jan 2012

 

   

Calculator for computing Appliance’s Electricity Cost

 

 

 

www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller

 


2. Power Meter

The beginning of this page starts with my handy portable power meter. It will be the most important instrument to help me measure the power consumption of the everyday appliances in my house. It was a coincidence that I brought my power meter. I had always like to have such a power meter to measure power consumption for fun and knowledge; the cost of such a gadget was rather expensive to be purchase just for fun. I got myself this power meter which is inexpensive. I like the huge display; the numbers are easy to read. It is very simple to use; just plug in the appliances that you want to measure and switched on the power. The function button can be pressed to cycle through the list of measurement parameters as follows.

1) Wattage, display the power consumption of the appliance

2) Display the energy consumption in terms of dollar cost

3) kWh (kilo Watt Hour), accumulated energy since operation.

4) Number of days, hours since measurement begins. (This helps to check against the kWh energy consumed and the accumulated cost run since measurement starts)

5) Voltage (Vrms measurement usually range from 220 – 240Vac)

6) Frequency (always 50Hz for measurement in Singapore)

7) Current (High current device usually requires thicker cable guage. High current flowing through thin cables can generate heat which leads to energy loss, and may result in fire.)

8) Power factor (PF range from 0.0 – 1.0. PF near to 1.0 indicates that the appliance has a better current to power efficiency, consuming all the power that was drawn) http://en.wikipedia.org/wiki/Power_factor

9) Highest/lowest wattage detected. (The meter when monitoring the appliance over a long period of duration, is able to show the highest/lowest wattage detected)

10) Key in the latest electricity tariff rate..

11) Reset button to reset the measurements.

The features on the power meter are more than enough to measure household appliances. There is a current limit of about 13A which the meter can handle; the meter will give off a warning beep sound and cut of the power if it is overloaded. I just love this power meter, cheap and good enough for my energy audit.

It was when I started measuring my household appliance, that I started to learn the appliances that are energy consuming. It is difficult to judge base on the device, even though I am a trained engineer in electronics circuit design. I was shocked to find that many appliances are poorly design in terms of energy conservation. This is also the reason why I started this page. I would like to find out the power consumption of the appliance in a typical home. The step to start saving our earth starts by being aware of our energy consumption; this is also known as our carbon footprint.

Besides measuring power consumption, this power meter is also very useful in my area of engineering works.

This portable power meter helps to verify my electrical installation works. There are also times where 110Vac is used in our 230Vac electrical system in Singapore. This meter helps to check if the voltage step-down transformer installation is correct, before we plug in any expensive 110Vac equipment from oiverseas. It can also be used to check the wattage of your equipment so that the accessories with the correct wattage can be purchased and installed.

Power factor (range 0.0 to 1.0) indicates the efficiency of the current drawn from the power station. Poor power factor is cause by your inductive equipment (eg. Fridge, Fan, Motor etc..) at home or factory. A power factor of 1.0 is the best, indicating the lowest possible current drawn. A reading of 0.6PF or below indicates a poor power factor, and you will expect the current drawn to be higher. The good news is, it can be improve by installing a capacitor across the power line.

This meter measures the power factor which allows me to add in the correct amount of capacitance to correct the power factor close to 1.0. Power factor of 1.0 means that the current drawn by my equipment will be minimum. The meter will also show the drop in the current drawn, before and after the capacitance installation. For more technical information on correcting power factor, I have another delicated page explaining all the details.

http://www.siongboon.com/projects/2012-01-24_power_saver/index.html

In the course of designing products for the industries, this meter also helps me to verify my design in terms of the energy consumption. It helps me to improve the design, allowing the product to consume less energy.

With this measuring instrument, we will have a better idea of how we can improve our energy consumption.

 

   “If you can not measure it, you can not improve it.”
                                                                     Lord Kelvin (1824-1907)

 

I hope this page can provide the awareness to get you conscious about your carbon footprint. It will also serve as a platform to compare the consumption with the available energy saving products. The journey shall starts with my power meter. Let’s get started.

References:

www.saveone.com.sg

 

 


 

 

My portable power meter packed with many features (description details on the left). Measure power from the plug.

1) Wattage

2) Accumulated electricity expense

 

saveOne power meter

3) kWh

4) Records of the number of Days & Hours since measurement starts

5) Voltage

6) Frequency

7) Current

8) Power factor

9) Highest/Lowest wattage detected
10) Entering the electricity tariff rate costing.

 

This power meter is purchased from saveOne logo.

Acknowledgement: some of the pictures on this page were taken from saveOne website. saveOne is a local company in Singapore, specialising in energy saving products and consultation services. They are also selling their various patented energy saving lightings products to promote green building to the industrial, hence reducing our carbon footprint in Singapore.

Website: www.saveone.com.sg , Email: sales@saveone.com.sg

Address: 63 Hillview Avenue, #08-01, Lam Soon Industrial Building, Singapore 669569.
Tel: +65 6764 3333, Fax: +65 6862 6277

 

 

Other brand of power meter available in Sim Lim Tower (Sim Lim Tower, 10 Jalan Besar 208787)

 

 

 

 

 

 

 

www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller



3. Home Appliances

Power Consumption

 

 

Note: the indicated elecrical costing is using the triff rate of $0.30/kWh

 

This is my electrical bill for my HDB house for the month of March 2012 from SP Services. The power consumption is estimated to be 363kWh which accounts to a bill of S$100.15. This is an estimation base on our electricity consumption for the pass few months. The tariff rate is 0.2759 for this quarter Jan-Mar 2012.

I am trying to measure all my appliances to see if I can estimate near to the indicated consumption of 363kWh per month. The list of contribution would propably comes from the following devices.

– Fridge
– Aircon
– Fan
– Computer
– TV and entertainment system
– Washing machine
– Lights
– Radio

It is time to find out the main culprit.

   

 

 

 

 

Home Lightings

Energy saving LED and Fluorescent lamp

 

 

Check out the various energy saving lamps here.

http://www.siongboon.com/projects/2011-04-17%20lamp%20bulb/index.html

 

 

Hot/Warm Water Dispenser

Model: Bio Pure (KEN2)

 

water dispenserwater dispenser

reading reading measurement
Typical standby power consumption is 6.8W When dispensing water, the wattage shoot up to 21W Total energy consumption for 63 days + 1 hour operation totals up to about 60.91kwh costing S$17.15

Standby power: 3.5W

Typical: 6.9W (wattage), 0.077A (current), 0.36PF (power factor)

Highest Wattage detected: 2256W

Low Wattage detected: 3.5W

 

AC indicator lamp

 

 

AC lamps

Hardly any wattage and current detected from the AC indicator lamp found on the multi socket adaptor..

 

Wireless Door Bell

Model: Sonik

 

wireless door bell Standby power is 1.2W

Even if the loud door bell ring is activated, the consumption still remains at 1.2W.

The door bell transmitter outside the door is using a battery.

 

Electric Fan

Model: Aerogaz 16″ stand fan AZ-163SF (60W)

 

Standby power: 0W

Speed 1 energy consumption: 34.2W, 0.159A, 0.95PF

Speed 2 energy consumption: 40.6W, 0.177A, 1.00PF

Speed 3 energy consumption: 45.3W, 0.190A, 1.00PF

Lab Bench Power Supply

Model: Kikusui variable DC power supply PAD 35-10L 0~35V 10A

 

14.3W consumption with no load to the lab bench power supply. Open DC voltage of about 0Vdc.

 

15.1W consumption with no load to the lab bench power supply. Open DC voltage of about 3Vdc.

 

Open DC voltage was tuned up to about 30Vdc. AC power consumption increases to 20.3W.

 

The current limits is purposely set very low to 0A. Consumption is now at 14.5W.

 

5Vdc open load. Wattage consumption is 15.2W.

 

5Vdc shorted load of 1A. This would have been a 5W load. Consumption is 27.9W. A 12.7W increased from the open load consumption.

 

Din rail MCB (Miniature circuit breaker), ELCB/RCD (Earth leakage circuit breaker)

Model: MOELLER PLS6-B6/2-AS (MCB ‘B’ 2Pole 6A 6kA), MOELLER PFIM-40/2/003-A (ELCB 40A 2Pole 30mA)

 

The circuit breaker and ELCB or RCD device uses very little energy. No power consumption was detected.

 

Charger for mobile phone (5V, 0.89A)

Model: Nokia C3

 

Not much power consumption when the charger is not plugged onto the mobile phone. Measured consumption is 0W. When the charger is plugged in, the consumption is about 1.3W.

Charger for bluetooth earpiece (5V , 0.55A)

Model: Sony Ericsson MW600

 

The bluetooth charger is similar to the mobile phone charger experiment. When the charger is plugged in, the consumption is about 0.7W.

Power Adaptor for laptop (19Vdc, 3.42A)

Model: Asus X23F 10″ laptop

 

For this Asus laptop’s adaptor, the consumption is more. When the adaptor is not plugged onto the laptop, the consumptionm measured is 0.3W, 0.014A.

When the adaptor is plugged onto the laptop, the consumption increases to 45.2W, 0.314A, 0.59PF

Then the laptop was switched on, the power consumption increases to 72.1W, 0.519A, 0.57PF.

The laptop was shutdown, and the power consumption drop back to 0.328A, 0.69PF. Should be about 45W.

 

Hair Dryer

Model: Rowenta (1500W)

 

This hair consumes a standby power of about 0.1W, 0.015A.

 

The hair dryer was switched to no.1, and the consumption is measured to be 755W, 3.26A, 0.98PF

 

Switching to no.2, the consumption now is measured to be 1460W, 6.3A, 1.00PF

 

Power Adaptor for Mini PC

Model: Giada Slim-N10 Intel dual-core Atom N330 1.6GHz, NVIDIA 9400M Graphics processor, 5x USB, 250Gb HDD, 2Gb DDR2 RAM, 802.11b/g WiFi, HDMI, Card reader

 

This Mini PC with power adaptor unplugged consumes about 0.5W. When it is plugged to the mini PC, the wattage increases to 3.6W, 0.053A, 0.25PF..

 

When the mini PC is switched on, the power consumption is about 28-30W, 0.21A, 0.55PF

 

Power consumption during standby with mini PC switched off.

 

Food Streamer

Model: Tefal, serie S07 (760W-900W)

 

When the streamer is off, power consumption is measured to be 0W. Turning on the “Keep Warm” features consumes about 835W, 3.55A, 0.98PF. The streamer will switch the streamer off when it reaches certain temperature threshold. This will keep the food warm while trying to keep the power coonsumption low.

With the streamer fully switched on, the reading is similar rto the power consumption of the “Keep Warm” feature.

 

LCD monitor

Model: 24″ Philips 240B MWB1240I (230Vac 1.2A)

 

This monitor has a standby power of 0.6W.

When it is switched on, it consumed about 27W and can reach as high as 43W.

 

Measurement taken 26.7W, 0.19A, 0.56PF.

 

Personnal Desktop Computer

Model: Shutter PC, Intel Core 2 Duo CPU E7500 2.93GHz, 4Gb RAM, 250Gb HDD, DVD drive

 

The computer CPU system has a standby of 0.7W when it is plugged onto a socket but not switched on. Typical about 60W, and the highest reading meansured is >70W. Current is 0.361A, Power Factor of 0.82PF. When the computer is put into sleep mode, the power consumption drop down to 3.6W 0.067A 0.21PF..

 

 

Color Laser Printer

Model: Fuji Xerox CP205W

 

Printer on standby 11.5W to 750W

Printer reaching its peak 776.1W.

The laser printer standby power is about 11.4W and reaches to 750W every 10 to 20sec in a pulsing manner (0.139A, 0.33PF). Perhaps it is using the energy to warm itself every now and then. Current 0.139A, Power Factor 0.33PF. Measurement taken during the printing process is about 50W to 750W.

 

A4 paper scanner

Model: Fujitsu Scansnap S510 (16V 1.5A), Power adaptor (230Vac to 16Vdc 2.5A)

 

Scanner power adaptor consume 0.5W when it is not plugged onto the scanner. When it is plugged to the scanner, the standby power is about 0.8W.

 

The scanner reaches to about 17.7W (0.131A, 0.54PF) when it is turned on. During the scanning process, the consumption is about 26.4W.

 

TV tuner box

Model: MyGica (5Vdc 0.6A), Power adaptor (230Vac to 5Vdc 1A)

 

This TV tuner box is surprisingly using not much energy. The consumption is measured at 0W when the adaptor is not plugged onto the device, and reads 1.5W when it is plugged in. Turning on the TV tuner consume only 3.3W.

Water Kettle

Model: Tefal VITESSE BF21 (2000-2400W)

 

The water is a simple heating element device. The load is resistive in nature. When not activated, the kettle consume 0W.

During the water heating process, the power consumption measured was 2140W (9.28A,0.98PF)

 

Battery Charger AA/AAA

Model: GP Power Bank GPPB50GS (230Vac 0.175mA, or 12Vdc 0.75A)

 

The battery charges has a standby power of 0.7W (0.008A) when no battery is under charging. The charging is a pulsing process. The wattage taken pulse between 3.1W & 0.7W when one AAA size battery was inserted for charging. The wattage goes up as more batteries (1x AAA and 2x AA) were inserted. The pulse is between 6.9W & 0.7W (0.055A, 0.5PF)

 

40″ LCD TV

Model: Sony KDL-40EX400 (155W)

 

 

See in this short video clip how the wattage increase as the TV starts to turn on. MVI_8968, sony lcd tv power consumption.AVI

 

 

The standby power for this Sony TV is quite high. 10.1W (0.095A, 0.42PF) was measured. It is equivalent to a lamp turning on.

The TV was switched on with the TV show running. The power consumption at this point in time was about 114W (0.546A, 0.89PF) .

There is this video footage capture for your reference. In the video, you can see on the power consumption rises as the TV was switched on.

MVI_8968, sony lcd tv power consumption.AVI

 

DVD player

Model: Pioneer DV-595K (7W)

 

Standby power 0.7W measured is the same as specified in the user manual. Thie meter seems quite accurate for our energy audit.

 

The standby power for this DVD player is 0.7W (0.008A).

When the player starts to playback video on the CD, the measurement taken was 6.5W (0.057A, 0.51PF). Energy consumption is quite reasonable for a player.

It increases slightly at time to 7.2W (0.6A, 0.49PF)

 

Induction cooker

Model: TAIYO TH-ID19 (1900W)

 

 

 

 

See in this video clip how a induction cooker consume the energy. MVI_8983, induction cooker.AVI

 

The standby power is about 4W (0.25A, 0.1PF) . When it is switched on without any pot, the reading was 10.8W (0.141A, 0.29PF). The induction cokker is quite intelligence. No power will be activated when the cooking pot is not on the stove.

A stainless steel pot fillled with water was placed on the cooker stove. The induction cooker detects the load and starts to consume a lot of nergy to boil the water. The power consumption was 1974W (8.691A, 0.99PF). The induction cooker power factor is surprising good. The load may not be inductive in nature, or perhaps capacitors are added to the cooker to correct the power factor. By correcting the power factor of your appliances to a value close to 1.00, the current it draws will be at its minimum. This helps to reduce losses, reduce of cable size, prolong lifespan of your cable, generate less heat, etc…. many benefits. The benefits will not be significant but it is better to have it optimised than a design that isn’t.

The following footage shows how the power consumption changes on this induction cooker.

MVI_8983, induction cooker.AVI

 

NAS Network Attached Storage

Model: Netgear ReadyNAS Duo, Power adaptor (230Vac to 12Vdc 5A)

 

The power adaptor was not plugged onto the NAS, gives a reading of 0.4W. This means that the power adaptor doing nothing is actually wasting the electricity when connected with the mains socket switched on. When plugged onto the NAS device, the standby power is 0.8W.

When the NAS was switched on, the power reading was 23W (0.17A, 0.53PF).

 

Home Wireless Router

Model: Dlink DIR-655 (12Vdc, 2A)

 

Wireless router’s power consumption seems ok. Measured power during operation was 6.1W (0.051A, 0.51PF).

 

AV Wireless Transceiver

Model: AV@AirPro

 

This wireless AV transceiver consume about 2W. Quite little energy.

 

Cable TV setup box

Model: STARhub Hubstatio DC162SHB

 

The STARhub setup box has a significantly high standby power required. The measured power during standby was 20-25.6W (0.184A, 0.59PF).

The setup box reaches 27W (0.187A, 0.6PF) during start up, and consume 26.5W (0.19A, 0.59PF) during the cable TV show. The increase in power from standby is relatively low. This device has the most energy wasted during standby. Turning the machine off to a standby mode will only save you 1 to 2W, but actually wasting about 25W.

 

The little multimedia Zen10 box consume much less energy compared to the STARhub setup box. Zen10 consume only about 0.4W during standby, and 6.2W (0.052A, 0.42PF). If the power adaptor is not plugged onto Zen10, the wasted power on the adaptor is measured at 0.2W.

Fridge

Model: MITSUBISHI

 

The fridge consumption seems rather stable. Different from what I have expected. I thought it should be like a pulsing type of power consumption pattern. Switching on and off the compressor when neccesary to cool the fridge. Typical wattage consumption was about 209.1W and can reach as high as 388.7W.

The meter was put on the fridge for another period of 32 days. The following reading was taken which was more accurate.

Wattage at the point in time: 204W

Current at the point in time: 1.126A

Power factor at the point in time: 0.78

Lowest wattage detected: 17.3W

Highest wattage detected: 440.5W

Voltage range: 228.9 to 230Vac (50Hz)

Total measurement period: 31days and 23 hours

Total energy consumed: 149.1kWh

Total electrical bill amount: $44.73 (base on electricity tariff rate $0.30/kWh)

 

I was shopping around to take a look at the latest energy efficient fridge. The consumption for these fridge as displayed was about 500-700kWh per annual. The efficient is much better. I am assuming the measurement was took without considering the typical scenario of opening of the fridge door. Opening the door increases the temperature inside, which means that more energy is required to cool it down.

 

Washing Machine

Model: National NA-FSSY6T

 

Washing machine standby power is 1.3W – 1.8W (0.006A, 0.42PF)

Filling up the washer with water consume 8W (0.038A, 1.00PF)

Washing process rotate the motor clockwise and anti-clockwise. The consumption is pulsing between 100W and 340W (0.7A and 1.4A 0.19PF). The power factor becomes lower when the motor starts to be activate. Motor is an inductive load causing the power factor to becomes lower.

After the washing process, the washing machine drained the water. This activity consume only 4.8W (0.021A 0.85PF).

The washing machine starts to spin to squeeze out the water. The machine controls the spin. I can see the wattage moving slowing from about 230W to 260W as the spin starts to pick up. When the spin reaches its momentum, the wattage starts to drop gradually to 200W. At top spin the wattage is about 200W. The initial start up requires more torque to spin the load, therefore more power was required. When the spin reaches it top speed, the torque required was less, therefore less power was required. This activity consume an average of about 230W for 2 min.

 

The whole washing process takes about 45min to 60min. Total wattage consume is about 0.352kWh for two wash (medium load). This comes up to about 0.176kWh of energy consume for each washing.

Oven

Model: TEFAL Turbo Delice 26L

 

oven baking tart oven baking tart

My mother was baking the pineapple tarts for Chinese New Year, when I took this measurement. I wanted to find out how much electricity is used to bake the tarts.

The tarts were baked at about 180°C for about 20 minutes. A total of 7 trays (36 pineapple tarts per tray) were baked in 4 batch. The cost of electricity is $0.42. This means that the electricity cost for each batch of baking cost about $0.105, each tray cost $0.0525, or each pineapple tart cost about $0.0015. The bill seems quite affordable.

Wattage at the point in time: 2900W

Current at the point in time: 12A

Power factor at the point in time: —

Lowest wattage detected: —

Highest wattage detected: —

Total measurement period: 1 hour 20 minutes

Total energy consumed: 1.431kWh

Total electrical bill amount: $0.42 (base on electricity tariff rate $0.30/kWh)

 

Soldering Iron

Model: GOOT TQ-95 Quick Heat Soldering Iron 200W/20W

 

 

When the soldering iron is first switched on, the wattage measured is 60W.

As the iron gets heated up, the temperature starts to drop to a constant wattage of 25W (0.1A, 1.0PF)

There is this quick heat button to heat up the iron faster (can only press for no longer than 10sec).

When this button is pressed, the wattage shoot up to about 128W (0.523A, 0.98PF).

The soldering iron is a resistive load, which is why the power factor is always quite close to 1.0PF.

 

Cost of running the soldering iron for 1 hour = 25W/1000 x 1hour x 0.30kWhr = $0.0075 (about 1 cent every hour)

 

   

Conclussion:

– Top energy consuming devices

– Many switching AC-DC power adaptor do consume energy when it is left switched on. The power factor from all these advance switching adaptor seems quite poor.

 

 

 

www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller

 

 




Keyword:
Power meter, energy consumption measurement, energy audit, energy saving, save energy, ECO friendly


Cable, Wiring and Connector Guide

Your reference guide for PCB (trace resistivity, footprint) wire (gaage chart), mil/ inch/mm, hole (drill, tap chart), fastener

Edited by Lim Siong Boon, last dated 02-Oct-09.


 

Shortcut to your reference guides and charts

  1. PCB Trace reference
  2. Wire and Cable gauge
  3. Advance conductor
  4. PCB Footprint reference
  5. Tap drilling guide (mm chart)
  6. Common Connector Pin Out
  7. Name of Connectors/Plugs
  8. Name of Cable/Wire

 

I always have to refer to these dimension references frequently,

and decide to put them up once and for all on this website.

Hope they are useful to you too.

 

 

 

1. PCB Trace reference

 

 

 

 

Trace resistance guide based on

PCB board 1oz copper at temperature 100˚C. (worst case)

 

Name Trace width Trace Length ResistanceCurrent
Power Normal 1.27mm 1000mm 0.49Ω1.75A
Power Min 0.64mm 1000mm 0.98Ω1.20A
Signal Normal 0.38mm 1000mm 1.65Ω0.80A
Signal Min 0.25mm 1000mm 2.51Ω0.50A

Conversion calculator might not work on some web browser.

 

Unit conversion table & calculator between inch, mil, mm, oz.

inch mil mm oz
1 1000 25.4  
0.1 100 2.54  
0.001 1 0.0254  
0.03937 39.37 1  
  1.38 0.035 1oz

Conversion calculator might not work on some web browser.

 

 

also Download the wire gauge calculator from UltraCAD Design, Inc

 

 

The IC chips, active and passive components are all connected by traces or wire. The traces on the PCB are assume to be of short circuit, which is 0Ω. This assumption is reasonable if it conduct a very small amount of current. When the conductor starts to carry larger amount of current, the voltage drop across the trace could be significant, causing intermediate hardware problem.

If you are expecting a large current flowing through the traces, you have to keep in mind to provide a wider trace to increase the conductivity of the cable. Larger trace width means lower resistance.

For my PCB route software, the defined trace width for power is 1.27mm and signal is 0.38mm. Sometimes there is a need to route the trace through narrow space. In this situation, I would have to use the recommended trace width for power min, and signal min. Usually I will keep this narrow trace as short as possible to avoid higher resistance.

Seldom do I need to worry about traces carrying signal information. I am more worried about the conductor distributing the dc supply to individual circuit zone. Whenever possible, I would provide a wider traces for my 5V and ground supply.

When designing the PCB routing for my power supply, I would use the star topologies. This will ensure a evenly spread for the current distribution, hence lowering the burden of individual traces. I have actually experience such technical issue during my final year school project. The noise problem is somehow reduce after the attempt to improve on the trace routing. Another experience involve power up a remote system about 10m away. The distance is quite near and the power cable is rather thick to me. The voltage at the remote end is found to be too low to power the remote system. We have to double the cable conductor in order to resolved the problem. Our equipment conduct high current of about 20A if I remember correctly. The problem might not be obvious because the high current being drawn might happen during certain hard to determine event. For example, when your system trigger the lightings or motor which draws very high current for a short period of time. The voltage drop cause by the sudden high current draw might cause your system to fail. Therefore the design should always cater for the worst case. Always find out the maximum possible current drawn. Over design the system to ensure that the system will not fail in the worst case scenario. Just to make a note, that I have been referring to dc voltage supply.

For high voltage AC supply, I guess it is a different way of looking at it. My understanding in high voltage system is quite weak.

On the left is the reference table to estimate the resistance of the trace for my PCB routing. I have assume the worst case at temperature 100˚C with the copper layer of 1oz thick. Seldom do you need to refer to this table, unless you have encounter space restriction for your high current carrying traces. It is my usual practise to double the current carrying capacity. 2 times the maximum current I will be expecting. If you have the space, make it wider.

Electrical Resistance Equations:

Resistance = Resistivity x Length/Area

 

 

Question 1:

1oz copper PCB, Trace width 0.25mm, Trace length 0.1m, Operating temperature 25˚C

 

Solution 1:

Copper resistivity at  25˚C is 1.68×10-8Ω.m

Resistance = 1.7×10-8Ω.m  x  0.1m  /  (1oz x 0.25mm)

                 = 1.7×10-8Ω.m  x  0.1m  /  (35um x 0.25mm)

                 = 1.7×10-8Ω.m  x  0.1m  /  (8.75nm2)

                 = 1.7×10-8Ω.m  x  0.0114×109m-1

                 = 0.19Ω

 

Question 2:

1oz copper PCB, Trace width 0.25mm, Trace length 0.1m, Operating temperature 100˚C

 

Solution 2:

Copper resistivity at  100˚C is 2.17×10-8Ω.m,

Resistance = 2.2×10-8Ω.m  x  0.1m  /  (1oz x 0.25mm)

                 = 2.2×10-8Ω.m  x  0.0114×109m-1

                 = 0.25Ω

 

I have also provide the computation for copper resistance for your reference. Taking this opportunity to do further read up in order to explain in a simplified form.

Area is the cross sectional area of the conductor. Just like a water pipe, the larger the cross sectional area, the easier the current is able to flow through.

Resistivity defines the resistance of the material for a unit of length at a certain temperature. The resistivity for the material copper at 25˚C is found to be 1.7×10-8Ω.m

The resistivity changes with temperature. The resistance will increase as the temperature increase. The term for this changing resistivity with temperature is known as the thermal resistivity of that particular material.

The material resistivity would therefore look like a graph curve. They are obtained through test and experiment. For some material, the graph curve could be approximated in the form of equation. This complicated formula describe the resistance behavior of the material under different temperature condition. For copper material, it can be represented from the following equation,

Copper resistivity = ρ0(1+α(Temperature-T0))

= 1.7×10-8Ω.m  x  (1 + 3.9×10-3Ω/˚C  x  (100˚C-25˚C))

= 2.2×10-8Ω.m at a temperature of 100˚C

0 is the material resistivity at T0 temperature>

As you can see from the calculation on the left, the increase in temperature from 25˚C to 100˚C has increase the 0.1m copper trace by 0.06Ω. This is about 30% increase in the resistance.

To keep the topic simple, we will not go into the details of varying temperature. There can be other factor that can affect the resistance of the material.

Here is a quick and simple graph showing the change in temperature in relation with the trace width and the current flowing through it. (taken from the magazine elektor 2010-02). The graph assume the pcb copper trace thickness to be 35um (1oz) & that it is place in a open air environment (not enclosed inside a box/casing). For example, given the trace width of 0.6mm, and a 1.5A current flowing through it, we can expect the copper area to rise by another 10°C.

pcb trace width, current, temperature

 

 

Some article reference:

PCB trace – HwB, trace vs current graph.pdf

 

Recommended digital and analog circuit layout on a PCB board.

recommended circuit layout

 

Recommended trace corner layout.

trace corners

 

Recommended plane placement.

plane placement

Reference taken from “Op Amps for Everyone“.

More PCB layout recommendation can be found in the book “Op Amps for Everyone” from Texas Instruments.

 

 

www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller

 

 

2. Wire and Cable gauge

I have put up this wire gauge guide for my own reference. Very often there is a need to return to this reference to choose an appropriate cable for use. I have also written an article some time back. Myth about how the cable relate to their resistance. It is taken out from the main webpage but I have place a link here, for anyone who are interested to understand more.

NOTE: The following guideline is a brief guideline for copper ampacity (current rating or current-carrying capacity) of the cable used for power supplying purpose. The ampacity is defined as the maximum current the cable can withstand. Any current higher than that will generate enough heat to burn away  the cable. There are many factor affecting the current capacity of the cable, and it should be compensated accordingly. I would advise to select the cable, with at least double the current-carrying capacity for the intended equipment. Never operate near the cable current-capacity limits. You will never know when, the current overruns. Some of the factors that will affect the current-carrying capacity of a cable are:

– Conductive wire cross section area.

– Wire material. The temperature the material can withstand without melting out.

– Temperature. If the wire/insulator jacket can withstand higher temperature, the cable is able to carry more current.

     – place of installation or the surrounding temperature.

     – material of insulation jacket/skin/cover.

     – how much the cable can dissipate heat

– Stranded or solid wire type. Stranded wire can carry more current than a solid wire for AC type of signal/power. This is due to a phenomenon known as skin effect.

 

Reference:

ayenbee AWG Wire Current Rating guide.pdf

Wire Chart for 12Volt 24Volt.pdf

A Guide to Wire and Cable Construction.pdf

230v Cable Size Selector- http://www.electacourse.com/cableselector.html

 

The factors involve are quite complex. The table is a simplified reference for myself to select the cables. Always allow a larger safety margin of minimum x2 when you chose your cable. Do take careful note of what you deploy.? There are many other factor, eg screw connections, plug contact which will affects the results. If the cable has the slightest warm, it is quite clear that the cable will be hitting it’s limit any time soon.

 

Wire Cable Description Diameter (mm) Area (mm2) Copper Resistance 20˚C.Ω/km Nearest SWG gauge (mm) Nearest AWG gauge (mm)
  11.68 107.2 0000
  10.4 85.03 000
  9.266 67.43 00
  8.252 53.48 0
  7.348 42.41 1
  6.543 33.63 2
  5.827 26.27 3
  5.189 21.15 4

230Vac power cable 16mm2 (absolute maximum 69A)

eg. Sub Mains

4.620 16.77 5
  4.115 13.30 6

230Vac power cable 10mm2 (absolute maximum 52A)

eg. high power showers, cookers & other very high power devices

3.665 10.55 7
  3.264 8.366 8

230Vac power cable 6mm2 (absolute maximum 38A)

eg. showers, cookers & other high power devices

2.906 6.634 9
  2.588 5.261 10

230Vac power cable 4mm2 (absolute maximum 30A, 6.9kW)

eg. low power electric shower

2.305 4.172 11
  2.00 3.10 5.47 14 (2.05) 12 (2.05)
  1.90 2.80 6.05    

230Vac power cable 2.5mm2 (absolute maximum 23A)

 

1.80 2.60 6.76 15 (1.83) 13 (1.83)
  1.70 2.30 7.57    

Wire copper enameled, Pro-Power ECW1.5. current rating 2.74A

eg. power speaker, transformer, motor

 
1.60 2.00 8.54 16 (1.63) 14 (1.63)
  1.50 1.80 9.7    

230Vac power cable 1.5mm2 (absolute maximum 16A, 3.6kW)

 

 
1.40 1.50 11.2 17 (1.42) 15 (1.45)
  1.30 1.30 13.0   16 (1.29)

230Vac power cable 1mm2 (absolute maximum 13A, 2.99kW)

eg. for light circuit

 
1.20 1.10 15.2 18 (1.22)  
  1.10 0.95 18.1   17 (1.15)

Audio cable (shielded), Belden 8760

eg. power speaker drive

1.00 0.78 21.1 19 (1.02) 18 (1.02)
  0.95 0.71 24.3    
  0.90 0.64 26.9 20 (0.91) 19 (0.91)
  0.85 0.57 30.2    
  0.80 0.50 34.1 21 (0.81) 20 (0.81)
  0.75 0.44 38.9    
  0.70 0.69 44.6 22 (0.71) 21 (0.72)
  0.65 0.33 51.7   22 (0.64)
  0.60 0.28 60.7 23 (0.61)  
  0.55 0.24 72.3 24 (0.56) 23 (0.57)
Wire Cable Description Diameter (mm) Area (mm2) Copper Resistance 20˚C.Ω/km Nearest SWG gauge (mm) Nearest AWG gauge (mm)
Category 5E network cable, 8060-OZZ7FNL from Alcatel

16 strand Ø0.2mm/strand

Multipurpose 10core shielded. (RS232 communication, data signal), Belden 9540, Belden 9536 (6 core), Belden 9534 (4 core)

0.50 0.20 87.5 25 (0.51) 24 (0.51)
Category 5E network cable

 

0.45 0.16 108 26 (0.46) 25 (0.45)
Telephone line cable, GC5040 from Pro Power 0.40 0.13 137   26 (0.40)
  0.35 0.096 178 29 (0.35) 27 (0.36)
Ribbon cable, 1.27mm pitch         28
  0.30 0.071 243 31 (0.29) 29 (0.28)
Wire wrapping wire, Ok Industries 0.25 0.049 351 33 (0.25) 30 (0.25)

Wire copper enameled

eg. small magnetic coil, speaker, solenoid, inductor, metal detector coil, small motor.

0.20 0.031 547
32 (0.20)
  0.19 0.028 605 36 (0.19)  
  0.18 0.026 676   33 (0.18)
  0.17 0.023 757 37 (0.17)  
  0.16 0.020 844   34 (0.16)
  0.15 0.018 970 38 (0.15)  
  0.14 0.015 1120   35 (0.14)
  0.13 0.013 1300 39 (0.13) 36 (0.13)
  0.12 0.011 1520 40 (0.12)  
  0.11 0.0095 1810 41 (0.11) 37 (0.11)
  0.10 0.0078 2190 42 (0.10) 38 (0.10)
  0.09 0.0064 2700 43 (0.09) 39 (0.09)
  0.08 0.0050 3420 44 (0.08) 40 (0.08)
  0.07 0.0039 4460 45 (0.07) 41 (0.07)
  0.06 0.0025 6070 46 (0.06) 42 (0.06)

Wire copper enameled (very fine)

eg. transformer coupler for audio/signal, wire for earphone

0.05 0.0020 8750 47 (0.05) 43 (0.05)
Wire Cable Description Diameter (mm) Area (mm2) Copper Resistance 20˚C.Ω/km Nearest SWG gauge (mm) Nearest AWG gauge (mm)
           

 

Cable Guide (typical cable type and name)          Click the chart for enlarge view.

Chart and images taken from Farnell, RS components and other websites.

 

      also Download the wire gauge calculator from UltraCAD Design, Inc

Other reference,

http://www.wiki.diyfaq.org.uk/index.php?title=Cables#Cable_Sizes

 

Refer to the most current National Electrical Code for further information on the electrical cable standards.

 

 

 

 

 

3. Advance conductor

 

Special material for conductivity connection. Some references for non-traditional or advance conductor materials.

 

I happen to see some special wire product that I think I should put them in this website for reference.

The follow shows a rubber strip (a black layer sandwich in between the two white layer). It is call the elastomer connector. It is typically used to connect a flat LCD display panel to the pcb board without any soldering. It is quite cool when it was being shown to me for the first time. The LCD and pcb is connected with this elastomer connector sandwich in between.

   

Elastomer connector

(soft rubber strip that can conduct like a wire)

 

 

Conductive fabric or cloth

this pic is tken from other website

The conductive fabric actually can feels like a typical cotton cloth material. Some other feels like a nylon fabric, a bit like plastic. This is great for RF shielding, which we used it to test the performance of RF transmission through various material.

 

Glocom Marketing Pte Ltd

 

Conductive glass

reference: conductive glass

 

Singapore Safety Glass

Conductive paint

 

 

Conductive tapes

 

 

 

 

www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller

 

 

4. PCB Footprint reference

 

 

Click here to access to footprint page.

 

5. Tap drill guide (metric chart)

Commonly used screw size in Singapore, Metric (fine pitch)

Screw Standard

Screw

diameter ‘O’

Drill size

diameter ‘I’

Pitch (fine)

M 1 1.0mm 0.75mm  
M 1.1 1.1mm 0.85mm  
M 1.2 1.2mm 0.95mm  
M 1.4 1.4mm 1.10mm  
M 1.6 1.6mm 1.25mm  
M 1.8 1.8mm 1.45mm  
M 2 2.0mm 1.60mm  
M 2.2 2.2mm 1.75mm  
M 2.5 2.5mm 2.05mm  
M 3 3.0mm 2.50mm 0.35mm
M 3.5 3.5mm 2.90mm  
M 4 4.0mm 3.20mm 0.5mm
M 4.5 4.5mm 3.70mm  
M 5 5.0mm 4.20mm 0.5mm
M 6 6.0mm 5.00mm 0.75mm
M 7 7.0mm 6.00mm 0.75mm
M 8 8.0mm 6.70mm 1.0mm
M 9 9.0mm 7.80mm  
M 10 10.0mm 8.50mm 1.25mm
M 11 11.0mm 9.50mm  
M 12 12.0mm 10.20mm 1.5mm
M 14 14.0mm 12.00mm  
M 16 16.0mm 14.00mm 1.5mm
M 18 18.0mm 15.50mm  
M 20 20.0mm 17.50mm  
M 22 22.0mm 19.50mm  
M 24 24.0mm 21.00mm 2.0mm
M 27 27.0mm 24.00mm 2.0mm






1/4″-36 6.5mm 6.0mm Thread for SMA RF connector thread

1/4″-36 6.5mm 6.0mm Toggle switch thread

 

 

 

 

 

Image of a machine cap screw

Enlarge image of the screw thread

  

diameter ‘I’

Diameter of the screw core

(Hole size to drill, for tapping the thread )

 

diameter ‘O’ Diameter of the screw thread

->

 

 

 

 

 

 

 

  Fastener Manufacturer:

References: http://www.aboveboardelectronics.com/catalogsmain.htm

Fasterner selection guide
http://www.aboveboardelectronics.com/abe_prodmain.htm
http://www.boltdepot.com/fastener-information/Type-Chart.aspx

 

 

Plastic fastener, Cable accessories

Enclosure bumper/rubber padding

Slide

 

 

 

 

Self-Clinching Nut, Standoff Guide  

Self Clinching Standoff

Installation Guide

 

 

Self Clinching Nut

Installation Guide

Silicone Moldmaking Techniques & Materials Silicon Moldmaking techniques & material guide.pdf

 




www.pic-control.com, Singapore Network WiFi Ethernet Solution

 

 

6. Common Connector Pin Out

This is a connector pin out reference.

 

3.5mm 4pins

Commonly use for:
– Earphone + Microphone

 

Earphone + Microphone:
Pin 1- Left Speaker
Pin 2- Right Speaker
Pin 3- Mic+
Pin 4- Ground

iPhone Mobile Phone Earpiece:
Samsung Galaxy
Samsung Nexus S
Pin 1- Left Speaker
Pin 2- Right Speaker
Pin 3- Ground, Push Switch
Pin 4- Mic+, Push Switch

Nokia Mobile Phone Earpiece:
Pin 1- Left Speaker
Pin 2- Right Speaker
Pin 3- Mic+, Push Switch
Pin 4- Ground, Push Switch

3.5mm 3pins

Commonly use for:
– Earphone
– Speaker

 

Earphone/Speaker pin out:
Pin 1- Left Speaker
Pin 2- Right Speaker
Pin 3- Ground

Notes: Speaker’s load is inductive. Measuring the resistivity from the pins will usually yield very low resistance (near to short circuit). Measurement by probing the pin in reverse will yield the same result.

Microphone pin out:
Pin 1- Mic+
Pin 2- Mic Power
Pin 3- Ground

Earphone/Microphone pin out:
Pin 1- Spk+
Pin 2- Mic+
Pin 3- Ground

3.5mm 2pins

 

Commonly use for:
– Microphone

 

Microphone pin out:
Pin 1- Mic+
Pin 2- Ground

Notes: Commonly available electret microphone contains active components. The positive terminal of a microphone can be detected using a ohm meter. Measure Mic+ (+ve Probe), Mic- (-ve Probe) will yield a higher resistivity than probing the reverse way Mic- (+ve Probe), Mic+ (-ve Probe).

Electret microphone equivalent circuit

Other type of microphone:
– The Carbon Granule Microphone
– The Piezoelectric Microphone
– The Condenser Microphone
– The Dynamic Microphone
– The Ribbon Microphone
– The Hot-Wire Microphone

reference:
http://mysite.du.edu/~jcalvert/tech/microph.htm

 

3.5mm 3pins, 2.5mm 3pins

 

Known to be use for:
– Walkie talkie

3.5mm 3pins, 2.5mm 2pins

Known to be use for:
– Walkie talkie

3.5mm 2pins, 2.5mm 3pins

Known to be use for:
– Walkie talkie

3.5mm 2pins, 2.5mm 2pins

Known to be use for:
– Walkie talkie

Mini DIN socket 6 pins (female receptacle)

 

 

Known to be use for:
– Walkie talkie

 

Walkie Talkie pin out:
Pin 1- Mic- / PTT Switch common
Pin 2- Mic+
Pin 3- PTT Switch
Pin 4- Speaker+ (left)
Pin 5- —unused— (right)
Pin 6- Speaker-

Mini DIN plug 6 pins (male pins)

 

Known to be use for:
– Walkie talkie

 

Walkie Talkie pin out:

Pin 1- Mic- / PTT Switch common
Pin 2- Mic+
Pin 3- PTT Switch
Pin 4- Speaker+ (left)
Pin 5- —unused— (right)
Pin 6- Speaker-

Pin 1 Mic- / PTT Switch common Re
Pin 2 Mic+ Bk
Pin 3 PTT Switch Wh
Pin 4 Speaker+ (left) Ye
Pin 5 —unused— or Speaker+ (right) Bl
Pin 6 Speaker- Gr

 

Mini DIN plug 4 pins (male pins)

Commonly use for:
– S-Video
– Walkie talkie PTT switch connector

 

Walkie Talkie pin out:
Pin 1- —unused—
Pin 2- —unused—
Pin 3- PTT Switch
Pin 4- PTT Switch

Mini DIN plug 4 pins (female pins)

 

DIN 5 pins

 

 

Known to be use for:
– Bike’s audio connector

 

Bike Audio pin out:
Pin 1- —unused—
Pin 2- —unused—
Pin 3- PTT Switch
Pin 4- PTT Switch

DIN 7 pins

 


Known to be use for:
– Bike’s audio connector

 

Bike Audio pin out:
Pin 7- PTT Switch (White)
Pin 3- Speaker L
Pin 5- Speaker R
Pin 2- Speaker Gnd
Pin 4- Mic-
Pin 1- Mic+
Pin 6- Mic shield

DIN 8 pins

 
GX16 Aviation plug and socket connectors (16mm)



GX16-2%20aviation-plug%2016mm.jpgGX16-8%20aviation-plug%2016mm.jpg

GX16-4%20aviation-socket%2016mm.jpgGX16-4%20aviation-plug%2016mm.jpg

GX16-5%20aviation-socket%2016mm.jpgGX16-5%20aviation-plug%2016mm.jpg



GX16-3%20dimension1.jpg
GX16-2%20dimension2.jpg
GX16%20connector%20selection.jpg
FD-M16 16mm Connectors FD-M16%20connector%20selection.jpg
Nanaboshi Connectors
(panel mount)

NJC series (general metallic connectors/socket)
NR series (twist lock connector, one-touch lock mechanism)
NJW series (waterproof panel mount connectors
/socket)
connector/Nanaboshi%20Connectors%20NJC%20NR%20Series.pdf
connector/nanaboshi%20njc%20panel%20mount%20connector.pdf
connector/nanaboshi%20connectors.pdf

Amphenol Connectors
(panel mount)

connector/amphenol%20connectors.pdf

XLR Plug 3 pins

 

Commonly use for:
– Studio Microphone

 

Studio Microphone pin out:
Pin 1- Shield
Pin 2- Positive Balance Signal
Pin 3- Negative Balance Signal

DC barrel jack/socket

DC barrel jack (OD=5.5mm, ID=2.1mm, length=11 to 12mm)

 

DC barrel socket

 

 

SMA RF connector (socket for WiFi Antenna)


sma rf cablesma rf cablesma rf cable
Toggle switch dimension, drill hole dimension and thread size 1/4-40 UNS-2A
sma connector dimension

 

 

 

7. Name of Connectors/Plugs

 

 

UK 3 pins Plug

EU 2 pins Plug

IEC 3 pins Socket


Male Plug -> IEC C14 (picture shown above)

Female socket -> IEC C13

Male Plug (with groove) -> IEC C16

Female socket (with groove) -> IEC C15

Check out here for more,

https://en.wikipedia.org/wiki/IEC_60320

 IEC socket dimension 230Vac 3 pin

Molex SPOX 5267 series connector header THT 2.5mm 4 way

Molex 5263 housing crimp receptacle 2.5mm 4 way

2.54mm pitch

General  
Product Family Crimp Terminals
Series 5263
   
Product Name SPOX™
UPC 800753534919
   
Physical  
Gender Female
Material – Metal Phosphor Bronze
Material – Plating Mating Tin
Material – Plating Termination Tin
Net Weight 43.200/mg
   
Plating min – Mating 0.889μm
Plating min – Termination 0.914μm
   
Termination Interface: Style Crimp or Compression
   
Wire Insulation Diameter 1.90mm max.
   
Wire Size AWG 22, 24, 26, 28
   
Wire Size mm² NA
   
   
Old Part Number 5263PBTL


molex KK 6410 series

molex KK 6471 crimp receptacle

2.54mm pitch

General  
Product Family Crimp Terminals
Series 4809
   
Product Name KK®
UPC 800753746022
   
Physical  
Gender Female
Material – Metal Brass
Material – Plating Gold
Material – Plating Gold
Net Weight 0.066/g
   
Plating min – Mating 0.381μm
Plating min – Termination 0.381μm
   
Termination Interface: Style Crimp or Compression
   
Wire Insulation Diameter 1.57mm max.
   
Wire Size AWG 22, 24, 26, 28, 30
   
Wire Size mm² NA
   
   
Old Part Number 4809555L

TJC8 connector (header and housing/receptacle pins)

Another name for housing is receptacle.

Pin Header PCB Crimp Style Cable Connector

TJC8 series(2.54mm pitch)Wire to Board Crimp style cable P.C.B connector housing terminal pin header

1. Pole: 1-40
2. Housing pins for wire size AWG28# – 22#
3. Header pins for PC board thickness: 1.6mm, 2.54mm pitch
4. Temperature range: -25C~85C
5: Voltage rating: 250V. AC/DC
6. Current rating: 3A
7. Contact resistance: 0.02
8. Insulation resistance: 800M
9. Withstand Voltage: 1000V. AC/1Min
10. Material:
Housing: PA66
Wafer: PBT
Terminal: Phos. Bronze Tin plated

Crimping tool, die sets size = ???

JST ZH connectors

B3B-ZR(LF)(SN)

S3B-ZR(LF)(SN)

ZHR-3

SZH-002T-P0.5

SZH-002T-P0.5 (0.08-0.13mm2, AWG28# – 26#, OD 0.8-1.1mm)
SZH-003T-P0.5 (0.032-0.08mm2, AWG32# – 28#, OD 0.5-0.9mm)

 
JST EL-2P (2 Way) Multipole Connectors With Wire

JST EL-2P multipole connectors




Connectors > Crimp Terminals / Solder Terminals & Splices > Quick Disconnect Crimp Terminals
Crimp terminal,
Blade,
Pin,
Push-on
Insulated push-on,
Butt,
Fork,
Ring,
Piggyback,
Male tab (6.35mm or 1/4 inch tab connector),
Male bullet,
Female bullet


Red Insulation   0.5-1.5mm2 / 22-16 AWG
Blue Insulation  1.5-2.5mm2 / 16-14 AWG
Yellow Insulation   4.0-6.0mm2 / 12-10 AWG


Good terminal is made of copper (tinned), not aluminium.





Wire size for various ferrule size (color determine the size)

Ferrule

 

 

 

8. Name of Cable/Wire

 

 

Ribbon Cable & IDE connectors

 IDC connector pin rating is 1A.

Flat Flexible Cable (FFC)

 

Flex Jumper

 
   

 




9. Others

 

 

RJ45 (Panel Mount), Ethernet network socket, 8P8C plug to socket
panel%20mount%20RJ45.png

USB Socket (Panel Mount)
panel%20mount%20USB%20socket.jpg



   



 

 

www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller

 

 

 

 

Keyword: mm inch mil thou, tap drill size, reference guide, PCB trace resistivity computation calculator, Foot print reference, Cable wire gauge resistance, cable wire selection, fastener

 

Working with 230Vac

Your reference guide to working with 230Vac or 110Vac High Voltage Electricity.

Edited by Lim Siong Boon, last dated 29-Aug-09.

 

Content 230Vac

  1. Safety

  2. Signal and Measurement

  3. Working with 230Vac electronics

  4. AC lightings wiring guide

 

 

 

1. Safety  

     

 

         

 

 

         

 

 

                

 

 

 

 

       

 

Introduction

The objective of this site is to get to know about the electronics components that can help us control 230Vac devices. Devices like ac lamps/lightings, power sockets/supply, heater, and many many other appliances at home. We are all surrounded by many appliances operating directly from AC mains supply. It is very interesting to control and work with these appliances. Learning to control with electronics, microcontroller and computer.

Our home is typically pre-installed with 230Vac sockets. The socket where we obtain our electrical power source. It is this basic utilities that keeps us operating in this urbanization era. Different country implement their own AC voltage system & AC plug. The electrical delivered to our home wall socket is a 230Vac single phase ac power. So throughout the section, we will only talk about single phase system and not the three phase system.

The first thing in my mind when it comes to 230Vac is “Dangerous”!!! I am still very scare of it. One careless mistake and we might not have a second chance to try again. Some article suggests that a voltage over 30V is considered as danger. Lower voltage is relatively safe to touch with your bare hand, although sometimes you may get the shock sensation on your muscle.

230Vac is a dangerous stuff, but when working with electronics you can hardly avoid using it. And when we cannot avoid it, then we have to face it. Facing it, by understanding more about it. Minimizing our chance of getting killed by 230Vac. So let us pay careful attention to this section.

 

The following article is from a website with simple illustration of electrical safety. It explains in simple terms the difference between birds and human touching the same high voltages cable. Why birds don’t get electrocuted? How do we get electrocuted? From these two question, we get to understand more about voltages and how we should deal with them to protect ourselves. Safety first, which is why I put this as the first section.

electrical safety.pdf

http://www.eng.cam.ac.uk/DesignOffice/mdp/electric_web/DC/DC_3.html

Remember that we will not have any chance to try again. Understanding the danger of electrical earth path will minimize the chance of getting electrocuted.

Before touching any wire, be sure to measure and ensure that there are no “live” voltage on the wire. You can use a multi-meter or test pen to check for live connection.

Multi-meter. Measure between the “live” and “nuetral” line to check if 230Vac is present.

 

Test Pen (this test pen comes in the form of a slotted screw driver. You can see a small bulb embedded in the handle. Touch the suspected “live” wire with the tip of the screw driver. Locate the back of the handle for a metal plate. If the bulb inside the handle lit up, when you touch your finger to the metal plate, it means that the wire is “live”.

 

 

reference:

Electrical System around the world,

–  http://kropla.com/electric2.htm

Electrical Safety,

http://www.eng.cam.ac.uk/DesignOffice/mdp/electric_web/DC/DC_3.html or electrical safety.pdf

http://www.allaboutcircuits.com/worksheets/shock.html

Electrical box install at home..         .

Bigger electrical box install at office…

      

Various names: Electrical box, DB box, Electrical distribution panel, Control panel

 

On the left are some of the common electrical box that we may find in our home. They are the main electrical distribution point to all the other rooms. From the power station to the sub-station and then to this box, distributing electrical power to our rooms.

This Type-G plug distributed to our rooms, consist of 3 cable namely Live (hot, brown), Neutral (return, blue) and Earth (safety ground, yellow/green).

Click here for other plug type.

 

 

On the electrical box, we can see a row of switch. One main switch is particular unique in color or size. This is the main switch which cut off the supply from live and neutral wire. The rest of the switches, only the live wire is disconnected. This is an important note to take, and the same applies to the wall switches. When we switch off the light or appliances, only the “Live” wire is disconnected.

There was once I was working on a power supply unit. Wanting to doing rewiring, I switch off the power leaving the 3 pin plug on the socket. I have carefully unscrewed and pull out the earth wire. Thinking that it is now safe that I have switch off the AC socket, I become relax and casually removed the earth cable. The earth wire accidentally touches the neutral wire and phow, my whole office got black out. From then on, I remember that neutral wire is as alive as the live wire. Never treat it lightly. When you switched off the power to do maintenance work, do not assume that the live as well as neutral is disconnected. Always check and handle them with care. Insulate the bare wire if you are unsure. Assume that they are always alive, unless you are absolutely 100% sure that the wire is unplugged from the power system. 99% is not good enough. It has to be 100%.

 

MCB (miniature circuit breaker) to protect the electrical line from over current drawn. RCB (residual current breaker) similar to MCD is another protection device trips when electrical leakage is detector (incoming current != outgoing current). Some device has both the features of MCD & RCD. They normally comes in the standard DIN rail mounting for the electrical boxes.

Other name: ELCB, MCCB, RCD, RCCB, RCCD (residual current circuit breaker), ground fault circuit interrupter (GFCI), ground fault interrupter (GFI) or an appliance leakage current interrupter (ALCI), safety switches, “salvavita” (life saver).

 

 

 

 

Power Distribution Components, MCB, RCB, Switches

             

    

 

It is recommended to install a circuit breaker (MCB) as well as a residual current breaker RCB when working with AC devices/equipments under test. They can protect against accidental over current or leakage fault that occur. Anything goes wrong, the device will be tripped, cutting off the power supply from the mains, protecting us from possible electrical shock.

RCB is more important as a protection from serious electrical shock. During normal operation, the current to and from the live and neutral wire should be equal. Any different in current indicates leakage. The device detects the leakage and trip the supply source.

MCB is more to cut off supply on overloading load. Example would be a short circuit from a faulty equipment. If the supply is not cut in time, the huge current pumping through will heat up the cable, resulting in fire along the cable.

There was once I am working on an automated swing door system. I try to cover back the aluminum cover, but find difficulty putting it back in position.  Not knowing why there was this small gap, I bang on the cover trying my luck to close it up. Suddenly I felt a very loud bang and bright light flashes over me, followed shortly by a slight breeze. They were the result of the small explosion.

After investigating, I found out the the casing actually cuts through the AC cable resulting in a short circuit. The cable were not properly secure in a safe position and the cover finishing is badly done. The edge will not filed and has a very sharp edge. It is lucky that I remembered to connect the earth wire to the aluminum cover, else I would have being shocked. So as you see, it is important to earth the metal surface that are near the AC line.

The MCB is found to be tripped, and some burn mark can be seen around the place of impact. The MCD is trip almost instantly, but the 3 pin AC plug for the automation door is still badly burned. When I open up the plug, the interior is completely burned out. Wire and fuse all black with carbon. I have to spent another hour to repair the cable & plug, tied the cable in place, smoothen the cover edges. A lesson to learn. Proper installation not only protects ourselves and it also minimize re-work.

In this scenario, the earth wire and MCB have done their job very well. You may have installed these protect in place, but without proper knowledge of how they are going to protect you, you are just as vulnerable. Learning how to protect yourself is the most important.

   A normal electrical switch. (no protection function)

 

 

     lockable switch for tagout purpose

 

The switch on the left may looks like MCB or RCD. It function as a simple single pole switch, and offers no protection at all. They are typical used to disconnect the live wire inside the electrical box, switching off the devices just like a wall switch.

 

Some models comes with a lockable design, for user to tagout. This is to minimize any chance of people unknowingly switch on the power, when the user is doing the maintenance work.

mcb-single-pole-b10-b16-c10-d10.jpg Single Pole MCB explain Curve Types

Surge current can be higher than steady state current, especially for inductive/capacitive load. Eg. motors. The surge higher than the current limit set, can easily trip the MCB. This means that it can be difficult to switch on a motor for example, because a surge from the motor startup can easily trip the circuit breaker.

This call for special MCB which has a wider allowance for surge current. MCB comes in various curve type, each has its torlerrence for surge current.

The photo on the left shows 3x MCB type (red color lever) having a circuit breaking current of 10 amphere, namely B10, C10, D10. Each of them has the same current limit. The type B, C or D curve indicates their ability to withstand sudden power on surge current.

MCB type B curve – Can withstand a surge current of about 3-5 times its rated current limit. For this MCB B10, the rate current limit is 10A. So this means that the MCB can withstand up to about 30-50A of surge current within the initial millisecond time.

MCB type C curve – Can withstand a surge current of about 5-10 times its rated current limit. For this MCB B10, the rate current limit is 10A. So this means that the MCB can withstand up to about 50-100A of surge current within the initial millisecond time.

MCB type D curve – Can withstand a surge current of about 10-20 times its rated current limit. For this MCB B10, the rate current limit is 10A. So this means that the MCB can withstand up to about 100-200A of surge current within the initial millisecond time.

There is another single pole MCB B16 in the picture. This MCB breaks the circuit when the current is over 16A. The MCB is of type B, meaning it can withstand the initial surge current of about 48-80A.

    

 

Industrial safety practice

When servicing AC socket or equipment, ensure that the AC source at the electrical box is switched off. If possible, unplug from the AC socket.

Lockout/Tagout procedure should be practice strictly. This is important when we work outside because we may not be the only person operating the equipment. Lockout/Tagout involve locking and tagging the switch source. So you can be sure that no other people can switch the power back on, when you are working on the socket or equipment. It is a safety procedure. If you do not have the facilities to lock out the power, a sign board or labeling warning is advise to prevent any accidental switched on.

For your own safety, the procedure is worth the trouble.

 
Some signage references,
caution_sign_w_exclamation.pngwarning-sign.gifwarning_sign_empty.gifwarning_sign.pngStop_sign.pngPalmCautionSign.jpg
As what I have experience, AC power is actually quite dangerous. It is very important that you equip yourself with the knowledge and know-how to protect yourself against any electrocuted accident. Safety is the most important. Always treat it as through it is the first you have touch it.

 

 

www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller

Singapore Customized, custom made Electronics Circuits & Kits

 

 

2. Signal and Measurement

 

graphic taken from:

 http://www.allaboutcircuits.com/worksheets/scope1.html

 

 

 

graphic taken from:

http://oscilloscope-tutorials.com/oscilloscope/Setting.asp

 

 

Measuring Voltage

There is once I wanted to measure the AC signal using my oscilloscope from the mains. I am curious to look at the sine wave from the wall socket mains. Tack, all the offices around me had their power tripped.

I made a Mistake?…..  I don’t even know why? I was lucky that I took extreme precaution during the measurement.

It is then that I started to re-visit 230Vac to understand more about it. I realized that our oscilloscope ground clip is actually connected to the earth as reference. Which is why the power trip, when I clip the ground lead to the neutral line. When this earth clip touches the neutral wire, the extra electricity leakage tripped the MCB (Miniature Circuit Breakers) found inside our electrical box. This is a safety feature to protect us. So remember that the Earth line is connected to the ground lead of the oscilloscope probe. Be careful.

 

Does this means that we cannot measure the ac waveform using the oscilloscope? How do we do the measurement then?

From what I found out, there are various methods to measure. Differential method to measure the AC signal would be more appropriate. Two probe would be required, placing across the signal you ant to measure. Ground lead can be floating, which the reference is earth because the ground lead is connected to the earth line. The difference between the two probe channel would be the actual AC signal. With help from the typical oscilloscope feature, the signal can be obtain as a single waveform ploy on the screen. One of the channel need to invert (using the INV function), and both the channel are added (using the ADD function).

Measurement technique

A Shortish Guide to Using an Oscilloscope.pdf

Floating Oscilloscope Measurements.pdf

Fundamentals of Floating Measurements and Isolated Input Oscilloscopes.pdf

http://idobartana.com/hakb/oscope.htm (10x probe to measure high voltage)

 

 

 

Oscilloscope guide from other site,

XYZs of Oscilloscopes, Tektronix 03W_8605_2.pdf

Basic oscilloscope operation.pdf http://www.best-microcontroller-projects.com/how-to-use-an-oscilloscope.html

 

 

Seldom typical engineer like us need to examine the AC signal. Those power engineering people who wanted to measure the signal probably wanted to see the harmonics to check up on the quality of the power supply. Or perhaps, as curious as I am, just wanting to see it.

Measuring the mains using digital multimeter. Reading is 230Vrms

graphic taken from:

 http://www.allaboutcircuits.com/vol_1/chpt_3/9.html

 

 

 

The waveform of the AC mains 230Vac 50Hz is shown in red.

The signal we should see on the scope…. (click to enlarge)

 

 

The most frequent used equipment for measuring our 230Vac mains would be the multi-meter. Portable and inexpensive. Providing us the basic measurement for checking the wire voltage. The power is quite reliable in urban area, always maintain it’s voltage reasonably at 230Vac. Probably a test pen can be the only measuring equipment you need.

When we measure the ac mains from the socket using the digital multi-meter, we will get a reading of 230Vac or 110Vac (depending on the country you are in). Take special  note that this reading is effectively the rms (root mean square) voltage. The actual peak voltage of the electrical line go up to about 325Vpeak. The 325Vp (peak) sine wave is equal to 230Vrms.

Vrms = √2 x Vp.

230Vrms = 0.707 x 325Vp.

Vrms can be think as the equivalent voltage in dc for power computation. The actual AC power (sine wave in red) has the same energy as one that is illustrated in the Vrms view point (square wave in blue). The energy can be computed, and they are defined as the area under the waveform. Area under the square & sine wave is equal. I have draw out the waveform to illustrate the idea.

Keep in mind the peak voltage. It would be useful in helping you select the proper component. Capacitor is one of such component where the capacitance and voltage rating is the main criteria for selection. Voltage higher than what the it can take, the capacitor will experience voltage breakdown. Pop, the capacitor can have a mini exposion.

So do remember, the AC mains is in fact 325Vp (peak) or 650Vp-p (peak to peak). That is very high voltage!!!

 

references:

http://en.wikipedia.org/wiki/Alternating_current

 

 

 

 

 

 

 

The Practical Part………

Yes. Now that we get our theory clear, let’s get on to the real hands on.

Date: 2009-08-01
This is one of the most exciting experiment that I ever done. Ever since my first disaster measuring AC mains, my understanding of oscilloscope and AV mains remains very unclear. Every step is carefully think of, carefully executed. This is unlike any other new electronics circuit that I want to experiment with. Any minor doubt that I have, I will research on the internet to confirm my understanding before I connect up the circuit.

It feels to me like experimenting with dangerous explosive. One mistake, either my life at risk, or my expensive digital oscilloscope gets damaged. It is the most detailed experiment that I ever done.

For an experience engineer, this can be as easy as ABC. For a first timer like me who have never measure the 230Vac line, and no senior to guide me, this is really frightening yet exciting. I am sure we will have a better understanding of high ac voltage, with this step by step measurement guide. Dealing with 230Vac will eventually be as easy as ABC.

So let me starts this exciting experiment.




 

NOTE: Click on the image for a clearer view.

 

My measurement setup for measuring the output of the zero crossing triacs circuit. A detail connection of this setup is shown in the following section.

 

The picture on the left is the setup that I have prepare for the 230Vac signal measurement.

Equipment used in this measurement experiment

– 3 pin extension socket (protected by RCD device)

– Triacs switch circuit

– DC power supply (to activate the triacs circuit)

– AC fan (device to be controlled by the switch circuit)

– Oscilloscope (Tektronix TDS 2014) and probe.

– Some wires for connection.

 

 

My triacs switch circuit. This switch circuit is solid state relay. Just like a mechanical relay, the circuit interface helps digital control circuit to control a 110/230Vac mains devices. There is a AC input and the controlled output as shown by the green wire terminal. Click here for further detail information on this circuit on another page.

 

Probe ground crocodile clip is clip onto the oscilloscope Earth pin. The measurement for Live/Neutral signal is with reference to the Earth potential.

 

The circuit that I am going to measure is the output of a AC switch circuit presented on the left. The circuit using a triac component to switch the AC power. If you are interested to find out more about this circuit, you can visit the following page I have put up.

about Triacs circuit

The following summaries the steps taken in order to do a proper measurement.

1) All the equipment for the experiment is powered from the RCD (residual current device) protected extension plug. This is to protect myself in case I accidentally touches the live/hot wire. The RCD will cut off the power in the case of power leakage through my body.

2) Connect up two probe from the oscilloscope to the circuit. CH1 probe is connected to the Live wire output, while CH2 is connected to the Neutral wire. The ground clip of the probe should be connected to the oscilloscope Earth pin. You should able to see such a pin on your scope with the Earth/Ground symbol (see the photo on the left). This is the setup for measurement with reference to the Earth ground. This Earth pin is internally connected to our 3pin AC socket. Therefore the pin is the same as our 3 pin plug Earth. The grounding clip from the oscilloscope is found to be Earth, so in fact there is no need to connect up. For clarity and safety reason, just connect it up. Always ensure that your oscilloscope is properly Earth for safety reason.

3) Set the probe attenuation to 10x. On probe there is a switch labeled 1x and 10x. 1x means that the probe signal is exactly feed into the scope. 10x means that the signal will be attenuated to a factor of 10 times before feeding into the scope. The scope may not be aware of the attenuation, so it is important to setup the scope for the 10x measurement. If this is not done, you will find that the reading is 10x smaller than expected. A 10V signal will be read as 1V. It is not important but will be clearer if you just set it on the scope. The signal is expected to see on the scope should be a 325V. After attenuating the probe, only 32.5V is actually feed into the oscilloscope input. Tektronix TDS 2014 oscilloscope can accept signal up to 300V. Without the attenuation, the scope might just blow up. Although the scope received only an input of 32.5Vp, it multiple the scale by a factor of 10 because of the settings I have done on the scope.

4) The reading is going to be very high, so set the voltage div for both CH1 & CH2 to the max. In my case after adjustment to the 10x factor on the scope, my max setting is 50 volt/div.

5) Set the scope to Math function: CH1 – CH2. CH1 is measuring the Live signal with reference to Earth while CH2 is measuring the Neutral wire with reference to Earth. In order to measure the signal Live with reference to Neutral, we need the scope to do some math, CH1 – CH2. (A red trace appear representing a new trace CH1 – CH2). Disable the CH1 & CH2 trace so that you can see only CH1 – CH2 trace clearly.

6) Ensure that all wire is properly screwed and secure. Pull individual wire, and ensure that it does not comes off.

 

 

The oscilloscope presents the signal at the output of the triacs switch circuit.

The AC mains power is not switch on to the triacs switch circuit yet, so no signal is detected at the circuit output..

Once I switch on the mains switch, some small noise is detected at the output of the circuit. The triacs is in the off state but some signal is being observed. This means that there are some leakage. The leakage is ok because it is too small to activate the AC fan.

The triac switch is activated and the 230Vac is observed at the output. Yes, this is the 230Vac. But there is a problem. The voltage is too high for the oscilloscope to display. My scale is to 50 volt/div, and I have only 8 division on the y-axis for display. This means that I can only measure in the range of 200Vp-p. The reason for the signal clipping on the display.

To display the full 230Vac range or 325Vp-p. We need to attenuate the signal more. Some probe you have the option to attenuate by 100x.

 

230Vac measurement connection with oscilloscope

 

Measurement with voltage divider across Live & Neutral wire.

 

My probe only allows me to attenuate the signal by a factor of 10. I will need to attenuate the signal further.

For my case, I have a voltage divider using 2x 1MΩ (0.25W), to attenuate the signal by two times before feeding the signal to the probe. The voltage divider is connected across the output terminal of the Live and the Neutral wire. CH1 is connected to the divided voltage (between the two resistor), while the CH2 remains connected to the Neutral wire.

You can use other resistor value but you need to ensure that the resistor wattage is able to handle the high voltage. The maximum voltage across the Live/Neutral is 325V. If 2x 1MΩ is used for he voltage dividing, the maximum current expected will be about 0.16mA. The minimum wattage required is therefore 325V x 0.16mA = 0.053W. I have used a 0.25W resistor, which is more than enough. If you are using 2x 10kΩ resistor divider, make sure your resistor wattage is at least 6W. There will be more current flowing through the resistor, more energy dissipating across it, and it is going to be hot. A lot of energy is wasted if you use lower resistance.

The left present the actual measurement setup with a voltage divider circuit to attenuate the signal so that the oscilloscope is able to display the high voltage.

Remember to multiply the voltage by 2 times while you analyze this waveform. This is because the voltage has been divided by 2 due to the voltage dividing circuit. Click on the photo to enlarge the signal 650Vp-p at 50Hz, representing our 230Vac mains supply.

Finally a clear 230Vac waveform display with a period of 20ms. I finally managed to measure the 230V mains.

On the scope, the signal display about 320Vp-p, but in fact the signal is actually about 640Vp-p. This is because of the voltage divider that I have added and the scope just have no idea about it. So mentally, you need to multiply by 2 to get the correct reading. This is about the same as what we have computed previously. 230Vrms has the actual waveform of 650Vp-p at 50Hz. Any capacitance component attached across the Live & Neutral wire have to withstand at least the voltage of 325V. This is important for our component selection.

After this write up I have better confidents in dealing with 230Vac and it’s electronics. Something that I often used and understood little about it.

It is so interesting. If only I am as curious when I am in school during my teenage days. There would be many teachers to guide me in the understanding. As a teenagers, most of us probably be fooling around rather than learning seriously and actively. Wanting to learn and know more than what the lecturer teaches.
 

I hope you have enjoy, and get a better understand in dealing with 230Vac measurement.

 

Measuring current by inserting the meter into the current path.

     

 

Measuring the AC current using the clamp meter. Easy, just clamp it.

                  

 

 

                     

 

picture taken from:

http://www.nakano-permalloy.co.jp/e_clamp_on_meter.html

http://www.licensedelectrician.com/Store/AM/AC71B.htm

Measuring Current

How much current is being drawn from your wall socket. You might probably want to know how much energy your equipment/appliances is consuming.

For measurement of current, a cable clamp meter is recommended. Clamp measurement detects the invisible alternating electrical field generated by the 230V ac 50Hz. No contact with the copper wire, just clamp around the cable. This is all about Faraday Law, founder Michael Faraday. It is actually very interesting learning about the history of how people actually discover these physics. They are great people. I watched a very interesting science history documentary. A documentary about the history and concept behind E=mc2. I think it would be great to share you everyone.

Do a search on,

“E=mc2 – Einstein and the World’s Most Famous Equation”

 

 

 

a mini current sensor for AC power line. Comes with 1:300, 1: 500, etc… transformer coil ratio

Measuring Current using a current sense coil or transformer

The picture on the left is a mini current transformer. To measure the current flowing through your AC power line, either a “Live” or “Neutral” wire has to be put through the hole located in the centre of the sensor.

The sensor consist of fine wire coil inside. The coil is wind around the circular core, forming a ring to sense the AC magnetic field around the AC power cable through the hole. It is important that only the “Live” or “Neutral” wire can be inserted through the hole. If both the “Live”and “Neutral” are put through the hole, the signal will be minimum. This is because the magnetic field of the out going wire will be cancel off by the returning wire.

 

The picture on the left is a simple setup with the oscilloscope probe to the two terminal on the current sensor.

Note that only 1 wire (Neutral) through the hole on the current sensor.

Signal at the output of a 1:300 coil transformer, while powering up a sprindle motor. The motor load is an inductive load. The current signal being pick up is quite noisy from the motor. The signal is about 5Vp-p.
Signal at the output of a 1:300 coil transformer, while powering up a soldering iron. The soldering iron is a heating element which is a resistive load. The current signal looks like the 230Vac 50Hz sin wave at about 0.2Vp-p.

This is a rectified signal (using diode bridge) picked from the sensor. The power line is not powered up, no load. I thought it should be flat. It could be noise generated from other nearby appliance through the “Neutral” wire.

The signal seems weird, but I did not investigate much on this result.

Ch1 is the rectified signal picked up by a 1:300 current sensor. The motor load is being switched on and off.

Ch2 is the signal conditioned through a LPF (low pass filter) and an op-amp comparator circuit. A clean result showing the motor being on and off.

Ch1 is the rectified signal picked up by a 1:500 current sensor. The motor load is being switched on and off. As you can see, the magnitude of the signal being picked up is higher. A higher voltage output, is being trade-off with a lower current drive. Since the signal will be conditioned by an op-amp, having a low current drive is not much of a problem.

Ch2 is the signal conditioned through a LPF (low pass filter) and an op-amp comparator circuit. A clean result showing the motor being on and off.

   

 

 

 

Computing Appliances Electricity Usage

Now that we measured the current consumption, I am starting to be curious on the power consumption for a typical home. Just for the fun of it, I have investigate some of the high power consumption appliances.

Energy (Wattage) = Voltage (Vrms) x Current (Ampere)

 

reference:

http://michaelbluejay.com/electricity/computers.html

 

 

Energy meter to measure power consumption of your electrical appliances.

 

 

How much does my power cost?

Energy cost: S$0.1803/kWh as on 16 Jun 2009

Energy cost: S$0.2558/kWh as on 1st Apr 2011

Energy cost: S$0.2728/kWh as on 1st July 2011

This means that it cost S$0.1803 running an appliance consumption 1kW  for an hour.

 

See more energy measurement at another webpage Energy Audit

 

Air King Model 9106

Energy: 57-77Watt

 

 

 

Energy consumption for 8hr/day= 77W x 8hr = 616Wh

Energy consumption for 30 days = 616Wh x 30 = 18.48kWh

Energy cost for 30 days = 18.48kWh x $0.1803/kWh = $3.33

Energy for a Fan will cost about

$2.47-$3.33 per month

 

 

 

         Daikin Inverter Multi Split (R-22)

Energy: 1520-6900Watt

 

MSZ-FB series

Energy: 2500-5000Watt

 

Energy consumption for 8hr/day= 6900W x 8hr = 55.2kWh

Energy consumption for 30 days = 55.2kWh x 30 = 1656kWh

Energy cost for 30 days = 1656kWh x $0.1803/kWh = $298.58

Energy for a Fan will cost about

$65.77-$298.58 per month

 

 

 

 

 

 

MR-560U 560 litre Refrigerator

Energy: 570kWh/year

or 65W when I divide that number

with 365 days x 24 hours

 

 

Energy consumption for 8hr/day= 65W x 8hr = 520Wh

Energy consumption for 30 days = 520Wh x 30 = 15.6kWh

Energy cost for 30 days = 15.6kWh x $0.1803/kWh = $2.81

Energy for a Refrigerator will cost about

$2.81 per month

 

 

Philips MASTER TL5 circular fluorescent lamp

Energy: 22-60W

 

Philips PL-T compact fluorescent bulb

CFL, compact fluorescent

Energy: 32-42W

 

Energy consumption for 8hr/day= 60W x 8hr = 480Wh

Energy consumption for 30 days = 480Wh x 30 = 14.4kWh

Energy cost for 30 days = 14.4kWh x $0.1803/kWh = $2.60

Energy for a fluorescent lamp will cost about

$0.95-$2.60 per month

 

Energy consumption for 8hr/day= 42W x 8hr = 336Wh

Energy consumption for 30 days = 336Wh x 30 = 10.08kWh

Energy cost for 30 days = 10.08kWh x $0.1803/kWh = $1.82

Energy for a fluorescent lamp will cost about

$1.38-$1.82 per month

 

Incandescent Light Bulb

Energy: 50W

 

 

Incandescent seems to have similar wattage with the fluorescent. In fact a 15W compact fluorescent can have the equivalent brightness of the 50-60W incandescent bulb. Therefore using fluorescent can be cost saving.

http://www.caus.vt.edu/maketheswitch/pages/facts.html

 

  The energy cost matches quite well with my home monthly electrical bill. I am quite surprise that the fridge use so much less energy. Did I make any wrong assumption? Now I also aware that the energy to turn on the aircon for a day, is enough to operate a fan for 3 months.

 

 

 

 

 

 

=

 

 

End of the fun. Let us start to research more about the AC ingredients available.

 

See more energy measurement at another webpage Energy Audit

 

 

 

www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller

Singapore Customized, custom made Electronics Circuits & Kits

 

 

3. Working with 230Vac electronics  
Component suitable for switching on and off 230Vac devices.

– Mechanical relay

– Solid state relay

– Triacs

– Thyristor

– Capacitor (high voltage rating)

– Resistor (high wattage rating)

– Transformer

 

about transformer- transformer.pdf

reference from http://www.melcontransformers.info/

 

The list on the left are namely some of the common components used for controlling 230Vac appliances.

This section is closely related to switching. So I decide to divert your attention to the switch. The range of components for controlling your appliances. It is all about “Switch“…

So let’s move on to learn more about switch.

 

 

AC to DC conversion (Transformerless)

Our electrical system uses high AC voltage to distribute energy to our homes. Most gadgets works with DC voltage, therefore we often see a AC-DC circuit module as part of the gadget.

Some AC-DC module are integrated into the product; for example, our computer, DVD player, radio. Some AC-DC module comes in the form of power adaptor that supply DC voltage to the devices.

The AC-DC module is so common, it will be useful to learn about them. Most AC-DC contains a transformer to isolate the DC voltage from the AC mains. This acts as a form of protection, so that people will not get electrocuted when touching the DC circuit.

There is also a newer type of AC-DC using switching method. It is something similar to switching DC-DC method. The transformer used can be alot smaller. You can see that old power adaptor was heavy and bulky. The power adaptor nowsaday are light and small.

Another type of AC-DC module uses only resistors and capacitors, without any transformer. They are also known as transformerless AC-DC circuit. You need to be careful when handling this type of cicuit as it is not isolated from the AC mains. You will get electrocuted touching the DC circuits. Please refer to the section above to understand more about 230Vac and how one can get electrocuted. Transformerless circuit is simple and cheap, and it is suitable for application that consume low power.

 

 

Example:  Transformerless 230Vac to 4.6Vdc

transformerless%20230Vac-4.6Vdc%20circuit.png

Please click here to see the transformerless AC-DC circuit schematic.

 

 

This circuit converts 230Vac to 4.6Vdc without using any transformer. Please take note that the circuit is not isolated from the 230Vac mains; ensure that the circuit is enclosed and properly earthed to prevent accidental electrical shock.


(Last update: 31 Oct 2010)

Example:  Transformerless 230Vac to Vdc (for a load of 24Vdc 20mA)

Please click here to see the transformerless AC-DC circuit schematic.

 

ac-dc transformerlessac-dc transformerless

 

This circuit converts 230Vac to Vdc suitable for a 24V 20mA load, without using any transformer. Please take note that the circuit is not isolated from the 230Vac mains; ensure that the circuit is enclosed and properly earthed to prevent accidental electrical shock.


(Last update: 12 Jan 2011)

Another transformerless circuit 230Vac to 5Vdc that I found on the internet. (I have not tested this yet)

 
AC-DC integrated circuit product manufacturer

You can refer to the datasheet on their website for the datasheet and application notes.

power integration

High efficient ac-dc conversion IC

– isolated (smaller transformer component)

– non isolated (transformerless), LNK306DN

2018-10-31 Transformerless Power Supply – 230Vac to 12Vdc

transformerless-230vac-design.png

 

ST microelectronics

– isolated (smaller transformer component), VIPer12A

AC-DC switching IC
IC: LM5021
IC: IRIS4013(K), IRIS40 series, irismps3.pdf
IC: NCP1200, AND8023-D.PDF
IC: NCP1215, AND8128-D.PDF
IC: NCP1271, AND8242-D.PDF
IC: NCP1381
IC: NCP1603, AND8207-D.PDF

 

 

www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller

Singapore Customized, custom made Electronics Circuits & Kits

 

 

4. AC lightings wiring guide  
Keyword: difference between normal fluorescent, PLC lamp
LEd fluorescent circuit
power supply LEd fluorescent circuit

Connecting electronic ballast with a fluorescent lamp.

http://www.goodmart.com/facts/light_bulbs/ballast_wiring.aspx
http://www.repairfaq.org/sam/flamp.htm
http://en.wikipedia.org/wiki/Ballast_(electrical)
http://www.oksolar.com/lighting/ballasts.htm
 

EXAMPLE

Say hob 32a
Say oven 32a

Total load 64amp

Cooker apply diversity

1st 10a 10amp
30% of 54a 16.2amp
Allow for socket 5amp

Ib 31.2amp
(Ib no socket 26.2amp)
 


Pluggable connector for 230Vac lighting points (Live, Neutral, Earth)

 

SPINNE EM16 connector (Black)

SPINNE EM16 connectorSPINNE EM16

 

163 3 TS IEC998-2-1 connector (Black)

163 3 TS IEC998-2-1

163 3 TS IEC998-2-1163 3 TS IEC998-2-1

163 3 TS IEC998-2-1

Can be purchased from New Starlight Industries Pte Ltd http://www.newstarlight.com/prdt76.html

 

 

quick release wire connector quick release connector (no need to screw on the wire)


Pluggable 3 way connectors from wieland, commonly used for connecting electrical AC cables to lightings lamp. The connector can be pre-installed onto the power termination point and the mating connector on the lamp component. This simplifies the cable to lamp connection and allows faster installation.


5. Ground Loop

references:
http://sound.westhost.com/earthing.htm
http://www.compliance-club.com/archive/old_archive/020918.htm

 



www.pic-control.com, Singapore Network Ethernet WiFi RS232 RS485 USB I/O Controller

Singapore Customized, custom made Electronics Circuits & Kits




 

 


Keyword: Vac mains, 230Vac 110Vac, High Voltage, Electrocute, Danger

Wall sockets, power points, power sockets, electric receptacles, electrical outlets

A Quick Reference Guide to Ascii, Keyboard & Windows Alt codes

Ascii, Windows Alt & Keyboard Codes

Edited by Lim Siong Boon, last dated 06-Oct-08.


 

 

 

 

 

Keyboard scan code

The Diagram below shows the codes that are returned when a key is pressed on the keyboard.                                      

For example, pressing ‘a’ would return 0x61.

If it is an extended key, the code is shown as “0,XX” where XX is the extended code.

 

 

 

Ascii Code Table

 

  0x?0 0x?1 0x?2 0x?3 0x?4 0x?5 0x?6 0x?7 0x?8 0x?9 0x?A 0x?B 0x?C 0x?D 0x?E 0x?F
0x0?

 

NULL

SOH

start of heading

STX

start of text

ETX

end of text

EOT

ENQ

equiry

ACK

•

BELL

BS

Back

Space

TAB

LF ‘\n’

new line

VT

vertical tab

FF

new page

CR ‘\r’ carriage return

SO

shift out

SI

shift in

0x1?

DLE

data link esc

DC1

DC2

DC3

DC4

§

NAK

neg ack

SYN

ETB

CAN

cancel

EM

SUB

ESC

FS

GS

RS

US

0x2?

 

Space
! # $ % & ( ) * + , . /
0x3? 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
0x4? @ A B C D E F G H I J K L M N O
0x5? P Q R S T U V W X Y Z [ \ ] ^ _
0x6? ` a b c d e f g h i j k l m n o
0x7? p q r s t u v w x y z { | } ~
0x8? Ç ü é â ä à å ç ê ë è ï î ì Ä Å
0x9? É æ Æ ô ö ò û ù ÿ Ö Ü ¢ £ ¥ ƒ
0xA? á í ó ú ñ Ñ ª º ¿ ¬ ½ ¼ ¡ « »
0xB?
0xC?
0xD?
0xE? α ß Γ π Σ σ µ τ Φ Θ Ω δ φ ε
0xF? ± ÷ ° · ² non-breaking space
  0x?0 0x?1 0x?2 0x?3 0x?4 0x?5 0x?6 0x?7 0x?8 0x?9 0x?A 0x?B 0x?C 0x?D 0x?E 0x?F
0x10? Ā ā Ă ă Ą ą Ć ć Ĉ ĉ Ċ ċ Č č Ď ď
0x11? Đ đ Ē ē Ĕ ĕ Ė ė Ę ę Ě ě Ĝ ĝ Ğ ğ
0x12? Ġ ġ Ģ ģ Ĥ ĥ Ħ ħ Ĩ ĩ Ī ī Ĭ ĭ Į į
0x13? İ ı IJ ij Ĵ ĵ Ķ ķ ĸ Ĺ ĺ Ļ ļ Ľ ľ Ŀ
0x14? ŀ Ł ł Ń ń Ņ ņ Ň ň ʼn Ŋ ŋ Ō ō Ŏ ŏ
0x15? Ő ő Œ œ Ŕ ŕ Ŗ ŗ Ř ř Ś ś Ŝ ŝ Ş ş
0x16? Š š Ţ ţ Ť ť Ŧ ŧ Ũ ũ Ū ū Ŭ ŭ Ů ů
0x17? Ű ű Ų ų Ŵ ŵ Ŷ ŷ Ÿ Ź ź Ż ż Ž ž ſ
0x18? ƀ Ɓ Ƃ ƃ Ƅ ƅ Ɔ Ƈ ƈ Ɖ Ɗ Ƌ ƌ ƍ Ǝ Ə
0x19? Ɛ Ƒ ƒ Ɠ Ɣ ƕ Ɩ Ɨ Ƙ ƙ            
0x1A?                                
0x1B?                                
0x1C?                                
0x1D?                                
0x1E?                                
0x1F? ǰ DZ Dz dz                        
0x201? – — ‘ ’ ‚ “ ” „
0x202? † ‡ • …






0x20A? €
0x212? ™
0x221?
                                 

 

How to key in special ascii symbol into your document.

Alt xxx    (printable char, where xxx is decimal code)

example: Alt 9, will print char-> ○

   where 9 is a decimal number

example: Alt 65, will print char-> A

   where 65 is a decimal number

Alt 0xxx    (for control char, where xxx is decimal code)

example: Alt 09, will execute-> tab function

   where 9 is a control code

Alt +XXXX (for printable char, where XXXX is hexadecimal code)

example: Alt +41, will print char-> A

   where 41 is a hexadecimal number

 

 

Extended Ascii/HTML codes (Press Alt 0xxx)

Name

Currency

 Character

Key press

sequence

     
  Currency  
cent ¢ Alt 0162
British Pound £ Alt 0163
Euro currency € Alt 0128
Japanese Yen ¥ Alt 0165
Dutch Florin ƒ Alt 0131
Generic currency ¤ Alt 0164
     
  Math Symbols  
diameter big Ø Alt 0216
diameter small ø Alt 0248
division ÷ Alt 0247
degree ° Alt 0176
     
plus/minus ± Alt 0177
micro µ Alt 0181
     
  Fractions  
  ¼ Alt 0188
  ½ Alt 0189
  ¾ Alt 0190
     
  Others  
Copyright © Alt 0169
Registered ® Alt 0174
Trademark ™ Alt 0153
List dot • Alt 0149
Section § Alt 0167
Paragraph Alt 0182
en-dash – Alt 0150
em-dash — Alt 0151

 

 

Other references:

LSB reference summary.pdf

USB HID to PS/2 Scan Code Translation Table.pdf




 

 

 

keyword: ascii code table, ascii chart

Switch

Introduction to the uses of Mechanical, Electrical and Electronic switches. Understanding the fundamental of electronics from the knowledge of switch.

Photos from internet, Edited by Lim Siong Boon, last dated 31-Oct-09.

 

 

 

My journey of searching the real meaning of electronics,

this topic “switch” is the one worth studying.

The deep understanding in switches,

helps me discover a lot much more about what is happening in electronics.

If you are looking for basic and simple understanding of electronics,

this topic would be the one worth studying.

Practically build up your fundamental in electronics.

 

 

Topic Discussion Overview

  1. Wire Connection
  2. Mechanical Switch
  3. Mechanical Relay
  4. Reed Relay
  5. Solid State Relay
  6. Transistor as a switch
  7. Triac , the electronic AC switch
  8. MEMs relay

 

 

 

1. Wire Connection

 

 

 

 

 

 

History, old telephone exchange in New York City, during the year 1910.

Switch Story

Long long time ago, circuit connection is achieved using muscular means. The telephone network is one of a major communication system in the early days. To Call your buddy next block, the first step you have to do is to pick up the phone. A human operator will attend to your pick up. Speak to her about the intention to talk to your buddy. The operator will manually plunk in wire connector linking your home telephone to your buddy phone. And Yes, you can now talk to your friend because there are operator doing the switching at the end of your telephone line.

http://www.artlebedev.com/mandership/91/

Sounds a lot of manual work. Yes, this is the good old days. The telephone operators in the central telephone exchange house, are making the circuit connection manually. This is what this page is all about. All about switches. All about making a good short circuit.

Not all short circuit is bad. In fact they are the fundamental building blocks in digital electronics. Many electronic design/interface are as simple as a switch.

In the articles that follows, it will be about the various type of electronics components that can help you in the creation of the perfect short circuits.

 

 

 

Various type of connectors

The following connector guide present the typical name for various connectors.

Click the image for the enlarge view.

(with courtesy from RS Components)

 

 

 

 

2. Mechanical Switch

 

 

 

1P2T latching type (Form1C)                     

 

1P1T latching type (Form1A)             

 

1P1T double break, push button type (Form1X)

 

2P2T latching type (Form2C)               

 

Summary Table for forms of Switch Contact

 

Normally Open,

NO

Normally Close,

NC

Normally Open,

with Double Break

Normally Close,

with Double Break

SPST or 1P1T

Form1A

 

Form1B

 

Form1X

 

Form1Y

 

SPDT or 1P2T

Form1C

 

Form1Z

DPST or 2P1T

Form2A, FormAA

 

Form2B, FormBB

 

Form2X, FormXX

 

Form2Y, FormYY

 

DPST or 2P1T

FormAB

 

FormXY

 

DPDT or 2P2T

Form2C, FormCC

 

 

 

Other Type of switch characteristic.
*ON-OFF
*(ON)-OFF
ON-(OFF)
ON-ON
ON-(ON)
ON-OFF-(ON)
*ON-OFF-ON
*(ON)-OFF-(ON)

* means most common configuration
(xx) means momentary position,
no bracket means latch position,
off means no connection between throw,

 


“alternate action” switch is similar to a momentary switch, but the state will get alternate/latch when the switch releases to the spring back position.



Switch Type (for switch with 2 or more throw)
non-Shorting (typically) – contact is break first before making contact with the next contact.
Shorting – contact is short with the next contact, before breaking with the previous contact.

 

 

 

 

                     

 

           Various product that uses switches

 

Mechanical switches is a simple type of interface to control electrical stuff using the means of some mechanical action. In short, a switch is a mechanical to electrical conversion device.

I can’t find any history on the evolution of the mechanical switches. I guess people might have become smarter. Rather than using a jumper wire to make connection manually, human invented switch to make short circuiting task more efficient. Tedious and time consuming work. Plucking the wires in and out takes a lot more effort, compare to toggling switches.

Of course mechanical switches are not suitable for telephone exchange application for the millions of household. However understand the roles of switches in electronics, will definitely increase our awareness for a more complex electronic system. Switches in the form of mechanical, digital circuit, power electronics are commonly use in the electronics design.

The greatest thing to understand about switches is all about the component/device rating. Some people refer it as the power handling capacity, which is the voltage and the current. The voltage it can handle across the switch terminals without destroying itself. Sometimes refer to as the breakdown voltage. The maximum amount of current that can flow through, without destroying itself. Sometimes refer to as the load current the switch can support.

In fact, the whole idea of this “switch” thingy is about understanding the rating and capabilities of the various type of electronics components. I mean it applies to all the electronics devices, including even wires. To me, this is also the most important concept towards understanding of all other electronics. It is so important. Fortunately it is also easy to understand, if you pay enough attention in this topic.

Not just switch have rating. Wire also have it’s rating, since we know that switch is in fact another form of wire, or to be precise we call it a conductor.

Like the size of a water pipe, there is a limit on the water flow rate. If the pipe diameter size is small, flow rate will be small too. Larger diameter pipe more water can flow. This is what they mean by the term “current rating”. Larger wire size can carry more current. Small wire may also carry the same current at the expense of increase temperature. When it gets too hot, the wire will just burn off, just like what a fuse do.

For further information on choosing your wire for carrying power, click here.

If there is an important message that I want you to bring back after reading this whole article, it will be the following four words.

“Everything have its Limit”

 

Shifting our attention back to mechanical switch. There are various kind of terms for mechanical switch. Switches can be “momentary” meaning the the switch will spring back to the original position when there is no external push forces, or “latched” meaning that the switch will stay at it’s new toggled position when when external push forces is applied.

Switch description such as “double poles double throws” or 2P2T provide more information on how the switches are operated. “Poles” tell us how many sets of switches are connected to a single mechanical trigger. This is often refer to as ganged switches. “Throws” describes the number of switch contact way. If you are still not clear what I mean, refer to the pictures on the left side. Picture indeed tells a thousand words.

Another term used is shorting or non-shorting switch. Non-shorting switch means that the switch will break the contact with the current “throw” position before making contact to the next “throw” position. This type of switch is more commonly in use. Shorting switch means that the switch will break the contact with the current “throw” position after making contact to the next “throw” position. This means that during the switching, two of the “throw” position will be shorted for a very short period. It is used where the connection needs to be connected always and not left floating at any one time. Happen to found out that these are used in switching loads such as loudspeakers, where the source cannot be safely operated without a load.

There are other form of switch description known as the “switch contact forms“, some example are Form A, B, C, X, Y, Z, AA, BB, AB. Form A is defined as a normally open switch, while Form B is a normally close. Form X is similar to form A except that it has a double break contact. Form X, Y, Z are double break switches.

For example a switch labeled as “Form 1A” (SPST) indicates that it is a 1 pole normally open switch. “Form 2C” consist of a NO as well as a NC contact, also known as the DPDT or 2P2T switch. Form Y is a normally close 1P1T double break switch. Form AA is a 2P1T normally open switch.

These terms are common description for  mechanical switches, and is also widely applied to mechanical and reed relay devices as well.

The main point to note when choosing a switch, is on the mechanics design, and the feel of the button. This is non-technical, and is more about user’s experience.

Technically all switch has their maximum rating for handling current. Like a wire, if you choose a thin and fine wire, the wire will get burn or melted when large current flow through it. This is also the principle of how electrical fuse works. You can choose a higher rating switch which can match most type of condition, however they are usually big and bulky. This is the trade-off on choosing an appropriate switches.

There are many more styles of switch, and you may like to refer to the following website for more references.

http://www.kpsec.freeuk.com/components/switch.htm

 

There are various mechanical switches around us. They are acting as a system interface, which convert mechanical motion into electrical signal. For example, the keyboard which you are typing, the power switch that turns on your TV, the keypad you pressed on your telephone or mobile phone, the lever switch that turns on your rice cooker, microwave oven….etc. They are interface with switches for us to control.

 

 

Interfacing a switch for digital input (TTL, CMOS)

 

 

 

 

 

 

The circuit on the left illustrate a simple switch interface. This interface provides a output voltage to indicate the status of the switch. If the switch is press, the output will be a 0V. While it is release, output will be a 5V. This can be a input interface to a digital circuit, for logic ‘1’ or ‘0’. A useful and basic circuit interface.

Mechanical Glitches from a mechincal switch

 

Mechanical switch is analog in nature. When a mechanical switch is pressed, two metal plate is in contact with one another. The force is small but is large enough to cause the contact plate to bounce away.

This is like a pencil dropping onto a floor, we can see the pencil hitting the floor and bounced up. The pencil will settle on the floor after a number of bounce.

This bouncing results in intermediate contract between the metal, and can be catches very quickly by the electronics. This also results in what is known as the switch glitches.

This is not too critical for some electronics, but for others, it may result in undesirable results. Designing a mechanical switch which is glitchless can be difficult. A practical way to remove the signal glitches would be through electronics components and design. Microcontroller is very popular in most circuit design, and the firmware can also be written to remove these unwanted input switch glitches.

The oscilloscope’s screen capture on the left shows the glitches produce by the following PCB mounted tactile push button switch.

The signal captured is the input signal, when the push button is released. These glitches can sustain its noise for as long as 5-15ms. The slower the switch is release, the longer the glitches can be generated.

The glitch behavior depends very on the mechanical switch design. There are switch which can produce a clean digital on/off signal. However, it is best not to assume that the noise will forever not appear. It is still better to assume the possibility of generating noise to design your input circuit properly.

A simple way to remove such switch glitch noise is to insert a capacitor of let say 100nF between the input signal and reference ground.

 

Common Switch Information (name, dimension, circuit)

Toggle Switch (chasiss mount)

toggle switch

Toggle switch dimension and thread size 1/4-40 UNS-2A
Drill 6mm hole for tapping.

Typical Toggle Switch Dimension
toggle switch dimension and thread size
Toggle switch drill hole size
toggle switch drill guide

Vandal-Proof Switch (chasiss mount)

metalic switch 16mm

silver aluminum metal, 16mm, latching type, red LED ring, 12V, vandal-proof, metalic switch

Thread M16, 1mm pitch
Drill 16mm hole for tapping.

Typical 16mm metalic switch dimension
metalic switch dimension

Vandal-Proof Switch (chasiss mount),
Pizeo Switch

piezo switch

piezo switch

Cross section illustration of a pizeo switch
piezo switch diagram

Pizeo switch circuit

pizeo switch circuit

 

 

Singapore Customized, custom made Electronics Circuits & Kits

 

 

3. Mechanical Relay

 

 

Typical Mechanical Relay connection pin

 

This is a very important section. The introduction to this electrical control switch, call a Relay. It is basically a device to activate a mechanical switch, by electrical means. This is unlike a switch which is activated manually. In another words it is a device that convert electrical signal to a mechanical energy back to electrical signal again. Similar to mechanical switch, they can be described as 2P2T, single pole double throw, etc…

How it works? A electrical voltage will be applied to activate a coil in the relay. The coil being powered up, will generate a magnetic force that will attract the lever. This lever will be pulled towards the magnetized coil, causing an action that will switch the mechanical contact.

Why on earth this relay is for? Why is there a need to convert electrical to mechanical to electrical again?

A example would be that you may want to switch on your home 230Vac power remotely from your friend house 1km away. To do this, one possibility is to lay cables thick between your friend’s home and your home. The cable must be thick enough to handle the high current and 230Vac voltage. Using a 230Vac rated switch, which is relatively bigger in size, it can be mounted in your friends home in order to do the switching.

Another cool method is that you can deploy a relay to help switching the 230Vac in your own house, while a thinner wire and lower rating switch laid across your friend’s house. This is one of the use of a relay. To be exact, the relay helps to control energy from a electrical signal to a mechanical energy to electrical power. Other application can be, controlling a high power motor using tiny switch, or to switch on the house lightings using your computer system digital signal.

The application of relay is important, as it is still widely used in control application. It can be thought of as a amplifier. A powered signal can be produced by using a small signal. This principle is similar to the use of a transistor as a switch. Knowledge in the relay will certainly aid understanding the transistor, commonly seen in circuit interfacing.

 

Example of an electrical circuit using a relay

 

 

There maybe times where you need to activate a relay, for certain logic output. The digital signal from the logic IC might not be able to turn on the relay coil. This is because the logic IC are not design to drive load that requires high current. To drive a high load device such as a relay or motor, a transistor can be interfaced between the logic and the supply to power up the load. The following diagram illustrate the circuit. More information about using a transistor as a switching device, can be found in the later section “Transistor

(fig.3a) Digital Logic interface to a Relay as output using transistor.

 

Another common use of relay is to act as a isolator output for communication or I/O between unknown electrical system. This isolated output acts as a mean for electronic hardware to communicate without affecting another electronics system. System design will be simpler, while integration/troubleshooting work will be easier and faster, because system can be isolated easily.

For example, one company may have a robotic application which require mobility and high current discharge. A 12V SLA sealed lead acid battery would certainly meet this requirement. A mobile phone company is following the market trend and will be designing a 3.3V electronics circuits which has the advantage of size and energy efficiency. Another one may choose to deploy 5V system, because they have been using some critical component which requires 5V. How are their design able to communicate or control another system using a different voltage system. They may use communication standard like RS232 to communication between systems. However the design will be considerably too complex if the communication requires only 1 bit of information, either on or off.

The operation of a relay as an isolated output is simple. The system X that activate the relay provides a switch contact to indicate logic 1 or 0 to the receiving system Y. Y provides its own power and interfacing circuit to sense if the switch is close or open. Since there is no voltage interaction between the two system, some people defined this as a “Dry Contact interface”. System X activating the relay has provides a “Dry Contact” or a switch contact output without any electrical signal transmitted to system Y. Dry contact does not mean that no electrical current flow. It simply mean that Y will provide it’s own electrical circuit to obtain the output signal from X. For further information on detecting switch status, you can refer to the section on mechanical switch.

In this scenario, the relay acts as a output isolator, providing a logic signal without any direct interference to the receiving system Y. Y will interpret the switching action, just like a normal mechanical switch. Implementing such a isolated design, it makes the system modular just like a black box. Certain input will be responded by a defined output result. On site deployment will be easier, and system troubleshooting can be a lot faster.

The important points to note when choosing a relay is to purchase the correct coil voltage rating, and the relay’s switch current handling capacity. When the coil is to be activated from a 12V signal from a circuit, you need to get a relay that can be trigger by 12V. There are various input rating typically 5V, 6V, 12V or 24V to choose from. Remember to take note of the voltage system your electronics circuit is running, before any relay purchase. On the switching side, you need to determine how much current will be flowing through the relay. If you need to turn on a high current rated device, make sure you get a relay that can handle the maximum current/power the device can draw from the supply. As a guide, choose a relay switch that have a current rating 2 times the maximum expected current that will be drawn. This would be quite a safe margin to prevent further complication due to temperature or other environment factor. A higher rated relay switch will be bigger. It is a trade off to decide upon. Cost ranges from S$3 to S$20. Relay can wear out and need replacement. There are socket available, so that the relay can be plug in and out for replacement easily. They are available for about S$5 to S$10, with choices like DIN rail mounting, PCB mount, etc…

Compare to current known technology, the relay is able to provide a higher current handling capacity, and higher isolation between system.

http://www.kpsec.freeuk.com/components/relay.htm

The disadvantage is that relay have relatively shorter operating life due to mechanical wear and tear. It also make tick tack noise produce by the mechanical action. The switching could also produce unwanted mechanical glitches. When switching high voltage power, because of the large voltage difference between both end of the contact, arcing will be produced during the switching. This arcing spike can weld the contact bit by bit, and after a period of time the contact can eventually be welded together. The relay will then be useless since it is unable to do switching. Therefore the mechanical relay component is unsuitable for switching high voltage power line.

Although there are a number of disadvantages, it is quite popular because of the ease of using it. Troubleshooting is a bit easier because you can hear or see a relay operating. Unlike a semiconductor devices, measuring instrument or indicator display is require as an aid to troubleshooting.

 

Mechanical relay selection design article from ECN Asia

 

 

 

Singapore Customized, custom made Electronics Circuits & Kits

 

 

4. Reed Relay

 

 

 

    

            

 

 

 

Reed relay is a smaller version of relay. Package is in plastic. It is about the same size as a 14 pin DIP IC socket. It has a slightly different magnetize structure, however the principle is the same as a mechanical relay. Since it is small, this reed relay is suitable for handling signal, and not high power or high current drawing load. Switching sound is hardly noticeable. You can still be able to hear some tick tick sound when it is activate. Switching speed is considerable faster than a relay because the switch mechanism inside the package is small.

Application for a reed relay can be for output signal isolation purposes or for switching on small current load. Example of small load devices that can be switched on might be LED, DC buzzer, relay, circuit or sensors. Typical current handling capacity is of about 0.5A load.

Reed relay comes in different type of forms. Forms refers to the nature of the switch contact. For further information on “contact forms”, refer to the switch section above.

Typically swtch form is a single pole single throw switch (SPST or Form A), Typical input coil voltage is of about range  from 3V to 12V. Load coil current is typically 10mA for a 5V reed relay. Cost is about S$2-5

A number of time I encounter product issue with the reed relay, and have to spend a lot of time de-soldering the component out for a replacement. I will recommend building a simple tester to test the reed relay.

For a 1A05 relay, the coil resistance is typically 500Ω. Some new reed relay can measure 500Ω, but after pumping 5V across the coil, the resistance might drop to 100-300Ω or even 0Ω. This might be due to the faulty coiling wire which go shorted inside the reed when the current is applied. Once the short occur, power supply may experience the short circuit. Fuse or transistor in the circuit may get damage due to the short. The output contact of the relay might not work properly, and should be checked as well.

Reed Relay Tester (2009-10-20)

 

 

 

click here to
Buy 5V Mini Relay Switch
Available Now at the PIC-store

 

 

Some part number that you can refer to, for Reed Relay products. Part no. description example “1A05” means the relay is of forms 1A, and is activated by 5V.

DSS41A05B, DSS41A05, DSS41A12, DSS41A24, MSS41A05, MSS41A12, MSS41A24, EGE EDR201A05000, ALEPH DA1A05BWD

CP Clare Be
MSS4 60003, 40-97


GI Clare, Taiwan , DYAD
DSS41A12, 52-89

Celduc Relais
D1A3100 (5V reed relay)

HAMLIN
HE721A0500 (5V reed relay)

 

 

 

 

Singapore Customized, custom made Electronics Circuits & Kits

 

 

5. Solid State Relay

 

 

 

 

 

    

 

 

 

Typical Solid State Relay connection pin

This is newer switch device known as Solid State Relay (SSR) or MOSFET relay. It is a semiconductor device, to replace the mechanical relay as a reliable alternative. In solid state relay, the input and switched output have voltage polarity. Be careful not to connect to the wrong terminal. Some SSR are design to have the same package and pin layout design as a reed relay. It looks like a reed relay. You can differential between a reed and a SSR device by testing it’s input terminal. A reed relay is able to function with a reverse input priority, however a SSR will not be able to function with reverse input priority.

The solid state relay can be smaller than a mechanical relay. It is a soft start device and does not result in current slug or arcing effect. It has no mechanical switching and is able to do faster switching. This mean that there are no noise, no glitches mechanical switching, lesser wear and tear. All these advantage adds up to longer lasting and more reliable device. The device works with a wider range of input voltage (typical 3V to 12V) and consume relatively less power to turn on the switch.

Like other semiconductor devices, they do have their disadvantages. The component have current leakage when inactive and dissipate heat during operation. Heat sink may be required to prevent overheating. With a heat sink mounted, the whole design could be a lot larger than the mechanical relay alternative. The heat sink itself can be up to 5 times the size of the SSR. If you don’t want to mount the huge heat sink to the device, you can try using a SSR that have a much higher current rating, of at least 2 times the capacity of what is required. At least it will not be very hot. If possible, mount it to a metal chassis or metal surface to act as a heat sink to dissipate the heat.

There are various model of SSR in the market which can take AC load 230V/150V and there are models that can handle up to 12Vdc 40A power. Price ranges from S$5 to S$150, depending on the requirement for the load rating. You may try visiting Crydom or Clare for more information on these devices.

In today’s competitive market, semiconductor product advances very quickly. Greater performance design might have been already out in the market at this point in time. You can try searching around for new products to keep in touch with the current technology. Free Electronic Engineering Times magazines from Global Sources, provides good information on technology trends as well as the latest electronic product that is rolling out onto the market. It is very likely that the semiconductor devices model for example, solid state relay, integrated circuit IC, transistor, that are presented on this page might be already behind time.

 

 

 

 

Some part number that you can refer to, for Solid State Relay,

CRYDOM

– d1d40 (support 40A DC current)
– d1d20 (support 20A DC current)
– XBPW6025C (current leakage 1mA)

CLARE
- CPC1218Y, CPC1510, GI Clare PRMA1B05 (form1B input 5Vdc)
- CPC1008N (form 1A, 100Vp, 150mA, 8
Ω)
OMRON
- 61CR, 61G
STMicroelectronics
- vn02n
VISHAY
- LH1500AT, VO1400AEF, VO14642AT
- LH1535AAB, LH1535AT
(DIP-6 or SMD-06 package, 1 Form A, Vmax 400V, I max 0.12A, Ron max 25 Ohm)
reference: http://www.vishay.com/solid-state-relays/

FOTEK
      

- SSR-25 DA (current leakage 3-5mA)




Leakage Current problem with solid state relay
In an ideal condition, when the input to the solid state relay is activate, the output will turn on, when there is no input, the output should be completely turn off.
In practise, solid state relay output do have some little current flowing, even when the input is not activated.
This little current is also known as a leakage current.
When connected to a big load, this current leakage will not cause any problem,
because the small current will not be able to activate the load.
Example of such a load can be a motor or heater.

When the same solid state relay is connected to a small load, for example, a LED, a lamp indicator, or an energy saving light bulb, the small leakage current can be enough to activate the load.
For LED indicator load, the lamp will be constantly turn on. For energy saving lamp, you may notice that the lamp is flickering.

In order to remove this leakage current, a load can be permanently connected across the output, so that this leakage current can be consumed.
A load can be a AC fan, motor, AC step down transformer, high wattage resistor etc... to remove the leakage current from the solid state relay. When connected in parallel with the indicator, the indicator will not be lighted up.
This is because a significant portion of the leakage current is supplying to the new load. This channelling of current, means that there are less current flowing to indicator.
If this current is low enough, the LED will not be lighted up. The significant portion of the leakage current will be flowing to the new load.
Since a fan/motor load cannot be activated with a small leakage current, nothing can be observed.
Leakage current problem will not become obvious to a typical user. To be precise, the little current probably consumed and converted to heat on the load by a tiny tiny bit.

Using a load across the solid state relay can help to dissipate the leakage current. It is a load which waste energy doing no work. More energy will be wasted when the solid state relay is in the on state.

A typical resistor load also known as "bleeder" resistors", can help dissipate the leakage current. According to many other reference it could be 22Kohm 1/2 watt to 30Kohm 1W.
Heat will be generate. Be sure to compute with a matching resistor wattage. My computation is about 23Kohm 2 to 3W.

Leakage current is due to the snubber networks (R-C circuit across the output used to improve the commuating for inductive load).

 

Singapore Customized, custom made Electronics Circuits & Kits

 

 

6. Transistor as a switch

 

 

 

 

 

 

Resemble circuit between the transistor and switch

(fig.6a) typical transistor interface, as a switch. Acts a voltage or signal converter, also known as a level shifter.

 

(fig.6b) switch interface function resembling fig a.

 

(fig.6c) opto-coupler interface.

 

(fig.6d) resembling opto-coupler interface, compare fig c.

 

 

 

Using transistor as a switch to drive high current loads

(fig.6e) Digital Logic interface to a Relay as output using transistor.

– npn transistor “BC549” to drive up to 0.1A load

– npn transistor “2N3019” to drive up to 1A load

– npn transistor “tip31a” to drive up to 3A load

(fig.6f) same transistor setup to drive a motor.

 

The switching setup to drive the coil load On/Off, can generate “spike voltage”. This is due to the sudden On/Off switching from the transistor. The same applies when replacing the transistor with a mechanical switch. A diode can be connected across the inductive coil load to divert the spike voltage away from the transistor, as shown in the following diagram. This diode has a name known as a flyback diode. The spike voltage can be high enough to damage the transistor (exceed the transistor’s breakdown voltage).

Transistor is often found to be permenantly short circuit, if the flyback diode is missing, disconnected or not working. Another symptom could be transistor is permenantly opened circuit, which happens after some time being short circuit. The short circuit current could probably burn up the shorted conection.

Flyback diode to protect npn or n-ch transistor

(fig.6g) flyback diode typically 1N4148 (for small current rating), to divert the spike generated by the inductance away from the npn or n-ch transistor. Refer to diode selection guide for higher current rating.

 

Flyback diode to protect pnp or p-ch transistor

 (fig.6g) flyback diode to protect a pnp or p-ch transistor

 

Analog Devices, IRF (International Rectifier), MAXIM, National Semiconductor

 

 

A switch is a mechanical to electrical conversion device. Transistor is similar to a relay. It converts between electrical system. A voltage logic of 0V 3.3V is able to convert to and from 0V 5V. A voltage logic of 0V 12V is able to convert to and from 0V 9V.

Transistor can be used as a switch or as an amplifier. A transistor as an amplifier needs more brain power. In this section, we will only discuss on using a transistor as a switch. Simple lesson.

As you might have know already, the transistor is actually a semiconductor device. In general, it is a conductive device. Transistor is a variable conducting switch. If you can still remember the main topic of this article. Yes. It is all about switch. Transistor is also a form of switch. The fundamental understanding of using/choosing a transistor, is in fact very similar to selecting a switch or wire. In this section “Transistor as a switch”, you should always think of a transistor as a switch. Think of it in the way that transistor can be a substitute for a switch. The switch can be a substitute for transistor. Compare between the transistor and switch, you will see a clearer picture of the transistor operating like a switch.

When I first learn the term transistor as a switch, I didn’t understand what my lecturer is trying to say. After some experience with the transistor, I finally become aware and understand that what the book is trying to say. The subject is title “transistor as a switch” for a reason. We have to think of it as if it is a switch.

Similar to a relay, the switching action of the transistor can be activated from a voltage input. Sufficient voltage input to the base of the transistor will make the collector and emitter terminal saturated, also known as Vce(sat). In another word, the collector and emitter terminal will be almost shorted like a switch. Technical it means Vce(sat)=0. In practise, Vce(sat) will never reach 0V. It will be slightly higher than 0V,  for example Vce=0.2V. Fig a, shows a typical schematic for a switching transistor. This is very similar to the switch interface in Fig b.

Resistor R1 is chosen so that sufficient current is supplied to the base of the transistor. In most cases 1kΩ  would be ok. Over driving the input will burn off the transistor, while under driving will not provide enough current to switch the transistor to fully saturated. For example, an input 3.3V is to turned on the transistor. Assuming the transistor parameter has a turn on voltage Vbe of 0.7V, with minimum requirement Ib of 2.6mA for terminal Vce saturation to occur. R1 should be chosen not more than 1kΩ “(3.3V-0.7V) / 2.6mA”. Any resistor greater than that, will not be able to provide enough current to turn on the transistor. A resistance too low for R1 will results in higher current, though likely to damage the transistor. Refer to the transistor datasheet for appropriate R1 value, or you can do a quick experiment to determine the R1 value to implement.

The design value for R2 resistor should be considered based on the input devices the switch signal will be feeding to. A low resistance value for R2 (example: 470Ω) consume more energy. This is because more current will flow through the resistor when the transistor switch is turned on. A higher value R2 (example: 10kΩ) conserved energy, however input response may be slow for certain charging devices. Example would be a ADC (analog to digital converter). The input signal requires faster charge-up/discharge for sampling to take place. A higher R2 will reduces the current and slow down the sample & hold process.

I seldom do computation on transistor when it is used as a switch. When you get used to it, you will get to understand the behavior of this component and eventually understand the computation of a transistor.

 

 

 

 

Typical transistor circuit acting like a switch. The control signal is from a low current supply IC (for example a microcontroller).

 

More information

For pnp transistor, the concept is the same as npn transistor. When do we used it? When your logic depends on positive voltage as a reference to switch on the transistor.

To understand this further, you need to realized that a single wire has a potential voltage. But exactly what the voltage is, you will not be able to define it.

This concept is like what I understand from the teaching of Tao. Tao is a Chinese philosophy teaching. Take for example, a wooden stick in my backyard garden. Some people say that the stick is long. But how long would you consider it as long. Compare it with the paper clip on my desk, it is long. Compare it with the river flowing down to the sea, the stick is too small to be seen. The fact is when we say the stick is long, we are comparing it to something we have in our mind. Comparing to a reference point is the key. The relative difference is the key concept.

This is the same as the voltage potential on the wire end. The open end wire has a potential. When we want to read the voltage of the wire, we are actually reading it with reference to another potential. The difference between the two potential is the voltage being read out. To know what is the voltage is on the wire, we need a reference point. Assume we read a voltage of 5V with reference from a ground potential. We will read the same wire as -7V if our reference is on the 12V potential. The voltage level is a very relative thing. Comparing to another ground reference, the voltage might be 100V. Voltage is relative. The same open end wire can be 5V, -7V, 100V at the same instant of time. This is because the reference used in each measurement is not the same.

To turn on a transistor, you need to provide a voltage difference between the base & emitter. You need 2 point to turn on a transistor. Only a wire to the base will not turn the transistor on. You need a pair of wire. One wire to the base, the other wire to the emitter terminal.

PNP has its emitter terminal on the positive end, while npn has its emitter terminal on the negative end.

Given a voltage system of 5V & Gnd (0V). If I have a logic 5V which I need to use it to switch on a transistor. For this case, I can use Gnd as the reference. Between this logic 5V and Gnd, is a voltage difference which can be applied to the transistor, to switch it on.

If the reference I used is a 5V. The logic 5V will not be able to switch on any transistor devices, because the voltage between logic 5V and reference 5V is equal to 0V difference. A transistor will need a voltage difference for it to be switched on. Typical textbook voltage is 0.7V which is our Vbe. Reference line to be connected to the emitter terminal. Logic or signal line to be connected to the base.

Now we know that we have logic 5V & reference 0V. We know that npn transistor would be the component for this switching on job.

Given another situation where you have a logic 0V signal which you want it to switch on your transistor. The voltage reference should be 5V. Present voltage difference to the transistor would be -5V. PNP transistor is chosen this time.

Another illustration to looking at a npn & pnp transistor is to look at the arrow on the transistor symbol. The potential of the arrow head should be lower than the arrow tail by typically Vbe 0.7V. Voltage difference can be more than 0.7V but base resistor should be present. The resistor is there to absorb all the unapplied voltage, so that Vbe can be maintain at 0.7V. If no base resistor is present, the base current is so large that the transistor will be damaged. In all the example used 1kΩ would be quite enough.

This is how we can look at a transistor as a switch.

 

 

NPN to PNP converter using npn pnp transistor

For Vcc = 12V, Vin = 3.3 to 5V
R1 = 1Kohm,
R2 = 10Kohm,
R3 = 10Kohm,
R4 = 100Kohm,
Q1 = BC817,
Q2 = BC807

 

Digital logic 1 (3V3, 5V) to Vcc converter,
NPN to PNP converter.


if Vcc is 12V
logic 1 -> 12V out
logic 0 -> 0V out


For input logic 3V3-5V R1 can be about 1Kohm. For Vcc 12V, R2 R3 can be about 10Kohm.

R2 is a pull up resistor. When Q1 is not turned on, the voltage V1 will be float at a undetermine state. This might result in Q2 pnp transistor being turned on slightly. R2 pull up resistor will ensure that the base of Q2 is tied to Vcc, therefore ensuring the Q2 is shut off.

R3 can be about 10Kohm. This should be large enough such that Q1 & Q2 will not be burned when they are switched on. Q1 collector-emitter junction will be shorted when it is switched on (Vin logic 1). Q2 Veb is about 0.7V when switched on. The value of R3 should be small enough for Q2 to turn on, big enough such that it don’t burn Q2 or waste too much energy.

Vout is about Vcc when input Vin is logic 1, and is 0V when input is logic 0. R4 is a pull down such that when Q2 is turned off, Vout does not becomes a floating voltage. R4 can be about 100Kohm

Logic inverter circuit using npn npn transistor

For Vcc = 12V, Vin = 3.3 to 5V
R5 = 1Kohm,
R6 = 10Kohm,
R7 = 1Kohm,
R8 = 100Kohm,
Q1 = BC817,
Q2 = BC817

Logic inverter circuit.
The circuit uses 2 npn transistor and
is similar to the one using npn pnp.


The input logic 1 will provide Vcc out, 0V will have Vout 0V. If the Vout is used to drive a load (input coil of a relay), the activation of the load is actually inverted.

For logic input 3V3 to 5V
R5 can be about 1Kohm.
If Vcc is 12V
R6 10Kohm, R7 1Kohm,
R8 100Kohm

Different form of transistor packing. Higher power rated transistor having a higher capacity to conduct more current is usually bigger in size. Typical power transistor have metal casing packaging which helps to dissipate possible heat generated by the large flowing current.

 

Various type of transistor packages.

The following guide present the typical package model name for transistors.

Click the image for the enlarge view.

(with courtesy from RS Components)

 

SOIC-8 package (typical pin out for n-ch)
source- pin 1,2,3 (gnd ref)
gate- pin 4
drain- pin 5,6,7,8

SOIC-8 package (typical pin out for p-ch)
source- pin 1,2,3 (Vcc ref)
gate- pin 4
drain- pin 5,6,7,8

 

Transistor selection references

 

The following are some of the common npn and it’s complementary pnp transistor ranging from low to high current ratings.

 

Commonly used smd package for transistors,

– sot-23 (for <1A)

– so-8 (for 1A up to 20A)

– dpak (for >10A up to 200A)

 

My own transistor classification

– Signal Transistor (0.1A)

– Medium Power Transistor (0.5A – 1A)

– Power Transistor (>1A)

– High Power Transistor (>20A)

 

NPN

PNP

Amp

Package

Vce

Gain

bc546

bc556

0.1

to-92

65

 

bc547

bc557

0.1

to-92

45

 

bc548

bc558

0.1

to-92

30

 

bc549

bc559

0.1

to-92

30

 

bc550

bc560

0.1

to-92

45

 

bc846b

bc856b

0.1

sot-23

80

450

bc847c

bc857c

0.1

sot-23

50

800

bc848b

bc858b

0.1

sot-23

30

450

bc817-16

bc807-16

0.5

sot-23

50

160

bc817-25

bc807-25

0.5

sot-23

50

250

bc817-40

bc807-40

0.5

sot-23

50

350

bc818-16

bc808-16

0.5

sot-23

30

160

bc818-25

bc808-25

0.5

sot-23

30

250

bc818-40

bc808-40

0.5

sot-23

30

350

NPN

PNP

Amp

Package

Vce

Gain

2n2219

2n2905

0.6

to-39

40

300

2n2222

2n2907

0.6

to-18

40

300

pn2222a

 

1

to-92

40

300

mmbt2222a

 

1

sot-23

40

300

pzt2222a

 

1

sot-223

40

300

2n3019

 

1

to-39

80

300

bc141-16

bc161-16

1

to-39

60

250

NPN

PNP

Amp

Package

Vce

Gain

tip31

tip32

3

to-220

40

50

tip31a

tip32a

3

to-220

60

50

tip31b

tip32b

3

to-220

80

50

tip31c

tip32c

3

to-220

100

50

tip120

tip125

5

to-220

60

1000

tip121

tip126

5

to-220

80

1000

tip122

tip127

5

to-220

100

1000

tip140

tip145

5

 

60

1000

tip141

tip146

5

 

80

1000

tip142

tip147

5

 

100

1000

tip41

tip42

6

to-220

40

75

tip41a

tip42a

6

to-220

60

75

tip41b

tip42b

6

to-220

80

75

tip41c

tip42c

6

to-220

100

75

N-ch

P-ch

Amp

Package

Vds

Ωon

2N7002F

 

0.475

sot-23

60

2

 

BSS84

0.13

sot-23

50

10

N-ch

P-ch

Amp

Package

Vds

Ωon

irf510

 

5.6

to-220

100

0.54

 

irf9510

4

to-220

100

1.2

irf740

 

10

to-220

400

0.55

NPN

PNP

Amp

Package

Vce

Gain

2n3055

mj2955

15

to-3

60

 

N-ch

P-ch

Amp

Package

Vds

Ωon

IRFH8242PbF

 

8.5

 

25

0.013

Si4800BDY

 

9

so-8

30

0.0185

Si4410BDY

 

10

so-8

30

0.0135

fds5670

 

10

so-8

60

0.014

rss100n03

 

10

so-8

30

0.019

std10pf06

10

dpak

60

0.2

irf8707pbf

 

11

so-8

30

0.012

 

irf7424

11

so-8

30

0.0135

 

fds6675

11

so-8

30

0.014

 

irf7220

11

so-8

14

0.012

phd3055l

 

12

 

60

0.18

 

irf9530

14

dpak

100

0.2

 

irf7410

16

so-8

12

0.007

ntd18n06g

 

18

dpak

60

0.05

irf8736pbf

 

18

so-8

30

0.005

irf7862pbf

21

so-8

30

0.004

 

irf9540

19

to-220ab

100

0.2

 

irf9540n

23

to-220ab

100

0.117

fds6064n3

23

so-8

20

0.004

irf8788pbf

24

so-8

30

0.003

irf540

 

28

to-220

100

0.077

irf540n

 

33

to-220ab

100

0.044

 

fdd4685

32

dpak

40

0.027

ntd40N03r

 

45

dpak

25

0.013

phb45n03lt

 

45

dpak

 

 

ntd5406n

 

70

dpak

40

0.009

irf2903z

sub75p05

75

 

 

 

stb80ne03l

 

80

 

 

 

85n3lh5

 

80

dpak

30

0.005

irfs3306pbf

 

120

dpak

60

0.004

irfs3107pbf

 

195

dpak

75

0.003

 

 

 

Note: This is a summary reference. Always refer to your datasheet for actual component’s specification.

 

Opto-coupler although look & work much like a transistor, has a slightly different properties. To turn on the transistor inside the opto-coupler, light is used instead of the pair of wire potential difference.

opto-coupler circuit example

Various analog switch and opto-coupler product.

Analog switch,

CD4066BC, ADG451, ADG452, ADG453, ADG511, ADG512, ADG513

 

Opto-coupler (0.1A)

4N25,4N26,4N27,4N28

TLP521-1 (1 channel, 4pins), TLP521-2 (2ch), TLP521-4 (4ch)

 

Opto-coupler with higher Vce breakdown voltage. (for interfacing to a DC output, that has an unknown relationship to 230Vac)

SFH619A (1ch 4pins)

FOD852 (1ch 4pins, small smd), cheaper ***

H11D1, 4N38M (1ch 6pins), cheaper ***

SFH640 (1ch 6pins)

NTE3088 (1ch 6pins)

 

 

Solid State High Breakdown Voltage Version (non-compatiable to above)

LH1501BT

CT130

 

 

Logic level translator
logic voltage converter

Using MOSFET and 2 resistor to convert a logic voltage from one to another. In this circuit example, a 3.3V logic is convert to a 5V logic.

Warning!!!
This is a very simple logic translator. Please take note that it the 3V3 power is lost, the output logic will be always at 5V. For critical mechanical or machine control, this interface is not recommanded.

opto-coupler interface to n-ch MosFet driving high current load

Interfacing opto-coupler IC to a N-ch Mosfet. If input is on, MosFet will be on.
R3 resistor is to absorb the opto coupler leakage current, and to ensure N-ch gate pin is tie to gnd at all times.

opto-coupler interface to npn MosFet driving high current load

Interfacing opto-coupler IC to a N-ch Mosfet. If input is on, MosFet will be on.
The npn and the npn from the opto-coupler forms a darlington pair.

 

 

Singapore Customized, custom made Electronics Circuits & Kits

 

 

7. Triac , the electronic AC switch

 

 

Triac

 

 

Symbol for Triac (conduct current in both direction).

 

 

 

Equivalent circuit for Triac component.

 

The equivalent circuit for the Triac component is actually two thyristor connected in a up and down orientation.

 

 

Diac

 

 

Symbol for Diac (conduct current in both direction with no gate control).

diac’s current voltage properties

 

Thyristor

The Thyristor is a solid-state semiconductor device, also known as SCR (silicon-controlled rectifiers). Unlike a triac, thyristor conducts in a single direction. Like a controllable diode or similar to a triac triggered transistor, it is typical use for controlling DC current. The symbol for thyristor,

 

taken from, http://www.cybermike.net/reference/liec_book/Semi/SEMI_7.html

 

Article on Thyristors and Triacs. (references from Philips Semiconductors)

Thyristors and Triacs application.pdf

 

 

 

Triac is a semiconductor. The device package is very similar to the package for transistor. It is used for switch AC power from the mains. I have no experience in this devices, and is looking forward to try this out.

I have found a very easy to read article relating to Triac as follows. So exciting. I will come up with something soon.

http://www.signindustry.com/electric/articles/2000-11_ALDORtriacexplainted.php3

There are 3 component type which I classified them in the same family.

– Thyristor or SCR (Silicon-Controlled Rectifier)

– DIAC

– Triac

Thyristor or SCR (Silicon-Controlled Rectifier), you can think of it like a voltage triggered diode. The component will starts to conduct at both end of the pin upon triggering the gate, and auto shutdown when the voltage at the conducting pin falls below a specific voltage. Diac is another type of Thyristor. DIAC, or diode for alternating current. It does not have gates.
Triac is a bidirectional triode thyristor. You can think in terms of two thyristor conducting in both direction as shown in the left illustration.

Like transistor the metal tab on the package is used as the interface for heat transfer. Heat sink can be mounted to dissipate the heat away from the conducting component. Some model have the tab connected to one of the live conducting pin. It may helps conduct away heat better but is rather dangerous. For safety reason, isolated tab would be prefered.

The following is a quick guide to getting your triac components. Please take note that every component do varies from various manufacturer. Always refer to the component datasheet and physically check the component.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

references:

http://www.epanorama.net/circuits/semiconductor_relays.html

 

 

Triac Switch Circuit:

Triac switch circuit & measurement

This circuit is a solid state relay interfacing a low digital voltage for controlling the 230Vac power supply to the AC device. In this example, I am powering up an AC motorized fan. This is almost the same as a mechanical relay. Solid state relay does not have mechanical parts which can wear off over the period of time.

The digital and AC power is being isolated by the opto-coupler triac IC, making it safe and easy for a digital microcontroller/circuit to control a high voltage device.

Triac Switch Circuit Schematic:

As shown on the schematic, the circuit uses MOC3021 opto-coupler triac which has a zero crossing detector built in. The zero crossing function will help ensure that the triac will only be switch on when the AC power (Live & Neutral) is at zero potential. If the potential across the Live & Neutral is high during switching, a large spike/EMI (electromagnetic interference) nosie will be generated. The zero crossing detection will ensure minimum spike generated. This can significantly reduce the noise on the power line.

The circuit is suitable for on/off application and not suitable for example light dimming or speed control application.

Measurement connection:

On the left presents the circuit setup and connection for measurement. If you are interested in the setup for measuring 230Vac signal, please visit this page dedicated to 230Vac.

 

 

 

Using the Traic for switching appliances. (2012-06-03)

There are many advantage using a Traic to switch on/off 230Vac appliances compare to using a mechanical relay.

Traic does not produce noisy clicking sound made by a mechanical relay. It does not have moving parts, therefore there are no physical wear and tear. Its physical size is also much smaller. It is a soft start device and does not generate arcing during when switching 230Vac power. Mechanical switch on a 230Vac power tends to generate arcing. Arcing over a long period of time results in the switch being welded, hence relay failure. The operating lifespan of a Traic is much better then the mechanical relay.

Traic can easily be design to operate from a very low voltage device. A mechanical relay current need at least 5V to 24V to enegised the relay’s coil to pull the switch. It uses more energy. Traic can be easily design to operated from a very low voltage, and power consumption is lower.

Besides switching 230Vac on/off, Traic can be design to fine control the motor speed or a heater temperature through a potential meter or microcontroller. Mechanical relay would not be able to achieve all these.

 

The picture on the left is a setup using PIC-117 mini relay switch, purchased from PIC-STORE.

This Triac circuit (PIC-117) was installed inside a wall switch enclosure for testing. The enclosure will ensure safety when operating the Traic circuit. Always be safe when working with 230Vac.

The dangling wire (grey and white) is the PIC-117 digital input. The wire is safe for hand to touch. A voltage as low as 3.3V can be applied to this input to switch on the appliance. PIC-117 accept digital input range from 3.3V to 12V, and can be easily modified to accomulate any range of voltage input.

This setup will be a switching module for any 230Vac appliances. For this demo, I am using a 9V battery to activate a Fan. Typical practical scenerio is to use a microcontroller (3.3V or 5V) to interface directly to the PIC-117 mini relay module.

A power meter is plugged onto the incoming power source. The wall box enclosure (with PIC-117) is plugged onto the power meter. The fan appliance is the last item, which is plugged onto the wall box enclosure. This power meter will measure the power rating, which helps us understand of Traic performance.

This is an ordinary fan appliance setup pior to the Traic setup. The fan’s brand is an Akira (400mm 48-52W stand fan). A power meter is used to measure its typical power consumption.

Power measurement of the fan at various fan speed,

          Watt   Current Power Factor
          —–  ——- ————
Speed1 -> 30.0W  0.148   0.90PF
Speed2 -> 35.0W  0.164   0.92PF
Speed3 -> 41.0W  0.179   1.00PF

Power measurement of the fan at various fan speed through PIC-117 mini relay switch.

          Watt   Current Power Factor
          —–  ——- ————
Speed1 -> 29.7W  0.147   0.87PF
Speed2 -> 35.0W  0.163   0.89PF
Speed3 -> 40.9W  0.177   1.00PF

The result shows that there isn’t much different in power consumption using a Traic or not.

The following are some video clips of using the PIC-117 mini relay switch module to turn on/off the 230Vac fan.

Video showing that it is safe to touch the digital input of the PIC-117 module. MVI_0346.AVI (17.3MB)

Turning on and off the fan using a 9V battery simulating a low digital input voltage. MVI_0347.AVI (31.6MB)

Notice that the fan is turn off and on instantly without making any noise or spark. The PIC-117 mini relay switch module is small and has much more capability than the traditional mechanical relay.

 

click here to
Buy Mini AC Switch Relay
Available Now at the PIC-store

Looking into how the Traic perform

Signal of the triac switch output, when the 230Vac mains is at the off state.

Signal of the triac switch output, when the 230Vac mains is switched on. Some signal passed through the triac although the triac is not switched on yet. There is some leakage but they are not significant enough to turn on the AC motorize fan.

The green signal represent the digital input to the opto-coupler. The red signal shows the power output becoming live, 100msec after the digital input is being triggered. There is some small delay.

The first few cycle of the 230Vac power is badly distorted, but we can see that the AC signal started off from zero. There is no sharp switching.

The first few cycle has come noise distorting the 230Vac 50Hz. The subsequence cycle shown on the photo, has less and less distortion.

Less and less distortion.

Within a very very short time after the triac switch is activated, the output reaches a steady state and there are no more distortion.

Note that the oscilloscope reading is not 650Vp-p as expected. This is because of the voltage divider stage used for the measurement. In order to obtain the effective voltage measure, I need to multiple the result by 2 times.

 

 

The enlarge version of the 230Vac, measuring 650Vp-p.

Manufacturer for Triac, Thyristor/SCR components

        

 

 

References from other website:

SCR’s and Triac Tutorial.pdf

Triac component part number

 

AC Current

Gate Current

Peak Voltage

 

IC

6A

5-50mA

600,800V

 

BTA06

8A

5-50mA

600,800V

 

BTA08

12A

5-50mA

600,800V

 

BTA12

12A

2-4mA

650,800V

SOT82

BTA151

16A

10-50mA

600,800V

 

BTA16

20A

5-50mA

600,700V

 

BTA20

25A

35-50mA

600,800V

 

BTA25

25A

6-35mA

600,800V

 

BTA140

26A

20-50mA

600,800V

 

BTA26

40A

50mA

600,800V

 

BTA40

8A

10-50mA

400,800V

 

MAC9

1.5A

10mA

400,600V

 

TICP206

16A

12-50mA

400,800V

 

TIC246

25A

7-50mA

400,800V

 

TIC263

1A

3-10mA

600,800V

 

Z0103

Z0107

Z0109

 

Click here for Triac Selection Chart.

(BTA A means isolated tab, BTB B means non isolated tab, 12 means conduct up to 12A rating)

 

 

Triac optoisolator/opto-coupler

 

Zero Crossing

Input Trigger Current

Peak Voltage

IC

IC

X

15mA

250V

MOC3010

K3010P

X

10mA

250V

MOC3011

K3011P

X

5mA

250V

MOC3012

K3012

X

30mA

400V

MOC3020

K3020

X

15mA

400V

MOC3021

K3021

X

10mA

400V

MOC3022

K3022

X

5mA

400V

MOC3023

K3023

15mA

400V

MOC3041

 

10mA

400V

MOC3042

 

5mA

400V

MOC3043

TLP3043

X

15mA

600V

 

TLP3051

X

10mA

600V

 

TLP3052

15mA

600V

MOC3061

TLP3061

10mA

600V

MOC3062

TLP3062

5mA

600V

MOC3063

TLP3063

X

10mA

600V

 

TLP260J (smd)

X

10mA

600V

S2S3ADYF

 

5-10mA

600V

S2S4BY0F

 

 

SCR optoisolator/opto-coupler

Zero Crossing

Input Trigger Current

Peak Voltage

IC

IC

X

11-20mA

200V

 

H11C1

X

11-20mA

200V

 

H11C2

X

14-30mA

200V

 

H11C3

X

11-20mA

400V

 

H11C4

X

11-20mA

400V

 

H11C5

X

14-30mA

400V

 

H11C6

 

Please click the hyperlinks for the datasheet.

 

 

Example of a simple dimmer circuit for 230Vac lighting buib

Click the picture to enlarge.

 

Reference from Arrow Lighting

 

 

 

 

Example of a 230Vac adjustable water heater circuit for shower bath

 

 

The schematic on the left is taken from a 230Vac instant water heater circuit for our shower bath. The circuit is actually very similar to the dimmer for lighting bulb. Two diode is observed, and I believe these might be there due to the inductive load. It is just my guess. Other than that, it is just like the circuit above. The triac used is quite big, which is mounted to the heater copper casing.

Example of a AC Motor (230Vac) speed controller circuit

This is a circuit that can control the speed of an AC motor. The adjustable speed resemble again, the dimmer AC circuit that is presented earlier.

 

Other traic circuits

On the left are three recommended schematic that I have extracted from one of the opto-triac datasheet. The example clearly shows the minor difference for various type of triac & load.

The circuit (figure 6) for resistive load RL is the simplest, requiring only a 180Ω. The circuit (figure 7) for inductive load consist of additional resistor and capacitor. The additional capacitor is perhaps to balance the inductive load.

Figure 8 using a less sensitive triac to control the inductive load, hence the resistor is reduce from 2.4kΩ to 1.2kΩ, providing more current to drive the triac.

 

The capacitor 0.1uF, 0.2uF that feedback to the incoming voltage is known as the snubber circuit. It is there to protect the triac and other semiconductor device from the high voltage generated from an inductive load. The feedback may cause some problem for non-inductive load. The small leakage can be significant enough to turn on small load (for example, 230Vac lamp indicator). You will need to modify the circuit to prevent the leakage.

More information on snubber circuit are as follows,

AN-3008, RC Snubber Networks for Thyristor Power Control and Transient Suppression.pdf
AN437, RC snubber circuit design for TRIACs.pdf

digital to ac relay1Circuit 1

digital to ac relay2Circuit 2

digital to ac relay3Circuit 3

digital to ac relay4Circuit 4

Low voltage digital input to control 230Vac relay

The circuit examples on the left illustrate my testing, interfacing a low digital voltage to a triggered AC relay. The digital input allows 1.8V, 3.3V to 5.0V (min 5mA) which will be applied to the opto-triac. The opto-triac will switch the high 230Vac voltage should trigger the AC relay.

Circuit 1 is my first attempt of using the opto-triac to trigger the relay. However upon activation, the relay is observed to be chattering/vibrating on/off very fast. It seems to be virbrating at a rate of the AC power 50Hz. I am surprised about the behavior of this AC relay, thinking that a 230Vac should hold the relay still. Assuming that opto-triac might be causing the problem, I apply the 230Vac directly to the coil of the AC relay. The same relay chattering is observed. This means that the use of opto-triac in this design should be working properly. I might have to design a diode bridge and a capacitor to the hold the relay. This AC relay behaves very much like a dc relay.

Circuit 2 is my next few attempt to find out the effect of a capacitor in series to the AC coil. I was thinking that the capacitive acting as a resistance to the AC current might weaker the power, and relay trigger would fail; since the relay is a 230Vac relay. To my surprised, not only it can trigger the relay, the relay is able to hold the contact switch. This means that my interface would be simpler.

Circuit 3, I attempt to insert a 470Ω resistor to weaker the power, but it still works.

Circuit 4, I attempt to insert a 1k Ω 1/4W resistor. It still works.

Solid state relay circuit example using triac (taken from other website)

solid state relay circuit

solid state relay circuit

 

 

 

 

Relating to traic circuit (Zero crossing circuit/detector)


zero crossing 3

Zero Crossing Detector (IC)
H1AA1
ps2506

Phase Control Using Thyristors
an1003.pdf

IRPLCFL3: A ballast that can be dimmed from a domestic (phase cut) dimmer
cfl-3.pdf

Dimmer
http://www.jaec.info/Home%20Automation/efficient-energy-management/light-dimmers.php




 

Singapore Customized, custom made Electronics Circuits & Kits

 

8. MEMs relay

MEMs relay. This is still under development at this point in time when this article is written. Got to know about this new device while I was researching for materials on the topic presented on this page. The MEMs relay has all the attractive properties found on various relay solution in the current market. It could be the next popular component in near future. You may like to learn more about it through this link.

http://www.memagazine.org/backissues/jan01/features/reraces/reraces.html

 

 

 

 

 

 

email:    contact->email_siongboon 

website: http://www.siongboon.com

 

 

 

 

Keyword: Solid State Relay, Mechanical Relay, Reed Relay, Opto-coupler, PCB mount, DIL Rail mount, Electronic Electrical controlled Switch,

                thyristor, SCR, triacs, solid-state, semiconductor relay, DC SDR, AC SSR, diac

References:

Finder Relay
http://www.findernet.com/

 

Coto Technology
http://www.cotorelay.com/

SRC Devices
http://www.srcdevices.com/

Reed Relay
http://zone.ni.com/devzone/conceptd.nsf/webmain/4569AFDC6AC9160F86256E0C00753240
 

Crydom Solid State Relay
http://www.crydom.com/

Clare
http://www.clare.com/

OMRON
http://www.omron.com

 

Analog Devices
http://www.analog.com/

National Semiconductor
http://www.national.com/

IRF International Rectifier
http://www.irf.com/

Maxim, Dallas Semiconductor
http://www.maxim-ic.com/