Minggu, 12 Februari 2017

IC 555 Timer Tester

Raj K. Gorkhali
0
668
This simple and easy-to-use gadget not only tests the IC 555 timer in all its basic configurations but also tests the functionality of each pin of the timer. Once a timer is declared fit by this gadget, it will function satisfactorily in whatever mode or configuration you may try it.
The two basic configurations in which a timer IC 555 can be used are the astable and the monostable modes of operation.
EFY CONFERENCES ANNOUNCED!
When the DPDT switch (S2) is in position 1-1, the timer under test automatically gets wired as a monostable multivibrator. In this case, the monoshot can be triggered by the microswitch (S1). The debouncing circuit constituted by the two NAND gates of IC1 (N1 and N2) produces a clean rectangular pulse when the microswitch is pressed. Resistor R3, capacitor C1 and diode D1 ensure that the trigger terminal of timer IC 555 (pin 2 is the trigger terminal) gets the desired positive-to-ground trigger pulse. This differentiator circuit also ensures that the width of the trigger pulse is less than the expected monoshot output pulse.

gadget sederhana dan mudah digunakan ini tidak hanya menguji IC 555 timer dalam semua konfigurasi dasar, tetapi juga menguji fungsi dari setiap pin dari timer. Setelah timer dinyatakan fit oleh gadget ini, itu akan berfungsi secara memuaskan dalam mode atau konfigurasi apa pun yang Anda mungkin mencobanya.

dua konfigurasi dasar di mana timer IC 555 dapat digunakan adalah astabil dan mode monostable operasi.
EFY KONFERENSI DIUMUMKAN!

Ketika saklar DPDT (S2) berada di posisi 1-1, timer yang diuji secara otomatis akan kabel sebagai multivibrator monostable. Dalam hal ini, monoshot dapat dipicu oleh microswitch (S1). Rangkaian debouncing dibentuk oleh dua gerbang NAND dari IC1 (N1 dan N2) menghasilkan pulsa persegi panjang bersih ketika microswitch ditekan. Resistor R3, kapasitor C1 dan dioda D1 memastikan bahwa terminal memicu timer IC 555 (pin 2 adalah terminal pemicu) mendapat yang diinginkan positif-ke-darat memicu pulsa. Sirkuit pembeda ini juga memastikan bahwa lebar pemicu pulsa kurang dari yang diharapkan keluaran monoshot pulsa.
7F4_AFA_1
The monoshot output pulse width is a function of the series combination of resistor R8 and potentiometer VR2, and capacitor C4. When DPDT switch S2 is in position 2-2, the timer gets configured for the astable mode of operation. The output is a pulse train with the high time period determined by the series combination of resistors R8, potentiometer VR2, resistor R9 and capacitor C4, whereas the low time period is determined by resistor R9 and capacitor C4.
The reset terminal of timer IC (pin 4) should be tied to Vcc normally. More precisely, the voltage at pin 4 should be greater than 0.8V. A voltage less than that resets the output. Whether you have connected the timer in the monoshot or astable mode of operation, the output goes low the moment you bring the reset terminal below 0.8V.
The control terminal (pin 5) can be used to change the high time (‘on’ time) of the output pulse train in the astable mode and the output pulse width in the monoshot mode by applying an external voltage. This external voltage basically changes the reference voltage levels of the comparators inside the IC. The levels are set by three identical resistors of usually 5 kilo-ohms inside the IC connected from Vcc to ground, at 2/3Vcc for pin 5 and 1/3Vcc for pin 2. These levels can be changed by connecting an external resistor between pin 5 and ground. Resistor R10 and potentiometer VR3 have been connected for this purpose.

 Ketika saklar DPDT (S2) berada di posisi 1-1, timer yang diuji secara otomatis akan kabel sebagai multivibrator monostable. Dalam hal ini, monoshot dapat dipicu oleh microswitch (S1). Rangkaian debouncing dibentuk oleh dua gerbang NAND dari IC1 (N1 dan N2) menghasilkan pulsa persegi panjang bersih ketika microswitch ditekan. Resistor R3, kapasitor C1 dan dioda D1 memastikan bahwa terminal memicu timer IC 555 (pin 2 adalah terminal pemicu) mendapat yang diinginkan positif-ke-darat memicu pulsa. Sirkuit pembeda ini juga memastikan bahwa lebar pemicu pulsa kurang dari yang diharapkan keluaran monoshot pulsa.

Output monoshot lebar pulsa adalah fungsi dari kombinasi rangkaian resistor R8 dan potensiometer VR2, dan kapasitor C4. Ketika DPDT saklar S2 di posisi 2-2, timer akan dikonfigurasi untuk mode astabil operasi. output adalah kereta pulsa dengan periode waktu yang tinggi ditentukan oleh kombinasi seri resistor R8, potensiometer VR2, resistor R9 dan kapasitor C4, sedangkan jangka waktu rendah ditentukan oleh resistor R9 dan kapasitor C4.

Reset terminal IC timer (pin 4) harus diikat ke Vcc normal. Lebih tepatnya, tegangan di pin 4 harus lebih besar dari 0.8V. Sebuah tegangan kurang dari yang ulang output. Apakah Anda telah terhubung timer di monoshot atau mode astabil operasi, output pergi rendah saat Anda membawa ulang terminal bawah 0.8V.
BACA BACA
Electronic Circuit Prototyping More Than Just An Artefact

Kontrol terminal (pin 5) dapat digunakan untuk mengubah waktu tinggi ( 'on' waktu) dari kereta pulsa output dalam modus astabil dan output lebar pulsa dalam modus monoshot dengan menerapkan tegangan eksternal. tegangan eksternal ini pada dasarnya mengubah tingkat tegangan referensi dari pembanding dalam IC. Tingkat ditetapkan oleh tiga resistor identik biasanya 5 kilo-ohm dalam IC terhubung dari Vcc ke ground, pada 2 / 3Vcc untuk pin 5 dan 1 / 3Vcc untuk pin 2. Tingkat ini dapat diubah dengan menghubungkan resistor eksternal antara pin 5 dan tanah. Resistor R10 dan potensiometer VR3 telah terhubung untuk tujuan ini.

The pulse width in the monoshotmode is given by:
1.1×total charging resistance×charging capacitance
This expression is valid when there is no external resistor connected at pin 5. The pulse width can be reduced by connecting an external resistor.
The high and low time periods in the astable mode are:
High time period = 0.69×chargingresistance×charging capacitance
Low time period = 0.69×dischargeresistance×capacitance
Again the expressions are true with no external resistor at pin 5. The high time period can be made to decrease by connecting an external resistor between pin 5 and ground.
The circuit can thus be used to check:
1. The timer IC in astable configuration.
2. The timer IC in monostable configuration.
3. The capability of the reset terminal to override all functions and rest the output to low.
4. The function of the control terminal to change the ‘on’ or the ‘high’ time of the output waveform in astable mode of operation and the output pulse width in monostable mode of operation.
The circuit operates off a 9V battery, which makes the gadget portable. You can construct it easily on any general-purpose PCB along with the 8-pin socket.
To test an IC 555:
1. Insert it into the socket.
2. Set switch S2 in position 1-1.
3. Switch on the power supply by flipping switch S3 to ‘on’ position. Power-indicator LED (LED3) glows to indicate that the circuit is ready to test the IC timer.
4. If the IC is okay, LED1 glows because the IC is wired as a monoshot and in the absence of any trigger, its output is low.
5. Apply the trigger pulse by momentarily pressing switch S1. LED1 stops glowing and, in turn, LED2 glows. This confirms that the output of the monoshot has gone high. After the predetermined time period, LED2 goes off and LED1 again glows. Vary preset VR2 and trigger the monoshot again through switch S1. You will find that LED2 glows this time for a longer or a smaller time period depending upon whether you increased or decreased VR2 resistance.

6. For checking the reset function of the timer, trigger the monoshot again, and before the expected time is over, quickly decrease the potmeter VR1 resistance so as to bring the voltage at pin 4 below 0.8V. You will observe the output going low (indicated by glowing LED1 and extinguished LED2).
7. For checking the control function of the timer IC, set potmeter VR1 again in the maximum resistance position. Also set preset VR3 in the minimum resistance position. Trigger the monoshot using switch S1. You’ll observe its output going high for a time period that is much less than that determined from the series combination of R8 and VR2, and capacitor C4. In fact, for any fixed setting of this series combination, the output pulse width can be observed to vary for different values of potmeter VR3 resistance—by triggering the monoshot several times, once for each setting of VR3.
8. Now set the DPDT switch in position 2-2. LED1 and LED2 glow alternatively with the timing determined by the resistances in the charge and discharge paths. This means the timer IC is okay and wired in astable mode.
9. The functions of reset and control pins can be checked in astable configuration too in the same way as discussed above for the monoshot configuration.

Ne 555 timer tester

IC 555 Timer Tester

Raj K. Gorkhali
0
668
This simple and easy-to-use gadget not only tests the IC 555 timer in all its basic configurations but also tests the functionality of each pin of the timer. Once a timer is declared fit by this gadget, it will function satisfactorily in whatever mode or configuration you may try it.
The two basic configurations in which a timer IC 555 can be used are the astable and the monostable modes of operation.
EFY CONFERENCES ANNOUNCED!
When the DPDT switch (S2) is in position 1-1, the timer under test automatically gets wired as a monostable multivibrator. In this case, the monoshot can be triggered by the microswitch (S1). The debouncing circuit constituted by the two NAND gates of IC1 (N1 and N2) produces a clean rectangular pulse when the microswitch is pressed. Resistor R3, capacitor C1 and diode D1 ensure that the trigger terminal of timer IC 555 (pin 2 is the trigger terminal) gets the desired positive-to-ground trigger pulse. This differentiator circuit also ensures that the width of the trigger pulse is less than the expected monoshot output pulse.

gadget sederhana dan mudah digunakan ini tidak hanya menguji IC 555 timer dalam semua konfigurasi dasar, tetapi juga menguji fungsi dari setiap pin dari timer. Setelah timer dinyatakan fit oleh gadget ini, itu akan berfungsi secara memuaskan dalam mode atau konfigurasi apa pun yang Anda mungkin mencobanya.

dua konfigurasi dasar di mana timer IC 555 dapat digunakan adalah astabil dan mode monostable operasi.
EFY KONFERENSI DIUMUMKAN!

Ketika saklar DPDT (S2) berada di posisi 1-1, timer yang diuji secara otomatis akan kabel sebagai multivibrator monostable. Dalam hal ini, monoshot dapat dipicu oleh microswitch (S1). Rangkaian debouncing dibentuk oleh dua gerbang NAND dari IC1 (N1 dan N2) menghasilkan pulsa persegi panjang bersih ketika microswitch ditekan. Resistor R3, kapasitor C1 dan dioda D1 memastikan bahwa terminal memicu timer IC 555 (pin 2 adalah terminal pemicu) mendapat yang diinginkan positif-ke-darat memicu pulsa. Sirkuit pembeda ini juga memastikan bahwa lebar pemicu pulsa kurang dari yang diharapkan keluaran monoshot pulsa.

 
7F4_AFA_1
The monoshot output pulse width is a function of the series combination of resistor R8 and potentiometer VR2, and capacitor C4. When DPDT switch S2 is in position 2-2, the timer gets configured for the astable mode of operation. The output is a pulse train with the high time period determined by the series combination of resistors R8, potentiometer VR2, resistor R9 and capacitor C4, whereas the low time period is determined by resistor R9 and capacitor C4.
The reset terminal of timer IC (pin 4) should be tied to Vcc normally. More precisely, the voltage at pin 4 should be greater than 0.8V. A voltage less than that resets the output. Whether you have connected the timer in the monoshot or astable mode of operation, the output goes low the moment you bring the reset terminal below 0.8V.

 Output monoshot lebar pulsa adalah fungsi dari kombinasi rangkaian resistor R8 dan potensiometer VR2, dan kapasitor C4. Ketika DPDT saklar S2 di posisi 2-2, timer akan dikonfigurasi untuk mode astabil operasi. output adalah kereta pulsa dengan periode waktu yang tinggi ditentukan oleh kombinasi seri resistor R8, potensiometer VR2, resistor R9 dan kapasitor C4, sedangkan jangka waktu rendah ditentukan oleh resistor R9 dan kapasitor C4.

