-->

Volt Meter Project Using 8051

By
A Lcd interfaced voltmeter Project Using 89s51/52
A Digital Volt meter is meter which displays the voltage in an alpha numeric Display .
Here is the Circuits ,code in keil ,Hexcode etc 
Theory behind calculation of Voltage divider circuit.
All we want is input voltage to ADC should not increase 5V and
Our maximum I/p Voltage to voltmeter is 15V only. So we design
the voltage divider circuit as follows.
 

where Vmax is Maximum i/p voltage to voltmeter.
Vip is i/p voltage to ADC.
R1 and R2 are resistance of voltage divider circuit.

    Vmax
    ---
     |
     \
     / R1
     \
     /
     |___ I/p (Vip)
     |
     \
     / R2
     \
     /
     |
     |
     V
    GND

Vmax = 15V

V = R2*Vmax/(R1+R2)

5/15 = R2/R1+R2

3 = R1/R2+1

2 = R1/R2

R2 = R1/2

Lets take R1 as 200K
and R2 will be 100K

Maximum current: Imax = (Vmax-Vipmax)/R1 (approx)

Vmax = 15V
Vipmax = 5V
R1 = 200K

Imax = (15-5)/200 = 10/200 = 0.02mA 

 

Keil Progarm  


#include <REGX51.H>
#include "lcd.h"
#define adc_port P1 //ADC Port
#define rd P3_7 //Read signal P3.7
#define wr P3_6 //Write signal P3.6
#define cs P3_5 //Chip Select P3.5
#define intr P3_4 //INTR signal P3.4
void conv(); //Start of conversion function
void read(); //Read ADC function
unsigned int adc_avg, adc;
void main()
{
char i;
LCD_INI();
while (1) { //Forever loop

adc_avg = 0;
for (i = 0; i < 10; i++) {
conv(); //Start conversion
read(); //Read ADC
adc_avg += adc;
}
adc_avg = adc_avg / 10;
wrt_cmd(0x80);
wrt_string("V(DC): ");
adc = adc_avg * 59;
hex2lcd((unsigned char) (adc / 1000));
wrt_data('.');
adc = adc % 1000;
hex2lcd((unsigned char) (adc / 10));
wrt_data('V');
}
}
void conv()
{
cs = 0; //Make CS low
wr = 0; //Make WR low
wr = 1; //Make WR high
cs = 1; //Make CS high
while (intr); //Wait for INTR to go low
}
void read()
{
cs = 0; //Make CS low
rd = 0; //Make RD low
adc = adc_port; //Read ADC port

rd = 1; //Make RD high
cs = 1; //Make CS high
}
Hex Code 

:10019400D2A7C2B0D2B130A706C2B2D2B280F7227F
:0E01B4001201948FA0C2B0C2B1D2B2C2B22268
:0E01C2001201948FA0D2B0C2B1D2B2C2B2224A
:10015B008B0D8A0E890FAB0DAA0EA90F12008A60A8
:10016B0013050FE50F7002050E14F912008AFF122A
:05017B0001C280E22238
:100180007F301201B47F0C1201B47F011201B47FE1
:04019000060201B4AE
:10010A00AE07E4FD749C2EFEC36480948040010D0A
:10011A00C3EE6480948050ECED648094804007EDD7
:10012A002430FF1201C2E4FD74642EFE74F62EFE22
:10013A00C36480948040010DC3EE6480948050ECC7
:10014A00ED2430FF1201C2EE240AFD2430FF020121
:01015A00C2E2
:0801E80056284443293A200087
:10000300120180E4F50AF50BF50C1201D01201A4DC
:10001300E509250BF50BE508350AF50A050CC3E5DB
:100023000C6480948A40E3AE0AAF0B7C007D0A1215
:1000330000B58E0A8F0B7F801201B47BFF7A0179A2
:10004300E812015BAE0AAF0B7C007D3B1200A38E6E
:10005300088F097C037DE81200B512010A7F2E1276
:1000630001C2AE08AF097C037DE81200B58C088D90
:1000730009AE08AF097C007D0A1200B512010A7FA0
:07008300561201C202000643
:0C01D000C2B5C2B6D2B6D2B520B4FD2232
:1001A400C2B5C2B7AF907508008F09D2B7D2B522D5
:030000000201DC1E
:0C01DC00787FE4F6D8FD75810F02000367
:10008A00BB010689828A83E0225002E722BBFE0274
:09009A00E32289828A83E49322A7
:1000A300EF8DF0A4A8F0CF8CF0A428CE8DF0A42E71
:0200B300FE222B
:1000B500BC000BBE0029EF8DF084FFADF022E4CC2F
:1000C500F875F008EF2FFFEE33FEEC33FCEE9DECF8
:1000D500984005FCEE9DFE0FD5F0E9E4CEFD22ED3E
:1000E500F8F5F0EE8420D21CFEADF075F008EF2F88
:1000F500FFED33FD4007985006D5F0F222C398FD79
:050105000FD5F0EA2215
:00000001FF

