8051 Microcontroller Projects

Hello everyone, hope you all are fine and having fun with your lives. Today, I am going to share 8051 Microcontroller Projects. Recently, I have shared quite a lot of tutorials on 8051 Microcontroller which are not much arranged as a whole. So, today, I thought to arrange all those tutorials and place them here so that you can get all of them quite easily. I will upload more 8051 Microcontroller Projects and I am gonna add their links in this post so stay subscribed to this post if you are interested in learning 8051 Microcontroller.

8051 Microcontroller, as we all know, is another Microcontroller series just like PIC Microcontroller or Arduino etc. The benefit of 8051 Microcontrollers is that they are quite cheap and easily available so if you are going to design some product then its better to use 8051 Microcontroller instead of PIC Microcontroller or Arduino etc. As they are cheap so they also come with a disadvantage which is that they are not much rich with features. Few of 8051 Microcontrollers doesn't even support Serial Communication. So, before choosing it for your project, must check their datasheet to confirm that they are suitable for your projects.

In most of these below projects, I have designed the complete simulation in Proteus and the code is also given but my suggestions is don't simply download the simulation and run it. Instead design the simulation from scratch and then design your code and run the simulation on your own. Consider my codes and simulations as a guide but dont get dependent on them as then you are not gonna get anything. Anyways let's get started with 8051 Microcontroller Projects.

8051 Microcontroller Projects

Below are mentioned all the 8051 Microcontrollers Projects, which I have shared on this blog. You can check these projects and can also download their simulations designed in Proteus. I have given codes for most of these projects but few are paid, which you can buy from our shop at a quite minimal rate.

Basic Projects

These are basic projects and are best for beginner level programmers. If you are new to 8051 Microcontroller then first read these projects. These all projects contain complete codes as well as the Proteus simulation so you can quite easily test them in Proteus software and can edit the codes and learn from it.

Intermediate Projects

These are Intermediate level 8051 Microcontroller Projects. If you wanna do these projects then you must first learn or atleast have a look at basic 8051 Microcontroller projects as they are using same components as we interfaced in basic level. If you feel any problem then ask in comments.

That's all for today, but I am gonna add more projects in it and will keep on updating the list. Subscribe us and get these exciting tutorials straight to your mail box.

PIR Sensor Library for Proteus

Update: Here are the latest versions of this library: PIR Sensor Library for Proteus V3.0 and PIR Sensor Library for Proteus V2.0.


Hello friends, hope you are doing well.  Today, I will share a new PIR Sensor Library for Proteus. PIR Sensor module is not available in Proteus so we can't use it in our simulations. But today, I will share a new PIR Sensor Library for Proteus which can easily simulate PIR Sensor in Proteus software. We are quite happy that we are helping engineers by sharing these new Proteus Libraries.

We all know about PIR Sensor but if you don't know then first read Interfacing of PIR Sensor with Arduino.

As a quick review, a PIR sensor is used to detect motion in the environment and is commonly known as a motion sensor. It's quite helpful in security projects where you need to detect motion. For example in some bank vault where there's no possibility of motion, you can place this sensor and can check if there's any movement. It is also used in home automation i.e. if there's no movement in some room, turn off its appliances. So, in short, the PIR sensor has numerous uses and is used quite a lot in engineering projects.

First of all, I will show you today, How to download this PIR Sensor Library for Proteus and then we will also design a small simulation in Proteus in which I will interface this PIR Sensor with Arduino UNO. You can interface it with any microcontroller i.e. PIC Microcontroller or 8051 Microcontroller. But today, I will interface it with an Arduino microcontroller. As homework, you guys interface it with a PIC Microcontroller or 8051 Microcontroller and share it in comments, it may help others. So, let's get started with the PIR Sensor Library for Proteus:

PIR Sensor Library for Proteus

  • First of all, click on the below button to download the PIR Sensor Library for Proteus:
PIR Sensor Library for Proteus
  • Once you download it, you will get three files in it, named:
    • PIRSensorTEP.LIB
    • PIRSensorTEP.IDX
    • PIRSensorTEP.HEX
  • Place all these three files in the library folder of your Proteus software.
Note:
  • Now open your Proteus software and search for PIR Sensor, you will get a total of four models in it.
  • Place these models in your Proteus workspace and it will look something as shown in the below figure:
  • I have added four models of this PIR Sensor in Proteus Library and you can use any of them.
  • As working is concerned they are all the same but they differ in color.
  • The first color is our normal color, which I always use for my Proteus Libraries while the second one is green, the third is pinkish and the fourth one is blue.
  • This PIR Sensor has a total of four Pins, among which one is Vcc so you need to give +5V at this pin, then there's GND which you need to ground.
  • The OUT pin is our main pin through which we will be getting our output like whether it detects the motion or not.
  • Now, obviously, we can't detect real motion in Proteus Simulation that's why I have placed a TestPin which will be working as a simulation Pin.
  • If TestPin is HIGH, it means the motion is detected and if it's LOW then it means the motion is not detected.
  • Now we have our module in Proteus so one last thing we need to do is add its functionality.
  • So, in order to do so, double-click this PIR sensor and in the Program File section give a path to the file PIRSensorTEP.HEX, which you have placed in the library folder of your Proteus software as shown in the below figure:
  • Now click OK and your PIR Sensor is ready to be used in the Proteus Simulation.
  • So, now let's design a simple example for this PIR Sensor which will help you in understanding this sensor.

