Posts

Showing posts from March, 2021

PIANO USING AT89C51RD2

Image
SIMULATOR: PROTEUS 8.0 SOFTWARE: KEIL 4.0 CIRCUIT DIAGRAM:   CIRCUIT DESCRIPTION: Switches from one to seven are connected in pull-up configuration to p1.0 to p1.6 respectively. A buzzer is connected to p2.0. WORKING: In this project, I have created the prototype of the piano using seven switches and a buzzer. Seven switches are used as a seven keys(sa, re, ga, ma, pa, dha, ni, sa) of piano. A buzzer is used to generate the sound given by the controller(AT89C51RD2). Whenever a switch related to a particular key is pressed, the frequency of that particular key is applied to the buzzer by the controller(AT89C51RD2). PROGRAM: #include<reg51.h> sbit sw1 = P1^0;   // SA sbit sw2 = P1^1;  // RE sbit sw3 = P1^2; // GA sbit sw4 = P1^3; // MA sbit sw5 = P1^4; // PA sbit sw6 = P1^5; // DHA sbit sw7 = P1^6; // NI sbit pulse = P2^0; //buzzer void tune(unsigned int th,unsigned int tl); int main() {   while(1) { if(sw1==0)   { pulse = ~P2^0; tune(0xf8,0x77); // frequency of sa } if(sw2==0) {

DC motor interfacing using AT89C51RD2

Image
SIMULATOR: PROTEUS 8.0 SOFTWARE: KEIL 4.0 CIRCUIT DIAGRAM: PIN DESCRIPTION of L293D: VSS and VS: +5v to +9v GND: GND EN1: Enable pin of motor 1 EN2: Enable pin of motor 2 IN1 and IN2: Input pin of motor 1 IN3 and IN4: Input pin of motor 2 OUT1 and OUT2: Output pin of motor 1 OUT3 and OUT4: Output pin of motor 2 CIRCUIT DESCRIPTION: EN1 and EN2 are the enable pins of dc motor 1 and dc motor 2 respectively. Both the enable pins must be connected to VCC to run the dc motors. IN1and IN2 pins are connected to p2.0 and p2.1 respectively.IN3 and IN4 pins are connected to p2.3 and p2.4 respectively.OUT1 and OUT2 pins are connected to dc motor1.OUT3 and OUT4 pins are connected to dc motor2. Switch 1 and Switch 2 are connected in pull-up arrangement to port1.0 and port 1.5 respectively. WORKING: In this project, I have interfaced two dc motors using the AT89c51RD2 controller. Motor driver L293D is used to drive both the dc motors. Whenever switch1 is pressed, dc mot

LCD interfacing using AVR(ATMEGA 32)

Image
SIMULATOR: PROTEUS 8.0 SOFTWARE: KEIL 4.0 CIRCUIT DIAGRAM: PIN DESCRIPTION OF LCD: PROGRAM: #include<avr/io.h>   // header file for AVR #include<util/delay.h> // header file for delay function void lcd_init(void); void lcd_command(char c); void lcd_data(char d); void str(char a[]); int main(void)    // main program   { DDRB=0XFF;  //  Select PORT B as an output port DDRD=0XFF; // Select PORT D as an output port lcd_init();      // initialize the lcd while(1)             // continuous loop   { str("WELCOME TO THE");  lcd_command(0xc0);                  // move cursor to the next line str("EMBEDDED SYSTEM"); lcd_command(0x01);           // clear display } } void lcd_init(void)  // lcd initialization function { lcd_command(0x38); //8bit,2 line,5*7 matrix lcd_command(0x0c); //cursor off,display on lcd_command(0x80);//force cursor to the beginning of the first line lcd_command(0x01);// clear display lcd_co