ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING Tester of diodes and bipolar transistors. Encyclopedia of radio electronics and electrical engineering Encyclopedia of radio electronics and electrical engineering / Measuring technology Most modern testers (multimeters) have built-in functions for testing diodes and sometimes transistors. But if your tester does not have these functions, then you can assemble a diode and transistor tester with your own hands. Below is a tester project based on the PIC16F688 microcontroller. The logic for testing diodes is very simple. A diode is a PN junction that is known to only conduct current in one direction. Therefore, a working diode will conduct current in one direction. If the diode conducts current in both directions, then the diode is inoperative - broken. If the diode does not conduct in either direction, then the diode is also not working. The circuit implementation of this logic is shown below. This logic can easily be adapted for a bipolar transistor test that contains two PN junctions: one between base and emitter (BE junction) and one between base and collector (BC junction). If both junctions conduct current in only one direction, the transistor is working, otherwise it is not working. We can also identify the type of a pnp or npn transistor by determining the direction of current conduction. For testing transistors, the microcontroller uses 3 inputs / outputs Transistor Test Sequence: 1. Turn on output (set to one) D2 and read D1 and D3. If there is a logical unit on D1, the BE junction conducts current, otherwise it does not. If D3 is 1, then the BC conducts current, otherwise it does not.
Further, if BE and BC conduct current, then the transistor is npn-type and working. If, however, EB and CB conduct current, then the pnp type transistor is also working. In all other cases (for example, EB and BE conduct current, or both transitions of BC and CB do not conduct, etc.), the transistor is in a non-working state. Schematic diagram of the diode and transistor tester and description The circuit of the tester is very simple. The device has 2 control buttons: Select (selection) and Detail (more). By pressing the Select button, the test type is selected: diode or transistor test. The Detail button works only in the transistor test mode, the LCD screen shows the type of transistor (npn or pnp) and the conduction status of the transistor junctions. The three legs of the transistor under test (emitter, collector, and base) are connected to ground through a 1 kΩ resistor. For testing, the pins RA0, RA1, and RA2 of the PIC16F688 microcontroller are used. To test the diode, only two outputs are used: E and K (marked D1 and D2 in the diagram). Program The software for this project is written using the MikroC compiler. During testing and programming, be careful and follow the settings of the inputs / outputs of the MK (RA0, RA1 and RA2). they often change during operation. Before setting any output to 1, make sure the other two I/Os of the MCU are defined as inputs. Otherwise, conflicts of inputs / outputs of the MK are possible.
/* Project: Diode and Transistor Tester Internal Oscillator @ 4MHz, MCLR Enabled, PWRT Enabled, WDT OFF Copyright @ Rajendra Bhatt November 9, 2010 */ // LCD module connections sbit LCD_RS at RC4_bit; sbit LCD_EN at RC5_bit; sbit LCD_D4 at RC0_bit; sbit LCD_D5 at RC1_bit; sbit LCD_D6 at RC2_bit; sbit LCD_D7 at RC3_bit; sbit LCD_RS_Direction at TRISC4_bit; sbit LCD_EN_Direction at TRISC5_bit; sbit LCD_D4_Direction at TRISC0_bit; sbit LCD_D5_Direction at TRISC1_bit; sbit LCD_D6_Direction at TRISC2_bit; sbit LCD_D7_Direction at TRISC3_bit; // End LCD module connections sbit TestPin1 at RA0_bit; sbit TestPin2 at RA1_bit; sbit TestPin3 at RA2_bit; sbit Detail at RA4_bit; sbit SelectButton at RA5_bit; // Define Messages char message1[] = "Diode Tester"; char message2[] = "BJT Tester"; char message3[] = "Result:"; char message4[] = "Short"; char message5[] = "Open "; char message6[] = "Good "; char message7[] = "BJT is"; char *type = "xxx"; char *BE_Info = "xxxxx"; char *BC_Info = "xxxxx"; unsigned int select, test1, test2, update_select, detail_select; unsigned int BE_Junc, BC_Junc, EB_Junc, CB_Junc; void debounce_delay(void){ Delay_ms(200); } void main() { ANSEL = 0b00000000; //All I/O pins are configured as digital CMCON0 = 0?07 ; // Disbale comparators PORTC = 0; PORTA = 0; TRISC = 0b00000000; // PORTC All Outputs TRISA = 0b00111000; // PORTA All Outputs, Except RA3 (I/P only) Lcd_Init(); // Initialize LCD Lcd_Cmd(_LCD_CLEAR); // CLEAR display Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off Lcd_Out(1,2,message1); // Write message1 in 1st row select = 0; test1 = 0; test2 = 0; update_select = 1; detail_select = 0; do { if(!SelectButton){ debounce_delay(); update_select = 1; switch (select) { case 0 : select=1; break; case 1 : select=0; break; } //case end } if(select == 0){ // Diode Tester if(update_select){ Lcd_Cmd(_LCD_CLEAR); Lcd_Out(1,2,message1); Lcd_Out(2,2,message3); update_select=0; } TRISA = 0b00110100; // RA0 O/P, RA2 I/P TestPin1 = 1; test1 = TestPin3 ; // Read I/P at RA2 TestPin1 = 0; TRISA = 0b00110001; // RA0 I/P, RA2 O/P TestPin3 = 1; test2 = TestPin1; TestPin3 = 0; if((test1==1) && (test2 ==1)){ Lcd_Out(2,10,message4); } if((test1==1) && (test2 ==0)){ Lcd_Out(2,10,message6); } if((test1==0) && (test2 ==1)){ Lcd_Out(2,10,message6); } if((test1==0) && (test2 ==0)){ Lcd_Out(2,10,message5); } } // End if(select == 0) if(select && !detail_select){ // Transistor Tester if(update_select){ Lcd_Cmd(_LCD_CLEAR); Lcd_Out(1,2,message2); update_select = 0; } // Test for BE and BC Junctions of n-p-n TRISA = 0b00110101; // RA0, RA2 I/P, RA1 O/P TestPin2 = 1; BE_Junc = TestPin1 ; // Read I/P at RA0 BC_Junc = TestPin3; // Read I/P at RA2 TestPin2 = 0; // Test for EB and CB Junctions of p-n-p TRISA = 0b00110110; // RA0 O/P, RA1/RA2 I/P TestPin1 = 1; EB_Junc = TestPin2; TestPin1 = 0; TRISA = 0b00110011; // RA0 O/P, RA1/RA2 I/P TestPin3 = 1; CB_Junc = TestPin2; TestPin3 = 0; if(BE_Junc && BC_Junc && !EB_Junc && !CB_Junc){ Lcd_Out(2,2,message3); Lcd_Out(2,10,message6); type = "n-p-n"; BE_info = "Good "; BC_info = "Good "; } else if(!BE_Junc && !BC_Junc && EB_Junc && CB_Junc){ Lcd_Out(2,2,message3); Lcd_Out(2,10,message6); type = "p-n-p"; BE_info = "Good "; BC_info = "Good "; } else { Lcd_Out(2,2,message3); Lcd_Out(2,10,"Bad "); type = "Bad"; } } if(select && !Detail){ debounce_delay(); switch (detail_select) { case 0 : detail_select=1; break; case 1 : detail_select=0; break; } //case end update_select = 1; } if(detail_select && update_select){ // Test for BE Junction open if(!BE_Junc && !EB_Junc){ BE_info = "Open "; } // Test for BC Junction open if(!BC_Junc && !CB_Junc){ BC_info = "Open "; } // Test for BE Junction short if(BE_Junc && EB_Junc){ BE_info = "Short"; } // Test for BC Junction short if(BC_Junc && CB_Junc){ BC_info = "Short"; } Lcd_Cmd(_LCD_CLEAR); Lcd_Out(1,1,"Type:"); Lcd_Out(1,7,type); Lcd_Out(2,1,"BE:"); Lcd_Out(2,4,BE_info); Lcd_Out(2,9,"BC:"); Lcd_Out(2,12,BC_info); update_select = 0; } // End if (detail_select) } while(1); } Author: Koltykov A.V.; Publication: cxem.net See other articles Section Measuring technology. Read and write useful comments on this article. Latest news of science and technology, new electronics: Artificial leather for touch emulation
15.04.2024 Petgugu Global cat litter
15.04.2024 The attractiveness of caring men
14.04.2024
Other interesting news: ▪ Livescribe 3 pen for digitizing handwritten notes ▪ Next Generation Solid State Drives from Toshiba ▪ Innovative battery will last for decades News feed of science and technology, new electronics
Interesting materials of the Free Technical Library: ▪ section of the site Visual illusions. Article selection ▪ article In a difficult moment of life ... A popular expression ▪ Mamura's article. Legends, cultivation, methods of application
Leave your comment on this article: All languages of this page Home page | Library | Articles | Website map | Site Reviews www.diagram.com.ua |