Reset terminal IC timer (pin 4) harus diikat ke Vcc normal. Lebih tepatnya, tegangan di pin 4 harus lebih besar dari 0.8V. Sebuah tegangan kurang dari yang ulang output. Apakah Anda telah terhubung timer di monoshot atau mode astabil operasi, output pergi rendah saat Anda membawa ulang terminal bawah 0.8V.

The control terminal (pin 5) can be used to change the high time (‘on’ time) of the output pulse train in the astable mode and the output pulse width in the monoshot mode by applying an external voltage. This external voltage basically changes the reference voltage levels of the comparators inside the IC. The levels are set by three identical resistors of usually 5 kilo-ohms inside the IC connected from Vcc to ground, at 2/3Vcc for pin 5 and 1/3Vcc for pin 2. These levels can be changed by connecting an external resistor between pin 5 and ground. Resistor R10 and potentiometer VR3 have been connected for this purpose.

BACA BACA
Electronic Circuit Prototyping More Than Just An Artefact

Kontrol terminal (pin 5) dapat digunakan untuk mengubah waktu tinggi ( 'on' waktu) dari kereta pulsa output dalam modus astabil dan output lebar pulsa dalam modus monoshot dengan menerapkan tegangan eksternal. tegangan eksternal ini pada dasarnya mengubah tingkat tegangan referensi dari pembanding dalam IC. Tingkat ditetapkan oleh tiga resistor identik biasanya 5 kilo-ohm dalam IC terhubung dari Vcc ke ground, pada 2 / 3Vcc untuk pin 5 dan 1 / 3Vcc untuk pin 2. Tingkat ini dapat diubah dengan menghubungkan resistor eksternal antara pin 5 dan tanah. Resistor R10 dan potensiometer VR3 telah terhubung untuk tujuan ini.
 
The pulse width in the monoshotmode is given by:
1.1×total charging resistance×charging capacitance
This expression is valid when there is no external resistor connected at pin 5. The pulse width can be reduced by connecting an external resistor.
The high and low time periods in the astable mode are:
High time period = 0.69×chargingresistance×charging capacitance
Low time period = 0.69×dischargeresistance×capacitance
Again the expressions are true with no external resistor at pin 5. The high time period can be made to decrease by connecting an external resistor between pin 5 and ground.
The circuit can thus be used to check:
1. The timer IC in astable configuration.
2. The timer IC in monostable configuration.
3. The capability of the reset terminal to override all functions and rest the output to low.
4. The function of the control terminal to change the ‘on’ or the ‘high’ time of the output waveform in astable mode of operation and the output pulse width in monostable mode of operation.
The circuit operates off a 9V battery, which makes the gadget portable. You can construct it easily on any general-purpose PCB along with the 8-pin socket.
To test an IC 555:
1. Insert it into the socket.
2. Set switch S2 in position 1-1.
3. Switch on the power supply by flipping switch S3 to ‘on’ position. Power-indicator LED (LED3) glows to indicate that the circuit is ready to test the IC timer.
4. If the IC is okay, LED1 glows because the IC is wired as a monoshot and in the absence of any trigger, its output is low.
5. Apply the trigger pulse by momentarily pressing switch S1. LED1 stops glowing and, in turn, LED2 glows. This confirms that the output of the monoshot has gone high. After the predetermined time period, LED2 goes off and LED1 again glows. Vary preset VR2 and trigger the monoshot again through switch S1. You will find that LED2 glows this time for a longer or a smaller time period depending upon whether you increased or decreased VR2 resistance.

Lebar pulsa di monoshotmode yang diberikan oleh:
1.1 × yang total pengisian perlawanan × pengisian kapasitansi

ungkapan ini berlaku ketika tidak ada resistor eksternal yang terhubung pada pin 5. Lebar pulsa dapat dikurangi dengan menghubungkan resistor eksternal.

Tinggi dan rendah periode waktu dalam modus astabil adalah:
periode waktu tinggi = 0,69 × chargingresistance × pengisian kapasitansi
Rendah jangka waktu = 0.69 × dischargeresistance × kapasitansi

Sekali lagi ekspresi benar tanpa resistor eksternal pada pin 5. Periode waktu yang tinggi dapat dibuat untuk mengurangi dengan menghubungkan resistor eksternal antara pin 5 dan tanah.

sirkuit dengan demikian dapat digunakan untuk memeriksa:
1. IC timer dalam konfigurasi astabil.
2. IC timer dalam konfigurasi monostable.
3. Kemampuan terminal ulang untuk mengesampingkan semua fungsi dan beristirahat output ke rendah.
4. Fungsi terminal kontrol untuk mengubah 'on' atau waktu 'tinggi' dari gelombang keluaran dalam modus astabil operasi dan output lebar pulsa dalam modus monostable operasi.
BACA BACA
kekuatan Pulser

sirkuit beroperasi dari baterai 9V, yang membuat portable gadget. Anda dapat membangun itu dengan mudah pada setiap tujuan umum PCB bersama dengan 8-pin socket.

Untuk menguji IC 555:
1. Masukkan ke dalam soket.
2. Set saklar S2 di posisi 1-1.
3. Hidupkan catu daya dengan membalik saklar S3 ke posisi 'on'. LED Power-indikator (LED3) bersinar untuk menunjukkan bahwa sirkuit siap untuk menguji IC timer.
4. Jika IC baik-baik saja, LED1 bersinar karena IC adalah kabel sebagai monoshot dan tanpa adanya pemicu apapun, output rendah.
5. Terapkan pemicu pulsa oleh sejenak menekan saklar S1. LED1 berhenti bersinar dan, pada gilirannya, LED2 bersinar. Ini menegaskan bahwa output dari monoshot telah pergi tinggi. Setelah periode waktu yang telah ditentukan, LED2 berbunyi dan LED1 lagi bersinar. Bervariasi ditetapkan VR2 dan memicu monoshot lagi melalui switch S1. Anda akan menemukan bahwa LED2 bersinar kali ini untuk lebih lama atau jangka waktu yang lebih kecil tergantung pada apakah Anda meningkat atau menurun perlawanan VR2.

6. For checking the reset function of the timer, trigger the monoshot again, and before the expected time is over, quickly decrease the potmeter VR1 resistance so as to bring the voltage at pin 4 below 0.8V. You will observe the output going low (indicated by glowing LED1 and extinguished LED2).
7. For checking the control function of the timer IC, set potmeter VR1 again in the maximum resistance position. Also set preset VR3 in the minimum resistance position. Trigger the monoshot using switch S1. You’ll observe its output going high for a time period that is much less than that determined from the series combination of R8 and VR2, and capacitor C4. In fact, for any fixed setting of this series combination, the output pulse width can be observed to vary for different values of potmeter VR3 resistance—by triggering the monoshot several times, once for each setting of VR3.
8. Now set the DPDT switch in position 2-2. LED1 and LED2 glow alternatively with the timing determined by the resistances in the charge and discharge paths. This means the timer IC is okay and wired in astable mode.
9. The functions of reset and control pins can be checked in astable configuration too in the same way as discussed above for the monoshot configuration.
6. Untuk memeriksa fungsi reset timer, memicu monoshot lagi, dan sebelum waktu yang diharapkan adalah lebih, cepat menurunkan potmeter VR1 perlawanan sehingga membawa tegangan pada pin 4 di bawah 0.8V. Anda akan melihat output akan rendah (ditunjukkan dengan bersinar LED1 dan padam LED2).
7. Untuk memeriksa fungsi kontrol timer IC, mengatur potensiometer VR1 lagi di posisi perlawanan maksimal. Juga mengatur ditetapkan VR3 di posisi resistance minimum. Memicu monoshot menggunakan saklar S1. Anda akan melihat output akan tinggi untuk jangka waktu yang jauh kurang dari yang ditentukan dari kombinasi seri R8 dan VR2, dan kapasitor C4. Bahkan, untuk pengaturan tetap kombinasi seri ini, lebar pulsa output dapat diamati bervariasi untuk nilai yang berbeda dari potmeter VR3 perlawanan-dengan memicu monoshot beberapa kali, sekali untuk setiap pengaturan VR3.
8. Sekarang atur saklar DPDT di posisi 2-2. LED1 dan LED2 bersinar alternatif dengan waktu ditentukan oleh resistensi dalam pengisian dan pengosongan jalur. Ini berarti timer IC baik-baik saja dan kabel dalam modus astabil.
9. Fungsi reset dan kontrol pin dapat diperiksa dalam konfigurasi astabil terlalu dalam cara yang sama seperti yang dibahas di atas untuk konfigurasi monoshot.

ne 555 diaplikasikan di amplifier

555 Timer PWM Audio Amplifier

T.A. Babu
0
4436
The ubiquitous 555 timer IC handles audio signals in its own pulse-width modulation (PWM) way. Here, the 555 IC works in astable mode. The switching frequency can be varied from 65 kHz to 188 kHz. Selection of PWM frequency depends on the amplitude of the input signal as well as the load impedance. By adjusting VR1, you can ensure comfortable listening with low audio distortion.
In pulse-width modulation, the carrier frequency’s pulse width varies as a function of the amplitude of the input audio signal. Feedback capacitor C2 ensures faithful reproduction of the audio signal. An output L-C filter is the common approach for a reasonable rejection of the carrier frequencies. For simplicity, it is omitted here. Moreover, the speakers cannot respond to the high-frequency signal. They respond to the average DC level modulated with the audio signal that we feed in from the input. Of course, the audio quality is not as good as that of a professional system, but it would be definitely an amazing experience to listen audio through a 555 chip with room-filling volume.


Di mana-mana IC timer 555 menangani sinyal audio sendiri pulse-width modulation nya (PWM) cara. Di sini, 555 IC bekerja dalam modus astabil. Frekuensi switching dapat bervariasi dari 65 kHz ke 188 kHz. Pemilihan frekuensi PWM tergantung pada amplitudo sinyal input serta impedansi beban. Dengan menyesuaikan VR1, Anda dapat memastikan mendengarkan nyaman dengan distorsi audio yang rendah.

Dalam modulasi lebar pulsa, lebar pulsa frekuensi pembawa bervariasi sebagai fungsi dari amplitudo sinyal input audio. Umpan balik kapasitor C2 memastikan reproduksi yang setia dari sinyal audio. Output L-C filter adalah pendekatan umum untuk penolakan yang wajar dari frekuensi pembawa. Untuk mempermudah, itu dihilangkan di sini. Selain itu, pembicara tidak bisa menanggapi sinyal frekuensi tinggi. Mereka menanggapi tingkat DC rata termodulasi dengan sinyal audio yang kita makan di dari input. Tentu saja, kualitas audio tidak sebagus yang dari sistem profesional, tapi akan pasti pengalaman yang luar biasa untuk mendengarkan audio melalui 555 chip dengan volume yang ruang-mengisi.
EFY CONFERENCES ANNOUNCED!
E2C_1
Impedance matching at both the input and output is important. So an input-impedance matching transformer (X1) is used to match the headphone output of a standard CD player to the input of the 555 amp. 8-ohm, 1W speakers were used as the load. If designed properly, PWM amplifiers could give a performance similar to conventional amplifiers. Even higher efficiency and effortless bass are possible.
EFY note. While testing this circuit at EFY lab, we had used Supertronix KEC make matching transformer X1, and the input to the circuit was the audio output taken from the computer’s headphone out terminal.

 Pencocokan impedansi pada kedua input dan output penting. Jadi masukan-pencocokan impedansi transformator (X1) digunakan untuk mencocokkan output headphone dari CD player standar untuk input dari 555 amp. 8-ohm, 1W speaker digunakan sebagai beban. Jika dirancang dengan baik, amplifier PWM bisa memberikan kinerja yang mirip dengan amplifier konvensional. efisiensi yang lebih tinggi dan bass usaha yang mungkin.

