This project is developed to control up to 50 solid state relays individually. The project is good learning material for students who which to expand the input output lines of microcontroller and want to control many devices.
This project is a basic idea for bank load implementation.
Features of bank load project using microcontroller 8051:-
1. Up to 50 external devices can be separately controlled with microcontroller.
2. The ON or OFF status of each external hardware device is currently shown with the help of LED, which will be replace with optical isolator to interface the relays or other high load device.
3. This project received serial RS232 commands to control the bank load.
4. To turn any LED (relay attached with the it on any output line), the command is
n_ _ or N_ _ i.e. here n or N stands for "ON" and at blank spaces put the number 01 to 50. so we can say that to turn on the led number 5, command will be n05 or N05.
4. Similarly to turn OFF, the command will be f05 or F05.
5. To expand the output lines, latches 74ls373 are used which are selected with decoded 74ls138 one by one.
The circuit diagram of the project is as follows:
The code is written in C language and C51 keil compiler is used.
This project is a basic idea for bank load implementation.
Features of bank load project using microcontroller 8051:-
1. Up to 50 external devices can be separately controlled with microcontroller.
2. The ON or OFF status of each external hardware device is currently shown with the help of LED, which will be replace with optical isolator to interface the relays or other high load device.
3. This project received serial RS232 commands to control the bank load.
4. To turn any LED (relay attached with the it on any output line), the command is
n_ _ or N_ _ i.e. here n or N stands for "ON" and at blank spaces put the number 01 to 50. so we can say that to turn on the led number 5, command will be n05 or N05.
4. Similarly to turn OFF, the command will be f05 or F05.
5. To expand the output lines, latches 74ls373 are used which are selected with decoded 74ls138 one by one.
The circuit diagram of the project is as follows:
The code is written in C language and C51 keil compiler is used.
#include<at89x51.h>
#include<stdio.h>
#include<stdlib.h>
unsigned char i,j;
unsigned char c;
unsigned char rs[3];
unsigned char control[7];
bit ON;
sbit ready = P3^7;
void delay(void);
void display(void);
void convert(unsigned char);
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[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;
rs[i] = SBUF;
ready = 0;
}
}
delay();
if(rs[0]=='n'|rs[0]=='N')ON=1;
if(rs[0]=='f'|rs[0]=='F')ON=0;
if(rs[1]<= 57 & rs [1]>= 48 & rs[2]<= 57 & rs [2]>= 48){
c = (((rs[1]-48)*10)+ (rs[2]-48));
}
convert(c);
display();
// ON = 0;
ready=1;
}
}
void delay(void){
unsigned int z;
for(z=0;z<15000;z++);
}
void display(void)
{
for(i = 0; i<7;i++)
{
P1 = i;
P2 = control[i];
delay();
}
}
void convert(unsigned char d)
{
switch (d)
{
case(1):{if(ON)control[0]=control[0]|0x01;else control[0]=control[0]&0xfe;}
break;
case(2):{if(ON)control[0]=control[0]|0x02;else control[0]=control[0]&0xfd;}
break;
case(3):{if(ON)control[0]=control[0]|0x04;else control[0]=control[0]&0xfb;}
break;
case(4):{if(ON)control[0]=control[0]|0x08;else control[0]=control[0]&0xf7;}
break;
case(5):{if(ON)control[0]=control[0]|0x10;else control[0]=control[0]&0xef;}
break;
case(6):{if(ON)control[0]=control[0]|0x20;else control[0]=control[0]&0xdf;}
break;
case(7):{if(ON)control[0]=control[0]|0x40;else control[0]=control[0]&0xbf;}
break;
case(8):{if(ON)control[0]=control[0]|0x80;else control[0]=control[0]&0x7f;}
break;
case(9):{if(ON)control[1]=control[1]|0x01;else control[1]=control[1]&0xfe;}
break;
case(10):{if(ON)control[1]=control[1]|0x02;else control[1]=control[1]&0xfd;}
break;
case(11):{if(ON)control[1]=control[1]|0x04;else control[1]=control[1]&0xfb;}
break;
case(12):{if(ON)control[1]=control[1]|0x08;else control[1]=control[1]&0xf7;}
break;
case(13):{if(ON)control[1]=control[1]|0x10;else control[1]=control[1]&0xef;}
break;
case(14):{if(ON)control[1]=control[1]|0x20;else control[1]=control[1]&0xdf;}
break;
case(15):{if(ON)control[1]=control[1]|0x40;else control[1]=control[1]&0xbf;}
break;
case(16):{if(ON)control[1]=control[1]|0x80;else control[1]=control[1]&0x7f;}
break;
case(17):{if(ON)control[2]=control[2]|0x01;else control[2]=control[2]&0xfe;}
break;
case(18):{if(ON)control[2]=control[2]|0x02;else control[2]=control[2]&0xfd;}
break;
case(19):{if(ON)control[2]=control[2]|0x04;else control[2]=control[2]&0xfb;}
break;
case(20):{if(ON)control[2]=control[2]|0x08;else control[2]=control[2]&0xf7;}
break;
case(21):{if(ON)control[2]=control[2]|0x10;else control[2]=control[2]&0xef;}
break;
case(22):{if(ON)control[2]=control[2]|0x20;else control[2]=control[2]&0xdf;}
break;
case(23):{if(ON)control[2]=control[2]|0x40;else control[2]=control[2]&0xbf;}
break;
case(24):{if(ON)control[2]=control[2]|0x80;else control[2]=control[2]&0x7f;}
break;
case(25):{if(ON)control[3]=control[3]|0x01;else control[3]=control[3]&0xfe;}
break;
case(26):{if(ON)control[3]=control[3]|0x02;else control[3]=control[3]&0xfd;}
break;
case(27):{if(ON)control[3]=control[3]|0x04;else control[3]=control[3]&0xfb;}
break;
case(28):{if(ON)control[3]=control[3]|0x08;else control[3]=control[3]&0xf7;}
break;
case(29):{if(ON)control[3]=control[3]|0x10;else control[3]=control[3]&0xef;}
break;
case(30):{if(ON)control[3]=control[3]|0x20;else control[3]=control[3]&0xdf;}
break;
case(31):{if(ON)control[3]=control[3]|0x40;else control[3]=control[3]&0xbf;}
break;
case(32):{if(ON)control[3]=control[3]|0x80;else control[3]=control[3]&0x7f;}
break;
case(33):{if(ON)control[4]=control[4]|0x01;else control[4]=control[4]&0xfe;}
break;
case(34):{if(ON)control[4]=control[4]|0x02;else control[4]=control[4]&0xfd;}
break;
case(35):{if(ON)control[4]=control[4]|0x04;else control[4]=control[4]&0xfb;}
break;
case(36):{if(ON)control[4]=control[4]|0x08;else control[4]=control[4]&0xf7;}
break;
case(37):{if(ON)control[4]=control[4]|0x10;else control[4]=control[4]&0xef;}
break;
case(38):{if(ON)control[4]=control[4]|0x20;else control[4]=control[4]&0xdf;}
break;
case(39):{if(ON)control[4]=control[4]|0x40;else control[4]=control[4]&0xbf;}
break;
case(40):{if(ON)control[4]=control[4]|0x80;else control[4]=control[4]&0x7f;}
break;
case(41):{if(ON)control[5]=control[5]|0x01;else control[5]=control[5]&0xfe;}
break;
case(42):{if(ON)control[5]=control[5]|0x02;else control[5]=control[5]&0xfd;}
break;
case(43):{if(ON)control[5]=control[5]|0x04;else control[5]=control[5]&0xfb;}
break;
case(44):{if(ON)control[5]=control[5]|0x08;else control[5]=control[5]&0xf7;}
break;
case(45):{if(ON)control[5]=control[5]|0x10;else control[5]=control[5]&0xef;}
break;
case(46):{if(ON)control[5]=control[5]|0x20;else control[5]=control[5]&0xdf;}
break;
case(47):{if(ON)control[5]=control[5]|0x40;else control[5]=control[5]&0xbf;}
break;
case(48):{if(ON)control[5]=control[5]|0x80;else control[5]=control[5]&0x7f;}
break;
case(49):{if(ON)control[6]=control[6]|0x01;else control[6]=control[6]&0xfe;}
break;
case(50):{if(ON)control[6]=control[6]|0x02;else control[6]=control[6]&0xfd;}
break;
}
}circuit diagram of 8051 interfacing with relay coils,relay switch atmel microcontroller,scrolling dot matrix led display using 8051,circuit diagram for line tracer using micro controller 8051,microcontroler comanda motor cc.schematic diagram sms relay control board usig gsm technology and microcontrolle 16f877 10 valvulas solenoides how to use moc3010