PIR Sensor simulation in Proteus

  • Design a simple circuit in Proteus software as shown in the below figure:
  • Now you can see in the above figure that I have placed a PIR Sensor along with Arduino UNO and a Virtual terminal.
  • PIR Sensor is connected to Pin # 2 of Arduino UNO.
  • Now upload the below code in Arduino software and get the hex file. You should read How to get Hex File from Arduino, if you don't know already.
    #define pirPin 2

    int calibrationTime = 30;
    long unsigned int lowIn;
    long unsigned int pause = 5000;
    boolean lockLow = true;
    boolean takeLowTime;
    int PIRValue = 0;

    void setup()
    {
    Serial.begin(9600);
    pinMode(pirPin, INPUT);
    }

    void loop()
    {
    PIRSensor();
    }

   void PIRSensor()
{
     if(digitalRead(pirPin) == HIGH)
     {       
         if(lockLow)
         {    
             PIRValue = 1;
             lockLow = false;
             Serial.println("Motion detected.");
             
             
             delay(50);
         }         
         takeLowTime = true;
       }

       if(digitalRead(pirPin) == LOW)
       {       
           
           if(takeLowTime){lowIn = millis();takeLowTime = false;}
           if(!lockLow && millis() - lowIn > pause)
           {
               PIRValue = 0; 
               lockLow = true;                        
               Serial.println("Motion ended.");
               
               delay(50);
           }
       }
}
  • Now run your simulation, and click the logic button to 1, which will indicate that motion is detected and you will get something as shown in the below figure:
  • Now let's make the logic state to 0, which will indicate that no motion detected, as shown in below figure:
  • So that's how our PIR Sensor is gonna work in Proteus. I hope you are going to like this PIR Sensor Library for Proteus.
  • You can download the simulation by clicking on the below button:
Download PIR Proteus Simulation
  • Here's a YouTube video where I have explained this PIR Sensor Library for Proteus in more detail, so check it out:

That's all for today, hope you have enjoyed it and gonna use it in your projects. If you get into any trouble, ask in the comments and I will try to resolve them as soon as possible. Take care !!! :)

XBee Library for Proteus

Hello everyone, today I am going to share a new XBee Library for Proteus. I am quite excited while sharing it as we are the first developer for this XBee Library. Now you can quite easily use XBee module in your Proteus software using this XBee Library for Proteus.Wehave spent quite a lot of time in developing this and that's the reason I couldn't share new tutorials in the past few days. Anyways we are done with this new exciting XBee Library for Proteus, hope you are gonna enjoy this one. I have already sharede two libraried for Proteus which are Arduino Library for Proteus and GPS Library for Proteus. You can also interface this XBee module with Microcontrollers like Arduino, PIC Microcontroller and 8051 Microcontroller quite easily.

As its the first version of our XBee Library for Proteus so its not quite perfect and can't do the complex tasks such as analog inputs etc. It will just do the serial communication. This xbee module has two pins TX and RX and you can do your communication with it quite easily. We have designed this XBee Library for Proteus, after quite a lot of effort and we are quite proud that we are presenting it first time for Proteus. Other bloggers are welcome to share this library on their blogs to share the knowledge but do mention our blog post link in your post. :) You should also have a look at XBee Arduino Interfacing. So, let's get started with it.

XBee Library for Proteus

  • First of all, download this XBee Library for Proteus by clicking on the below button:
XBee Library for Proteus

  • Now once you click it you will get a zip file to download so download this zip and open it.
  • In this zip file you will get two files named as:
    • XBeeTEP.LIB
    • XBeeTEP.IDX
  • So, now place these two files in the libraries folder of your Proteus software.
Note:
  • Now, start your Proteus ISIS software or restart it if its already running.
  • Go to your components library and search for XBee Module as shown in below figure:
  • Now place it in your workspace and it will look something as shown in below figure:
  • If you don't know much about xbee module then you should also have a look at Introduction to XBee Module.
  • As you can see in the above figure, its our xbee module in Proteus for the first time.
  • As, I mentioned earlier, its a first version of xbee module so its not very advanced and it will do just the basic serial communication i.e. sending and receiving data.
  • It has two pins on it which are TX and RX and using these two pins you can send and receive data quite easily.
  • So, let's design a simple example and we will see How to do the Serial communication using this new XBee library for Proteus.
  • Design a simple circuit as shown in below figure:
  • Now what I did is, I simply place a Virtual terminal with both of these xbee modules.
  • Now we need to change the Properties of one of these XBee module so double click on any one of these and you will get the below window:
  • You should also have a look at Interfacing of XBee with Computer.
  • Now, I have simply changed the Physical Port of this module to COM2 while the other module is at COM1.
  • So, now one of my XBee module is at COM1 while the second module is at COM2.
  • Now when I run my simulation then both XBee will start sending and receiving data on their respective COM Ports.
  • So, what I need to do is to virtually combine these two ports and for that I have used a software named as Virtual Software Driver from Eltima and I combine these two ports.
  • Now, run your simulation and whatever you type in the Virtual Terminal of first xbee will appear in the virtual terminal of second xbee. as shown in below figure:
  • You can also interface this XBee modue with other microcontrollers like Arduino, PIC Microcontrollers or 8051 Microcontrollers etc.
  • I have explained this whole tutorial in below video as well.