LCD.c File 
#include "lcd.h"

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**** Cheacking the busy flag of LCD
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

void busy()
{
flag = 1;
rs = 0;
rw = 1;
while (flag != 0) {
en = 0;
en = 1;
}
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**** Writing command to LCD ****
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

void wrt_cmd(unsigned char val_lcd)
{
busy();
lcd_port = val_lcd;
rs = 0;
rw = 0;
en = 1;
en = 0;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~
**** Writing data on LCD ****
~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

void wrt_data(unsigned char dat)
{
busy();
lcd_port = dat;
rs = 1;
rw = 0;
en = 1;
en = 0;
}

void wrt_string(unsigned char *string)
{
while (*string)
wrt_data(*string++);
}

void LCD_INI(void)
{
wrt_cmd(0X30);
wrt_cmd(0X0C);
wrt_cmd(0X01);
wrt_cmd(0X06);
}

void hex2lcd(unsigned char hex)
{
char temp1, temp2;
temp1 = hex;
temp2 = 0;
do {
temp1 = temp1 - 100;
if (temp1 >= 0)
temp2++;
} while (temp1 >= 0);
if (temp2 > 0)
wrt_data(temp2 + 0x30);
temp2 = 0;
temp1 = temp1 + 100;
do {
temp1 = temp1 - 10;
if (temp1 >= 0)
temp2++;
} while (temp1 >= 0);
wrt_data(temp2 + 0x30);
temp2 = temp1 + 10;
wrt_data(temp2 + 0x30);
}
 LCD Header File
#ifndef __LCD_H__
#define __LCD_H__

#include <REGX51.H>

#define lcd_port P2
#define rs P3_0
#define rw P3_1
#define en P3_2
#define flag P2_7

void wrt_cmd(unsigned char);
void wrt_data(unsigned char);
void wrt_string(unsigned char *);
void LCD_INI(void);
void busy(void);
void hex2lcd(unsigned char);

#endif

Volt Meter Project Using 8051

By
A Lcd interfaced voltmeter Project Using 89s51/52
A Digital Volt meter is meter which displays the voltage in an alpha numeric Display .
Here is the Circuits ,code in keil ,Hexcode etc 
Theory behind calculation of Voltage divider circuit.
All we want is input voltage to ADC should not increase 5V and
Our maximum I/p Voltage to voltmeter is 15V only. So we design
the voltage divider circuit as follows.
 

where Vmax is Maximum i/p voltage to voltmeter.
Vip is i/p voltage to ADC.
R1 and R2 are resistance of voltage divider circuit.

    Vmax
    ---
     |
     \
     / R1
     \
     /
     |___ I/p (Vip)
     |
     \
     / R2
     \
     /
     |
     |
     V
    GND

Vmax = 15V

V = R2*Vmax/(R1+R2)

5/15 = R2/R1+R2

3 = R1/R2+1

2 = R1/R2

R2 = R1/2

Lets take R1 as 200K
and R2 will be 100K

Maximum current: Imax = (Vmax-Vipmax)/R1 (approx)

Vmax = 15V
Vipmax = 5V
R1 = 200K

Imax = (15-5)/200 = 10/200 = 0.02mA 

89S series (Microcontrollers) Programmer using Parallel Port

By
Here is a simple programmer circuit which uses the PC parallel port to burn the 89s series chips.
It can program almost all AT89S series micro controllers.













89S series (Microcontrollers) Programmer using Parallel Port

By
Here is a simple programmer circuit which uses the PC parallel port to burn the 89s series chips.
It can program almost all AT89S series micro controllers.













LED Blinking Using 8051

By
--> LED Blinking Using 8051 -Proteus Simulation Tutorials
AT89C51 is an 8-bit micro-controller and belongs to Atmel's 8051 family. AT89C51 has 4KB of Flash programmable and erasable read only memory (P-EROM) and 128 bytes of RAM. It can be erased and program to a maximum of 1000 times.

In 40 pin AT89C51, there are four ports designated as P1, P2, P3 and P0. All these ports are 8-bit bi-directional ports, i.e., they can be used as both input and output ports. Except P0 which needs external pull-ups, rest of the ports have internal pull-ups. When 1s are written to these port pins, they are pulled high by the internal pull-ups and can be used as inputs. These ports are also bit addressable and so their bits can also be accessed individually.

Port P0 and P2 are also used to provide low byte and high byte addresses, respectively, when connected to an external memory. Port 3 has multiplexed pins for special functions like serial communication, hardware interrupts, timer inputs and read/write operation from external memory. AT89C51 has an inbuilt UART for serial communication. It can be programmed to operate at different baud rates. Including two timers & hardware interrupts, it has a total of six interrupts.

One can read datasheets for detailed knowledge.

Lets start with our first program to blink the LED's at the PORT-0 of the Micro-Controller.
Note that these programs are made in Keil u Vision 3
-->

#include <REGX51.H> // Header file

void Delay(unsigned char i); // Function calling

void main()

{
P0 = 0x00;                               //PORT 0 as Output Port


while (1) {

P0 = 0xAA;                           // 10101010

Delay(1000);

P0 = 0x55;                           // 010101010

Delay(1000);

}
}

void Delay(unsigned char itime)

{

unsigned char i;

for (i = 0; i < itime; i++);

}

  1. Now put the generated *.hex files in the micro-controller's memory and view the result, the output is shown below.
Any doubt Please mail me i will help you thannara123(at)gmail.com

LED Blinking Using 8051

By
--> LED Blinking Using 8051 -Proteus Simulation Tutorials
AT89C51 is an 8-bit micro-controller and belongs to Atmel's 8051 family. AT89C51 has 4KB of Flash programmable and erasable read only memory (P-EROM) and 128 bytes of RAM. It can be erased and program to a maximum of 1000 times.

In 40 pin AT89C51, there are four ports designated as P1, P2, P3 and P0. All these ports are 8-bit bi-directional ports, i.e., they can be used as both input and output ports. Except P0 which needs external pull-ups, rest of the ports have internal pull-ups. When 1s are written to these port pins, they are pulled high by the internal pull-ups and can be used as inputs. These ports are also bit addressable and so their bits can also be accessed individually.

Port P0 and P2 are also used to provide low byte and high byte addresses, respectively, when connected to an external memory. Port 3 has multiplexed pins for special functions like serial communication, hardware interrupts, timer inputs and read/write operation from external memory. AT89C51 has an inbuilt UART for serial communication. It can be programmed to operate at different baud rates. Including two timers & hardware interrupts, it has a total of six interrupts.

One can read datasheets for detailed knowledge.

Lets start with our first program to blink the LED's at the PORT-0 of the Micro-Controller.
Note that these programs are made in Keil u Vision 3
-->

#include <REGX51.H> // Header file

void Delay(unsigned char i); // Function calling

void main()

{
P0 = 0x00;                               //PORT 0 as Output Port


while (1) {

P0 = 0xAA;                           // 10101010

Delay(1000);

P0 = 0x55;                           // 010101010

Delay(1000);

}
}

void Delay(unsigned char itime)

{

unsigned char i;

for (i = 0; i < itime; i++);

}

  1. Now put the generated *.hex files in the micro-controller's memory and view the result, the output is shown below.
Any doubt Please mail me i will help you thannara123(at)gmail.com

Basic Electronics

By



Electronics is the branch of science that deals with the study of flow and control of electrons (electricity) and the study of their behavior and effects in vacuums, gases, and semiconductors, and with devices using such electrons. This control of electrons is accomplished by devices that resist, carry, select, steer, switch, store, manipulate, and exploit the electron. 



Difference in “Electronics” and “Electrical

Electronics deals with flow of charge (electron) through non-metal conductors (semi-conductors).

Electrical deals with the flow of charge through metal conductors.
Example: Flow of charge through silicon which is not a metal would come under electronics whereas flow of charge through copper which is a metal would come under electrical.



How is Electricity Generated

We all know that everything on earth is made op of atoms. Each atom is made up of electronics which are negatively charged, protons which are positively charged and neutrons which are neutrally charged or they have no charge. The number of electrons and protons in an atom is always same. Look at the picture on the right.
Now what will happen when electronics, by any means, flow away from the atom (Protons cannot flow away from an atom because they are in the inner orbit than electrons and are very tightly and strongly bonded.)? Yes, this flow of electrons produces electricity.
Let us say there are two objects - A and B with 10 electrons each. Due to friction or any other reason, 2 electrons from the outer orbit of A flows away to B. Now there are 8 electrons in A and 12 electrons in B. What is the net result of this flow of electrons? Yes, object A will get negatively charged because of excess electrons and object B will get positively charged because of Deficit of electrons. This is how electricity is produced.

Ohm's Law

Ohm's law states that, in a given electrical circuit, the amount at current in amps is equal to the pressure in volts divided by the resistance in ohms. The formula is: I (Current) = V voltage or V = I x RR resistance or R = V/I.


Electronic Components

Electronic components are basic electronic element or electronic parts usually packaged in a discrete form with two or more connecting leads or metallic pads. Electronic Components are intended to be connected together, usually by soldering to a printed circuit board (PCB), to create an electronic circuit with a particular function (for example an amplifier, radio receiver, oscillator, wireless). Some of the main Electronic Components are: resistor, capacitor, transistor, diode, operational amplifier, resistor array, logic gate etc.
Electronic components are classed into either being Passive devices or Active devices. Active devices are different from passive devices. These devices are capable of changing their operational performance, may deliver power to the circuit, and can perform interesting mathematical functions. While a device that does not require a source of energy for its operation.


Active Electronic Components

An active device is any type of circuit component with the ability to electrically control electron flow (electricity controlling electricity). In order for a circuit to be properly called electronic, it must contain at least one active device. Active devices include, but are not limited to, vacuum tubes, transistors, silicon-controlled rectifiers (SCRs), and TRIACs. All active devices control the flow of electrons through them. Some active devices allow a voltage to control this current while other active devices allow another current to do the job.

Passive Electronic Components

Components incapable of controlling current by means of another electrical signal are called passive devices. Resistors, capacitors, inductors, transformers, and even diodes are all considered passive devices.Electronic Circuit
An Electronic Circuit may be defined as a collection of electronic elements that performs a prescribed function.
Electronic Circuit 

Analog Electronic Circuit

Analog electronic circuits are those in which signals may vary continuously with time to correspond to the information being represented. Electronic equipments like voltage amplifiers, power amplifiers, tuning circuits, radios, and televisions are mainly analog. 



Will Be Continue ....................



Basic Electronics

By



Electronics is the branch of science that deals with the study of flow and control of electrons (electricity) and the study of their behavior and effects in vacuums, gases, and semiconductors, and with devices using such electrons. This control of electrons is accomplished by devices that resist, carry, select, steer, switch, store, manipulate, and exploit the electron. 



Difference in “Electronics” and “Electrical

Electronics deals with flow of charge (electron) through non-metal conductors (semi-conductors).

Electrical deals with the flow of charge through metal conductors.
Example: Flow of charge through silicon which is not a metal would come under electronics whereas flow of charge through copper which is a metal would come under electrical.



How is Electricity Generated

We all know that everything on earth is made op of atoms. Each atom is made up of electronics which are negatively charged, protons which are positively charged and neutrons which are neutrally charged or they have no charge. The number of electrons and protons in an atom is always same. Look at the picture on the right.
Now what will happen when electronics, by any means, flow away from the atom (Protons cannot flow away from an atom because they are in the inner orbit than electrons and are very tightly and strongly bonded.)? Yes, this flow of electrons produces electricity.
Let us say there are two objects - A and B with 10 electrons each. Due to friction or any other reason, 2 electrons from the outer orbit of A flows away to B. Now there are 8 electrons in A and 12 electrons in B. What is the net result of this flow of electrons? Yes, object A will get negatively charged because of excess electrons and object B will get positively charged because of Deficit of electrons. This is how electricity is produced.

Ohm's Law

Ohm's law states that, in a given electrical circuit, the amount at current in amps is equal to the pressure in volts divided by the resistance in ohms. The formula is: I (Current) = V voltage or V = I x RR resistance or R = V/I.


Electronic Components

Electronic components are basic electronic element or electronic parts usually packaged in a discrete form with two or more connecting leads or metallic pads. Electronic Components are intended to be connected together, usually by soldering to a printed circuit board (PCB), to create an electronic circuit with a particular function (for example an amplifier, radio receiver, oscillator, wireless). Some of the main Electronic Components are: resistor, capacitor, transistor, diode, operational amplifier, resistor array, logic gate etc.
Electronic components are classed into either being Passive devices or Active devices. Active devices are different from passive devices. These devices are capable of changing their operational performance, may deliver power to the circuit, and can perform interesting mathematical functions. While a device that does not require a source of energy for its operation.


Active Electronic Components

An active device is any type of circuit component with the ability to electrically control electron flow (electricity controlling electricity). In order for a circuit to be properly called electronic, it must contain at least one active device. Active devices include, but are not limited to, vacuum tubes, transistors, silicon-controlled rectifiers (SCRs), and TRIACs. All active devices control the flow of electrons through them. Some active devices allow a voltage to control this current while other active devices allow another current to do the job.

Passive Electronic Components

Components incapable of controlling current by means of another electrical signal are called passive devices. Resistors, capacitors, inductors, transformers, and even diodes are all considered passive devices.Electronic Circuit
An Electronic Circuit may be defined as a collection of electronic elements that performs a prescribed function.
Electronic Circuit 

Analog Electronic Circuit

Analog electronic circuits are those in which signals may vary continuously with time to correspond to the information being represented. Electronic equipments like voltage amplifiers, power amplifiers, tuning circuits, radios, and televisions are mainly analog. 



Will Be Continue ....................



More Posts

gElectron. Powered by Blogger.

Contributors

16x2 LCD Interfacing with STM32,STM32F103C6

 16x2 LCD  Interfacing with STM32,STM32F103C6 lcd_init(); LCD_LINE1; lcd_String(" GeElectron"); LCD_LINE2; lc...

Contact Form

Name

Email *

Message *

Contact us

Name

Email *

Message *

Follow Us

https://www.facebook.com/gElectron-393939667321867/ FBbox/https://www.facebook.com/IVYthemes

Comments

[blogger]

MKRdezign

Test

Latest

[recent][newsticker]

Technology

Top Ads

RECENT COMMENTS

Subscribe Via Email

Subscribe to our newsletter to get the latest updates to your inbox. ;-)


Your email address is safe with us!

RECENT COMMENTS