Catatan EFY. Sementara pengujian sirkuit ini di laboratorium EFY, kami telah menggunakan Supertronix KEC make pencocokan transformator X1, dan input ke sirkuit adalah output audio yang diambil dari headphone komputer keluar terminal.

aplikasi ne555

This circuit is based on a passive infrared (PIR) sensor, which automatically switches on a device when someone comes close to it. It can be used for detection of theft or an unauthorised person entering a restricted area or building. It can also turn on lights when someone approaches the area where it is installed. Applications of this circuit include security systems, corridor lights and bathroom lights, among others.
Fig. 1: Circuit diagram of the motion detector
Circuit and working
EFY CONFERENCES ANNOUNCED!
4B9_TestThe circuit diagram of the motion detector using NE555 timer is shown in Fig. 1. It is built around 230V AC primary to 9V, 300mA secondary transformer X1, bridge rectifier DB107 (BR1), 6V voltage regulator 7806 (IC1), timer NE555 (IC2) and a few other components.
The 230V AC mains is stepped down to 9V, 300mA through step-down transformer X1. Secondary output of X1 goes to bridge rectifier BR1. Capacitor C1 filters the ripples and the rectified output is given to regulator 7806 (IC1). IC1 provides 6V regulated DC output to operate the circuit. LED1 is used as a power-on indicator.
63A_pathsIC2 is configured in monostable mode. Time period of IC2 is based on resistor R4 and capacitor C3, which is around ten minutes in this case. By changing resistor R4 and capacitor C3 you can change the time period of IC2.
Output pin 3 of IC2 is connected to the base of relay driver transistor T2. Contacts of relay RL1 are connected to the load, which could be a CFL or a bulb connected across CON2.
The PIR sensor is a pyroelectric device developed for detection of human body infrared radiations. It has a single output that goes high when a valid motion is detected. That is, the load is switched on whenever the PIR module senses a body in motion nearby.
The 555 timer IC is an integral part of electronics projects. Be it a simple project involving a single 8 bit micro-controller and some peripherals or a complex one involving system on chips (SoCs), 555 timer working is involved. These provide time delays, as an oscillator and as a flip-flop element among other applications.
Introduced in 1971 by the American company Signetics, the 555 is still in widespread use due to its low price, ease of use and stability. It is made by many companies in the original bipolar and low-power CMOS types. According to an estimate, a billion units were manufactured back in the year 2003 alone. (That time, only 555 i knew was a cough syrup).
EFY CONFERENCES ANNOUNCED!
Depending on the manufacturer, the standard 555 package includes 25 transistors, 2 diodes and 15 resistors on a silicon chip installed in an 8-pin mini dual-in-line package (DIP-8). Variants consists of combining multiple chips on one board. However 555 is still the most popular. Let’s look at the pin diagram to have an idea about the timer IC before we talk about 555 timer working.

Pin diagram and description

PinNamePurpose
1GNDGround reference voltage, low level (0 V)
2TRIG
The OUT pin goes high and a timing interval starts when this input falls below 1/2 of CTRL voltage (which is typically 1/3 Vcc, CTRL being 2/3 Vcc by default if CTRL is left open). In other words, OUT is high as long as the trigger low. Output of the timer totally depends upon the amplitude of the external trigger voltage applied to this pin.
3OUTThis output is driven to approximately 1.7 V below +Vcc, or to GND.
4RESET
A timing interval may be reset by driving this input to GND, but the timing does not begin again until RESET rises above approximately 0.7 volts. Overrides TRIG which overrides threshold.
5CTRL
Provides “control” access to the internal voltage divider (by default, 2/3 Vcc).
6THR
The timing (OUT high) interval ends when the voltage at threshold is greater than that at CTRL (2/3 Vcc if CTRL is open).
7DIS
Open collector output which may discharge a capacitor between intervals. In phase with output.
8Vcc
Positive supply voltage, which is usually between 3 and 15 V depending on the variation.

Some important features of the 555 timer:

555 is used in almost every electronic circuit today. For a 555 timer working as a flip flop or as a multi-vibrator, it has a particular set of configurations. Some of the major features of the 555 would be,
  • It operates from a wide range of power ranging from +5 Volts to +18 Volts supply voltage.
  • Sinking or sourcing 200 mA of load current.
  • The external components should be selected properly so that the timing intervals can be made into several minutes along with the frequencies exceeding several hundred kilo hertz.
  • The output of a 555 timer can drive a transistor-transistor logic (TTL) due to its high current output.
  • It has a temperature stability of 50 parts per million (ppm) per degree celsius change in temperature which is equivalent to 0.005 %/ °C.
  • The duty cycle of the timer is adjustable.
  • Also, the maximum power dissipation per package is 600 mW and its trigger and reset inputs has logic compatibility.

555 timer working

The 555 generally operates in 3 modes. A-stable, Mono-stable and Bi-stable modes.

A-stable mode

This means there will be no stable level at the output. So the output will be swinging between high and low. This character of unstable output is used as clock or square wave output for many applications.

Mono-stable mode

This configuration consists of one stable and one unstable state. The stable state can be chosen either high or low by the user. If the stable output is set at high(1), the output of the timer is high(1). At the application of an interrupt, the timer output turns low(0). Since the low state is unstable it goes to high(1) automatically after the interrupt passes. Similar is the case for a low stable mono-stable mode.

Bi-stable mode

In bi-stable mode, both the output states are stable. At each interrupt, the output changes from low(0) to high(1) and vice versa, and stays there. For example, if we have a high(1) output, it will go low(0) once it receives an interrupt and stay low(0) till the next interrupt changes the status.
This datasheet should provide an insight into the specifics: 555 Timer IC

induktansi

Inductance

Inductance is the name given to the property of a component that opposes the change of current flowing through it and even a straight piece of wire will have some inductance. Inductors do this by generating a self-induced emf within itself as a result of their changing magnetic field. When the emf is induced in the same circuit in which the current is changing this effect is called Self-induction, ( L ) but it is sometimes commonly called back-emf as its polarity is in the opposite direction to the applied voltage.

When the emf is induced into an adjacent component situated within the same magnetic field, the emf is said to be induced by Mutual-induction, ( M ) and mutual induction is the basic operating principal of transformers, motors, relays etc. Self inductance is a special case of mutual inductance, and because it is produced within a single isolated circuit we generally call self-inductance simply, Inductance. The basic unit of inductance is called the Henry, ( H ) after Joseph Henry, but it also has the units of  Webers per Ampere (1 H = 1 Wb/A).

Lenz's Law tells us that an induced emf generates a current in a direction which opposes the change in flux which caused the emf in the first place, the principal of action and reaction. Then we can accurately define Inductance as being "a circuit will have an inductance value of one Henry when an emf of one volt is induced in the circuit were the current flowing through the circuit changes at a rate of one ampere/second". In other words, a coil has an inductance of one Henry when the current flowing through it changes at a rate of one ampere/second inducing a voltage of one volt in it and this definition can be presented as:

Inductance
induktansi

Induktansi adalah nama yang diberikan untuk properti dari komponen yang menentang perubahan arus yang mengalir melalui itu dan bahkan potongan lurus kawat akan memiliki beberapa induktansi. Induktor melakukan ini dengan menghasilkan emf disebabkan diri dalam dirinya sendiri sebagai akibat dari medan magnet mereka berubah. Ketika emf yang diinduksi di sirkuit yang sama di mana saat ini berubah efek ini disebut Self-induksi, (L) tapi kadang-kadang biasa disebut back-emf sebagai polaritas adalah dalam arah yang berlawanan dengan tegangan yang diberikan.

Ketika emf yang diinduksi menjadi komponen yang berdekatan terletak dalam medan magnet yang sama, ggl yang dikatakan disebabkan oleh Reksa-induksi, (M) dan saling induksi adalah kepala operasi dasar transformator, motor, relay dll Diri induktansi adalah kasus khusus dari induktansi, dan karena diproduksi dalam sirkuit terisolasi tunggal umumnya kita sebut induktansi diri sederhana, Induktansi. Unit dasar induktansi disebut Henry, (H) setelah Joseph Henry, tetapi juga memiliki unit Webers per Ampere (1 H = 1 Wb / A).

Hukum Lenz memberitahu kita bahwa ggl induksi menghasilkan arus dalam arah yang menentang perubahan fluks yang menyebabkan emf di tempat pertama, prinsip aksi dan reaksi. Kemudian kita secara akurat dapat menentukan Induktansi sebagai "sirkuit akan memiliki nilai induktansi dari satu Henry ketika ggl satu volt diinduksi di sirkuit yang saat ini mengalir melalui perubahan sirkuit pada tingkat satu ampere / detik". Dengan kata lain, sebuah kumparan memiliki induktansi dari satu Henry ketika arus yang mengalir melalui perubahan pada tingkat satu ampere / detik menginduksi tegangan satu volt di dalamnya dan definisi ini dapat disajikan sebagai:


Inductance

Inductance, L is actually a measure of an inductors "resistance" to the change of the current flowing through the circuit and the larger is its value in Henries, the lower will be the rate of current change.

We know from the previous tutorial about the Inductor, that inductors are devices that can store their energy in the form of a magnetic field. Inductors are made from individual loops of wire combined to produce a coil and if the number of loops within the coil are increased, then for the same amount of current flowing through the coil, the magnetic flux will also increase. So by increasing the number of loops or turns within a coil, increases the coils inductance. Then the relationship between self-inductance, ( L ) and the number of turns, ( N ) and for a simple single layered coil can be given as:


Self Inductance of a Coil
Self_Inductance_of_a_Coil
Self_Inductance_of_a_Coil

Where:

L is in Henries

N is the Number of Turns

Φ is the Magnetic Flux Linkage

Ι is in Amperes

This expression can also be defined as the flux linkage divided by the current flowing through each turn. This equation only applies to linear magnetic materials.


Example No1

A hollow air cored inductor coil consists of 500 turns of copper wire which produces a magnetic flux of 10mWb when passing a DC current of 10 amps. Calculate the self-inductance of the coil in milli-Henries.

Example1

Exp1

induktansi

Induktansi adalah nama yang diberikan untuk properti dari komponen yang menentang perubahan arus yang mengalir melalui itu dan bahkan potongan lurus kawat akan memiliki beberapa induktansi. Induktor melakukan ini dengan menghasilkan emf disebabkan diri dalam dirinya sendiri sebagai akibat dari medan magnet mereka berubah. Ketika emf yang diinduksi di sirkuit yang sama di mana saat ini berubah efek ini disebut Self-induksi, (L) tapi kadang-kadang biasa disebut back-emf sebagai polaritas adalah dalam arah yang berlawanan dengan tegangan yang diberikan.

Ketika emf yang diinduksi menjadi komponen yang berdekatan terletak dalam medan magnet yang sama, ggl yang dikatakan disebabkan oleh Reksa-induksi, (M) dan saling induksi adalah kepala operasi dasar transformator, motor, relay dll Diri induktansi adalah kasus khusus dari induktansi, dan karena diproduksi dalam sirkuit terisolasi tunggal umumnya kita sebut induktansi diri sederhana, Induktansi. Unit dasar induktansi disebut Henry, (H) setelah Joseph Henry, tetapi juga memiliki unit Webers per Ampere (1 H = 1 Wb / A).

