Hello readers! I hope you are doing great. Today, we are discussing the latest library for proteus. In the tutorial, we will look at the Arduino Mega 2560 library for Porteus V 3.0, which is one of the most versatile and useful microcontrollers from the Arduino family. We have shared the previous versions with you before this; these were the Arduino Mega 2560 library for Proteus and the Arduino Mega 2560 library for Proteus V2.0. The current version is better in structure and does not have a link to the website so you may use it in your projects easily.
Here, I will discuss the detailed specifications of this microcontroller. After that, I will show you the procedure to download and install this library in the Proteus and in the end, we’ll create a mini project using this microcontroller. Here is the introduction to the Arduino Mega 2560:
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | Buzzer | Amazon | Buy Now | |
2 | Arduino Mega 2560 | Amazon | Buy Now |
The Arduino Mega 2560 belongs to the family of Arduino microcontrollers and is one of the most important devices in embedded systems. Here are some of its specifications:
Specification |
Value |
Microcontroller |
ATmega2560 |
Operating Voltage |
5V |
Input Voltage (recommended) |
7-12V |
Input Voltage (limit) |
6-20V |
Digital I/O Pins |
54 (of which 15 provide PWM output) |
Analog Input Pins |
16 |
DC Current per I/O Pin |
20 mA |
DC Current for 3.3V Pin |
50 mA |
Flash Memory |
256 KB (8 KB used by bootloader) |
SRAM |
8 KB |
EEPROM |
4 KB |
Clock Speed |
16 MHz |
LED_BUILTIN |
Pin 13 |
Length |
101.52 mm |
Width |
53.3 mm |
Weight |
37 g |
Now that we know the basic features of this device, we can understand how it works in Proteus.
This library is not present by default in Porteus. The users have to download and install it in the Porteus library folder. Click on the following link to start the downloading process:
Arduino Mega 2560 V3.0 for Proteus
If the downloading process is complete, you can see a zip file in the downloading folder of your system. Click on it.
Extract the zip folder at the desired location.
Along with some other files, you can see there are two files with the following names in the zip folder:
ArduinoMega3TEP.IDX
ArduinoMega3TEP.LIB
You have to copy these two files only and go to the folder of the given path:
C>Program files>Lab centre electronics>Proteus 7 Professional>Library
If you want more details on this process, you must see How to Add a New Library File in Proteus .
Note: The procedure to install the same package in Proteus Professional 8 is the same.
Now, the Arduino Mega 2560 V3.0 can be run on your Proteus software. Open your Proteus software or if it was already opened, restart it so the libraries may load successfully.
Click on the “P” button on the left side of the screen and it will open a search box for devices in front of you.
Here, type “Arduino Mega 2560 V3.0,” and it will show you the following device:
Double-click on it to pick it up.
Close the search box and click on the name of this microcontroller from the pick library section present on the left side.
Place it in the working area to see the structure of the Arduino Mega 2560 V3.0.
If you have seen the previous versions of this microcontroller in Proteus, you can see that the latest version has some changes in it. The design and colour are closer to the real Arduino Mega 2560. Moreover, it does not have a link to the website and the pins are more realistic.
The workings of the Arduino Mega 2560 V3.0 library can be understood with the help of a simple project. Let’s create one. For this, follow the steps given here:
Now, connect all the components through the connecting wires. Here is the final circuit:
Now, it's time to add code to the simulation.
const int buttonPin = 2; // Pin connected to the button
const int speakerPin = 3; // Pin connected to the speaker
int buttonState = 0; // Variable to store the button state
boolean isPlaying = false; // Variable to track whether the speaker is playing
void setup() {
pinMode(buttonPin, INPUT);
pinMode(speakerPin, OUTPUT);
}
void loop() {
// Read the state of the button
buttonState = digitalRead(buttonPin);
// Check if the button is pressed
if (buttonState == HIGH) {
// Toggle the playing state
isPlaying = !isPlaying;
// If playing, start the speaker
if (isPlaying) {
digitalWrite(speakerPin, HIGH);
} else {
// If not playing, stop the speaker
digitalWrite(speakerPin, LOW);
}
// Add a small delay to debounce the button
delay(200);
}
}
You can get the same code from the zip file you have downloaded from this tutorial.
Click on the "verify" button present on the above side of the code.
Once the loading is complete, click on the “upload” button present just at the side of the verify button. It will create a hex file in your system.
From the console of loading, search for the address of the file where the code is saved.
In my case, it looks like this:
Copy this path to the clipboard.
Once again, go to your Proteus software.
Click on the Arduino Mega 2560 to open its control panel.
Paste the path of the hex file in the place of the program file:
Hit the “OK” button to close the window.
Once you have loaded the code into the microcontroller, you can now run the project.
At the bottom left side of the project, you can see different buttons, click on the play button to run the project.
Before clicking on the button of the project, the project looks like the following:
Once the button is pressed, you will hear the sound from the speaker. Hence, the speaker works with the button.
If all the above steps are completed successfully, you will hear the sound of the speaker. I hope all the steps are covered in the tutorial and you have installed and run the Arduino Mega 2560 v3.0 in Proteus, but if you want to know more about this microcontroller, you can ask in the comment section.
We all use calculators in our daily life, whether you are working in an office or counting money at the bank, you are buying your daily grocery or doing shopping online, you will find calculators in different forms everywhere. In fact, the computer was initially considered a giant calculator. So if it is that common, why do we not make our own calculator?
Before going into the details of the project, it is good to know some history of that, let’s know some facts about the calculator. So the first known device for calculation is Abacus. And the first digital calculator was made by Texas Instruments in 1967 before that all calculators were mostly mechanical and they did not need any electronic circuits. The first all-transistor calculator was made by IBM and it is claimed that the calculator performed all the four basic operations such as addition, subtraction, multiplication, and division.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | Keypad 4x4 | Amazon | Buy Now | |
2 | LCD 16x2 | Amazon | Buy Now | |
3 | Arduino Mega 2560 | Amazon | Buy Now |
In this, we will be going to use the Proteus simulation tool and we will make our whole project using this software only. But no need to worry while using the actual components because if our project works perfectly with simulation, it will definitely work with actual hardware implementation. And the best part of the simulation is, here we will not damage any components by making any inappropriate connections.
If you don’t have an idea about Proteus, Proteus is a software for the simulation of electronic circuits and here we can use different types of microcontrollers and run our applications on them.
So for this project, we need to install this software. This software has a big database for all electronics components but still, it lacks some, therefore we have to install some libraries for modules which we are going to use in this project.
In this project, we will take input from the user using a keypad and perform the operation using Arduino UNO and display the result on an LCD display.
Our project will work the same as a normal digital calculator such that the user will enter two numerical values and select arithmetic operations which she/he wants to perform on the given values. Once the user clicks on the equal button, thereafter Arduino UNO will calculate the output and display the result on the LCD module.
Now, let’s start designing our circuit diagram for the calculator.
Now we have all the required components in the workplace as follows.
Let's start connecting them.
That is all for connection. Make sure all the connections are correct, especially for keypad’s row and column connections otherwise we will get the wrong values from the keypad input.
And while working on the actual components, power the backlight of the LCD module and set the appropriate contrast, else nothing will be visible even if that has been displayed.
In the above-mentioned image, the first argument for RS pin, second for Enable pin, and rest four for data pins.
And required operation will be stored in the ‘op’ variable and a flag will be set for taking the second number.
That is all the code, we need to run an Arduino Calculator.
Now, we have completed the coding and circuit part, it is time to run the simulation in the Proteus.
I hope we have covered everything related to Arduino calculator i.e. Simulation, Code, Working etc. but still if you find anything confusing, ask in the comments.
Thanks for reading this project out. All the best for your projects!
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | LEDs | Amazon | Buy Now | |
2 | Resistor | Amazon | Buy Now | |
3 | LCD 16x2 | Amazon | Buy Now | |
4 | Arduino Mega 2560 | Amazon | Buy Now |
As you all already know the importance of traffic lights and their usage has solved a number of traffic problems, traffic is becoming denser on each road in the whole world by the hour. This leads us to consider traffic density at such roads as well. A number of different solutions have been developed in recent times to help with this problem such as roundabouts. This is done so to ensure the safety of vehicles on road and of people walking on pedestrian walks. With the world going towards automation and autonomous systems, this is the right time to switch traffic lights to an autonomous traffic light system too and make the system intelligent.
We will be going through how to make an autonomous traffic system by using Arduino as a microcontroller. However, we’re not making an actual system rather we will be making a simulation of the said traffic system on a circuit simulating software Proteus. So make sure you already have the latest version of Proteus installed on your PCs and laptops. If not, you should first install the Proteus Software by following the embedded link. Proteus is open database software, meaning people can easily make their own circuit simulating libraries for the software and can easily integrate those libraries. This helps in making the software versatile and easy to use. You can easily add your own components or download libraries of components and place them within the software.
To start working with this project, you need to install and include the following libraries on your Proteus software:
This is a smart 4-way traffic light system. The pedestrian lights work such that whenever a certain traffic light is green its opposite pedestrian lights turn on. An addition of ultrasonic sensors have been made in the traffic light sequence. One ultrasonic sensor is placed at each traffic light. Each ultrasonic sensor controls the time of their respective green traffic light. When the ultrasonic sensor output is high, the traffic light opens for one second, when the ultrasonic sensor output is intermediate the traffic light opens for two seconds and when the ultrasonic sensor output is low the traffic lights open for 3 seconds.
The main components and their use in this project is given below:
We will go through the details of some of the important components being used in this project.
Arduino is an open-source programmable board that serves as a microcontroller and processes information based upon inputs and gives information to actuators in terms of output. Arduino Mega is based upon the chip ATmegaGA2560 and has 53 digital I/O pins.
Liquid Crystal Displays used in electronics are of two basic sizes, 16x2 and 24x2. These represent the number of columns and rows of the LCD. Each pixel can store one character in it. It is also known as a character LCD. It comes equipped with a backlight. The intensity or glow of the backlight can be controlled by attaching a potentiometer at specified pins.
Figure 2: LCD display
An ultrasonic sensor uses SONAR technology to identify objects. It is basically used to find the distance of objects from the sensor. The ultrasonic sensor works by sending out ultrasonic waves and when these waves or parts of waves hit an object, they are reflected backward and the time from their propagation to their return is then noted. This time is then converted into the distance because we already know the speed by which those waves are traveling.
Figure 3: Ultrasonic Sensor
In order to simulate this project on Proteus software, we will first make the circuit diagram on Proteus. After that, we will write our code on Arduino IDE software and integrate it with the circuit made in Proteus.
Open Proteus and open a new project. Import the following components in your Proteus worksheet.
Place the component in your worksheet as illustrated in the figure below:
Figure 5: Placement of components
After placing the components, make the connections as follows:
With this, your circuit connections are complete and we will now move on to the firmware setup of this circuit.
We have divided the Arduino code in 3 segments:
We will look at these sections separately now.
The first step in the code is the declaration of variables that we will utilize in our program. At first is the declaration of ultrasonic sensor pins and setting them up with their respective pins of Arduino board. The syntax of this code is as follows.
Figure 6: Ultrasonic declaration code
Now we will include the library of LCD into our Arduino program, you can download this library from within the software. After that we will declare the LCD by defining the LCD pins. The syntax for which is as follows:
In the next step, we will declare traffic light variables and define their Arduino pins.
Figure 8: Traffic light variable declaration
Now, we will declare the variables of pedestrian LEDs and then allot them their Arduino pins being used in the circuit.
Figure 9: Declaration of pedestrian LEDs
Now, there are two variables being used for each ultrasonic sensor for the calculation of their distance and time duration. We will declare those variables now.
Figure 10: Declaration of variables being used for calculations
Void setup is the part of Arduino program that only runs once, in this section the program that only needs to run once is put, such as declaring pins as output pins or input pins.
Only the echo pins of ultrasonic sensor are input pins while all other pins are going to be output pins for this project.
We will first set up ultrasonic pins as follows:
Now we will declare traffic light pins as output pins. The syntax for this is given as follows:
Figure 12: Setup of Traffic light Pins as Output
Now we will setup our pedestrian LEDs.
Figure 13: Setup of Pedestrian LEDs as Output
Now we will initialize our LCD, this basically tells the microcontroller to start the LCD and give power to it. The syntax is given below.
Figure 14: Initializing LCD
This part of Arduino Program runs in a loop and consists of the main code of the program in which all the calculations are being done.
In the first part of the program, we will set the trigger pin of the first ultrasonic sensor to low and high. This would generate a pulse and send out a wave. After that we will read a pulse input from the echo pin. This will give us the duration in which the wave was propagated and returned. After that we will calculate the distance from the duration of the wave.
Figure 15: Syntax of 1st Ultrasonic Sensor
This distance calculation is for our first traffic light. Now we will use the if loop to check our distance value.
If the value falls between our set limit for the loop, the signal will turn green for three seconds. This will also be displayed on the LCD.
Figure 17: Arduino Code
After that in our if loop, the yellow lights 1 and 2 will turn on to indicate transition.
Figure 18: Arduino Code
Now we will use the if loop to check our distance value.
If the value falls between our set limit for the loop of intermediate traffic, the signal will turn green for two seconds. This will also be displayed on the LCD.
Figure 19: Arduino Code
After that in our if loop, the yellow lights 1 and 2 will turn on to indicate transition.
Now we will use the if loop to check our distance value again.
If the value falls between our set limit for the loop of low traffic, the signal will turn green for one second. This will also be displayed on the LCD.
Figure 21: Arduino Code
After that in our if loop, the yellow lights 1 and 2 will turn on to indicate transition.
Figure 22: Arduino Code
Now we will set the trigger pin of the second ultrasonic sensor to low and high. This would generate a pulse and send out a wave. After that we will read a pulse input from the echo pin. This will give us the duration in which the wave was propagated and returned. After that we will calculate the distance from the duration of the wave.
Figure 23: Arduino Code
This distance calculation is for our Second traffic light. Now we will use the if loop to check our distance value.
Figure 24: Arduino Code
If the value falls between our set limit for the loop, the signal will turn green for three seconds. This will also be displayed on the LCD.
After that in our if loop, the yellow lights 2 and 3 will turn on to indicate transition.
Figure 26: Arduino Code
Now we will use the if loop to check our distance value.
If the value falls between our set limit for the loop of intermediate traffic, the signal will turn green for two seconds. This will also be displayed on the LCD.
Figure 27: Arduino Code
After that in our if loop, the yellow lights 2 and 3 will turn on to indicate transition.
Figure 28: Arduino Code
Now we will use the if loop to check our distance value again.
If the value falls between our set limit for the loop of low traffic, the signal will turn green for one second. This will also be displayed on the LCD.
Figure 29: Arduino Code
After that in our if loop, the yellow lights 2 and 3 will turn on to indicate transition.
Now we will set the trigger pin of the third ultrasonic sensor to low and high. This would generate a pulse and send out a wave. After that, we will read a pulse input from the echo pin. This will give us the duration in which the wave was propagated and returned. After that we will calculate the distance from the duration of the wave.
Figure 31: Arduino Code
This distance calculation is for our third traffic light. Now we will use the if loop to check our distance value.
Figure 32: Arduino Code
If the value falls between our set limit for the loop, the signal will turn green for three seconds. This will also be displayed on the LCD.
Figure 33: Arduino Code
After that in our if loop, the yellow lights 3 and 4 will turn on to indicate transition.
Figure 34: Arduino Code
Now we will use the if loop to check our distance value.
If the value falls between our set limit for the loop of intermediate traffic, the signal will turn green for two seconds. This will also be displayed on the LCD.
After that in our if loop, the yellow lights 3 and 4 will turn on to indicate transition.
Figure 36: Arduino Code
Now we will use the if loop to check our distance value again.
If the value falls between our set limit for the loop of low traffic, the signal will turn green for one second. This will also be displayed on the LCD.
Figure 37: Arduino Code
After that in our if loop, the yellow lights 3 and 4 will turn on to indicate transition.
Figure 38: Arduino Code
Now we will set the trigger pin of the fourth ultrasonic sensor to low and high. This would generate a pulse and send out a wave. After that, we will read a pulse input from the echo pin. This will give us the duration in which the wave was propagated and returned. After that, we will calculate the distance from the duration of the wave.
Figure 39: Arduino Code
This distance calculation is for our fourth traffic light. Now we will use the if loop to check our distance value.
If the value falls between our set limit for the loop, the signal will turn green for three seconds. This will also be displayed on the LCD.
Figure 41: Arduino Code
After that in our if loop, the yellow lights 4 and 1 will turn on to indicate transition.
Figure 42: Arduino Code
Now we will use the if loop to check our distance value.
If the value falls between our set limit for the loop of intermediate traffic, the signal will turn green for two seconds. This will also be displayed on the LCD.
After that in our if loop, the yellow lights 4 and 1 will turn on to indicate transition.
Figure 44: Arduino Code
Now we will use the if loop to check our distance value again.
If the value falls between our set limit for the loop of low traffic, the signal will turn green for one second. This will also be displayed on the LCD.
Figure 45: Arduino Code
After that in our if loop, the yellow lights 4 and 1 will turn on to indicate transition.
Figure 46: Arduino Code
At first, after writing the code, generate its hex file and put that hex file on the Arduino board on your Proteus software. After that, run the simulation. The results of the simulation are shown below thoroughly.
At first, when sensor one gives the output within 500 cm, the traffic light will turn on for one second only.
Figure 47: Simulation Results
However, if the sensor one value is between 500 and 900 cm, the traffic light 1 will be green for 2 seconds with the LCD displaying the remaining time.
Figure 48: Simulation Results
If the sensor values are above 900 cm, then the lights will be green for 3 seconds.
When the sensor two gives the output within 500 cm, traffic light 2 will turn on for one second only.
Figure 50: Simulation Results
However, if the sensor two value is between 500 and 900 cm, the traffic light 2 will be green for 2 seconds with the LCD displaying the remaining time.
Figure 51: Simulation Results
If the sensor values are above 900 cm, then the lights will be green for 3 seconds.
Figure 52: Simulation Results
When sensor three gives the output within 500 cm, traffic light 3 will turn on for one second only.
However, if the sensor three value is between 500 and 900 cm, the traffic light 3 will be green for 2 seconds with the LCD displaying the remaining time.
Figure 54: Simulation Results
If the sensor values are above 900 cm, then the lights will be green for 3 seconds.
Figure 55: Simulation Results
When sensor four gives the output within 500 cm, traffic light 4 will turn on for one second only.
Figure 56: Simulation Results
However, if the sensor four value is between 500 and 900 cm, the traffic light 4 will be green for 2 seconds with the LCD displaying the remaining time.
Figure 57: Simulation Results
If the sensor values are above 900 cm, then the lights will be green for 3 seconds.
Figure 58: Simulation Results
Phew! I know that this was an extremely long project, but that is a part of an engineer’s life. Multiple receptions and running recurring patterns smoothly requires skill and patience only an engineer can possess. I hope you guys made it through. Kudos to your nerves of steel. Thanks for reading.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | LEDs | Amazon | Buy Now | |
2 | Arduino Mega 2560 | Amazon | Buy Now |
Traffic lights are an integral part of the world’s transportation systems. Over the years a number of different algorithms regarding traffic lights have been developed. The algorithm being used at any place for the purpose of controlling traffic takes into account of various factors, such as number of lanes, people that cross a certain road, etc. The most common usage of traffic lights is to control the flow of traffic, which means providing a steady flow for people to go about their daily business on the road. Traffic lights help reduce accidents by a large margin since they allow the flow of vehicles in only one direction at a time. Traffic lights also help in avoiding traffic jams. The most common traffic light pattern being used in the world today is a 4-way traffic control that accounts for pedestrians as well. This sort of pattern is used in main city blocks and squares since these possess both vehicular traffic as well as pedestrian traffic. Traffic lights have a universal color understanding that red light signals for the traffic to stop, yellow light serves as a transition light from going to stop and vice versa.
Since we are simulating this project instead of designing it using hardware components, you need to fill some requisites so that you can follow our procedure. At first, we need to have the simulating software. For simulation purposes, we will use the Proteus software, if you already have that installed, that is excellent. However, if you don’t, you should Install Proteus Software. Proteus is a circuit simulating software that has an open database that can be customized quite easily, leaving room to add new components along with their libraries. To start working with Proteus for this project, you need to add the following libraries:
The main components of a 4-way traffic light are:
In this certain design, we have used delays to control the ON and OFF time of the traffic lights. There are other ways around this as well but using delays with Arduino is the simplest and most effective way for small projects.
The pedestrian lights are set up so that whenever a certain traffic light is GREEN, its opposing pedestrian light on which there is no traffic is turned ON and signals for the pedestrians to walk.
Arduino Mega is a programmable microcontroller board.
Arduino Mega contains ATMegaGA2560 and is based on that microcontroller.
Every Arduino board is equipped with voltage regulators to make sure an excessive input does not burn components on the board.
Arduino Mega has 53 digital I/O pins.
This module consists of three lights, namely, Red, Yellow and Green.
All three lights have separate input pins through which each light is controlled independently.
Make sure you connect all three pins to the Arduino, even if you are not using a certain light. This is because Proteus simulation only works when all the pins of traffic light are connected.
Figure 2: Traffic Lights
We will first make the circuit on our Proteus software, after doing the connections of the circuit, we will work on the Arduino code based upon the circuitry and connections made.
First of all, make sure you have downloaded and installed Proteus software on your system and have downloaded and integrated the required libraries with the downloaded software.
Open Proteus and then open a new project, there is no need to change settings and simply select okay to default selected settings.
Import all the components of this project mentioned above and shown in the figure below:
Figure 3: Required Components
Place the components in the worksheet as illustrated below:
After placing the components in the worksheet, make connections as follows:
With this, your circuit connections are complete and we will now move on to the firmware setup of this circuit.
We have divided the Arduino code into 3 segments:
We will look at these sections separately now.
The first step in the code is the declaration of variables that we will utilize in our program. At first is the declaration of traffic lights and setting them up with their respective pins of Arduino board. The syntax of this code is as follows.
Figure 5: Arduino Code
The next declaration is of pedestrian lights. The syntax of pedestrian light declaration is illustrated as follows.
Figure 6: Arduino Code
This part of the code along with the declaration part is run only once, we will use this to define output and input pins. This helps Arduino to understand which pins to take data from and which pins to write data on.
Since there is no input, we will only define traffic lights and pedestrian lights as output pins. The syntax to do this is shown in figure 7.
Figure 7: Arduino code, Void Setup
This part of the code runs in a loop consistently and is used to write the main section of the code.
In the first section, we will turn on the green light of signal 1 while all other signals are red. The pedestrian lights are red for pedestrian signals 1, 2 and 3. While the pedestrian 4 light is green since it is opposite to traffic signal 1.
Figure 8: Arduino Code
After a delay of 2000ms, we will turn on the yellow light for signal 1 and signal 2 to indicate that a transition from signal 1 to signal 2 will be made shortly. We will also turn all pedestrian lights red in order to ensure pedestrian safety.
Figure 9: Arduino Code
After a delay of 1000ms, all traffic and pedestrian lights will turn off for 100ms.
For the second signal, we will turn on the green light of signal 2 while all other signals are red. The pedestrian lights are red for pedestrian signals 2, 3 and 4. While the pedestrian 1 light is green since it is opposite to traffic signal 2.
Figure 11: Arduino Code
After a delay of 2000ms, we will turn on the yellow light for signal 2 and signal 3 to indicate that a transition from signal 2 to signal 3 will be made shortly. We will also turn all pedestrian lights red in order to ensure pedestrian safety.
Figure 12: Arduino Code
After a delay of 1000ms, all traffic and pedestrian lights will turn off for 100ms.
Figure 13: Arduino Code
For signal 3, we will turn on the green light of signal 3 while all other signals are red. The pedestrian lights are red for pedestrian signal 1, 3 and 4. While the pedestrian 2 light is green since it is opposite to traffic signal 3.
After a delay of 2000ms, we will turn on the yellow light for signal 3 and signal 4 to indicate that a transition from signal 3 to signal 4 will be made shortly. We will also turn all pedestrian lights red in order to ensure pedestrian safety.
Figure 15: Arduino Code
After a delay of 1000ms, all traffic and pedestrian lights will turn off for 100ms.
Figure 16: Arduino Code
For the final signal, we will turn on the green light of signal 4 while all other signals are red. The pedestrian lights are red for pedestrian signals 1, 2 and 4. While the pedestrian 3 light is green since it is opposite to traffic signal 4.
Figure 17: Arduino Code
After a delay of 2000ms, we will turn on the yellow light for signal 4 and signal 1 to indicate that a transition from signal 4 to signal 1 will be made shortly. We will also turn all pedestrian lights red in order to ensure pedestrian safety. This will also complete the loop and the sequence will keep running on its own.
Figure 18: Arduino Code
After a delay of 1000ms, all traffic and pedestrian lights will turn off for 100ms.
With this, the program of the void loop will end and start again from signal 1 on its own.
Generate a hex file from the Arduino program made above. Be sure to select
Integrate the hex file into your Arduino board on Proteus.
Run the simulation.
The results of the simulation should be something like our simulation results.
The simulation results for each scenario are illustrated in the figure below.
At first, traffic signal 1 is turned ON and the green light is displayed for 2000ms. The green pedestrian light 4 is also turned ON since it is opposite to signal 1.
Figure 20: Signal 1 is ON while Pedestrian 4 is ON.
Then the yellow light of signals 1 and 2 are turned ON showing transition is about to happen. The red pedestrian lights during this are turned ON to ensure pedestrian safety.
Then traffic signal 2 is turned ON and the green light is displayed for 2000ms. The green pedestrian light 1 is also turned ON since it is opposite to signal 2.
Figure 22: Signal 2 is ON while Pedestrian 1 is ON.
Then the yellow light of signal 2 and 3 is turned ON showing transition is about to happen. The red pedestrian lights during this are turned ON to ensure pedestrian safety.
Figure 23: Yellow light showing transition.
Then traffic signal 3 is turned ON and the green light is displayed for 2000ms. The green pedestrian light 2 is also turned ON since it is opposite to signal 3.
Figure 24: Signal 3 is ON and Pedestrian 2 is ON
Then the yellow light of signal 3 and 4 is turned ON showing transition is about to happen. The red pedestrian lights during this are turned ON to ensure pedestrian safety.
Then traffic signal 4 is turned ON and the green light is displayed for 2000ms. The green pedestrian light 3 is also turned ON since it is opposite to signal 4.
Figure 26: Signal 3 is ON and Pedestrian 2 is ON
Then the yellow light of signal 4 and 1 is turned ON showing transition is about to happen. The red pedestrian lights during this are turned ON to ensure pedestrian safety.
Figure 27: Yellow light showing the transition.
That is all for today’s tutorial, I hope you enjoyed learning with us. We wish you have a good day ahead of you. Thanks for reading.
Hi Friends! Hope you’re well today. Happy to see you around. In this post today, I’ll walk you through Latest Proteus Libraries for Engineering Students V2.0.
We have been designing proteus libraries for our blog readers for quite a while now. You might have visited our Arduino Libraries for Proteus V2.0 and Analog Sensors Libraries for Proteus V2.0. We keep working on those libraries and make sure the bugs are removed and you always get the updated version of those libraries.
We are going to share the most advanced and upgraded version of Proteus Libraries V2.0 we have designed for our readers. These libraries are more robust, fast, and efficient than previous versions. Moreover, we have converted some digital sensors to analog sensors, helping you pick from a wide range of libraries for your projects. If you think some sensors or modules are missing in the Proteus database that should be included, leave your valuable suggestion in the section below. We’ll try our best to design and simulate those in proteus.
Before further ado, let’s jump right in.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | LEDs | Amazon | Buy Now | |
2 | Resistor | Amazon | Buy Now | |
3 | ACS712 | Amazon | Buy Now | |
4 | DHT11 | Amazon | Buy Now | |
5 | DHT22 | Amazon | Buy Now | |
6 | DS18B20 | Amazon | Buy Now | |
7 | Flame Sensors | Amazon | Buy Now | |
8 | Arduino Mega 2560 | Amazon | Buy Now | |
9 | Arduino Nano | Amazon | Buy Now | |
10 | Arduino Uno | Amazon | Buy Now |
We’ll be covering both Arduino Libraries for Proteus V2.0 and Analog Sensors Libraries for Proteus V2.0.
Arduino boards are open-source electronic development boards that you can use in your projects. Arduino Libraries for Proteus V2.0 contain the following Arduino boards.
Arduino UNO is a microcontroller board based on the Atmega328 microcontroller. We have designed Arduino UNO Library for Proteus V2.0 which you can download from the link given below. We’ve previously designed the Proteus Library for the Arduino UNO V1.0 board and the below figure shows the comparison of both V1 and V2 Arduino boards. You can see the V2 board is more compact and small-sized compared to the V1 Arduino UNO board.
In this library, we’ve also interfaced LCD with the Arduino UNO. If you find any difficulty in interfacing the board with the LCD, you can approach me in the section below. I’d love to help you the best way I can.
Download the Arduino UNO Library for Proteus V2.0 by clicking the link below:
Download Arduino UNO Library for Proteus V2.0
Arduino Mega is an electronic board that features an Atmega1280 microcontroller. You can use this board to develop stand-alone electronic projects or you can also incorporate it into embedded projects. Again, the following figure shows a comparison between Arduino Mega 1280 V1 and V2. The V2 board is compact and small-sized compared to the V1 board.
We have developed the Arduino Mega 1280 library for proteus V2.0 which you can download to simulate Arduino Mega 1280 in proteus.
Download the Arduino Mega 1280 Library for Proteus V2.0 by clicking the link below:
Download Arduino Mega 1280 Library for Proteus V2.0
Arduino Mega 2560 is a sophisticated, application-type microcontroller board that features an Atmega2560 microcontroller. This board comes in handy when you require more input and output pins and more memory space to store the code for your electronic project. We have developed Arduino Mega 2560 Library for Proteus V2.0 to help you simulate this board in the proteus. Moreover, we’ve also interfaced LCD with this board so if you have any questions about it, you can ask me in the section below:
]TEPImg6]
Click the link below and download the Arduino Mega 2560 Library for Proteus V2.0.
Download Arduino Mega 2560 Library for Proteus V2.0
Arduino Mini is a small-sized, powerful open-source microcontroller board based on the Atmega328 microcontroller. The board is 1/6th of the size of the Arduino UNO board and can easily rest on hard-to-reach places. We have designed Arduino Mini Library for Proteus V2.0 that you can download to simulate Arduino Mini in Proteus.
Click the link below and download the Arduino Mini Library for Proteus V2.0:
Download Arduino Mini Library for Proteus V2.0
Arduino Pro Mini is a small-sized microcontroller board that includes an Atmega328 microcontroller. The Proteus library V2.0 is designed for Arduino Pro Mini, moreover, we have also interfaced the board with the LCD 20x4.
Click the link below and download the Arduino Pro Mini Library for Proteus V2.0.
Download Arduino Pro Mini Library for Proteus V2.0
Arduino Nano is a powerful and bread-board-friendly microcontroller board based on ATmega328p/Atmega168 microcontroller. We have developed the Arduino Nano Library for Proteus V2.0 which you can download to simulate Arduino Nano in the Proteus workspace.
Click the link below and download the Arduino Nano Library for Proteus V2.0:
Download Arduino Nano Library for Proteus V2.0
Analog Sensors Libraries for Proteus V2.0 contain the following Analog Sensors.
An analog vibration sensor, also known as a piezoelectric, is mainly employed to detect the vibration of industrial machinery. The sensor gets activated if the vibration of the machines goes above the standard value. Vibration sensors are used to monitor the small changes in temperature, acceleration, pressure, and force.
We have done a little work and designed Analog Vibration Sensor Library for Proteus V2.0. Earlier we designed the proteus library for V1 version analog vibration sensors. The V2 version is more robust, compact, and advanced compared to the V1 version. Four vibration sensors are included in the proteus library and they have both digital and analog output pins which you can interface with Arduino boards or microcontrollers.
You can download the analog vibration sensor library for proteus V2.0 by clicking the link below:
Download Vibration Sensor Library for Proteus V2.0
A sound detector sensor is used to detect the sound in the environment. This sensor is only used for sound detection, not for sound recognition.
We have designed the Sound Detector Sensor Library for Proteus V2.0 that you can download to simulate this sensor in proteus. An LC filter is used on the analog output of the sensor since we need to convert the peak to peak voltage into Vrms. Know that you don’t require this LC filter in the real sensor circuit. We have simulated two sound detector sensors in proteus as they have different outputs because of different voltages on the test pin.
Click the link below and download the Sound Detector Sensor Library for Proteus V2.0:
Download Sound Detector Library for Proteus V2.0
An Analog flex sensor, also known as a bend sensor, is a special type of sensor used to detect the value of bend in the application. This sensor is mainly employed indoor sensors, robot whisker sensors, and stuffed animal toys.
We have developed an analog flex sensor library for proteus that you can download to simulate this sensor in Proteus. Know that Test Pin is included in the pinout of this sensor in proteus only, you won’t find this pin in the real sensor. This pin will determine the value of the bend. The HIGH value at this pin will give the value of bend and the LOW value at this pin will indicate there is no bend. We have also interfaced the Arduino board with the sensor where the analog input pin of the board is connected with the voltage appearing across the voltmeter.
Click the link below and download the Analog Flex Sensor Library for Proteus:
Download Flex Sensor Library for Proteus
PIR (Passive Infrared) sensor is a small, inexpensive, low-power sensor used to detect heat energy in the surrounding. The sensor monitors if the human body has come in or out of the sensor’s range.
We have designed Analog PIR Sensor Library for Proteus that you can download to simulate this sensor in Proteus. Moreover, we’ve also developed a simulation of this PIR sensor with an Arduino board. Know that, besides Arduino boards, you can also interface this sensor with PIC or Atmel microcontrollers. We’ve added four PIR sensors file in the proteus that are the same in terms of working but they come in a different color. Again, a test pin is added in the pinout of this sensor in proteus only, you won’t find this pin in real. This pin is added to sense the motion in the proteus workspace.
Click the link below and download the Analog PIR Sensor Library for Proteus:
Download PIR Sensor Library for Proteus
A water sensor is a sensor used to sense the presence of water. The water’s electrical conductivity is measured using this sensor to sense the presence of water. This sensor is widely used in applications where we need to monitor rainfall, water level, and water leakage.
We have designed the water sensor library for proteus which you can download to simulate this sensor in proteus. The Test pin is added to detect the water in the proteus simulation. We’ve also interfaced this sensor with the Arduino board where we have connected the analog input pin of the Arduino board with the output of the water sensor appearing across the voltmeter.
You can download the water sensor library for Proteus by clicking the link below:
Download Water Sensor Library for Proteus
A soil moisture sensor is employed to analyze the water content in the soil. The sensor uses capacitance to monitor the dielectric permittivity of the soil which defines the function of the water content.
We have designed the Soil Moisture Sensor Library for Proteus where we have connected the test pin with the variable resistor. This resistor is used to define the soil moisture content in the proteus simulation. The maximum resistance on the test pin shows zero volts across the voltmeter, referring to the zero moisture value of the water content. The sensor is also interfaced with the Arduino board as shown below.
Click the link below and download the Soil Moisture Sensor Library for Proteus:
Download Soil Moisture Library for Proteus
The IR proximity sensor is used in robots to detect obstacles. This sensor is widely used for path navigation and obstacle avoidance in electronic projects.
We have designed the IR Proximity Sensor Library for Proteus which you can download to simulate this sensor in Proteus. The Test pin is used for hurdle detection. HIGH value on this pin means there is an obstacle in front and LOW value on this pin means there is no hurdle.
LC filter is included in the simulation which you don’t require in real. This filter is used to convert the Peak to Peak value we get on Proteus into the Vrms value.
[TEPImg16]
You can download the IR proximity sensor library for proteus by clicking the link below:
Download IR Proximity Sensor Library for Proteus
That’s all for today. Hope you find this article helpful. If you have any questions, you can approach me in the section below. I’d love to help you the best way I can. Thank you for reading this article.
If you are a regular reader of our blog, you must have noticed that we are sharing Proteus Libraries of different embedded sensors & modules on regular basis. Moreover, we have also launched version 2.0 of few libraries. So, today I am going to provide links to download Proteus Library of all Arduino Boards designed by TEP.
So, let's get started with How to Download Proteus Library of Arduino Modules:
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | Arduino Mega 2560 | Amazon | Buy Now | |
2 | Arduino Nano | Amazon | Buy Now | |
3 | Arduino Uno | Amazon | Buy Now |
Hi Friends! Hope you’re well today. In this post today, I’ll walk you through the detailed Introduction to Arduino Mega 2560 Rev3.
The Arduino Mega 2560 Rev3 is a microcontroller board that is based on the ATmega2560 microcontroller.
The Arduino boards are widely used in the automation industry and embedded projects. Other boards like Arduino Uno, Arduino Nano, Arduino Every, Arduino Beetle all seem a good pick for the projects that require little memory to store the program. However, when the nature of projects becomes complex, requiring more memory and a rich set of I/O interfaces, the Arduino Mega 2560 Rev3 comes into play. In order to power up these Arduino boards, we need to use a Power supply for electronics or we can also use the USB port on the board.
I suggest you buckle up and read this entire post till the end, as I’ll detail the complete Introduction to Arduino Mega 2560 Rev3, covering pinout, pin description, features, programming, and applications.
Let’s get started.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | Arduino Mega 2560 | Amazon | Buy Now |
In the following picture, you’ll see the pinout diagram of Arduino Mega 2560 Rev3.
The board incorporates 4 LEDs where one is a built-in LED connected to pin 13 of the board. One is a power LED that turns on when the board is turned on. While two LEDs are reserved for Rx and Tx which respond when the serial communication happens on this board.
Hope you’ve got a brief idea about this Arduino Mega board. In this section, we’ll highlight the pin description of each pin incorporated on the board.
Let’s get started.
There are 4 serial ports incorporated on the board. Each UART serial port comes with two pins Rx and Tx. The Rx is the receiving pin that ensures the receiving of serial data while Tx is the transmission pin that guarantees the transmission of serial data.
The board carries one I2C communication protocol. It carries two pins SDL and SCL. The SDL is the serial data pin that carries the data while SCL is the serial clock line that ensures the synchronization of data transfer over I2C bus.
This comes with the most number of digital I/O pins incorporated on any Arduino board. The reason it is called Arduino Mega. It is also capable to store more memory of the Arduino program in the Flash memory. You can use these 54 pins as an input or output based on the requirement. These pins receive two values HIGH and LOW. When they receive 5V the pins are at HIGH state while when they receive 0V the pins remain in a LOW state.
The board contains 15 analog pins. These pins can get any values in contrast to digital pins that receive only two values HIGH and LOW.
Out of 54 digital I/O pins, 15 pins can be used as PWM pins. These pins generate analog results with digital means.
The main features of Arduino Mega 2560 Rev3 are described below.
The Arduino.cc has introduced the official software Arduino IDE to program all Arduino boards.
The Arduino Mega 2560 Rev3 comes with a USB comes that is used to program the board. Simply connect the board with the computer using a USB cable and start playing with it.
Moreover, the board comes with an internal Bootloader which is used to burn the program inside the controller. Setting you free from buying the external burner to burn the program.
This mega board is an ideal pick for the projects requiring more memory space to store the program and require a rich set of I/O interfaces. The following are the main applications of Arduino Mega 2560 Rev3.
That’s all for today. Hope you find this article helpful. If you’re unsure or have any questions, you can approach me in the section below, I’d love to help you the best way I can. Feel free to share your valuable suggestions and feedback around the content we share. This helps us create quality content customized to your exact needs and requirements. Thank you for reading the post.
I have updated articles previously on Arduino Uno, Arduino Nano, and Arduino Pro Mini. All these boards function similarly in one way or the other. There are some basic features like PCB layout design, size, number of analog pins and breadboard friendly nature that make them different from each other. In terms of coding, all these boards are programmed in Arduino IDE software and you don't need to attach extra components or devices to put them in running condition. Everything is already built in the board that makes this device readily available. Just plug and play with the board as per your requirement. Here's the video presentation of Arduino Mega 2560:
All the boards mentioned above work perfectly for a number of Arduino Projects when you require a simple task to be completed with fewer I/O pins and memory. However, when the project goes complex, a board with less memory fails to complete the task. This is where Arduino Mega 2560 comes in handy. This board comes with 54 pins and 16 analog pins with more memory to store the code. Sounds crazy, isn't it? Thanks to technology that keep your covered in every aspect and provides support in any way when it comes to fulfilling your technical needs.
I'll try to cover each and everything related to Arduino Mega 2560, what is this about, the main features, working, technical specifications and everything you need to know. Let's jump right in.
No. | Pin Number | Pin Description |
---|---|---|
1 | D0 - D53 | 54 Digital Input / Output Pins. |
2 | A0 - A15 | 16 Analog Input / Output Pins. |
3 | D2 - D13 | 12 Pulse Width Modulation ( PWM ) Pins. |
4 | Pin # 0 (RX) , Pin # 1 (TX) Pin # 19 (RX1) , Pin # 18 (TX1) Pin # 17 (RX2) , Pin # 16 (TX2) Pin # 15 (RX3) , Pin # 14 (TX3) | 4 Serial Communication Ports (8 Pins). |
5 | Pin # 50 ( MISO ) Pin # 51 ( MOSI ) Pin # 52 ( SCK ) Pin # 53 ( SS ) | SPI Communication Pins. |
6 | Pin # 20 ( SDA ), Pin # 21 ( SCL ) | I2C Communication Pins. |
7 | Pin # 13 | Built-In LED for Testing. |
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | Arduino Mega 2560 | Amazon | Buy Now |
So, I hope that you are all aware of or at least have heard about these two boards, which are Arduino and Raspberry Pi. If you haven't heard yet then you must have a look at Arduino Official Site and Raspberry Pi Official Site. They will give you a basic overview of what these boards are. Anyhow, I am going to start it from the very basics so that you guys won't get into much trouble. So, let's get started with Arduino Vs Raspberry Pi:
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | Arduino Mega 2560 | Amazon | Buy Now | |
2 | Arduino Nano | Amazon | Buy Now | |
3 | Arduino Pro Mini | Amazon | Buy Now | |
4 | Arduino Uno | Amazon | Buy Now | |
5 | Raspberry Pi 3 | Amazon | Buy Now | |
6 | Raspberry Pi 4 | Amazon | Buy Now | |
7 | Raspberry Pi Pico | Amazon | Buy Now | |
8 | Raspberry Pi Zero | Amazon | Buy Now |
I have created few points below and in each of these points, I have made the difference between these two boards. I have also mentioned their strengths and weaknesses and which one to use. Obviously, they both have their own importance so we can't say that one is better than the other. Instead, we are making a comparison between the two and then you will get a clear idea of which one you should use for your project. The selection of your controller board actually depends entirely on the nature of your project. Am I getting far :O don't worry if it's more to digest about Arduino Uno R3 Vs Raspberry PI 3, I am explaining them below in detail. :D
Arduino:
For a new Engineering student, who has just started his project. He always wonders which one I should use among these two. Should I go with Arduino or should I start working on Raspberry Pi? It's really a big question if you are new in this field. So, let me tell you one thing first, no one is better than the other, Arduino and Raspberry Pi both have their own importance. Now which one you should use, entirely depends on the nature of your project. So, let's take a look at projects for both of these boards. I think this Arduino Vs Raspberry Pi comparison is now going to take an interesting turn. :)
Arduino:So, that's a kind of an overview on Arduino Vs Raspberry Pi, which I think you guys must have enjoyed. It was quite boring so that's why I have tried my best to make it as interesting as I can, but still, if you find it boring then I can't do anything. :) So, that's all about Arduino Vs Raspberry Pi, I hope you guys have got something out of it. Will see you guys in the next tutorial. Till then take care and have fun. :)