Skip to main content

The future of AI in business and its potential to transform industries

Traffic signal timer simulation

 Traffic signal timer simulation using proteus

traffic signal timer banner

In our day to day life, we always get a traffic signal on our way, where you need to wait for a particular time for the signal to get green. Hence in today's article, we will talk about the simulation of the traffic signal timer.

The simulation software I am using is proteus 8 professional and for writing the code I am using Keil MicroVision 5.

The microcontroller we will be working on is AT89C51 microcontroller.

We will cover the article on the following topics:
  • Hardware components for simulation.
  • Making the hardware connection for simulation.
  • Writing the program for the microcontroller
  • Uploading the program on the microcontroller.
  • Simulate the project.

Hardware component for simulation

The hardware components we are using for simulation are:
  • AT89C51 microcontroller
  • Animated traffic light module
  • 7-segment BCD display
  • 8-way resistor pack with common

Making the hardware connection for simulation

In this section, we will connect all our hardware components in our simulation 

The picture for the hardware connection is given below.

proteus simulation circuit

While making connections make sure the correct pin of the microcontroller is connected to the correct devices.

Writing the program for the microcontroller

In this section, we will write our program on Keil Microvision 5 software and generate the hex file, so it can be upload to our proteus simulation.

If you don't know how to generate a hex file you can click here.

code

#include <reg51.h>

int i,j;

void delay()
{
  for(i=0;i<14;i++)
{
TMOD=0x01;
  TH0=0;
TL0=0;
TR0=1;
while(TF0==0);
TF0=0;
TR0=0;
}
}

void count()
{
  for(j=5;j>=0;j--)
{
  P3=j;
delay();
}
}

void main()
{
P0=0x54;
P2=0x02;
count();
P0=0xA1;
P2=0x02;
count();
P0=0x09;
P2=0x05;
count();
P0=0x4A;
P2=0x08;
count();

}

Uploading the program to the microcontroller

After completing the programming part you can upload the code to the microcontroller on proteus.

For that, you need to double click on the microcontroller and select your created hex file.

Note:- Don't forget to change the clock frequency of the microcontroller from 12MHz to 11.059MHz.

To simulate the project all you need is to click the play button at the bottom left corner of the simulator.

Or you can watch the video given below.

Video description

Popular posts from this blog

What is machine learning and it's types?

 What is machine learning(ML)? Machine learning is a subset of artificial intelligence. Machine learning enables computers or machines to make data-driven decisions rather than being explicitly programmed for a certain task. These programs or algorithms are designed in a way that they learn and improve over time when are exposed to new data. Examples:- 1. Product recommendations   While checking for a product did you noticed when it recommends a product similar to what you are looking for? or did you noticed "the person bought this product also bought this" combination of products? How are they doing this recommendation? This is machine learning. 2. Email spam and malware filtering  There are a number of spam filtering approaches that email clients use.  To ascertain that these spam filters are continuously updated they are powered by machine learning. 3. Online customer support A number of websites nowadays offer the option to chat with customer support representati...

PIC18 Timer programming in C

The PIC18 timer is divided into 4 types Timer 0 Timer 1 Timer 2 Timer 3 PIC18 timers can be used to generate a time delay or as a counter to count external event happening outside the microcontroller. In this article, we will see how to generate a time delay by programming the PIC18 timer. Timer 0 The timer 0 module has the following features Software is scalable as an 8 bit or 16-bit timer/counter. Readable and writable Dedicated 8 bit software programmable Prescaler Clock source selectable to be internal or external Edge select for external clock Register required for Timer 0 Control register Each timer has a control register called TCON to set the various timer operation modes. T0CON is an 8-bit register used for control of timer 0. TOCON TMR0ON (Timer0 on/off control bit)                                       1 = Enable timer 0                ...

Different domains of Artificial intelligence(AI)

Artificial intelligence is a computer system that is able to perform tasks that ordinarily require human intelligence. Artificial intelligence systems are critical for companies that wish to extract value from data by automating and optimizing processes or producing actionable insights. There are certain domains of artificial intelligence on which we can create our expertise Machine learning Deep learning Robotics Expert systems Fuzzy logic Natural language processing Computer vision  1. Machine learning Machine learning is a subset of artificial intelligence. Machine learning enables computers or machines to make data-driven decisions rather than being explicitly programmed for a certain task. These programs or algorithms are designed in a way that they learn and improve over time when are exposed to new data. Different types of machine learning models Supervised learning Unsupervised learning Reinforcement learning Use cases Product recommendation on a shopping website. spam fil...