I hope you have enjoyed it and are gonna like it. Let me know if you got into any trouble and have problems in using this library. Also share your suggestions about improvement in this XBee Library for Proteus. :)

GPS Library for Proteus

Hello friends, hope you all are fine and having fun with your lives. In today's tutorial, I am gonna share another awesome library designed by our team for Proteus, which is GPS Library for Proteus. It's my second library for Proteus, the first one was Arduino Library for Proteus which I have already shared. I am really enjoying designing these modules in Proteus because its a new and quite challenging thing. I haven't found even a single website who has designed these modules in Proteus already. So, now for the first time, you can have the GPS Library for Proteus using which you can easily simulate your GPS module in Proteus and can design your code for Arduino, PIC Microcontroller or 8051 Microcontroller.

Other bloggers are welcome to share this library and its my humble request that do mention our blog in credits. :) The GPS module, I have designed for Proteus is a simple GPS which has TX and RX pins and when you start the simulation, this module starts sending the NMEA data on its TX pin, which you can easily check using Virtual Terminal. I am gonna show you how to check it in today's post. Another important thing, obviously in Proteus Simulation we can't get the actual values of longitude,latitude etc, so in our model, I have used the dummy values for all these data. The benefit of this module is that you can easily design your code for GPS and can test it in your simulation. Plus, its design is cool as well. ;)

Note:

GPS Library for Proteus

  • First of all, click on the below button and download GPS Library for Proteus.
GPS Library for Proteus
  • After downloading, you will get a zip file containing three files in it.
  • Now extract all these three files named as:
    • GpsTEP.LIB
    • GpsTEP.IDX
    • GpsTEP.HEX
  • Place these files in Libraries folder of your Proteus software.
Note:
  • Now open your Proteus software, if you have already opened it then restart your Proteus software.
  • Now in components list search for GPS Module and place it in your workspace.
  • If everything's fine then you will get your module as shown in below figure:
  • As you can see in the above figure, it has two pins in total which are TX and RX.
  • Now double click this GPS module and you will get to its properties as shown in below figure:
  • Now, one last thing you need to do is to upload the GpsTEP.HEX file, which you got in the downloaded zip file, in the Program File section.
  • This GpsTEP.HEX file is essential for this model as its adding the functionality of GPS in this model.
  • So, after adding the link of GpsTEP.HEX file in the Program File section, now your Gps module is ready to use in your circuit.
  • So, now let's add a Virtual terminal and check the output of this GPS Module. If you haven't worked on Virtual Terminal before then you should read How to use Virtual Terminal in Proteus ISIS.
  • Design a small circuit as shown in below figure:
Note:
  • The baud rate of this GPS Module is 9600.
  • The data sent by this GPS module is dummy as we can't get these values in simulation.
  • Now let's run the simulation and check the Virtual Terminal and if everything goes fine then you will get results as shown in below figure:
  • The first line is just the intro for this module and after that you will start receiving data which is in NMEA format.
  • NMEA data will remain constant but will keep on coming.
  • Now, instead of using this Virtual Terminal, you can use any microcontroller here like Arduino, PIC Microcontroller or 8051 Microcontroller etc. and can write your code easily and test it.
  • In my coming tutorials, I am gonna share examples for this GPS module in which I will interface it with different Microcontroller.
  • In the below video, I have explained this tutorial again so if you got any trouble then watch it as well.
That's all for today. You should also have a look at Interfacing of GPS Module with Arduino in Proteus ISIS. I hope you guys have enjoyed today's post and are gonna get benefit from it. Let me know your views about today's tutorial and also give your suggestions and help us in making this GPS Library for Proteus more smarter. :)

Arduino Library for Proteus

Update: Here are the latest versions of this library: Arduino Library for Proteus V3.0 and Arduino Library for Proteus V2.0.


Hello friends, I hope you all are fine. In today's tutorial, I am going to share a new Arduino Library for Proteus. I am quite excited about today's post as it's my first complete Arduino Library for Proteus. In my previous tutorials, I have shared these Arduino boards in separate Proteus libraries but today I have combined all the boards together in a single library. You just need to download the Proteus library zip file and install it in Proteus software. You will get all the Arduino boards in your Proteus workspace. You should also give a try to Genuino Library for Proteus.

We have tested all the boards with different types of sensors. So, now you can easily use Arduino in Proteus and can simulate any kind of project. If you have any issues, you can ask in the comments or use our forum to post your queries. Here's the video tutorial on How to install and use this Arduino Proteus Library:

