MOC3021 Circuitry for Inductive Load with Snubber Circuit

Remember, as a thumb rule, that whenever the inductive load is used in the circuits; depending upon the nature of the load, there can be or can not be a need for a snubber circuit. Snubber circuit is basically used to cater for the dv/dt and di/dt side effects. We mostly used capacitors and inductors in designing snubber circuits. Usually a RC snubber is used with the thyristors so that false turn on of the thyristor due to the high dv/dt can be avoided.  The values of these passive components are calculated depending upon the load and the selection of components. Since most of the AC loads are inductive in nature, so there is often a need of the snubber circuit with MOC3021 and BT136. Here is the modified version the MOC3021 circuitry for an inductive load.
Here you can see that there are snubber circuits, one for the triac and the other for the opto triac. A combination of 39 ohm resistance and 0.01u is a protection for the triac BT-136, similarly 470 ohm/0.05 u is for the opto triac. The above circuit had been tested practically.

More to follow.

Also see:

11:03 | Posted in , , , | Read More »

220V zero crossing detection using AVR microcontroller with minimum components

Well, it seems strange that zero crossing being done directly using microcontroller with the help of two resistors only. AVR  application note 182 verifies that zero crossing of 220 AC is possible using two resistors only. Here is how it looks like:

There is no rocket science in the above arrangement. 220AC through 1M ohm resistor, being fed directly to the AVR microcontroller will not do any harm to it. This is because the microcontrollers have internal clamping diodes that limits the high input voltage to microcontrollers operating voltage. The resistors here are used to convert a high voltage AC sinusoid to low voltage square wave. Thereafter using interrupts of the microcontroller, one can easily do the zero crossing detection.

However, there are some issues regarding the above arrangement. First of all EMI (Electromagnetic Compatibility) issue can arise. This is due to the fact that there is no isolation between the Hot Line and the microcontroller and the induced noise may affect the functionality both in the inter or intra system.  Secondly, the resistor connected with AC lines act as a RC filter and thereby generating a minute phase delay. But this minute phase delay can be neglected in most of the applications. This method for the zero crossing detection is still considered very efficient. 

Care should also be taken that high AC voltage may not damage the other components. There have been cases, I personally know, that people have burned out their microcontroller just because of little carelessness.

Also refer to the following posts:

RMS Voltage Control Circuit with MOC3021 and BT136

AVR C code for RMS voltage control using BT-136 and MOC-3021



For any queries, contact elprojects@ymail.com or fill up the contact form.

More to Follow!

01:42 | Posted in , , , , , | Read More »

AVR C code for RMS voltage control using BT-136 and MOC-3021

To accomplish the firing angle (RMS) firing angle control of an AC load, please refer to the hardware arrangement explained here. Here is the schematic taken from the application notes of MOC3021 :


There is a need of zero crossing detector, that will provide the reference point. Just after the microcontroller detects the zero crossing of 220V AC, it will turn on the BJT C828 (shown above) with some delay. This delay will determine the RMS voltage across the AC load. Say for example on 50 Hz AC,  the time period comes out to be 20ms. That means the microcontroller will detect the zero crossing every 10 ms. So the range of delay, after which the microcontroller will trigger C828, comes out to be 0-10ms. At delay of 0ms, whole sinusoid will pass through the AC load. Similarly at 5ms i-e firing angle of 90', the RMS voltage across the AC load will be 110V. Therefore we can say that by varying the delay from 0-10ms, we get varying RMS voltage from 220V to 0V.

I have tested the above circuitry using AVR ATmega16L. What microcontroller needs to do is to generate an interrupt on zero crossing and then call the delay routine. How zero crossing of 220V AC is accomplished on microcontroller, will be discussed later. Here is the C code for AVR studio, to test the firing angle control of AC load:

#include <avr/interrupt.h>
#include <avr/iom16.h>
#include <util/delay.h>


volatile int int_flag=0;