Hukum Lenz memberitahu kita bahwa ggl induksi menghasilkan arus dalam arah yang menentang perubahan fluks yang menyebabkan emf di tempat pertama, prinsip aksi dan reaksi. Kemudian kita secara akurat dapat menentukan Induktansi sebagai "sirkuit akan memiliki nilai induktansi dari satu Henry ketika ggl satu volt diinduksi di sirkuit yang saat ini mengalir melalui perubahan sirkuit pada tingkat satu ampere / detik". Dengan kata lain, sebuah kumparan memiliki induktansi dari satu Henry ketika arus yang mengalir melalui perubahan pada tingkat satu ampere / detik menginduksi tegangan satu volt di dalamnya dan definisi ini dapat disajikan sebagai:

nductance

Induktansi, L sebenarnya ukuran sebuah induktor "perlawanan" terhadap perubahan arus yang mengalir melalui rangkaian dan lebih besar nilainya di henrie, semakin rendah akan menjadi tingkat perubahan saat ini.

Kita tahu dari tutorial sebelumnya tentang induktor, yaitu induktor adalah perangkat yang dapat menyimpan energi mereka dalam bentuk medan magnet. Induktor terbuat dari loop individu kawat dikombinasikan untuk menghasilkan sebuah kumparan dan jika jumlah loop dalam kumparan meningkat, maka untuk jumlah yang sama dari arus yang mengalir melalui kumparan, fluks magnetik juga akan meningkat. Jadi dengan meningkatkan jumlah loop atau berubah dalam kumparan, meningkatkan kumparan induktansi. Maka hubungan antara self-induktansi, (L) dan jumlah putaran, (N) dan untuk yang sederhana kumparan berlapis tunggal dapat diberikan sebagai:


Induktansi diri dari Coil

Self_Inductance_of_a_Coil

dimana:

L adalah di henrie

N adalah Jumlah Turns

Φ adalah Magnetic Flux Linkage

Ι adalah dalam ampere

Ungkapan ini juga dapat didefinisikan sebagai linkage fluks dibagi dengan arus yang mengalir melalui setiap giliran. Persamaan ini hanya berlaku untuk linear bahan magnetik.


contoh No1

Sebuah pesawat buang biji induktor kumparan berongga terdiri dari 500 lilitan kawat tembaga yang menghasilkan fluks magnetik 10mWb ketika melewati arus DC dari 10 amp. Hitunglah induktansi diri kumparan di mili-henrie.

example1

exp1


Example1
Exp1

Example No2

Self_Induced_emf
Calculate the value of the self-induced emf produced in the same coil after a time of 10mS.

Self_Induced_emf

he self-inductance of a coil or to be more precise, the coefficient of self-inductance also depends upon the characteristics of its construction. For example, size, length, number of turns etc. It is therefore possible to have inductors with very high coefficients of self induction by using cores of a high permeability and a large number of coil turns. Then for a coil, the magnetic flux that is produced in its inner core is equal to:

magnetic_flux

Where:
magnetic_flux
Φ is the magnetic flux linkage, B is the flux density, and A is the area.

If the inner core of a long solenoid with N turns/metre is hollow, "air cored", the magnetic induction in its core will is given as.
magnetic_induction
magnetic_induction

Then by substituting these expressions in the first equation above for Inductance will give us:

Inductance_ex2
Inductance_ex2

By cancelling out and grouping together like terms, then the final equation for the coefficient of self-inductance for an air cored coil (solenoid) is given as:
self-inductance_for_an_air_cored_coil
self-inductance_for_an_air_cored_coil

Where:

L is in Henries

μο is the Permeability of Free Space (4.π.10-7)

N is the Number of turns

A is the Inner Core Area (Ï€.r2) in m2

l is the length of the Coil in metres

As the inductance of a coil is due to the magnetic flux around it, the stronger the magnetic flux for a given value of current the greater will be the inductance. So a coil of many turns will have a higher inductance value than one of only a few turns and therefore, the equation above will give inductance L as being proportional to the number of turns squared N2. As well as increasing the number of coil turns, we can also increase inductance by increasing the coils diameter or making the core longer. In both cases more wire is required to construct the coil and therefore, more lines of force exists to produce the required back emf. The inductance of a coil can be increased further still if the coil is wound onto a ferromagnetic core, that is one made of a soft iron material, than one wound onto a non-ferromagnetic or hollow air core.
misalnya No2
Example1
Menghitung nila
Self_Induced_emfi emf self-induced diproduksi di kumparan yang sama setelah waktu 10mS.

Self_Induced_emf

ia induktansi diri dari kumparan atau lebih tepatnya, koefisien induktansi diri juga tergantung pada karakteristik konstruksi. Misalnya, ukuran, panjang, jumlah putaran dll Oleh karena itu mungkin untuk memiliki induktor dengan koefisien yang sangat tinggi induksi diri dengan menggunakan core dari permeabilitas tinggi dan sejumlah besar coil bergantian. Kemudian untuk sebuah kumparan, fluks magnetik yang dihasilkan di inti adalah sama dengan:

magnetic_flux

dimana:

magnetic_flux
Φ adalah linkage fluks magnetik, B adalah densitas fluks, dan A adalah daerah.

Jika inti dari sebuah solenoid panjang dengan N berubah / meter adalah hampa, "udara buang biji", induksi magnetik di intinya akan diberikan sebagai.

magnetic_induction

magnetic_induction
Kemudian dengan menggantikan ekspresi ini dalam persamaan pertama di atas untuk Induktansi akan memberi kita:

Inductance_ex2


Inductance_ex2
Dengan membatalkan dan pengelompokan bersama-sama seperti istilah, maka persamaan akhir untuk koefisien induktansi diri untuk kumparan udara buang biji (solenoid) diberikan sebagai:

self-inductance_for_an_air_cored_coil

self-inductance_for_an_air_cored_coil

dimana:

L adalah di henrie

μο adalah Permeabilitas Free Space (4.π.10-7)

N adalah Jumlah bergantian

A adalah Core Lokasi batin (Ï€.r2) di m2

l adalah panjang Coil dalam meter

Sebagai induktansi dari kumparan adalah karena fluks magnetik di sekitarnya, semakin kuat fluks magnetik untuk nilai tertentu saat ini lebih besar akan induktansi. Jadi kumparan banyak berubah akan memiliki nilai induktansi yang lebih tinggi dari satu dari hanya beberapa putaran dan oleh karena itu, persamaan di atas akan memberikan induktansi L sebagai sebanding dengan jumlah putaran kuadrat N2. Serta meningkatkan jumlah kumparan bergantian, kami juga dapat meningkatkan induktansi dengan meningkatkan diameter kumparan atau membuat inti lagi. Dalam kedua kasus yang lebih kawat diperlukan untuk membangun kumparan dan karena itu, lebih garis gaya ada untuk menghasilkan emf yang diperlukan kembali. Induktansi dari kumparan dapat ditingkatkan lebih jauh lagi jika kumparan luka ke inti feromagnetik, yang merupakan salah satu yang terbuat dari bahan besi lunak, dari satu luka ke sebuah inti udara non-feromagnetik atau berongga.

If the inner core is made of some ferromagnetic material such as soft iron, cobalt or nickel, the inductance of the coil would greatly increase because for the same amount of current flow the magnetic flux would be much stronger. This is because the lines of force would be more concentrated through the ferromagnetic core material as we saw in the Electromagnets tutorial. For example, if the core material has a relative permeability 1000 times greater than free space, 1000μο such as soft iron or steel, than the inductance of the coil would be 1000 times greater so we can say that the inductance of a coil increases proportionally as the permeability of the core increases. Then for a coil wound around a former or core the inductance equation above would need to be modified to include the relative permeability μr of the new former material.

If the coil is wound onto a ferromagnetic core a greater inductance will result as the cores permeability will change with the flux density. However, depending upon the ferromagnetic material the inner cores magnetic flux may quickly reach saturation producing a non-linear inductance value and since the flux density around the coil depends upon the current flowing through it, inductance, L also becomes a function of current, i.

In the next tutorial about Inductors, we will see that the magnetic field generated by a coil can cause a current to flow in a second coil that is placed next to it. This effect is called Mutual Inductance, and is the basic operating principal of transformers, motors and generators.
- See more at: http://www.dnatechindia.com/Tutorial/Inductor/Inductor-Inductance-of-a-Coil.html#sthash.cU000h0D.dpuf

Jika inti terbuat dari beberapa bahan feromagnetik seperti besi lunak, kobalt atau nikel, induktansi dari kumparan akan sangat meningkat karena untuk jumlah yang sama dari arus fluks magnetik akan jauh lebih kuat. Hal ini karena garis-garis gaya akan lebih terkonsentrasi melalui bahan inti feromagnetik seperti yang kita lihat di tutorial elektromagnet. Sebagai contoh, jika bahan inti memiliki permeabilitas relatif 1000 kali lebih besar dari ruang bebas, 1000μο seperti besi lunak atau baja, dari induktansi dari kumparan akan 1000 kali lebih besar sehingga kita dapat mengatakan bahwa induktansi dari kumparan meningkat secara proporsional sebagai permeabilitas meningkat inti. Kemudian untuk luka melilit mantan atau inti persamaan induktansi di atas akan perlu dimodifikasi untuk menyertakan μr permeabilitas relatif dari bahan bekas baru.

Jika kumparan luka ke inti feromagnetik induktansi yang lebih besar akan menghasilkan sebagai core permeabilitas akan berubah dengan kerapatan fluks. Namun, tergantung pada bahan feromagnetik core dalam fluks magnetik dapat dengan cepat mencapai memproduksi nilai induktansi non-linear saturasi dan karena kepadatan fluks sekitar kumparan tergantung pada arus yang melalui itu, induktansi, L juga menjadi fungsi saat ini, i .

Dalam tutorial berikutnya tentang induktor, kita akan melihat bahwa medan magnet yang dihasilkan oleh kumparan dapat menyebabkan arus mengalir di kumparan kedua yang ditempatkan di samping itu. Efek ini disebut Mutual Induktansi, dan kepala operasi dasar transformator, motor dan generator.
- Lihat lebih lanjut di: http://www.dnatechindia.com/Tutorial/Inductor/Inductor-Inductance-of-a-Coil.html#sthash.cU000h0D.dpuf



When the emf is induced into an adjacent component situated within the same magnetic field, the emf is said to be induced by Mutual-induction, - See more at: http://www.dnatechindia.com/Tutorial/Inductor/Inductor-Inductance-of-a-Coil.html#sthash.cU000h0D.dpuf

Inductance

Inductance is the name given to the property of a component that opposes the change of current flowing through it and even a straight piece of wire will have some inductance. Inductors do this by generating a self-induced emf within itself as a result of their changing magnetic field. When the emf is induced in the same circuit in which the current is changing this effect is called Self-induction, ( L ) but it is sometimes commonly called back-emf as its polarity is in the opposite direction to the applied voltage
- See more at: http://www.dnatechindia.com/Tutorial/Inductor/Inductor-Inductance-of-a-Coil.html#sthash.cU000h0D.dpuf

Inductance

Inductance is the name given to the property of a component that opposes the change of current flowing through it and even a straight piece of wire will have some inductance. Inductors do this by generating a self-induced emf within itself as a result of their changing magnetic field. When the emf is induced in the same circuit in which the current is changing this effect is called Self-induction, ( L ) but it is sometimes commonly called back-emf as its polarity is in the opposite direction to the applied voltage
- See more at: http://www.dnatechindia.com/Tutorial/Inductor/Inductor-Inductance-of-a-Coil.html#sthash.cU000h0D.dpufv

Inductance

