Hi everyone, this is Shashanan. In continuation with previous videos, I just want to give a simple application on 8051 controller which is traffic signal. So, which is already prepared. I will explain the application. So, if you want to follow our videos, you can go through YouTube and just Aerotech Solutions and even Facebook also.
So one basic application with you can do with simple LEDs prototype with three different colors. You can work out even hardware also. It's a very simple application. So I just developed source code with embedded C by using keel IDE and simulated with produce simulation tool. So there are three individual block representation of application which is more needed because All microcontrollers and other components need DC source.
So you need to have one DC source with 5 volts. For that I just took power supply unit and microcontroller unit. So even microcontroller means not single 40 pin device.
So you need some other components as crystal oscillator and across 9th pin you need some reset connections and The other side is traffic signal. So you can make it with this traffic signal with three different color LEDs as red, green and yellow. So when I can show you the circuit diagram, which is already drawn in produce simulation tool. This is my simple circuit diagram, which is connected with GPIOs of microcontroller.
as port 2 and port 3 so i need to use 12 Ivo pins from the controller where i am using port 2 and port 3 lsb part of GPIOs okay so now i'll show the source code with this application so which is already developed in keel micro visual so you can follow the options so I'll show you the source code of this application So now you can observe the source code of this application as all the declarations you need to do before main by following this SBIT data type and one standard global header file of 5.1 families as rej5.1.h. So I just taken user names as E stands for east direction and W stands for west and N for north and S for south. The 14 the 12 i o declarations i just given on different i o pins so you should use i o port letter with upper case so you don't use lower case for i o ports declarations because all sfr registers you need to use in upper case so i just given all 12 declarations along with this I just took one user defined function which is delay with the argument type and I just declared globally and main program starts from here so I'm just giving IOO logics as zeros because by default all IOOs are high from 8051 families so you need to keep it off so that I am assigning logic zeros. 0x00 means it's the hexadecimal representation of eight binary bits of two Iocode. Anyway I'm using only lsb part but still I'm making zeros of all four three pins also while of one.
It's an infinite loop the logic starts from here. So initially I'm just going to understand so you need to understand here so i'm making eeg which means east green is on the other three directions red color is on so one represents logic one of fives and zero represents logic zero so that you can provide sufficient voltage to the leds and i'm staying some time just approximately giving this argument as 30. so in my way so 30 stands for 30 seconds i'm holding this east green is on the other three colors is red after some time i need to turn off this green and the next operated signal red should be off but no signal will directly comes from green to red or red to green directly so there is a yellow operation in between so you need to turn on yellow but yellow signal should be operate with very less time compared to red and green. So, that I am giving has done.
So after LO again I need to turn off this LO. The next signal green which is not green should be ON. Red should be ON of previous signal. So that ER which means East red. Now I'm operating North green.
So this also holds 30 seconds time and after 30 seconds again I need to choose the next signal what it has to operate. So I'm moving to west so that I'm going to turn on west yellow and north yellow. And this also holds very less time, which is 10 seconds approximately.
So if you want to generate time delays with timers, you can go with accurate. But if you are taking self-forloughs, it should be approximate. So again, north yellow and west yellow is off. Again, west green is on, north red is on.
so again always green and red will hold 30 seconds as per my logic approximately and yellow is operated with 10 seconds approximately so again i'm moving from west to south so west signal is west green and south red is off so yellow again as usual and after 10 seconds here south yellow is off and south green comes to off So again, I'm moving from south to east so that south green and east red is off, south yellow and east yellow is on and which is very less time delay as 10 seconds and I'll again come back to east green. This is my simple logic and delay I'm just using self-forlough concept here and whatever the argument you are passing here, it will reach to your variable v. and this is used in my file number of times repetition so this is my logic okay so now i can show you the simulation application running with this this is Proteus simulation tool you can pick your components with this by just by clicking on this p symbol and you can connect all this now you need to check the link of hex file whether it is linked or not you need to link your hex file just by clicking on this so you need to go with where your hex file is located in a computer so this is my application hex file so don't link dot c files you need to link dot hex files 12 megahertz there is no issue just by linking your hex file you need to play this so you can check the signal operation very clearly so one is green the other three should be red and again your yellow will be operated parallely on two signals. I'll check. It should be very less time, but green will hold more time compared to other.
Now one cycle we are going to finish. This is the way to check your applications just by writing embedded C program on KLMicroVisor and checking your outputs with Routube simulation tool. Now, so if you want to take training or any projects, we are supporting even online and offline and classroom training and hardware support and we are doing even component sales also.
If anyone interested, just contact with this number or you can WhatsApp us and your address is very clear which is located in kphp which is very near to metro station and you can send us any queries regarding any applications and if you have any requirements so just send me the mail ysn and the red aerodox solutions thanks for watching