Interfacing large load bank with Microcontroller 8051 port expander with 4094 serial to parallel shift register:-
This project is output port expander of microcontroller 8051. In this project we will learn , how to interface a large load bank with microcontroller 8051. In this load bank project, up to 50 solid state relays are interfaced with microcontroller using shift register 74LS4094 TTL IC, student can use CD4094 CMOS IC, any of them will work here fine.
The basic purpose of this microcontroller project is to learn the interfacing of shift register for output port expansion.This project is for bank load which could be in the form of a large number of relays to switch ON or OFF the high voltages and high current loads. The same project can be used for the interfacing of solid state relays.
This is improved version of last project ( Control solid state relays up to 50 with microcontroller 8051 ) in which latches were used. The wiring diagram of that project was complicated. Thus by using serial to parallel shift register ICs, the circuit diagram is quit simple now.
To turn ON any individual LED for load, command is n01 or N01 from RS232 serial communication from PC, you can use hyper terminal for testing the project or you can write your own code in any PC language.
To turn OFF any individual LED for load, command is f01 or F01 to F50 or f50. again serial command will be used for this operation.
The project is tested in Proteus ISIS and found OK.
The circuit diagram of project Interfacing large load bank with Microcontroller 8051 port expander is as follows:
The code is written in C language and compiler is C51 keil. The c code of the project is as under:
This project is output port expander of microcontroller 8051. In this project we will learn , how to interface a large load bank with microcontroller 8051. In this load bank project, up to 50 solid state relays are interfaced with microcontroller using shift register 74LS4094 TTL IC, student can use CD4094 CMOS IC, any of them will work here fine.
The basic purpose of this microcontroller project is to learn the interfacing of shift register for output port expansion.This project is for bank load which could be in the form of a large number of relays to switch ON or OFF the high voltages and high current loads. The same project can be used for the interfacing of solid state relays.
This is improved version of last project ( Control solid state relays up to 50 with microcontroller 8051 ) in which latches were used. The wiring diagram of that project was complicated. Thus by using serial to parallel shift register ICs, the circuit diagram is quit simple now.
To turn ON any individual LED for load, command is n01 or N01 from RS232 serial communication from PC, you can use hyper terminal for testing the project or you can write your own code in any PC language.
To turn OFF any individual LED for load, command is f01 or F01 to F50 or f50. again serial command will be used for this operation.
The project is tested in Proteus ISIS and found OK.
The circuit diagram of project Interfacing large load bank with Microcontroller 8051 port expander is as follows:
The code is written in C language and compiler is C51 keil. The c code of the project is as under:
#include<at89x52.h>
#include<stdio.h>
unsigned char i,j;
unsigned char c;
unsigned char serial_buffer[3];
unsigned char control_Relay[7];
bit ON;
sbit ready = P3^7;
void delay(void);
void display(void);
void convert(unsigned char);
void led_write(unsigned char );
// PORT1 bit 0 are connected to Data_in of first 4094
// PORT1 bit 1 is connected to Clock to all 4094
// PORT1 bit 2 is connected to STB to all 4094
sbit serial_data_out = P1^0;
sbit serial_clock_out = P1^1;
sbit stb = P1^2;
#define LED_STROBE() ((stb = 1),(stb=0))
void main(void){
TMOD = 0x20;
SCON = 0x50;
TH1 = 0xFd;
TL1 = 0xFd;
TR1 = 1;
TI = 1;
RI=0;
EA = 1;
P2 = 255;
P1 = 255;
for(i = 0; i<7;i++)
{
P1 = i;
P2 = 0;
control_Relay[i]=0;
}
ON = 0;
puts("To turn ON say LED # 5, Enter: n05");
puts("To turn OFF say LED # 21, Enter: f21");
while(1)
{
if(RI) {
for(i=0;i<3;i++)
{
while(!RI) ;
RI= 0;
serial_buffer[i] = SBUF;
ready = 0;
}
}
delay();
if(serial_buffer[0]=='n'|serial_buffer[0]=='N')ON=1;
if(serial_buffer[0]=='f'|serial_buffer[0]=='F')ON=0;
if(serial_buffer[1]<= 57 & serial_buffer [1]>= 48 & serial_buffer[2]<= 57 & serial_buffer [2]>= 48){
c = (((serial_buffer[1]-48)*10)+ (serial_buffer[2]-48));
}
convert(c);
display();
// ON = 0;
ready=1;
}
}
void delay(void){
unsigned int z;
for(z=0;z<500;z++);
}
void led_write(unsigned char y)
{
signed char i;
for(i=7; i>=0; i--)
{
serial_clock_out=0; /* drive clock low */
if ((y>>i)&0x01){serial_data_out = 1;}
else {serial_data_out = 0;}
delay();
serial_clock_out=1;
}
}
void display(void)
{
for(i = 0; i<8;i++)
{
led_write( control_Relay[7-i]);
delay();
}
LED_STROBE();
}
void convert(unsigned char d)
{
switch (d)
{
case(1):{if(ON)control_Relay[0]=control_Relay[0]|0x01;else control_Relay[0]=control_Relay[0]&0xfe;}
break;
case(2):{if(ON)control_Relay[0]=control_Relay[0]|0x02;else control_Relay[0]=control_Relay[0]&0xfd;}
break;
case(3):{if(ON)control_Relay[0]=control_Relay[0]|0x04;else control_Relay[0]=control_Relay[0]&0xfb;}
break;
case(4):{if(ON)control_Relay[0]=control_Relay[0]|0x08;else control_Relay[0]=control_Relay[0]&0xf7;}
break;
case(5):{if(ON)control_Relay[0]=control_Relay[0]|0x10;else control_Relay[0]=control_Relay[0]&0xef;}
break;
case(6):{if(ON)control_Relay[0]=control_Relay[0]|0x20;else control_Relay[0]=control_Relay[0]&0xdf;}
break;
case(7):{if(ON)control_Relay[0]=control_Relay[0]|0x40;else control_Relay[0]=control_Relay[0]&0xbf;}
break;
case(8):{if(ON)control_Relay[0]=control_Relay[0]|0x80;else control_Relay[0]=control_Relay[0]&0x7f;}
break;
case(9):{if(ON)control_Relay[1]=control_Relay[1]|0x01;else control_Relay[1]=control_Relay[1]&0xfe;}
break;
case(10):{if(ON)control_Relay[1]=control_Relay[1]|0x02;else control_Relay[1]=control_Relay[1]&0xfd;}
break;
case(11):{if(ON)control_Relay[1]=control_Relay[1]|0x04;else control_Relay[1]=control_Relay[1]&0xfb;}
break;
case(12):{if(ON)control_Relay[1]=control_Relay[1]|0x08;else control_Relay[1]=control_Relay[1]&0xf7;}
break;
case(13):{if(ON)control_Relay[1]=control_Relay[1]|0x10;else control_Relay[1]=control_Relay[1]&0xef;}
break;
case(14):{if(ON)control_Relay[1]=control_Relay[1]|0x20;else control_Relay[1]=control_Relay[1]&0xdf;}
break;
case(15):{if(ON)control_Relay[1]=control_Relay[1]|0x40;else control_Relay[1]=control_Relay[1]&0xbf;}
break;
case(16):{if(ON)control_Relay[1]=control_Relay[1]|0x80;else control_Relay[1]=control_Relay[1]&0x7f;}
break;
case(17):{if(ON)control_Relay[2]=control_Relay[2]|0x01;else control_Relay[2]=control_Relay[2]&0xfe;}
break;
case(18):{if(ON)control_Relay[2]=control_Relay[2]|0x02;else control_Relay[2]=control_Relay[2]&0xfd;}
break;
case(19):{if(ON)control_Relay[2]=control_Relay[2]|0x04;else control_Relay[2]=control_Relay[2]&0xfb;}
break;
case(20):{if(ON)control_Relay[2]=control_Relay[2]|0x08;else control_Relay[2]=control_Relay[2]&0xf7;}
break;
case(21):{if(ON)control_Relay[2]=control_Relay[2]|0x10;else control_Relay[2]=control_Relay[2]&0xef;}
break;
case(22):{if(ON)control_Relay[2]=control_Relay[2]|0x20;else control_Relay[2]=control_Relay[2]&0xdf;}
break;
case(23):{if(ON)control_Relay[2]=control_Relay[2]|0x40;else control_Relay[2]=control_Relay[2]&0xbf;}
break;
case(24):{if(ON)control_Relay[2]=control_Relay[2]|0x80;else control_Relay[2]=control_Relay[2]&0x7f;}
break;
case(25):{if(ON)control_Relay[3]=control_Relay[3]|0x01;else control_Relay[3]=control_Relay[3]&0xfe;}
break;
case(26):{if(ON)control_Relay[3]=control_Relay[3]|0x02;else control_Relay[3]=control_Relay[3]&0xfd;}
break;
case(27):{if(ON)control_Relay[3]=control_Relay[3]|0x04;else control_Relay[3]=control_Relay[3]&0xfb;}
break;
case(28):{if(ON)control_Relay[3]=control_Relay[3]|0x08;else control_Relay[3]=control_Relay[3]&0xf7;}
break;
case(29):{if(ON)control_Relay[3]=control_Relay[3]|0x10;else control_Relay[3]=control_Relay[3]&0xef;}
break;
case(30):{if(ON)control_Relay[3]=control_Relay[3]|0x20;else control_Relay[3]=control_Relay[3]&0xdf;}
break;
case(31):{if(ON)control_Relay[3]=control_Relay[3]|0x40;else control_Relay[3]=control_Relay[3]&0xbf;}
break;
case(32):{if(ON)control_Relay[3]=control_Relay[3]|0x80;else control_Relay[3]=control_Relay[3]&0x7f;}
break;
case(33):{if(ON)control_Relay[4]=control_Relay[4]|0x01;else control_Relay[4]=control_Relay[4]&0xfe;}
break;
case(34):{if(ON)control_Relay[4]=control_Relay[4]|0x02;else control_Relay[4]=control_Relay[4]&0xfd;}
break;
case(35):{if(ON)control_Relay[4]=control_Relay[4]|0x04;else control_Relay[4]=control_Relay[4]&0xfb;}
break;
case(36):{if(ON)control_Relay[4]=control_Relay[4]|0x08;else control_Relay[4]=control_Relay[4]&0xf7;}
break;
case(37):{if(ON)control_Relay[4]=control_Relay[4]|0x10;else control_Relay[4]=control_Relay[4]&0xef;}
break;
case(38):{if(ON)control_Relay[4]=control_Relay[4]|0x20;else control_Relay[4]=control_Relay[4]&0xdf;}
break;
case(39):{if(ON)control_Relay[4]=control_Relay[4]|0x40;else control_Relay[4]=control_Relay[4]&0xbf;}
break;
case(40):{if(ON)control_Relay[4]=control_Relay[4]|0x80;else control_Relay[4]=control_Relay[4]&0x7f;}
break;
case(41):{if(ON)control_Relay[5]=control_Relay[5]|0x01;else control_Relay[5]=control_Relay[5]&0xfe;}
break;
case(42):{if(ON)control_Relay[5]=control_Relay[5]|0x02;else control_Relay[5]=control_Relay[5]&0xfd;}
break;
case(43):{if(ON)control_Relay[5]=control_Relay[5]|0x04;else control_Relay[5]=control_Relay[5]&0xfb;}
break;
case(44):{if(ON)control_Relay[5]=control_Relay[5]|0x08;else control_Relay[5]=control_Relay[5]&0xf7;}
break;
case(45):{if(ON)control_Relay[5]=control_Relay[5]|0x10;else control_Relay[5]=control_Relay[5]&0xef;}
break;
case(46):{if(ON)control_Relay[5]=control_Relay[5]|0x20;else control_Relay[5]=control_Relay[5]&0xdf;}
break;
case(47):{if(ON)control_Relay[5]=control_Relay[5]|0x40;else control_Relay[5]=control_Relay[5]&0xbf;}
break;
case(48):{if(ON)control_Relay[5]=control_Relay[5]|0x80;else control_Relay[5]=control_Relay[5]&0x7f;}
break;
case(49):{if(ON)control_Relay[6]=control_Relay[6]|0x01;else control_Relay[6]=control_Relay[6]&0xfe;}
break;
case(50):{if(ON)control_Relay[6]=control_Relay[6]|0x02;else control_Relay[6]=control_Relay[6]&0xfd;}
break;
}
}
relay switch atmel microcontroller51, interfacing relays with 8051, PLC output on relay switch, how a relay is behave like a switch, load bank consisting of many relays, bank load of relays and switches,data flow diagram of modem data rate analysis,industrial electronics circuit diagram








Dear sir
ReplyDeleteThis seems to be simple. thankyou very much.
reddy
@ Reddy
ReplyDeleteYes, you are right this second version of bank load project using shift registers (serial to parallel)74ls4094 is simple and easy to develop. So you can also use it. Now you have choice. ok
Greetings! I know this is kind of off topic but I was wondering if you knew where I could get a captcha plugin for my comment form? I'm using the same blog platform as yours and I'm having problems finding one? Thanks a lot!
ReplyDelete