Inductance is the name given to the property of a component that opposes the change of current flowing through it and even a straight piece of wire will have some inductance. Inductors do this by generating a self-induced emf within itself as a result of their changing magnetic field. When the emf is induced in the same circuit in which the current is changing this effect is called Self-induction, ( L ) but it is sometimes commonly called back-emf as its polarity is in the opposite direction to the applied voltage
- See more at: http://www.dnatechindia.com/Tutorial/Inductor/Inductor-Inductance-of-a-Coil.html#sthash.cU000h0D.dpuf
Inductance is the name given to the property of a component that opposes the change of current flowing through it and even a straight piece of wire will have some inductance. Inductors do this by generating a self-induced emf within itself as a result of their changing magnetic field. When the emf is induced in the same circuit in which the current is changing this effect is called Self-induction, ( L ) but it is sometimes commonly called back-emf as its polarity is in the opposite direction to the applied voltage.
When the emf is induced into an adjacent component situated within the same magnetic field, the emf is said to be induced by Mutual-induction, ( M ) and mutual induction is the basic operating principal of transformers, motors, relays etc. Self inductance is a special case of mutual inductance, and because it is produced within a single isolated circuit we generally call self-inductance simply, Inductance. The basic unit of inductance is called the Henry, ( H ) after Joseph Henry, but it also has the units of  Webers per Ampere (1 H = 1 Wb/A).
Lenz's Law tells us that an induced emf generates a current in a direction which opposes the change in flux which caused the emf in the first place, the principal of action and reaction. Then we can accurately define Inductance as being "a circuit will have an inductance value of one Henry when an emf of one volt is induced in the circuit were the current flowing through the circuit changes at a rate of one ampere/second". In other words, a coil has an inductance of one Henry when the current flowing through it changes at a rate of one ampere/second inducing a voltage of one volt in it and this definition can be presented as
- See more at: http://www.dnatechindia.com/Tutorial/Inductor/Inductor-Inductance-of-a-Coil.html#sthash.cU000h0D.dpuf
Inductance is the name given to the property of a component that opposes the change of current flowing through it and even a straight piece of wire will have some inductance. Inductors do this by generating a self-induced emf within itself as a result of their changing magnetic field. When the emf is induced in the same circuit in which the current is changing this effect is called Self-induction, ( L ) but it is sometimes commonly called back-emf as its polarity is in the opposite direction to the applied voltage.
When the emf is induced into an adjacent component situated within the same magnetic field, the emf is said to be induced by Mutual-induction, ( M ) and mutual induction is the basic operating principal of transformers, motors, relays etc. Self inductance is a special case of mutual inductance, and because it is produced within a single isolated circuit we generally call self-inductance simply, Inductance. The basic unit of inductance is called the Henry, ( H ) after Joseph Henry, but it also has the units of  Webers per Ampere (1 H = 1 Wb/A).
Lenz's Law tells us that an induced emf generates a current in a direction which opposes the change in flux which caused the emf in the first place, the principal of action and reaction. Then we can accurately define Inductance as being "a circuit will have an inductance value of one Henry when an emf of one volt is induced in the circuit were the current flowing through the circuit changes at a rate of one ampere/second". In other words, a coil has an inductance of one Henry when the current flowing through it changes at a rate of one ampere/second inducing a voltage of one volt in it and this definition can be presented as
- See more at: http://www.dnatechindia.com/Tutorial/Inductor/Inductor-Inductance-of-a-Coil.html#sthash.cU000h0D.dpuf
Inductance is the name given to the property of a component that opposes the change of current flowing through it and even a straight piece of wire will have some inductance. Inductors do this by generating a self-induced emf within itself as a result of their changing magnetic field. When the emf is induced in the same circuit in which the current is changing this effect is called Self-induction, ( L ) but it is sometimes commonly called back-emf as its polarity is in the opposite direction to the applied voltage.
When the emf is induced into an adjacent component situated within the same magnetic field, the emf is said to be induced by Mutual-induction, ( M ) and mutual induction is the basic operating principal of transformers, motors, relays etc. Self inductance is a special case of mutual inductance, and because it is produced within a single isolated circuit we generally call self-inductance simply, Inductance. The basic unit of inductance is called the Henry, ( H ) after Joseph Henry, but it also has the units of  Webers per Ampere (1 H = 1 Wb/A).
Lenz's Law tells us that an induced emf generates a current in a direction which opposes the change in flux which caused the emf in the first place, the principal of action and reaction. Then we can accurately define Inductance as being "a circuit will have an inductance value of one Henry when an emf of one volt is induced in the circuit were the current flowing through the circuit changes at a rate of one ampere/second". In other words, a coil has an inductance of one Henry when the current flowing through it changes at a rate of one ampere/second inducing a voltage of one volt in it and this definition can be presented as
- See more at: http://www.dnatechindia.com/Tutorial/Inductor/Inductor-Inductance-of-a-Coil.html#sthash.cU000h0D.dpuf

Inductance

Inductance is the name given to the property of a component that opposes the change of current flowing through it and even a straight piece of wire will have some inductance. Inductors do this by generating a self-induced emf within itself as a result of their changing magnetic field. When the emf is induced in the same circuit in which the current is changing this effect is called Self-induction, ( L ) but it is sometimes commonly called back-emf as its polarity is in the opposite direction to the applied voltage.
When the emf is induced into an adjacent component situated within the same magnetic field, the emf is said to be induced by Mutual-induction, ( M ) and mutual induction is the basic operating principal of transformers, motors, relays etc. Self inductance is a special case of mutual inductance, and because it is produced within a single isolated circuit we generally call self-inductance simply, Inductance. The basic unit of inductance is called the Henry, ( H ) after Joseph Henry, but it also has the units of  Webers per Ampere (1 H = 1 Wb/A).
Lenz's Law tells us that an induced emf generates a current in a direction which opposes the change in flux which caused the emf in the first place, the principal of action and reaction. Then we can accurately define Inductance as being "a circuit will have an inductance value of one Henry when an emf of one volt is induced in the circuit were the current flowing through the circuit changes at a rate of one ampere/second". In other words, a coil has an inductance of one Henry when the current flowing through it changes at a rate of one ampere/second inducing a voltage of one volt in it and this definition can be presented as:
- See more at: http://www.dnatechindia.com/Tutorial/Inductor/Inductor-Inductance-of-a-Coil.html#sthash.cU000h0D.dpuf

Minggu, 05 Februari 2017

Microcontrollers and Electronics Project Blog



Using Transistor as a Switch

December 23, 2008 by , under Electronics.




Most of microcontrollers work within 5 volt environment and the I/O port can only handle current up to 20mA; therefore if we want to attach the microcontroller’s I/O port to different voltage level circuit or to drive devices with more than 20mA; we need to use the interface circuit. One of the popular method is to use the Bipolar Junction Transistor (BJT) or we just called it transistor in this tutorial. I have to make clear on this BJT type to differentiate among the other types of transistors family such as FET (Field Effect Transistor), MOSFET (Metal Oxide Semiconductor FET), VMOS (Vertical MOSFET) and UJT (Uni-Junction Transistor).
A. The Switch
The transistor actually works as a current gainer; any current applied to the base terminal will be multiplied by the current gain factor of the transistor which known as hFE. Therefore transistor can be used as amplifier; any small signal (very small current) applied to the base terminal will be amplified by the factor of hFE and reflected as a collector current on the collector terminal side.

All the transistors have three state of operation:
  1. Off state: in this state there is no base current applied or IB = 0.
  2. On active state: in this state any changes in IB will cause changes in IC as well or IC = IB x hFE. This type of state is suitable when we use transistor as a signal amplifier because transistor is said is in the linear state. For example if we have a transistor with gain of 100 and we increase the IB from 10uA to 100uA; this will cause the IC to swing from 1000uA to 10000uA (1 mA to 10 mA).
  3. On saturate state: in this state any changes in IB will not cause changes in IC anymore (not linear) or we could say IC is nearly constant. We never use this state to run the transistor as a signal amplifier (class A amplifier) because the output signal will be clamped when the transistor is saturate. This is the type of state that we are looking for on this tutorial.

From the picture above we could see the voltage and current condition of transistor on each state; if you notice when transistor is in off state the voltage across collector and emitter terminal is equal to the supplied voltage, this is equivalent to the open circuit and when transistor is in saturate state the collector to emitter voltage is equal or less then 0.2 Volt which is equivalent to the close circuit. Therefore to use transistor as a switch we have to make transistor OFF which equivalent to the logical “0” and SATURATE which is equivalent to the logical “1“.
One of the famous diagrams that show the transistor operating state is called the transistor static characteristic curve as shown on this following picture:

When we operate transistor as the class A common emitter amplifier usually we choose to bias the transistor (apply voltage on VBE and VCE) in such a way (Q-Point) that IC and VCE (output) will swing to its maximum or minimum value without any distortion (swing into the saturation or cut-off region) when the IB (input) swing to its maximum or minimum value; but when we operate the transistor as switch we intentionally push the transistor into its saturation region to get the lowest possible VCE (i.e. near 0.2 volt) when we need to make the transistor ON (switch ON) and into its cut-off region when we need to make the transistor OFF (switch OFF).

The above diagram show a typical microcontroller interface circuit using NPN transistor; the RB resistor is used to control the current on base terminal that make transistor OFF and ON (saturate); while the RC resistor is the current limiter for the load. if the load operate with the same voltage as the supplied power (Vcc) you can by pass the RC (not use).
Notice the diode (also known as the clamp diode) in the inductive load circuit is needed to protect the transistor again the EMF (Electromotive Force) voltage generated by the inductor component when the transistor is switched on and off rapidly, this voltage is oppose the source voltage. The diode will act as a short circuit to the high voltage generated by the inductor component, you can use any general purpose diode with capable on handling minimum 1 A of current such as 1N4001, 1N4002, etc.

On the picture shown above you could see how we connect the transistor as the high active switch (logical high) also known as low side switch using NPN transistor and the low active switch (logical low) also known as high side switch using PNP transistor.
Ok let’s calculate each of the RB and RC value on this following NPN transistor circuit:

On the circuit above we are going to use 2N3904 (the cheap general purpose transistor where you could easily found on your local market) to drive 5 LED from microcontroller port, from the 2N3904 datasheet we get this following information:
IC max = 200mA (this is maximum value that will make your transistor smoked, in practical application always use just half of the maximum value mentioned on the datasheet), hFE = 100 to 300, VBE saturate = 0.65 Volt, VCE saturate = 0.2 Volt
For most transistor in general we can use VBE = 0.7 Volt (should be saturate) and VCE = 0 Volt. Using the 5 volt power supply (VCC) and assuming VLED = 2 Volt, with each of them consuming 15 mA, we could calculate the RC value using the Ohm’s law as follow:
IC = 5 x 15 mA = 75mA (0.075 A), this current is still far bellow the maximum IC allowed by 2N3904 transistor.
RC = (VCC – VLED) / IC = (5 – 2) / 0.075 = 40 Ohm
Power Dissipation on the RC resistor will be
P = (VCC – VLED) x IC = (5 – 2) x 0.075 = 0.225 Watt
Base on the above calculation we could use the nearest higher value available on the market; which is 47 Ohm, 0.5 watt resistor (for heat dissipation usually we use twice of the watt value calculated).
Assuming the hFE minimum is 100; the minimum current required in the transistor’s base terminal to drive the LED is:
IC = hFE x IB
IB = IC / hFE = 0.075 / 100 = 0.00075 A (0.75 mA)
This current can easily be supplied by most microcontroller I/O port; which is capable to drive up to 20 mA output current. Again by applying the Ohm’s law we could calculate the RB value as follow:
RB = (VPORT – VBE) / IB
Assuming the minimum average voltage of microcontroller I/O port (VPORT) with logical “1” is about 4.2 volt (the microcontroller is powered by 5 volt supply):
RB = (4.2 – 0.7) / 0.00075 = 4666.66 Ohm
Power dissipation on the RC resistor will be
P = (VPORT – VBE) x IB = (4.2 – 0.7) x 0.00075 = 0.002625 Watt
Base on the result you could use 4K7 Ohm, 0.25 Watt resistor (this is the common resistor which you could easily found on the local market i.e. 0.25 watt and 0.5 watt).
Use this RB calculation as your maximum reference value; in the real world most of the transistors hFE is vary and being measured (tested) with different VCE and IC value not to mention different specification even though you use the same transistor type. Therefore the real RB value could be lower than 4K7 if you really want to drive the transistor into its fully saturate mode where the VCE near 0.2 volt.