Dear Dr.Rana sir
ReplyDeleteMany thanks for posting the code and schematic for the project of bank load using microcontroller 8051.
Is it possible to use VB6? I am not good in C language. I want to use vb6 in my project.
It would be great help if you could built the same with vb6.
many thanks for your time and patiance, i appreciate that.
Regards
Reddy
@ Reddy:
ReplyDeleteI think you are new in the field of programming and designing microcontroller based projects.
I want to tell you that, for your project related to bank load controller using 8051 has two parts with respect to programming.
1. We have to write a program or code for microcontroller. This is written in C language for your project. Now using keil c51 compiler, this c-code is converted to HEX fils. Using a hardware called programmer , the hex file is then burned into microcontroller.
2. The PC side code, yes, to make any LED ON or OFF, microcontroller seeks some instructions to be send via serial communication. The comands will be send to microcontroller using serial port RS232. Thus for this you have to write program for PC also. Now you can use VB6 for this code writting.
3. If you are not good in VB6 and can not write it, then you can use hyper terminal applcation comes with windows till winXP. windows vista and window 7 donot have hyper terminal.
4. To use hyper terminal , you have to do some configuration in this according to your requirements. like selection of com port, selection of buid rate.
5. The bank load controller is designed to work on this serial communication protocol: Buad rate9600, 8N1.
6. So, you have to use c code, given in the post, and compile it to make HEX file, using programmer to burn it. Then eithor use huper terminal and configure it or use VB6 and write program for PC for serial communication.
ENJOY IT
Dear
ReplyDeleteMr.Dr.Rana
firstly accept my sincere thanks for supporting with schematic and code.
i got it now ,i have not done any projects in microcontroller so i was not sure of compilers and all.
i can write code for serial port using vb6 ,first i will rig up the hardware and let you know.
Many thanks for your quick support , i appreciate that.
Regards
Reddy
@ Reddy:-
ReplyDeletei suggest you, plz wait, i am working on an other version of this project using shift registers.
then you decide , which one is better for you.
download proteus ISIS and make the circuit in it. then you will chekc it on PC, without soldering any component. This is very good simulator program.
ok
new version will be uploaded very soon.