ISR( INT0_vect )
{
int_flag=1;
}


void int0_init( void )
{
    MCUCR = (0<<ISC01)|(1<<ISC00);  // enable any level change interrupt
    GICR = (1<<INT0);               // enable INT0
}


int main( void )
{
        DDRB   = 0xFF;     // PORTB as output
DDRA   = 0xFF;     
DDRC   = 0xFF;


  
    int0_init();                    // configure INT0

    sei();                          // enable global interrupts

    while (1)                       // loop forever, 
        
{
asm("nop");

if(int_flag==1)
{

PORTB=0x00;
PORTA=0x00;
PORTC=0x00;
PORTC=0xFF;
PORTB|=(1<<PB0);
_delay_ms(0.625);
PORTB=(1<<PB1)|(1<<PB0);
_delay_ms(0.625);
PORTB=(1<<PB2)|(1<<PB1)|(1<<PB0);
_delay_ms(0.625);
PORTB=(1<<PB3)|(1<<PB2)|(1<<PB1)|(1<<PB0);
_delay_ms(0.625);
PORTB=(1<<PB4)|(1<<PB3)|(1<<PB2)|(1<<PB1)|(1<<PB0);
_delay_ms(0.625);
PORTB=(1<<PB5)|(1<<PB4)|(1<<PB3)|(1<<PB2)|(1<<PB1)|(1<<PB0);
_delay_ms(0.625);
PORTB=(1<<PB6)|(1<<PB5)|(1<<PB4)|(1<<PB3)|(1<<PB2)|(1<<PB1)|(1<<PB0);
_delay_ms(0.625);
PORTB=(1<<PB7)|(1<<PB6)|(1<<PB5)|(1<<PB4)|(1<<PB3)|(1<<PB2)|(1<<PB1)|(1<<PB0);
_delay_ms(0.625);
PORTA=(1<<PA0);
_delay_ms(0.625);
PORTA=(1<<PA1)|(1<<PA0);
_delay_ms(0.625);
PORTA=(1<<PA2)|(1<<PA1)|(1<<PA0);
_delay_ms(0.625);
PORTA=(1<<PA3)|(1<<PA2)|(1<<PA1)|(1<<PA0);
_delay_ms(0.625);
PORTA=(1<<PA4)|(1<<PA3)|(1<<PA2)|(1<<PA1)|(1<<PA0);
_delay_ms(0.625);
PORTA=(1<<PA5)|(1<<PA4)|(1<<PA3)|(1<<PA2)|(1<<PA1)|(1<<PA0);
_delay_ms(0.625);
PORTA=(1<<PA6)|(1<<PA5)|(1<<PA4)|(1<<PA3)|(1<<PA2)|(1<<PA1)|(1<<PA0);
_delay_ms(0.625);
PORTA=(1<<PA7)|(1<<PA6)|(1<<PA5)|(1<<PA4)|(1<<PA3)|(1<<PA2)|(1<<PA1)|(1<<PA0);
int_flag=0;

}

}
    return(0);
}

What is happening in the code? The two ports of AVR ATmega16 is dedicated to test the RMS voltage control of an AC load. Any pin of PORTA and PORTB can be connected to the BJT. Pin 0 of PORTB will trigger the transistor at a delay of 0ms, Pin 1 at a delay of 0.625 ms. In fact the the firing angle is divided into 16 steps (as their are 16 pins dedicated), therefore as you move from PINB0 to PINB7 and then from PINA0 to PINA7, you get an increment of 0.625ms each time you move from one pin to another. If the BJT is connected across PINB0, you get RMS voltage 220 across the load. This RMS voltage will decrease as you move to PINB1 and further till PINA7, as the delay is increasing. 

The above code has been tested successfully. Contact elprojects@ymail.com for any queries.

22:49 | Posted in , , , | Read More »

Bidirectional Control of DC Motor using transistor based H-Bridge with single input