Now the question is how we determine the exact value? To answer to this question I build this following testing circuit base on the RC and RB calculated value above using the Atmel AVR ATTiny25 microcontroller to blink the five LED:

Note: the reason I used RC = 3×150 Ohm because at that time I run out the required 47 Ohm resistor, therefore you could use just single 47 Ohm resistor or if you only have 150 Ohm as I did, you could use them as I did.
Using Transistor as a Switch
Bellow is the C Program that I used to test this circuit:
//***************************************************************************
//  File Name   : trswitch.c
//  Version   : 1.0
//  Description   : Transistor as Switch: Simple LED Blinker
//  Author     : RWB
//  Target     : Atmel AVR ATTiny25 Microcontroller
//  Compiler      : AVR-GCC 4.3.0; avr-libc 1.6.2 (WinAVR 20090313)
//  IDE           : Atmel AVR Studio 4.17
//  Programmer    : Atmel AVRISPmkII
//  Last Updated  : 1 November 2009
//***************************************************************************
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
   // Initial I/O
   DDRB |= (1<<PB3);       // Set PB3 as Output, Others as Input
   PORTB &= ~(1<<PB3);     // Reset the PB3

   for(;;) {               // Loop Forever
     PORTB |= (1<<PB3);    // Port PB3 High
     _delay_ms(3000);      // Delay 3 Second
     PORTB &= ~(1<<PB3);   // Port PB3 Low
     _delay_ms(1000);      // Delay 1 Second
   }
   return 0;            // Standard Return Code
}
/* EOF: trswitch.c */
The program simply blink all the LED by toggling the AVR ATTiny25 microcontroller PB3 output port high for about 3 second and low for about 1 second and here is the test result when the PB3 port swing to the logical high:

As you’ve seen from the result there is about 0.4 volt drop on the collector to emitter (VCE) terminal instead of 0 Volt as we assume on the above calculation and the DC current gain is about 58 instead of 100 again as we assume on the above calculation. Now you understand there are tremendous different result between the 2N3904 transistor datasheet and my test circuit, this is because the 2N3904 datasheet is measured using the PWM (Pulse Width Modulation) with period for about 300 us (micro second) and duty cycle for about 2%, the reason to use this very short pulse period method in the measurement is because they don’t want to overheat the transistor junction; where this junction heating will vary the transistor hFE measurement significantly.
On my test circuit above; I used 3 second to make the 2N3904 transistor ON (saturate, VBE = 0.81 Volt, VCE = 0.4 Volt) and 1second to make it OFF. The other factor that make the test result differ is the various manufacture specification even though we used the same transistor type. Therefore the answer to the above question is; there is no exact value for RC and RB; is depend on your application but it save to use the above method to calculate the RC and RB and then do the circuit prototyping to test your design, next adjust your RC and RB value accordingly.
Some calculation suggestion is to use the collector to base current ratio of 10 (regardless of the transistor hFE value) to force the transistor into fully saturate (VCE = 0.2 Volt, as shown on the datasheet above) by using this following formula:
IB = IC / hFE = IC / 10
This is what I called a “maximum saturate calculation method” (also known as worst-case design procedure), again as you’ve seen from the real test circuit result above even though we drive the VBE more than 0.7 volt, we still get the hFE for about 58 and IB for about 0.88 mA which is useful in the microcontroller application (for more information you could read  “Powering Your Microcontroller’s Base Project” on this blog), therefore for practical application I would suggest; if you want to use this maximum saturate calculation method to determine the base resistor (RB) value, make sure at least you double the calculated value. For example to determine the RB on the test circuit above using this maximum saturate calculation method:
IB = IC / hFE = 0.075 / 10 = 0.0075 A (7.5 mA)
RB = (4.2 – 0.7) / 0.0075 = 466.66 Ohm
By using twice the calculated value you will get 933.32 Ohm, or you could use the 1K Ohm standard resistor.
In typical rapid switching transistor application actually we don’t drive the transistor into its full saturate state (i.e. VCE = 0.2 Volt),  because when the transistor is fully saturate, it tend to have a longer switching time (i.e. from ON to OFF to ON again). The VCE = 0.4 volt as shown on the real test circuit above is already adequate for most switching application, while we could still take advantage of the low transistor base current (i.e. IB = 0.88 mA). You could see this test circuit on the video at the end of this article.
B. Driving the Relay
Relay perhaps is one of the oldest electronic components that could be tracked back from the early years when we first use the electricity in our life. A relay basically is an electrical switch that uses the electromagnetic solenoid to control a switch contact. Because it use the solenoid (inductive load), therefore we need to use a diode to protect the transistor against the EMF. The main advantage of using a relay is that we could “relaying” or pass on the switch effect from a low power side on its solenoid to the high power side on its metal contact by using the electromagnetic effect, where both of the solenoid and contact has its own separate electrical specification.

Now using the same principal we could easily calculate the RC and RB value on this following circuit:

By using 5 Volt power supply and relay with 5 Volt and 60mA operating current:
RC = 0 Ohm (not use, connect relay directly to VCC)
IB = IC / hFE = 0.06 A / 100 = 0.0006 A
RB = (VPORT – VBE) / IB = (4.2 – 0.7) / 0.0006 = 5833.33 Ohm, use 5K6 Ohm resistor
P = (VPORT – VBE) x IB = (4.2 – 0.7) x 0.0006 = 0.0021 watt, use 0.25 Watt resistor
C. Increasing the Collector Current
What if the load current is more than 1 A, let’s say you want to drive a DC motor? Perhaps you will think to use bigger transistor such as 2N3055 power transistor; unfortunately the big power transistor tends to have small hFE mostly less then 20, so it’s mean we have to supply bigger base current. We know that most microcontrollers I/O port can only supply a current up to 20mA, therefore by using this type of transistor the maximum current that we could achieve in the collector terminal is about 400mA; which is far bellow our expectation. The solution for this situation is to use what known as Darlington pair circuit:

By using the Darlington pair circuit we could combine two transistors; one with high hFE2 factor usually has a low collector current and the one with high collector current usually has a low hFE1factor. This will give you a total hFE of hFE1 x hFE2. In the Darlington pair circuits the VBE will be twice the normal transistor saturated voltage which is about 1.4 Volt. One of the popular ready made Darlington pair transistors on the market are TIP120 (NPN type) and TIP125 (PNP type) which could handle the collector current up to 3 A (max 5 A), and has the hFE minimum of 1000.

The TIP120 and TIP125 is called a pair Darlington transistors as they have similar characteristic but have an opposite type (i.e. NPN and PNP), this Darlington transistor pair is popular used in motor controller with the H-Bridge circuit. Remember when you use a power transistor to drive a large collector current, you need to supply the transistor with the adequate heat sink to help cooling the transistor by dissipating heat through the heat sink surface into the surrounding air.
Using the same principal we’ve learned before, we could easily calculate the RB value of the DC motor circuit interface bellow:

By using 5 Volt power supply and DC Motor with 12 Volt and 1 A maximum operating current:
RC = 0 Ohm (not use, connect directly to the 12 Volt power)
IB = IC / hFE = 1 A / 1000 = 0.001 A
RB = (VPORT – VBE) / IB = (4.2 – 1.4) / 0.001 = 2800 Ohm, use 2K7 Ohm resistor
P = (VPORT – VBE) x IB = (4.2 – 1.4) x 0.001 = 0.0028 watt, use 0.25 Watt resistor
D. The Darlington Transistor Array
For more compact version of the Darlington pair transistor you could use the Texas Instrument ULN2803A which is contain 8 Darlington pair transistors with has build in 2K7 base resistor and clamp diode for each Darlington pair transistors. This makes this Darlington transistor array suitable for driving the relay or motor up to 500mA (this is a maximum datasheet value) directly from the microcontroller output.

To increase the output current up to 1 A (2 x 500mA, remember this is a maximum datasheet value, for practical application use just half or 2 x 250 mA) you could simply use two Darlington transistor array connected in parallel, the following is the sample circuit for driving two DC motors using the ULN2803A Darlington transistor array:

Thanks to the build in internal 2K7 base resistor and the two clamp diode, you don’t need any external component when using ULN2803A to drive the DC motor from your microcontroller port. The Darlington transistor array ULN2803A could be used to drive up to 50 volt voltage load.
E. Isolating your Circuit
Sometimes we need to isolate our microcontroller circuit from the interface circuit especially in the environment that generating a lot of noise which could disturb our microcontroller operation. When we use a relay from the above example, the driver ground is still directly connected to the microcontroller circuit, so there is a change the noises will interfere the microcontroller circuit.
To completely isolate the circuit we could use the optocouplers (also called optoissolator) circuit, this circuit will completely isolate your microcontroller from the interface circuit:

The popular optocouplers circuit available on the market is 4N35 which has the hFE of 500 (in the optocouplers terminology this is also known as the transistor static forward current transfer ratio, Texas Instrument SOES021C, measured with infrared LED current = 0) and maximum collector current of 100mA.
Differ from the ordinary transistor in the optocouplers we don’t use the transistor base terminal for driving the collector current; instead we use the internal infrared LED to transfer the infrared LED light intensity to the phototransitor; based on this infrared LED light intensity the phototransistor will be turned ON or OFF; giving more current to drive this infrared LED will effect more current to flow on the phototransistor collector; This effect is known as the current transfer ratio (CTR). The 100% CTR means that all the current flow on the infrared LED will be transferred 100% to the phototransistor collector.
Therefore by driving the internal infrared LED with 15 mA (in the optocouplers terminology this is also known as the input diode static forward current),  we could assure that the phototransistor will be in the saturate state (ON), because the minimum current to make the phototransitor on is about 10 mA. The following circuit is use optocoupler to interfacing the relay:

By using 5 Volt power supply and relay with 5 Volt and 60mA operating current:
RC = 0 Ohm (not use, connect relay directly to 5 Volt)
Idiode = 15 mA (0.015 A), VLED = 2 Volt
RB = (VPORT – VLED) / IB = (4.2 – 2) / 0.015 = 146.66 Ohm, use 150 Ohm resistor
P = (VPORT – VLED) x IB = (4.2 – 2) x 0.015 = 0.033 watt, use 0.25 Watt resistor
If you need to drive more current you could use the Darlington pair circuit above or you could use the high gain Darlington optocopuler such as 4N45 (CTR minimum about 350 %).
F. Controlling your DC motor direction
Using just one transistor to control the DC motor as the above example; we only can turn the DC motor in one direction if we want to change the direction than we also have to change the DC motor voltage polarity. The other way to work around this condition is to use the relay to switch the DC motor’s voltage polarity, but using this method means the DC motor will always ON and we can not control the DC motor speed using digital signal or known as the PWM (Pulse Width Modulation).
The best and popular way to solve this issue is to use the H-bridge circuit:

When we apply current (IB1) to the TR1 and TR2 transistors, IB2=0 to the TR3 and TR4 transistors, then TR1 and TR4 transistors will be turned ON, TR2 and TR3 will be turned OFF; this will cause the current to start flow through TR1 transistor, passing the DC motor and going into the TR4 transistor (blue color). When we apply current (IB2) to the TR3 and TR4 transistors, IB1=0 to the TR1 and TR2 transistors, then the TR3 and TR2 transistors will be ON while TR1 and TR4 transistors will be turned OFF; this will cause the current to flow through TR3, passing the DC motor in reverse polarity and going into the TR2 transistor (red color). By not applying current to both IB1 and IB2 all the transistors will be turned OFF.
Again by applying the Ohm’s law we could easily calculate the RB1 and RB2 on this following circuit (Updated! Thanks for the nice discussion and correction from the All About Circuits Forum discussion here, in order for this circuit to work you have to put a resistor on each of the TIP 120 Darlington transistors base terminal):