This Arduino Library for Proteus is unique in its kind because there's no such library posted before that has as many boards as we have in our Library. We have added almost all the basic Arduino boards to it and we are also working on advanced boards i.e. Arduino DUE, Arduino YUN etc. You should also have a look at the Arduino Tutorial for Beginners. This Proteus Arduino Library consists of the following boards:

So, let's get started with Arduino Library for Proteus:

Note:

You should also download these Proteus libraries of different sensors & modules. Other Proteus Libraries are as follows:

Arduino Library for Proteus

  • First of all, download Arduino Library for Proteus by clicking the below button:
Arduino Library for Proteus
  • After downloading the Proteus library zip file, unzip it and you will get two files in it.
  • These two Proteus library zip files are named as:
    • ArduinoTEP.LIB
    • ArduinoTEP.IDX.
  • Copy these two files and place them in the Library folder of your Proteus software.
Note:
  • Now, restart your Proteus software and in components section search for ArduinoTEP as shown in below figure:
  • These are all the boards designed by our team in Arduino Library for Proteus.
  • In the Proteus workspace, these boards will appear as shown in the below figure:
  • So, these are the boards available in this Arduino Library for Proteus.
  • Arduino Mega 1280 is missing in this figure because it's the same as Arduino Mega 2560 so I haven't posted it here but it's included in the library.
  • So, now you have all the Arduino boards in your Proteus software and you can simulate them as you want them.
  • Let's design a simple Arduino UNO led blinking circuit for better understanding.
  • So, design a circuit as shown in below figure:
  • Now open your Arduino software, open the LED blinking Example and get your hex file.
Note:
  • Now upload your hex file to your Arduino board.
  • Hit the Run button on your Proteus software and you will get the result as shown in the below figure:
  • So, you can easily simulate any of your above-mentioned Arduino boards quite easily in Proteus software using our Arduino Library for Proteus.
  • If you are new to Arduino then you should try these Arduino Projects for Beginners, they will help you to get your hands on this marvelous creation. :P

That's all for today. I hope you have enjoyed this Arduino Library for Proteus and will benefit from it. Share your opinions about it in the comments below and help us to help you out. :)

Arduino Pro Mini Library for Proteus

Update: We have created a new version of this library, which you can check here: Arduino Pro Mini Library for Proteus V2.0.
Hello friends, hope you all are fine and having fun with your lives. In today's post, I am gonna share Arduino Pro Mini Library for Proteus. Recently, I have shared Arduino Nano Library for Proteus, and before that I have also posted Arduino UNO Library for Proteus as well as Arduino Mega 2560 Library for Proteus, and now I am gonna share Arduino Pro Mini Library for Proteus. Arduino Pro Mini is another Arduino board which also uses the same Atmega328 Microcontroller and has almost the same number of pins as Arduino UNO and Arduino Nano. Arduino Pro Mini is even more smaller than Arduino Nano board. It doesn't have the programmer on it so if you need to program it you have to use some TTL to Serial converter or you can also use Arduino UNO board in order to burn programming code in it. So, in today's tutorial, I am gonna share the Arduino Pro Mini Library for Proteus, which is the first library ever made for this board. You won't find the Arduino Pro Mini Library for Proteus anywhere. I am quite proud that our blog is sharing this library for the first time. You can download this library freely from the link below and can now simulate your circuits quite easily. So, now let's get started with this new Arduino Pro Mini Library for Proteus. I have added all the Arduino boards in a single library. This library contains six Arduino boards which are Arduino UNO, Arduino Mega 2560, Arduino Mega 1280, Arduino Nano, Arduino Mini and Arduino Pro Mini. You can download this complete Arduino Library by checking Arduino Library for Proteus.

Arduino Pro Mini Library for Proteus

  • First of all, download the Arduino Pro Mini Library for Proteus by clicking the below button.
Arduino Pro Mini Library for Proteus

  • Now when you click it, you will get a zip file so extract this zip file and you will get two files named as ArduinoProMiniTEP.LIB and ArduinoProMiniTEP.IDX.
  • So download these two files and place it in the libraries folder of your Proteus software.
Note:
  • Now, after getting the Arduino Pro Mini Library for Proteus files and placing it properly in your Proteus software. Open your Proteus software and make a search for Arduino Pro Mini.
  • Once you get this board, place it in your Proteus workspace and it will look like something as shown in below figure:
  • Now next thing you need to do is to read How to get hex Fie from Arduino, so that you can get the hex file, which we are gonna upload in this Arduino Pro Mini board.
  • So, once you get the link for your hex file, simply double click this board to open its properties.
  • Now place this hex file in the Program File section of its Properties section as we have seen in Arduino Nano Library for Proteus tutorial.
  • That's all, now using this Arduino Pro Mini Library for Proteus, you can easily simulate your circuits in Proteus and can test your codes.
  • Now, let's design a simple blinking example as we have done for previous libraries.
  • So, in order to dos so, design a simple circuit in Proteus as shown in below figure:
  • So, now as usual, use the blink example from the Arduino software and get your hex file as described in How to get hex file from Arduino.
  • So, after uploading the hex file, run your simulation. If everything goes fine then you will get results as shown in below figure:
  • So, now that's how you can simulate Arduino Pro Mini in Proteus using Arduino Pro Mini Library for Proteus.