Controlling a DC motor in both directions often need a H-Bridge, which is nothing but an arrangement of few transistors. If not by using a single input, atmost two inputs be used to control the motor in both the directions. Otherwise, there are chances for accidential burning of transistors by programming errors. For example, if you accidentally set the transistors 1 and 2 in conducting state, shot-circuit current will flow through both of these transistor making them useless for further operations.
At any instant only one of the cross pairs of transistors can be in conducting state as explained earlier. These two pairs of transistors are responsible for the movement of motor in both directions. When 1 and 2 are on, the motor moves in one direction, on the other hand when 3 and 4 are on, the motor moves into other direction. Not Gate is placed to make sure that the two pairs are never turned on together.
How to lock the motor using a single input? The single input can be provided with 1 or 0 forcing the motor to move in either direction. So locking of motor can not be achieved. However if the pulse of 50% duty cycle is given to the input, then the motor will come to halt. One disadvantage of this approach is that the motor will draw current even in the locking state.
The above circuit has been tested practically!
More to Follow

22:02 | Posted in , , , , | Read More »

RMS Voltage Control Circuit with MOC3021 and BT136


Triac is a power electronic component that conducts in both directions when triggered through gate. Figure below shows a generic working of triac.As it can be seen that at time t1, angle of sinusoid is 45' which means that if we triggered triac at this angle i-e at 45', only shaded blue area will pass through the triac and hence through the load. Observe that shaded blue are has RMS Voltage less than the pure sinusoid. This is the basic principle by which RMS Voltage control is accomplished. Firing needs a small pulse at gate that can be give through microcontroller also. Similarly at firing angle 90' (firing angle is an angle with reference zero crossing at which the triac is triggered using gate pulse) , only red part of sinusoid will pass through the triac giving us the RMS 110V for 220V.



Coutesy of Motrola,Inc

MOC3021 is an optotriac (product of Motorola) that is used for isolation between power and driving circuitry. Note that when C828 on the base is applied voltage>0.7V, optotriac gets triggered. As the triac gets triggered now, the positive or negative voltage (whatever maybe) get pass through the gate of BT136 (triac) and hence triggered it. It should be noted here that by using above arrangement we can control the RMS voltage in both directions. What needs to be taken care of, is the triggering time or firing angle.

There is a need of a zero-crossing detector that will give us the reference for providing delay for desired firing angle. In above example, for firing angle to be 90' for 220V 50Hz AC signal, we need to have a delay of 2.5 ms (t1=2.5ms) right after each zero crossing. Usually MOC3021 is driven through microcontroller, which gives the firing pulse on the basis of interrupt generated by the zero-crossing detector. 

The above circuit is mainly used as a dimmer and is often used speed controlling of AC motor. There are other versions of the above circuits available that caters for the inductive load which will be discussed later.

More to follow!

21:16 | Posted in , , , , | Read More »

MOSFET BASED DC MOTOR DRIVER

You will notice that there are diodes placed across the mosfets. Usually mosfets have internal diodes, but it is a good idea to add external diodes, just to be safe. These diodes should be high speed schotky diodes, with an appropriate current rating. When motors rapidly change direction, the back EMF generated inside the motor can damage mosfets. These diodes are in place to absorb the back EMF, and to keep the mosfets safe. Do not ignore these diodes, as they are necessary to keep your H-Bridge from being destroyed.



When choosing mosfets, it is important that they will be able to handle the maximum current required by your motors. This is the stall current. If the mosfets you chose are insufficient, it can cause your motor driver to go up in smoke if your motors approach stall. I have used IR530 and IR 9530. Also note that all the transistors must be from the same company (this is not written in any book,  its my own observation), otherwise you may have heating problem. The above model has been successfully implemented on the robot, report of which will be publishes ASAP. Thanks.

20:01 | Posted in , | Read More »

Labels

Recently Commented

Recently Added