The above H-Bridge circuit use 5 Volt supply and DC motor with 5 Volt and 1 A maximum operating current rating; assuming the TIP120 Darlington transistor hFE is 1000, the RB1 and RB2 resistors could be calculated as follow:
IB = IC / hFE = 1 A / 1000 = 0.001 A, for each of the transistor base current
RB1a,b = (VPORT – VBE) / IB = (4.2 – 1.4) / 0.001 = 2800 Ohm, use 2K2 Ohm resistor
RB2a,b = (VPORT – VBE) / IB = (4.2 – 1.4) / 0.001 = 2800 Ohm, use 2K2 Ohm resistor
P = (VPORT – VBE) x IB = (4.2 – 1.4) x 0.001 = 0.0028 watt, use 0.25 Watt resistor for RB1 and RB2
To test the TIP 120 Darlington transistors H-Bridge circuit above I used this following circuit using Atmel AVR ATTiny13 microcontroller as shown on this following picture:


Bellow is the C Program that I used to test this circuit:
//***************************************************************************
//  File Name  : trhbridge.c
//  Version      : 1.0
//  Description. : Transistor as Switch: Simple All TIP120 H-Bridge
//  Author    : RWB
//  Target    : Atmel AVR ATTiny13 Microcontroller
//  Compiler     : AVR-GCC 4.3.2; avr-libc 1.6.2 (WinAVR 20090313)
//  IDE          : Atmel AVR Studio 4.17
//  Programmer   : Atmel AVRISPmkII
//  Last Updated : 18 June 2010
//***************************************************************************
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
   // Initial I/O
   DDRB |= (1<<PB3)|(1<<PB4); // Set PB3,PB4 as Output, Others as Input
   PORTB &= ~(1<<PB3);        // Reset PB3 (OFF)
   PORTB &= ~(1<<PB3);        // Reset PB4 (OFF)

   for(;;) {                  // Loop Forever
     PORTB |= (1<<PB3);       // Turn ON PB3
     _delay_ms(3000);         // Delay 3 Second
     PORTB &= ~(1<<PB3);      // Turn OFF PB3
     _delay_ms(2000);         // Delay 2 Second
     PORTB |= (1<<PB4);       // Turn ON PB4
     _delay_ms(3000);         // Delay 3 Second
     PORTB &= ~(1<<PB4);      // Turn OFF PB4
     _delay_ms(2000);         // Delay 2 Second
   }
   return 0;               // Standard Return Code
}
/* EOF: trhbridge.c */
One of the advantage using all NPN transistors in the H bridge circuit is the NPN transistor tends to have faster turn on time comparing to the PNP transistor, beside by using the same transistor type we could have similar transistor characteristic in the circuit. You could read more example of using all NPN transistor H-Bridge in “H-Bridge Microchip PIC Microcontroller PWM Motor Controller” on this blog.
Actually most of the modern H-Bridge circuit design for higher voltage (e.g. more than 9 volt) is rarely use the BJT anymore; instead we use the MOSFET because MOSFET is more efficient on higher voltage (i.e. less power dissipation) compare to the ordinary BJT. The other advantage of using MOSFET is that it has very high input impedance, therefore we could easily connect parallel a couple of the same MOSFET to achieve the higher current output and at the same time we could decrease the output resistance of the MOSFET (Rds), which mean we could get more lower power dissipation as shown on this following picture:

The “The Line Follower Robot with Texas Instruments 16-Bit MSP430G2231 Microcontroller” article is a good example of how we use the N-Channel MOSFET to control the DC motor.
Driving the Stepper Motor
One type of the brushless electric motor that is designed specifically for digital signal input is called the stepper motor. The stepper motor usually is used when we need to control the precise rotation movement and speed with the open loop control. These advantages make the stepper motor is widely found in many applications such as printers, scanners, disk drives, automotives, CNC machines, toys, and many more.
Today the most common used stepper motor types are Unipolar Stepper Motor and Bipolar Stepper Motor. The unipolar stepper motor usually has two windings with a center tap on each of windings, therefore the current could move from the center tap either to the left winding or to the right winding. Usually the unipolar stepper motor comes with 5 or 6 terminal leads. On the other hands the bipolar stepper motor actually is similar to the unipolar type but without the center tap.

Therefore the unipolar stepper motor has advantage of more simple driving circuit over the bipolar stepper motor but has a torque less than the bipolar motor for the same size. The following circuit uses four BC639 transistors to drive the unipollar stepper using the Atmel AVR ATTiny13 microcontroller to provide the required stepping signal to the unipolar stepper motor:

From the schematic above you could see that each transistor is connected to half windings of the unipolar stepper motor phase. You need to experiment with your own stepper motor to get the right windings connection. Assuming maximum 100 mA unipolar stepper motor current on 5 volt supply, and using minimum BC 639 transistor hFE of 40, we could calculate the RB (the base resistors) as follow:
IB = IC / hFE = 100 mA / 40 = 0.0025 A
RB = (VPORT – VBE) / IB = (4.2 – 0.7) / 0.0025 = 1400 Ohm, use 1K5 Ohm resistor
P = (VPORT – VBE) x IB = (4.2 – 0.7) x 0.0025 = 0.0086 watt, use 0.25 watt resistor
Two clamp diodes on each transistor are required because the winding has a center tap. Therefore when one end of winding is high (Vcc) the other end is low (GND) the lower diode will bypass the back EMF (Electromotive Force) voltage that appear on BC 639 transistor collector and emitter terminals.
This following is the C code is used for testing the circuit above:
//***************************************************************************
//  File Name   : upstepper.c
//  Version       : 1.0
//  Description.  : Transistor as Switch: Simple Unipolar Stepper
//                  Motor Driver - Full Step Method
//  Author     : RWB
//  Target     : ATTiny13
//  Compiler      : AVR-GCC 4.3.2; avr-libc 1.6.2 (WinAVR 20090313)
//  IDE           : Atmel AVR Studio 4.17
//  Programmer    : Atmel AVRISPmkII
//  Last Updated  : 03 Nov 2010
//***************************************************************************
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
// Unipolar Stepper Motor CW/CCW Stepping Sequence
#define MAX_STEP 4
unsigned char cwstep_seq[MAX_STEP]= {0b00000110,
                                     0b00000011,
         0b00001001,
         0b00001100};
unsigned char ccwstep_seq[MAX_STEP]= {0b00001100,
                                      0b00001001,
          0b00000011,
          0b00000110};
volatile unsigned char step_index;
volatile unsigned int ovftimes;
volatile unsigned char status;
ISR(TIM0_OVF_vect)
{
  static unsigned int count=1;
  count++;
  if (count >= ovftimes) {
    cli();                      // Disable Interrupt
    // Stepping Output
    if (status)
      PORTB = ccwstep_seq[step_index++];
    else
      PORTB = cwstep_seq[step_index++];
    if (step_index >= MAX_STEP)
      step_index=0;
    count=0;                    // Reset Count
    TCNT0=0;                    // Start counter from 0
    sei();                      // Enable Interrupt
  }
}
int main(void)
{
   // Initial I/O
   DDRB = 0b00001111;        // Set PB0, PB1, PB2, and PB3 as Output, Others as Input
   PORTB = 0b00000000;       // Reset PORTB Output
   // Set ADCSRA Register on ATTiny13
   ADCSRA = (1<<ADEN) | (1<<ADPS2) | (1<<ADPS1);
   ADCSRB = 0b00000000;
   // Set ADMUX to PB4 (ADC2)
   ADMUX=0b00000010;
   // Disable Digital Input on PB4 (ADC2)
   DIDR0=0b00001000;
   // Initial TIMER0
   TCCR0A=0b00000000;        // Timer/Counter 0 Normal Operation
   TCCR0B=(1<<CS01);         // Use prescaller: Clk/8 with 9.6 MHz Internal Clock
   TCNT0=0;                  // Start counter from 0
   TIMSK0=(1<<TOIE0);        // Enable Counter Overflow Interrupt
   step_index=0;
   ovftimes=10;
   status=0;                 // 0 - CW, 1 - CCW
   sei();                    // Enable Interrupt

   for(;;) {                 // Loop Forever
     // Start conversion by setting ADSC on ADCSRA Register
     ADCSRA |= (1<<ADSC);
     // wait until convertion complete ADSC=0 -> Complete
     while (ADCSRA & (1<<ADSC));
     // Get the ADC Result
     ovftimes = ADCW;
     if (ovftimes > 800)
       status^=0x01;        // Toggle the Direction

     _delay_ms(50);
   }
   return 0;             // Standard Return Code
}
/* EOF: upstepper.c */

The method to rotate this unipolar stepper motor rotor is known as the full step mode method; in full step mode we always excite two windings at the same time, with the right current sequence we could rotate the stepper motor in 4 repeatable steps. Reversing the step sequences will make the stepper motor to turn into opposite direction. In this tutorial I used NMB-PM20S-020 permanent magnet motor where the step required is shown on this following diagram:

You could easily adapt the step sequence to your own unipolar stepper motor by changing both the cwstep_seq (clockwise rotation) and ccwstep_seq (counter clockwise rotation) array variables data in the program.
Using the AVR ATTiny13 microcontroller TIMER0 interrupt we could easily supply the required output steps to the stepper motor. I used the ADC (Analog to Digital Conversion) to control the stepper motor step sequence delay as well as to change the rotation direction by adjusting the 10K trimport. For more information about AVR ADC and TIMER0 you could read these blog’s articles “Analog to Digital Converter AVR C Programming” and “Working with AVR microcontroller Communication Port Project“.
You could also replace the BC639 transistor with the Darlington pair transistor array such as ULN2803A from Texas Instrument mention above. Using this Darlington pair transistor array make the unipolar stepper circuit become simpler (less components) because it has the required clamp diode on each Darlington transistor pair and you could take advantage of higher current gainer provided by the Darlington pair transistors.
To drive the bipolar stepper motor; each of the two windings will require the H-Bridge circuit similar to the H-Bridge circuit for driving the DC motor mention above. Therefore we need at least 8 transistors to drive the bipolar stepper motor (4 transistors on each windings). By forwarding and reversing the current flow on each winding we could achieve the required steps sequence to drive the bipolar motor.

And by supplying the correct steps sequence logic to IN1, IN2, IN3, IN4, IN5, IN6, IN7, and IN8 input from the microcontroller output port we could make this bipolar stepper motor to rotate. The opposite direction (counter clockwise) rotation could be achieved by reversing the steps sequence (i.e. 4, 3, 2, and 1).
Using Transistor as switch Testing Circuit Video
1. This following video show you of how to drive a transistor which connected with 5 red LED using the Atmel AVR ATTiny25 microcontroller.
2. The TIP120 H-Bridge Testing Circuit video using Atmel ATTiny13 Microcontroller:
3. The Unipolar Stepper Motor Testing Circuit video using Atmel ATTiny13 Microcontroller:

Bookmarks and Share


bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark




28 Responses to “Using Transistor as a Switch”