Arduino Nano Library for Proteus

Update: Here are the latest versions of this library: Arduino Nano Library for Proteus V3.0 and Arduino Nano Library for Proteus V2.0.


Hello friends, hope you all are fine and having fun with your lives. In today's post, I am going to share a new Arduino Nano Library for Proteus. Arduino Nano is also a microcontroller board just like Arduino UNO but the advantage of Arduino Nano over Arduino UNO is its small size.

Arduino Nano is quite small in size and hence can be used in such projects where we need to use smaller PCBs. For example, I once worked on a project in which I needed to design a test cricket bat.

In that project, I used IMU along with Arduino Nano and placed the complete kit over the bat. As I need to place the electronic kit over the bat so it has to be quite small, that's why I have used Arduino Nano instead of Arduino UNO board. So, now I hope you got the idea of where to use Arduino Nano instead of Arduino UNO.

Now, coming to Proteus software, in Proteus we don't have the default board for Arduino Nano so that's why I have designed this Arduino Nano Library for Proteus, using which you can quite easily use the Arduino Nano board in Proteus and can test your code quite easily. I have already posted the Arduino UNO Library for Proteus and have also posted the Arduino Mega 2560 Library for Proteus. So, today I am posting the third Arduino Library for Proteus. Hope you are going to like it as well.

In the next tutorials, I will share more Arduino Libraries for Proteus. I am working on Arduino Mini and Arduino Pro Mini as well. So, I will post their libraries too once I get them completed. I am also planning on designing the Sim900D Library for Proteus but till now I haven't started it. I am planning to post a complete Arduino Library at the end in which you just need to install one library and all the Arduino boards will come in Proteus. Anyways, let's get started with the Arduino Nano Library for Proteus.

Note: I have added all the Arduino boards in a single library. This library contains six Arduino boards which are Arduino UNO, Arduino Mega 2560, Arduino Mega 1280, Arduino Nano, Arduino Mini and Arduino Pro Mini. You can download this complete Arduino Library by checking the Arduino Library for Proteus.

Arduino Nano Library for Proteus

  • First of all, download Arduino Nano Library for Proteus files, by clicking the below button:
Arduino Nano Library for Proteus
  • After clicking this button, you will get a zip file containing two files named as ArduinoNanoTEP.LIB and ArduinoNanoTEP.IDX, so extract these two files and place these files in the Library folder of your Proteus software.
Note:
  • After placing these files in the Library folder of your Proteus software then open your Proteus software.
  • In Proteus software search for Arduino Nano and place it in your workspace.
  • The Arduino Nano board in Proteus will look like something as shown in below figure:
  • It has the same ATMEGA328 Microcontroller as in Arduino UNO and has almost the same pins.
  • So, now next thing we need to check is the hex file. So in order to upload the hex file in Arduino Nano, simply double-click it to open the Properties panel and it will look like something as shown in the below figure:
  • Now, you can upload the hex file by clicking the browse button in the Program File Section.
  • The crystal oscillator we are using here is 16MHz which is the default for Arduino boards.
  • You should also read How to get hex File from Arduino so that you can get the hex file easily.
  • So, now let's design a simple LED blinking circuit with this Arduino Nano board to test it.
  • Design a simple circuit as shown in below figure:
  • So, now simply use the blink example from the Arduino software and compile it to get the hex file.
  • Upload this hex file in the PROGRAM FILE section and hit the RUN button.
  • If everything goes fine then you will get the results as shown in the below figure:
  • So, now that's how you can simulate Arduino Nano in Proteus quite easily using Arduino Nano Library for Proteus.

That's all for today. In the coming post, I will share the Arduino Mini and Arduino Pro Mini Library for Proteus. You should also have a look at these Arduino Projects for Beginners. So stay tuned and have fun!!! :)

Seven Segment Display with 8051 Microcontroller

Hello friends, I hope you all are fine and having fun with your lives. In today's post, we are gonna have a look at How to interface Seven Segment display with 8051 Microcontroller. Seven Segment Display is normally used in those projects where counting or clock functionalities are required. If you wanna read the basic details of Seven Segment Display then must read Interfacing of Seven Segment Display with Arduino, I have explained 7 Segment Display in detail in that tutorial. And have also interfaced it with Arduino board. So, I am not gonna go into the details of 7 Segment in today's tutorial and I would recommend you to must read this tutorial.

As 8051 Microcontroller is concerned, we all know that Its a Microcontroller in which we program our code and make it work. The 8051 microcontroller, I have used in this post is AT89C51. I have also designed this project on hardware and have tested code and it works fine. The crystal oscillator I have used in this project is of 16MHz. You can also download the Proteus Simulation along with programming code and hex file designed in keil uvision 3, at the end of this post. So, now let's get started with it. You may also wanna read the below projects on 8051 Microcontroller:

Interfacing of Seven Segment Display with 8051 Microcontroller

  • Seven Segment Display is of two types which is common cathode and common anode.
  • In this post, I have used common anode but you can easily use this code for common cathode but you have to do small change in the hardware.
  • If you are using common cathode then instead of GND you have to give +5V to the Seven Segment Display.
  • So, now let's first design the Proteus Simulation of Seven Segment Display with 8051 Microcontroller.
Proteus Simulation
  • First of all, design a Proteus Simulation for Interfacing of Seven Segment Display with 8051 Microcontroller,as shown in below figure:
  • Now you can see in the above figure that I have used 8051 Microcontroller which is AT89C51.
  • I have used Seven Segment display which is of Red color.
  • It has total 8 pins so we have connected these 8 pins of Seven Segment Display to 8 pins of Port 2 of 8051 Microcontroller.
  • Now, the last thing, I have used is 74LS245. Its kind of a current amplifier. 8051 Microcontroller provides quite small current on its output pins which is not quite enough for the Seven Segment Display to turn its LEDs ON.
  • So, we used this 74LS245 which provides extra current and makes the Seven Segment Display to work properly.
  • Now, let's design the programming code for this project.
Programming Code
  • I have designed the programming code for interfacing of Seven Segment Display with 8051 Microcontroller in Keil uvision 3 compiler.
  • The programming code is as follows:
#include<reg51.h>

void cct_init(void);
void delay(int);
void DisplayOn7Segment(char);

int main(void)
{
   char ch = '0';	          // Character to be displayed on 7seg

   cct_init();   	          // Make all ports zero	

   while(1)           
   {
	DisplayOn7Segment(ch);	  // Display ch on 7seg
	delay(30000);			  // About 1 sec delay

	switch(ch)				  // Update ch with new value to be displayed
	{
		case '0':	ch = '1';  break;
		case '1':	ch = '2';  break;
		case '2':	ch = '3';  break;
		case '3':	ch = '4';  break;
		case '4':	ch = '5';  break;
		case '5':	ch = '6';  break;
		case '6':	ch = '7';  break;
		case '7':	ch = '8';  break;
		case '8':	ch = '9';  break;
		case '9':	ch = '0';  break;
	
	
		default: ch = '0';  break;
	}
   }
}

void cct_init(void)
{
	P0 = 0x00;   
	P1 = 0x00;   
	P2 = 0x00;   
	P3 = 0x00;  
}

void delay(int a)
{
   int i;
   for(i=0;i<a;i++);   //null statement
}

void DisplayOn7Segment(char ch)   // ch can have a value from '0' to 'F' only
{
	switch(ch)
	{
		case '0':	P2 = 0x3F;  break;
		case '1':	P2 = 0x06;  break;
		case '2':	P2 = 0x5B;  break;
		case '3':	P2 = 0x4F;  break;
		case '4':	P2 = 0x66;  break;
		case '5':	P2 = 0x6D;  break;
		case '6':	P2 = 0x7D;  break;
		case '7':	P2 = 0x07;  break;
		case '8':	P2 = 0x7F;  break;
		case '9':	P2 = 0x6F;  break;
	

		default: P2 = 0x3F;  break;
	}	
}
  • Now the code code is quite simple. I have added a small delay of 1 second and then displayed the character and stored the next character in array.
  • So, in this way we are displaying the characters from 0 to 9 and then repeats the process.
  • Now, you have seen the basics of Seven Segment Display with 8051 Microcontroller and now you can design any kind of project on it, like you can create a counter or a timer.
  • Now, compile the code and get the hex file and upload it to your 8051 Microcontroller and run the simulation.
  • If everything goes fine then you will get the results as shown in below figure:
  • You can download the Programming code and Simulation for interfacing of Seven Segment Display with 8051 Microcontroller, by clicking on the below button.

Download Simulation and Code

That's all for today, I hope now you can quite easily interface this seven segment display with 8051 Microcontroller. In the next post, we will have a look at some new project with 8051 Microcontroller. So, till then take care and have fun !!! :)

Electronic Quiz Project with 8051 Microcontroller

Hello friends, hope you all are fine. In today's project, we are gonna design Electronic Quiz Project with 8051 Microcontroller. I have done this project recently in which we need to design a quiz project game using 8051 Microcontroller. It was quite a big project and we have to work quite hard to make it done. In this project we have used many components on which I have already post tutorials so that you guys first get introduction to those components. So, first of all you should read Interfacing of LCD with 8051 Microcontroller, after that you must check Interfacing of Keypad with 8051 Microcontroller and finally get your hands on Serial communication with 8051 Microcontroller. These tutorial are must to read because these are all gonna use in today's project.

So, before going in details of this project, let me first tell you that its not free because we have done quite a lot of work in designing it so it will be of $20. We have placed quite a small amount as mostly it will be downloaded by the engineers students.You can download it by clicking the above button, but before buying it must read the details and also check the video posted at the end of this tutorial so that you know what you are buying. So, let's get started with the details of this project.

Overview of Electronics Quiz Project

  • Let's first have some overview of Electronic Quiz Project with 8051 Microcontroller.
  • In this project, I have designed a quiz game which has two modes in total named as:
    • Single Player.Mode
    • Two player Mode
  • In the start of this project, using keypad you have to select the Mode i.e. you wanna start Single player Mode or Two Player Mode.
  • Now let's check the details of each mode seperately:
Single Player Mode
  • When you select the single player mode then only one player can answer the questions.
  • In order to answer the questions, you have to use keypad.
  • The questions will be displayed on LCD.
  • The questions are in the form of MCQs so ti will have four options.
  • So,whenever the question is displayed on LCD, you need to use keypad to select the correct answer.
  • Rite now, I have added 6 questions in its database, which you can change easily or can also add more questions.
  • In single run, it will ask 3 random questions from the user and will get the answers.
  • For each correct answer, it will add the 5 marks and for each wrong answer it will subtract 2 marks.
  • After attempting all the 3 questions, it will display the final marks on the LCD screen.
  • Now you need to press any button to restart the system.
  • Below is given the Block diagram for the algorithm of Single Player Mode.
Two Player Mode
  • In two player Mode, there will be a competition between two players, in which first player will reply the question using keypad while the second player will reply the question using Keyboard which will come to the system via Serial port.
  • The question will be displayed on the LCD and the laptop at the same time, the question coming to laptop is via Serial port so you need to open some Serial Monitoring if you have designed it in hardware while in Proteus I have used Virtual Terminal to display the question.
  • Now after the question is displayed, system will wait for the response from both the players.
  • Now among the two players, who will press the 0 button first will be able to answer the question.
  • If he gave the correct answer, then 5 marks will be added in his total marks and if he gave wrong answer then 3 marks will be deducted.
  • IF the selected person given the wrong answer then the system will move to second user and will ask for the answer from him.
  • Now if the second user give the correct answer then 5 marks will be added in his marks and he give wrong answer then no marks will be deducted.
  • Total of three marks will be asked and at the end of these questions, marks of both players will be displayed and who got the maximum marks will be considered as a winner.
  • Now if you press any key, the system will restart.
  • The complete block diagram for the algorithm of two player mode is shown below:
Components Used
I have used below components in designing this project:
  • 8051 Microcontroller (AT89C51)
  • Keypad
  • LCD (20 x 4)
  • Serial Communication
  • Laptop or PC
So, now let's have a look at the Proteus Simulation and working of Electronic Quiz Project with 8051 Microcontroller.

Electronic Quiz Project with 8051 Microcontroller

  • So, now we have the detailed overview of Electronic quiz project with 8051 microcontroller. Let's design its Proteus Simulation.
  • Design a circuit in Proteus as shown in below figure:
 
Programming Code
  • I have designed the programming code in Keil uvision 3 for Electronic Quiz Project with 8051 Microcontroller.
  • I am not gonna share the complete code here because its not free but you can buy it quite easily by clicking the below button for just $20.
  • But I am gonna explain the code in chunks so that you get some idea How I am doing this Electronic quiz project with 8051 Microcontroller.
  • First of all let's have look at lcd code. In my previous post I was writing character by character on LCD because it was quite a small project, but now I have to print quite a lot of string so that's why I have written a function to which you can give any string and it will print it on LCD. The function is as follow:
void writeline_lcd(char line[])
{
   		int i;
   		for(i=0;i<strlen(line);i++)
   		{ writedata(line[i]); } //write to lcd
   
}
  • Using this function, you can easily write complete string on LCD.
  • Next in order to send data to Serial Port I have used the below function:
void writeline_serial(char line1[])
{  
   int i;
   EA = 0; ES = 0;
   for(i=0;i<strlen(line1);i++)
   { SendByteSerially(line1[i]); } // SEND DATA TO PC 
   EA = 1; ES = 1;
}
  • For storing the questions I have used the below function:
void Ask_Question(void)
{
	int q = 13;
	writecmd(0x01);
	
	//randomize question
	while(!(q<7 & q>-1))
	{
		q = (TL1%6);
		if(q1==1 & q==1)  { q = 6; }
		if(q2==1 & q==2)  { q = 4; }
		if(q3==1 & q==3)  { q = 5; }
		if(q4==1 & q==4)  { q = 6; }
		if(q5==1 & q==5)  { q = 2; }
		if(q6==1 & q==6)  { q = 3; }
	}

	switch(q)
	{
	case 1:  q1=1; writeline_lcd("3,8,15,24,35..."); newline2(); writeline_lcd("51  48  46  42"); Return();
			 if(mode=='1') { writeline_serial("3,8,15,24,35...   options are (1)51  (2)48  (3)46  (4)42"); } break;
	case 2:  q2=1; writeline_lcd("6,14,18,28,30..."); newline2(); writeline_lcd("32  46  42  28"); Return();
			 if(mode=='1') { writeline_serial("6,14,18,28,30...   options are (1)32  (2)46  (3)42  (4)28"); } break;
	case 3:  q3=1; writeline_lcd("4, 1, 0, 1, 4..."); newline2(); writeline_lcd("1   3   9   0"); Return();
			 if(mode=='1') { writeline_serial("4, 1, 0, 1, 4...   options are (1)1  (2)3  (3)9  (4)0"); } break;
	case 4:  q4=1; writeline_lcd("-1, 4, 1, 6, 3..."); newline2(); writeline_lcd("8   10   5   7"); Return();
			 if(mode=='1') { writeline_serial("-1, 4, 1, 6, 3...   options are (1)8  (2)10  (3)5  (4)7"); } break;
	case 5:  q5=1; writeline_lcd("10,21,33,46,60..."); newline2(); writeline_lcd("88   73   65   75"); Return();
			 if(mode=='1') { writeline_serial("10,21,33,46,60...   options are (1)88  (2)73  (3)65  (4)75"); } break;
	case 6:  q6=1; writeline_lcd("1-1+1-1+...inf=?"); newline2(); writeline_lcd("0   1   1/2   -1"); Return();
			 if(mode=='1') { writeline_serial("1-1+1-1+...inf=?   options are (1)0  (2)1  (3)1/2  (4)-1"); } break;
	}
	
	q_no = q;
}
  • This same function is also used for asking the questions, I simply call this function when I need to ask the question.
  • These are the main functions used in this project. Another important function is the cchecking answer function, which I am not sharing here. this function is used to check the reply i.e. the answer is correct or not.
  • After that there is another function which is result function. This function calculate the result and display it on LCD.
  • Now once you have the code compile it and get the hex file.
  • Upload that hex file in your 8051 Microcontroller and run your simulation.
  • The first screen you will get is as follow:
  • After a delay of some seconds, it will ask for Mode Selection as follows:
  • Now, you need to give 0 if you want to select Single Player Mode or 1 if you want to Select Two Player Mode and the game will start.
  • I am not adding more images as the post will become quite long so I have made a video given below which will give you detailed working of this project.
So, that's all about Electronic quiz project with 8051 Microcontroller, I hope you have enjoyed this post. So let's meet in the next tutorial. Till then take care !!! :)

Arduino Mega 2560 Library for Proteus

Update: We have created a new version of this library, which you can check here: Arduino Mega 2560 Library for Proteus V2.0.

Hello friends, hope you all are fine. In today's post, I am going to share Arduino Mega 2560 Library for Proteus. In the previous post, I have shared the Arduino UNO Library for Proteus and I have mentioned that I am gonna share more Arduino Libraries soon. Actually these days I am quite excited about this Proteus component designing and I am designing the Arduino boards as a starter. So, till now I have designed two Arduino boards in Proteus. First one was Arduino UNO which I have provided for download in previous post and today, I am going to share Arduino Mega 2560 Library for Proteus.

In the coming posts, I am gonna share more exciting libraries for Proteus as I have already started designing the Arduino Nano board in Proteus, which will be the talk of our next tutorial hopefully. We all know about Arduino Mega 2560 board which is quite bigger version of Arduino UNO board and uses Atmega2560 Microcontroller. In the below post, I have first given the link to download Arduino Mega Library and afterwards I have explained How to use Arduino Mega board in Proteus by designing a simple blinking LED circuit as we did for Arduino UNO simulation in Proteus. So, let's get started with it.

I have added all the Arduino boards in a single library. This library contains six Arduino boards which are Arduino UNO, Arduino Mega 2560, Arduino Mega 1280, Arduino Nano, Arduino Mini and Arduino Pro Mini. You can download this complete Arduino Library by checking Arduino Library for Proteus.

Arduino Mega 2560 Library for Proteus

  • First of all, click the below button to download the Arduino Mega 2560 Library for Proteus.
Arduino Mega 2560 Library for Proteus

  • Now download this library and you will find a zip file.
  • Extract this zip file, it will contain two files named as ArduinoUnoTEP.LIB and ArduinoUnoTEP.IDX.
  • Place these files in the library folder of your Proteus software.
Note:
  • Now we have placed our Arduino Mega 2560 library for Proteus files in the libraries folder of Proteus software. So, now run your Proteus software and search Arduino Mega 2560.
  • Place this Arduino board in your workspace and it will look like something as shown in below figure:
  • It has become quite big but looking quite attractive and I am feeling kind of proud on my new invention. :)
  • Anyways, now next thing we need to do is to upload the hex file in it.
  • So, in order to do so, we need to double click the Arduino Mega 2560 board and its properties panel will poop up as shown in below figure:
  • Now browse for your hex file in the section PROGRAM FILE or paste the link as we did in previous Arduino UNO post.
  • You should read How to get Hex File from Arduino if you don't know already.
  • You can also change different options here but my suggestion is to not change anything else if you are not pro.
  • So, now we have seen How to get the Arduino Mega 2560 library for Proteus. Now let's design a simple example in which we will show led blinking with Arduino Mega 256 in Proteus software.
  • So, design a simple circuit as shown in below figure:
  • Now open the blink example from your Arduino software and get the hex file.
  • Upload this hex file in your Proteus software and run the simulation.
  • If everything goes fine then you will get something as shown in below figure:
  • Quite Simple. isn't it. Now below is given the video demonstration for Arduino Mega 2560 Library for Proteus.
So, that's all for today. Till now we have designed two Arduino boards in Proteus which are Arduino UNO and Arduino Mega 2560. I am planning on designing more Arduino boards and will post them soon.
Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir