Saturday, July 3, 2021

Understanding Active and Reactive Power

Electrical Engineering students find it difficult to understand the difference between active and reactive power. The tool given in here enables changing relevant parameters and observe the behavior of apparent power, active power, and reactive power.

Apparent Power

Let's drive an equation for instantaneous apparent power.

The equation for the instantaneous voltage:

The equation for the instantaneous current:

where;

 is instantaneous voltage

 is instantaneous current

 is RMS voltage

 is RMS current

 is system frequency

 is phase angle between the voltage and the current


if you  substitute  and  and apply little bit of trigonometry,

This shows that apparent power can be decomposed into two components. The green color component is active power and the red color component including the negative sign is reactive power.

Active Power

You may observe that the direction of the active power is always positive. This means active power always flows from the source to the load.

Reactive Power 

The direction of the reactive power change in a frequency of two times the system frequency. This means loads absorb and release reactive power. The released reactive power should be absorbed by the source.

Tool

You can change RMS voltage, RMS current, frequency, and the load power factor and observe the changes in apparent power, active power, and reactive power. 

When the power factor is 1, there is no reactive power and when the power factor is 0, there is no active power.

Sunday, January 13, 2013

LCD Display with Microcontroller


Here I have described how to connect a 16 by 2 LCD display to a microcontroller. Here I have demostrated it with very common pic 16F877A. This is the circuit diagram.

Soldering LCD pins

Here I haven't showed the power supply and oscillator connection for pic and LCD. LCD normally have 16 pins. If you carefully observed you can see number 1 or 16 have printed near the related pin. First let's start with power. LCD display mainly two 5V DC power supplies. Main power supply should connect to VSS and VDD pins. Other power supply is for turn on backlight. Those pins are pin 15 and 16. They haven't been shown in the figure. Backlight power supply is not necessary if we are not going to work in a dark environment. Ok now power supply is done. VEE pin should supply 5Vs through a preset(Variable resistor). By adjusting preset we can change the supply power to the VEE pin. It controls the brightness of the displayed text. If you are not connected this supply some times you may not see text on LCD. D4 to D7 are data pins. We only need 4 pins from them at this stage(D0 to D3). RS, E and D0 to D3 pins should be connected to the earth. 

Connecting LCD to the microcontroller   

Select any port(Eg.  PORTB, PORTC whatever) from microcontroller. Connect pins shown in the figure to any pin as you want on that port. Connection dont't want to be same as the figure. You can use any configuration. We can use microC pro code to initialize microcontroller pins for LCD pins.

Initializing code have shown here.


// LCD module connections

// LCD module connections
sbit LCD_RS at RB2_bit;
sbit LCD_EN at RB3_bit;
sbit LCD_D4 at RB4_bit;
sbit LCD_D5 at RB5_bit;
sbit LCD_D6 at RB6_bit;
sbit LCD_D7 at RB7_bit;

sbit LCD_RS_Direction at TRISB2_bit;
sbit LCD_EN_Direction at TRISB3_bit;
sbit LCD_D4_Direction at TRISB4_bit;
sbit LCD_D5_Direction at TRISB5_bit;
sbit LCD_D6_Direction at TRISB6_bit;
sbit LCD_D7_Direction at TRISB7_bit;
// End LCD module connections

Here we can see that since RS pin have been connected to the RB2 pin sbiv LCD_RS at RB2_biy; code give instruction to microcontroller to control it as thr RS pin. Others are also same. So you can use any microcontroller pin to connect ant LCD pin.

You can use other LCD library in microC pro to send characters to the LCD. They have explained in microC pro help file. If you have any questions about above things please comment here. 

Saturday, October 20, 2012

230V AC TO 5V DC

In this post, I have explained how to build good rectifier circuit to convert 230V AC(This depends on your regional distribution voltage. Eg: 120V in US) power supply into 5V DC power supply. This type of circuit is essential for electrical students when they have to design circuits with microcontrollers and other 5V power supply(VCC) required ICs. This is the circuit diagram.

Lets go from left to right of the circuit. Here I have used 230V to 9V transformer. It has a 300ma rated current. In micrtocontroller based projects we do not need 300ma. But these are the commonly available transformers in the market. Follow my post to get more detail about selecting a suitable transformer. 

Then common full rectifier circuit with four 1N4002 diodes. I think that i do not need to explain how does this bridge work. 

470uF capacitor has been connected between the output terminals of the bridge. This capacitor is very important. Without this, there is a significant change in power output. It increases the supply voltage to the rectifier and make smooth the waveform. If you connect a LED to a microcontroller pin and supply power without this cap most possibly you will see flickers.Other caps also do the same work.

Finally about the regulator. Regulators are designed to supply required voltage without fluctuations. That means we do not need to use regulators with DC power supply. But most of us use these regulators. Why? We use them to reduce the voltage to a desired value. Here we have used AC supply and the regulator does both of those things. It supplies a constant voltage and reduces 9V to 5V.

This is a good time to explain how select a regulator from the market for this type of project. Normally last digits of the regulator indicates the out put voltage. Eg: 7805 : 5V, 7806 : 6V, 7809 : 9V. Regulators with wide range of voltages available in the market. Normally input voltage should be 2V graeter than the output voltage. If you need to regulate negative voltage you can use 79XX series.