02.09.09#1
Comment by slowjoe.
I’ve had a go at making the final H-bridge circuit shown here using TIP120 darlington pairs and had a bit of trouble. If I split the connections from the microcontroller after the resistors RB1 and RB2 (as shown in the circuit diagram) then it doesn’t seem to work, however if I split the signal before the resistors and use 2 resistors for each of RB1 and RB2 then it does work. I’m not sure I understand why yet maybe somebody can explain.
02.09.09#2
Comment by rwb.
The original TIP120 H-Bridge schematic has been changed; now I used resistor on each of the TIP120 base terminal as you did. Thank you
23.01.10#3
Comment by mandomoose.
Thankyou for this great post. I was wondering about using the transistor as a switch with my avr.
Keep having fun :)
20.07.10#4
Comment by kansairobot.
Thanks for the great blog :)
I am sorry if this sounds like a total newbie question but in your pics (in which you dont use a optocoupler) you connect both the 12V circuit and the micro ground to a common ground.
My question is how to implement the 12V and 5V part? I mean let’s say I am using common batteries (8 batteries= 12V) I connect the motor to the 12V part but where do I connect the 5V pin of the micro to??
I dont know if my question make sense sorry
Kansai
20.07.10#5
Comment by rwb.
You should have two separate DC power sources (e.g. 3 AA batteries for 4.5 volt and 8 AA batteries for 12 volt); the first one is the 5 volt or 4.5 volt which is used to power the microcontroller circuit and the second one is the 12 volt which is used to power the Darlington transistor and the DC motor. In order to make the darlington transistor work (ON) we have to provide adequate voltage between the base and the emitter terminal; this voltage is provided by the microcontroller I/O port (powered by 5 Volt source), that is why we have to connect these two voltage sources on the same common ground.
21.07.10#6
Comment by kansairobot.
thank you very much for your reply.
For the H-bridge part i was thinking of using 2N2222’s (since my motor only needs around 280mA).
or use Toshiba TA7291S bridge circuit.
These circuits are made of transistors it seems but how can you see if they generate enough current C-E (as we did for transistors in this tutorial)? I cant seem to understand their datasheet.
Sorry for all the questions but I am learning a lot with your tutorials. Thanks always for these resources…
kansai
21.07.10#7
Comment by rwb.
When you choose the transistor (e.g. 2N2222A); from datasheet Ic max = 800 mA, remember this is the maximum value, usually in real application we only use just half of its maximum capacity which is 400 mA. When you measure the DC motor make sure you also take into the consideration the DC motor stall current (i.e. motor on heavy load, where its almost stop) not reach the 400mA limit; unless you only use the DC motor as a free running DC motor (without or have a very small load).
When using the Toshiba TA7291S bridge all you need is to supply the correct standard logic voltage to the IN1 and IN2 input pins; the integrated circuit inside TA7291S will make sure you get the saturate transistors condition on its output (average 0.9 volt). The input current on the IN1 and IN2 pins is very low (about 3 to 10 uA with Vin = 3.5 volt).
21.09.10#8
Comment by ajoyz124.
Very illustrative, basic and simple facts required to work with micro controls.
Thanks.
08.05.11#9
Comment by topx666.
Lhank you Mr. Besinga for creating this tutorial. please let me introduce my self. my name Taufiq Sunar. I am a student of Electronics and Instrumentation in Gadjah Mada University, Indonesia. Currently I’m trying to make a switch using MOSFET with input from the AVR microcontroller PWM. I’m planning to use MOSFET series IRF740, IRF9530, IRF9540, or IRFZ44. Whether working principle and the calculation of MOSFET is similar to BJT transistor? Thank you very much for your answer!
08.05.11#10
Comment by rwb.
Nice to know you Taufiq. Bipolar Junction Transistor (BJT) is different compared to Metal Oxide Semiconductor Field Effect Transistor (MOSFET), therefore all the calculation for BJT could not be applied to MOSFET.
BJT will amplify the input current (IB) by the current gain factor (hFE) on it’s output (IC) as follow:
hFE = IC / IB
On the other hand MOSFET will amplify the input voltage (VGS) by the transconductance gain factor (gfs) on it’s output (IDS) as follow:
gfs = (change in IDS / change in VGS)
Where VDS: gate to source voltage and IDS: drain to source current.
As you notice there is no IG (gate current) on the MOSFET gain factor formula; because of the issulation oxide on the MOSFET gate terminal design, therefore there is no current flow on the MOSFET Gate terminal (MOSFET is also known as a very high input impedance transistor).
The IDS (drain to source current) will start to increase when the VGS voltage is above the VGS threshold voltage. Any small VGS voltage change applied to the MOSFET Gate input terminal will be amplified by the factor of gfs and reflected as a Drain current on the MOSFET Drain terminal side.
Therefore by supplying VGS much greater than VGS threshold voltage, we could easily push the MOSFET into its saturate region. This make using the MOSFET is more simple compared to BJT as all you need is to connect the MOSFET gate terminal directly to the AVR microcontroller output port.
The AVR microcontroller output port voltage (high logic) could easily drive the MOSFET into its saturate region, but make sure you always read the MOSFET datasheet especially the VDS, IDS, gfs, and VGS threshold when using different type of MOSFET.
I hope this answer will clarify the differences between BJT and MOSFET
10.05.11#11
Comment by topx666.
Thank you very much for the explanation Mr. Besinga. Actually, I want to make a high-speed switch from AVR microcontroller PWM. PWM output is squarewave. Whether after connected into the MOSFET, its output also a squarewave? Because I’ve tried using a IRF740 MOSFET, and 8-bit fast pwm. But the results was not squarewave and its currents and voltages are very small. The PWM input was connected by 4k7 resistor to its gate. And its source supplied by 12V with 10k resistor.
10.05.11#12
Comment by rwb.
Yes the output should be a square wave when the input is a square wave. You could read more about AVR Fast PWM on “Working with Atmel AVR Microcontroller Basic Pulse Width Modulation (PWM) Peripheral” article.
Actually you don’t need to use 4K7 resistor (current limiter) in series with the MOSFET Gate terminal, because there is no “Gate Current”, therefore you don’t have to “reduce” the current as it in BJT. If you want to use resistor use the voltage divider circuit (2 resistors) instead of one resistor. As long as the VGS > VGS threshold and VGS > VDS, the MOSFET will turn ON.
28.06.11#13
Comment by drogge.
I’ve been trying to make a H-Bridge circuit using 4 TIP120’s as per the above diagram and everything works fine if the motor voltage is around 5V. However if I raise the motor voltage to 9 volts I only see about 3.5 volts at the motor. The problem seems to be that the TIP120 can switch the motor to ground but it can’t switch the full 9 volts when it’s base is 5 volts. In other words the circuit labled Using TIP120 Darlington Transistor for Driving Motor works but if I move the transistor between V and the motor it doesn’t work. It looks like I need to use something like TIP125’s for the top transistors in the H-Bridge.
29.06.11#14
Comment by rwb.
Yes, the all TIP120 H-Bridge circuit only work when the base and collector has the same power supply voltage. Because the top TIP120 (NPN) transistor is in common collector configuration and in order to turn ON the transistor, we need to forward bias the VBE, therefore if the base voltage is less then the collector voltage it will not turn ON. When you use the TIP125 (PNP) for the top transistor then all the transistors will have the same common emitter configuration.
I will do some correction and add example on the article above, thanks for your comment.
06.12.11#15
Comment by akhb.
Hi there, This is a very informative post. Your hard work is very appreciated by everyone who luckily lands here.
I receive an active low error signal for a chip. The signal and Vcc on board is +5V. I want to light a blue LED if the signal is low. So I guess we use PNP transistor. I was looking at digital transistors. (they have biased resistors pre-built-in). Can you suggest something like
PDTA143E where the resistors and their ratio is all correct for +5V power supply?
Thank you in advance.
06.12.11#16
Comment by rwb.
You could use any PNP potential divider type of digital transistor as long as you choose a suitable Ic max for your need.
22.09.12#17
Comment by nhokiki.
plz…can you help me!:
LED driver circuit design with the following parameters:
V Led = 6V
I Led = 30mA
and the temperature t*C = 65*C
with square pulse:
Vi max = 6V
Vi min = 0.5V
27.09.12#18
Comment by thbounzer.
Found this article looking for something about driving transistor with a micro;
I must tell you that this post was awesome, a great work!
Detailed explanation, good photos and wonderful schemas.
By the way, give it a look on my blog, if you want, this is the address:
http://www.carlolog.net/log/
Keep going updating yours, ’cause is very nice!
29.09.12#19
Comment by abe.
WOW ! this is an EXCELLENT tutorial. Well done !
21.05.13#20
Comment by jolly.
hi Mr rwb
Thanks you very much for your post. Please i want to know how to use IGBT as switch? But i know how to use as inverter.
27.05.13#21
Comment by rwb.
IGBT (Insulated-Gate Bipolar Transistor) basically is similar to MOSFET (Metal-Oxide Field Effect Transistor). The IGBT will turn-on (conduct current from Collector to Emitter) by applying an adequate Gate to Emitter voltage.
30.05.13#22
Comment by jolly.
thanks Mr.rwb
you explained differneces between BJT and MOSFET. I want to know, how to use IGBT as amplifier? Please Mr.rwb. thanks you.
04.09.13#23
Comment by abdulr76.
Thanks, indeed very informative.
I would like to get some feedback/help on my circuit. I have built a vacuum pump for vacuum assisted brake system (don’t laugh :)). I am going to use digital vacuum switch to make the vacuum pump turn ON under low vacuum (below 15 inches of mercury [in Hg] ) and turn OFF under high pressure (upto 22 inches of mercury) for effective brake. I have various vacuum switches, mainly with 2 options 1. NPN Open Collector Output 2. Analog output.
In order to turn ON/OFF vacuum pump motor, it should be connected to 24 volt relay for which I need to understand how to connect NPN Open Collector output with the 24 volt relay, which looks easy as compared to building a DC-DC Converter/Boost circuit which will amplify vacuum switch output voltage i.e. 2-3 volts to 24 volts. I am using SMC Vacuum switches details are as under:
1. Switch Model = SMC ZSE3
Output = NPN Open Collector, 30V 80 mA or less
2.Switch Model = SMC ZSE40 (BOTH OPEN C.OUT+ANALOG)
NPN or PNP 2 outputs Max. load current : 80 mA
Max. applied voltage: 30 VDC (With NPN output)
Residual voltage : 1 V or less (With 80 mA load current)
ANALOG OUTPUT:
Output voltage: 1 to 5 V
±5% F.S. or less (in rated pressure range)
Linearity: ±1% F.S. or less
Output impedance: Approx. 1 kilo ohm
3. Switch Model = SUNX DP2-20
Output voltage: 1 to 5 V
±5% F.S. or less (in rated pressure range)
Linearity: ±1% F.S. or less
Output impedance: Approx. 1 kilo ohm
Thanking in advance.
Please reply.
Regards,
05.09.13#24
Comment by rwb.
You could connect the open collector with resistor to Vcc, next connect the collector to the base of PNP or NPN transistor to drive a relay.
13.01.14#25
Comment by FlyingW.
Thank you…very helpful and informative.
17.04.14#26
Comment by xelion.
Thank you for an in-depth explanation on driving MOSFET’s. I Really like your way of explaining things!
I’m building a high current power supply, and was having difficulties driving my MOSFET with a PWM signal. After resolving to the Darlington configuration the problem was solved!
Now finally, I can continue on my project, thanks to you;)
21.10.14#27
Comment by vheinitz.
What an amount of work!
I wonder, what software do you use for making your appealing images and diagrams?
14.06.15#28
Comment by chupo_cro.
Are you sure the direction changing algorithm is OK? Seems as it just toggles the direction every 50 ms when the result of AD conversion is more than 800!? Turning the potentiometer will:
a) from ADC=0 to ADC=800 –> decrease the speed of the motor
b) from ADC=800 to ADC=1024 –> decrease the speed of the motor + continuously (every 50 ms) toggle the direction
I don’t think b) is what was intended.


  • Custom Search



  • Future Post

    Controlling the Motor is one of interesting topics in the embedded world especially for the robotics enthusiasts, on the next post we will learn the basic of motor electronic circuit as well as how to control it with microcontroller. Therefore don't miss it, stay tune on this blog !
  • Subscribe

  • Feature Product


    AVRJazz Mega168 Board
    AVRJazz Mega168 Board
  • Categories

  • Archives