LM317 Voltage Regulator in Proteus
Hello friends, hope you all are fine and having fun. In today's post we are gonna have a look at LM317 Voltage Regulator in Proteus. In the previous post, we have seen how to design a 5V Power Supply in Proteus ISIS, which I have designed using IC regulator 7805. Today I am going to share How to design LM317 Voltage Regulator Circuit in Proteus. This DC power supply is a variable one means you can set its output voltage to any level you want. In order to change its output value we have used a variable resistor and by changing its value you can change the output value. It is a basic level project and very simple but used as a base to design large industrial projects. In this project, we are going to control the speed of a DC Motor and the corresponding voltages, appearing across it. The reason for designing this variable DC power supply is that, when you are working on some engineering project then each electronic module has its own power level i.e. xbee module works on 3.3V while Arduino board works on 5V. So, there's a need to design such power supply which can provide variable voltages and we can set them according to our demand. So, for all Microcontrollers like Arduino or PIC Microcontroller or 8051 Microcontroller, I designed 5V Power supply using 7805 but for 3.3V modules like XBee, NRF24L01 etc I design this variable DC power supply using LM317. I hope now you got the importance of this LM317 Voltage Regulator.
To design this, we will be using LM317k. Basically, it is a Voltage Regulator IC. It has 3 pins. Pin # 2 is for input voltages, marked as VI. Pin # 3 is for output voltages, marked as VO, and pin # 1 is used for Regulating Voltages and it is marked as ADJ. Further, if you notice the circuit diagram, which is given in the figure, then you will see that pin # 1 is connected to a Potentiometer. Potentiometer is a Variable Resistor device and it is also known as Voltage Divider. The feature of this electronic device is that, we can adjust the voltage through it according to our own choice. It operates on 12 Volts and it gives us ease that, we can adjust its voltages from 0 to MAXIMUM (which is 12 volts in most cases). Further if we notice the circuit, then we will see that a LED is connected in parallel with a simple DC motor and a voltmeter is also connected in parallel with Motor to monitor the voltages appearing across it. Above information was a little demo about the individual components of the circuit, now let’s be practical and move towards Hardware and see how actually Electronic components respond. You should also have a look at Introduction to LM317, if you wanna read all the basics about it. So let's get started with LM317 Voltage Regulator in Proteus:
LM317 Voltage Regulator in Proteus ISIS
Download Proteus Simulation
-
A 12-Volt DC supply is provided to input pin (# 2) of LM317 and potentiometer is connected to Adjustable pin of LM317, which is, pin # 1.
- At output pin we have connected DC Motor and a Voltmeter is also connected in parallel with Motor.
-
The complete circuit, ready for simulation is shown below in image:
Stage # 1
- Set the potentiometer at 0% and run the simulation, you will notice that Motor will rotate very slowly in clock-wise direction and 1.25 volts will appear on the voltmeter across it. If all the connections are OK, and when you will run the simulation, LM317 Voltage Regulator simulation will look like as shown in the image below:
Note:
- If you don't want to use the variable resistance, then you should use this LM317 Calculator to get value of your second resistance.
Stage # 2
- Now, set the potentiometer value to 11% and you will see that, Motor will start to rotate with a faster rate and on voltmeter scale, we will see 6.40 volts. In this setting, the interesting thing is, LED will start to Flash and it will turn ON & OFF automatically. This phenomenon can be seen in images below:
- Stage # 2 is our transient stage. When the potentiometers setting is below 11%, voltage appears across the motor and it also rotates but LED doesn’t glow. On the other hand, when potentiometers setting is above 11%, then LED glows continuously while motor also rotates as before, and voltmeter also gives some particular values of voltages appearing across the motor.
Stage # 3
- Now at final stage, set potentiometer to 100% and you will observe that motor is rotating with full speed and voltmeter reading will be 10.6 volts while LED is glowing continuously. This stage of the simulation can be seen in the image below:
Now, we can conclude that, LM317 is the monitoring device of this circuit. We can set the value of potentiometer according to our own choice and by this, the speed of motor can be controlled and also the corresponding voltages, appearing across it.
Here's the video in which I have given the detailed introduction of LM317 and have also run its simulation:
Alright friends, that's all for today and I hope now you can easily design this LM317 Voltage Regulator. In the next post, I have discussed DC Motor Drive circuit in Proteus ISIS . Till than take care and be safe !!! :)
Angle Control of Servo Motor using 555 Timer in Proteus ISIS
Hello friends, hope you all are fine and enjoying. Today we are going to share our new project’s tutorial which is Angle Control of Servo Motor using 555 Timer in Proteus ISIS. It is a very simple but a bit technical project. This project has various applications both in industry and in small educational projects.
Servo motor is a DC operated motor and it is available in various sizes and powers. Generally the servo motor used in basic projects, is named as micro servo motor. It is of small size and low power rating. But as I stated earlier that it needs dc supply to operate but it also needs a continuous pulse train to operate and this pulse is commonly generated by some sort of timers or micro controllers. Since my today’s project tutorial (Angle Control of Servo Motor using 555 Timer in Proteus ISIS) is of basic level so, we will be using 555 timer to generate the continuous pulse train or PWM. Now let’s move towards hardware but dear friends, always remember that to become a technical person, you must have to perform technical work by yourself.
Angle Control of Servo Motor using 555 Timer in Proteus ISIS
- First of all, place the components in your Proteus workspace, as shown below in image.
-
A 555 timer is an 8 pin IC. Pin # 6 is called threshold pin and for 555 timer threshold level is 5 volts.
- So, 555 timer will trigger above 5 volts and it will generate output which can be collected from pin # 3 represented as ‘Q’ which is output pin of 555 timer.
- After that the output pulse is sent to servo motor through a Transistor which is BC547.
- BC547 is basically a NPN transistor and the pulse signal is sent to servo motor through its Emitter.
- The full angle deflection of servo motor is from -180 degrees to +180 degrees. It can’t rotate through full 360 degrees. Now it’s your own choice that either you want to rotate the motor at one particular angle or at multiple angles or to get full rotation.
-
Since in this tutorial (Angle Control of Servo Motor using 555 Timer), we are going to get full deflection of motor so, we have inserted 2 switches in the circuit. The complete circuit will look like:
-
Switch # 1 will rotate the servo motor to 180 degrees in anti-clockwise direction. We will press the button only once and when the motor completes its rotation, it will automatically stop.
- After that if we press the switch # 2, then it will rotate the servo motor in clockwise direction and again after completing the angle, motor will again stop.
-
If you have connected the components in correct order and when you will run it, the exact simulation will look like as shown:
- Sonow, if you have a close look on the above two iages then you can see in theState # 1 image I have pressed the left button and the servo motor is moved to -90 degree, this -90 is also mentioned in the green LEDbox just below servo motor.
- And in State # 2, I have pressed the right button and thus the motor is moved to +90 degrees. That's how it will work.
- You can Download the simulation of Angle Control of Servo Motor Project Using 555 Timer in Proteus ISIS, by clicking on below button:
Download Angle Control of Servo Motor Project using 555 Timer
Alright Friends, that's all for today, In the coming posts, we will discuss few more such projects. Till than, take care and be safe !!! :)
LED Dimming Project Using 555 Timer in Proteus ISIS
Hello friends, hope you all are enjoying and having fun. In today's tutorial we are gonna see how to design a LED Dimming Project using 555 Timer in Proteus ISIS. In our previous tutorials we have seen how to design Multiple LED Flasher Project using 555 Timer in Proteus ISIS and also Single and Double LED Flasher Project using 555 Timer in Proteus ISIS, in which we have seen how to flash Single and Multiple LED's using 555 Timer in Proteus ISIS. In today's post i am gonna extend the same concept and we will see how to design a LED Dimming Project Using 555 Timer in Proteus ISIS.
It is a quick and very simple tutorial and it elaborates how to control the Intensity of LED using 555 Timer in Proteus ISIS. It's a very simple project and the complete project is given at the end for download but again as i always say try to design it by yourself so that you get some knowledge out of it. It's a very simple project and these type of projects are designed by Engineering students in their First semester and are really a good start in learning electronics. If you have any queries regarding this project then feel free to ask and i will try me best to resolve them. So, let's get started with implementation of LED Dimming Project using 555 Timer in Proteus ISIS.
LED Dimming Project Using 555 Timer in Proteus ISIS
- 555 timer is a well known IC used in timing Projects and it is the most widely used IC before micro controllers.
- In our previous projects we have seen how to flash a single or multiple LED's but today we are going one step ahead and we are gonna learn How to Control the Intensity of LED using 555 timer in Proteus ISIS.
- So. first of all, open your  Proteus software and include the below components into its work space.
- After adding these components, now we need to design the circuit diagram.
- So, design a circuit diagram of LED Dimming Project using 555 Timer as shown below:
- If you look closely at the project then you will see that it is similar to one of our project titled Sequential LED Blinking Project with 555 Timer in Proteus ISIS.
- In this project we will control the intensity of LED through 555 timer.
- These kind of projects are also used for Decoration purpose and the beauty of this system is that we can change the Dimming rate of LED and we can control it our self.
- Now we are done with the Designing of the project and let's run its Proteus simulation.
- When you run the Proteus simulation and if everything is alright then the LED pattern will be like:
- The above figure shown the three states of the project.
- State # 1 shows the OFF state of LED, State # 2 shows that LED has started to glow and State # 3 shows that LED is glowing with full intensity.
- After that the loop starts again from State #1 to State # 3, unless you keep running the Proteus Simulation.
- You can download the simulation of LED Dimming project using 555 Timer by clicking on below button:
Download Project Simulation
That's all for today, in the coming post we will discuss few more such projects. Till than take care !!! :)
,
Multiple LED Flasher Project using 555 Timer in Proteus ISIS
Hello friends, hope you all are enjoying and having fun. In today's tutorial, we are gonna see How to design a Multiple LED Flasher Project using 555 Timer in Proteus ISIS. In our previous tutorial we have seen How to design a LED Flasher Project with 555 Timer in Proteus ISIS, in which we have flashed single and double LEDs. In today's post, I am gonna extend that previous tutorial and will see How to flash multiple LEDs with 555 Timer in Proteus ISIS.
Its quite a quick tutorial, as I don't have much material on it and its also quite simple so no much explanation is required. The complete project is given at the end for download but again as I always mention, try to design it by yourself, so that you get some knowledge out of it.This type of projects are normally designed by engineering students in their first or second semesters and are really a good start in learning electronics. IF you have any questions related to this project then ask in comments and I will try my best to resolve them. So, let's get started with implementation of multiple LED Flasher Project using 555 Timer in Proteus ISIS.
Multiple LED Flasher Project using 555 Timer in Proteus ISIS
- 555 Timer is well known IC used in timing projects and its the most widely used IC before microcontrollers.
- In our previous project we have flashed one and two LEDs using 555 Timer which was quite simple and easy and today we are gonna go a little advance and will flash multiple LEDs using 555 Timer.
- So first of all, open your Proteus software and include the below components into its workspace.
- After adding these components, now we need to design the circuit diagram.
- So, design a circuit diagram of Multiple LED FLasher Project using 555 Timer as shown below:
- If you have a look at the above figure closely and compare it with the previous project of 2 LED Flasher with 555 Timer in Protes ISIS then you can have the idea that its simple an extended version of that project.
- I haven't done anything but simply added LEDs in parallel to those 2 LEDs and give it a beutiful form so that it look attractive.
- These kinds of projects are normally used for decoration where you need to set some pattern for LEDs and make them blink.
- So, now we are done with the designing of our project so let's run the PRoteus Simulation.
- When you run the Proteus Simulation, and if everything's gone fine then these LEDs will start flashing as shown in the below figure:
- The above figure shows the three states of this project.
- State # 1 shows the OFF state of this project while State # 2 and 3 are the ON states, these LEDs will keep on flashing as long as the simulation is running.
- You can download the Proteus simulation of Multiple LED Flasher Project using 555 Timer by clicking on the below button:
Download LED Flasher Project using 555 Timer
That's all for today, I hope I have conveyed some knowledge and helped in some way. It was a quite an easy project that's why I haven't explained much but if you have some querries then ask in comments. Subscribe us via email to get these tutorials straight in your inbox. Till next tutorial, take care !!! :)
Display ADC value on LCD using Arduino
Hello friends, hope you all are fine and having good life. In today's project, we will see how to display ADC value on LCD using Arduino in Proteus ISIS. Its quite a simple project in which we are gonna measure the voltage of ADC pins and then will display them over to LCD. The microcontroller I am using in this project is Arduino. The simulation is designed in Proteus ISIS. IF you are working on PIC Microcontroller then you should have a look at How to Display ADC value on LCD using PIC Microcontroller in Proteus ISIS.
Arduino has 10 bit ADC pins so whenever you apply voltage on these pins it will give you a value ranging from 0 to 1023 depending on the voltage provided. One can easily get this value using a simple function in Arduino analogRead(); but the real problem is to convert this analog value into the actual voltage present on the pin. Suppose you are using A0 pin of arduino and you are providing 3.3V over to this pin, now when you use this analoagRead() function then it will give you some value say 543, but you wanna know what's the actual voltage at this pin which is 3.3V so now converting this 543 to 3.3 is a bit tricky part. It's not difficult but involves a little calculations, which I am gonna cover today in detail. Before going any further, make sure you have already installed the Arduino Library For Proteus, if not then first do it because without this library you won't be able to use Arduino board in Proteus. So, let's get started with How to Display ADC value on LCD using Arduino.
Display ADC value on LCD using Arduino in Proteus ISIS
I have divided this tutorial on How to Display ADC value on LCD using Arduino in few steps, follow these steps carefully and if you get into some trouble then ask in comments and I will try my best to resolve them, all the materials are provided at the end of step 1 for download but I suggest that you design your own so that you do mistakes and learn from them. Moreover, you should also have a look at these Arduino Projects for Beginners. Anyways, let get started:
Step1: Circuit Designing in Proteus
- First of all, I have designed a circuit in Proteus for Displaying ADC value on LCD using Arduino.
- In this circuit, I have used two transformers which I have named as Potential Transformer and Current Transformer. I am supplying 220V to these transformers which is then converted into 5V.
- I have set the turn ratio of these transformers such that they give maximum 5V at the output.
- Now,rest of the circuit is simple, I have just connected the LCD with Arduino so that we could display these ADC value over to LCD.
Note:
- Here's the circuit diagram of displaying ADC value on LCD using Arduino in Proteus ISIS:
- You can download the Proteus Simulation and the Arduino hex file for Displaying ADC value on LCD using Arduino by clicking on below button:
Download Proteus Simulation and Arduino Hex File
- It's quite simple and self explanatory. After designing the circuit diagram, now let's move to second step, which is code designing for Displaying ADC value on LCD using Arduino.
Step 2: Arduino Code Designing
- Now copy the below code and paste it into Arduino software. Compile your code and get the Arduino hex file.
- If you dont know How to get the hex file from Arduino then read Arduino Library for Proteus, I have explained it in detail there.
#include <LiquidCrystal.h>
#define NUM_SAMPLES 10
int sum = 0;
unsigned char sample_count = 0;
float voltage = 0.0;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int PT = A0;
const int CT = A1;
float Cur;
float Vol;
float Power;
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(20, 4);
// Print a message to the LCD.
lcd.setCursor(6,1);
lcd.print("Welcome To");
lcd.setCursor(5,2);
lcd.print("Energy Meter");
//delay(5000);
lcd.clear();
Constants();
}
void loop() {
lcd.setCursor(0, 2);
ShowVoltage(9, 0, PT);
Vol = voltage;
ShowVoltage(9, 1, CT);
Cur = voltage;
Power = Vol * Cur;
lcd.setCursor(7,2);
lcd.print(Power);
}
void Constants()
{
lcd.setCursor(0,0);
lcd.print("Voltage: ");
lcd.setCursor(0,1);
lcd.print("Current: ");
lcd.setCursor(0,2);
lcd.print("Power: ");
lcd.setCursor(14,0);
lcd.print("V");
lcd.setCursor(14,1);
lcd.print("A");
lcd.setCursor(12,2);
lcd.print("W");
}
void ShowVoltage (int x,int y, unsigned int value)
{
while (sample_count < NUM_SAMPLES)
{
sum += analogRead(value);
sample_count++;
delay(10);
}
voltage = ((float)sum / (float)NUM_SAMPLES * 5.015) / 1024.0;
lcd.setCursor(x, y);
lcd.print(voltage);
sample_count = 0;
sum = 0;
}
- The code is quite simple and self explanatory, the only difficulty is in ShowVoltage function. In this function, I have first taken an average of 10 ADC values and after that I have applied a simple formula over it and then it will start start giving the voltage value which I have simply displayed over the LCD.
- Now everything's done, so Get your Hex File from Arduino Software and let's check the results whether it displayed ADC value on LCD using Arduino or not
Step 3: Result
- We have designed the electronic circuit in Proteus and have also designed our code and uploaded the hex file in Arduino.
- Now press start button and you will see something like this:
- Now if you compare the voltages in voltmeter and on LCD, you can see they are exactly the same. You can check the value of variable resistor and the values in LCD will also change as the voltage in voltmeter change.
That's all for today, hope I have conveyed some knowledge today and now you can easily
Display ADC value on LCD using Arduino. In the next post we will explore more Arduino features. Till then take care and have fun !!! :)
LED Flashing Project with 555 Timer in Proteus
Hello friends, hope you all are fine and enjoying life. In today's tutorial, I am gonna show how to do
LED Flashing Project with 555 Timer in Proteus ISIS. Its quite a simple project and usually done by engineers in their first or second semester. I have done this project in my first semester and have learned quite a lot from it. I recently done it on Proteus so thought of sharing it with you guys. It will also work on hardware as I have tested it.
In this tutorial, we will first have a look at How to do single LED Flashing with
555 Timer in Proteus ISIS. And afterwards, we will also see how to flash two LEDs with 555 Timer in
Proteus ISIS. Its quite simple and anyone one with basic knowledge of electronics can design it in his first attempt. Still if you get into any trouble, then ask in comments and I will try my best to resolve your issues, but I don't think its gonna happen as its quite basic. So let's start with this project:
Single LED Flashing Project with 555 Timer in Proteus ISIS
- First of all, copy these components from the Proteus components library:
- After selecting these components, now design a circuit in Proteus as shown in the below figure:
- Now when you click on RUN button in PRoteus ISIS, the LED will kep on flashing,it will go ON for 1 sec and then go OFF as shown in below figures.
- State # 1 is showing the OFF state of LED while the State # 2 is showing the ON state of LED.
- So, it will keep on flashing unless you Stop the Proteus ISIS simulation.
- You can download this simulation by clicking on the below button.
Download Single LED Flashing with 555 Timer in Proteus
Double LED Flashing Project with 555 Timer in Proteus ISIS
- In the above portion, we have seen how to flash a single LED with 555 Timer in Proteus ISIS, now let's flash two LEDs with 555 Timer in Proteus ISIS.
- First of all design a circuit as shown in below figure:
- As you can see its quite similar to the above project for single LED flashing with 555 timer in Proteus ISIS but has small changes in thhe values of resistor.
- So, now when you hit RUN button on Proteus ISIS then these LEDs will start flashing one after another, means when first LED is ON then the second one will be OFF and vice versa.
- Below figures are showing their ON OFF states:
- State # 1 is showing the OFF state for both the LEDs, while State # 2 is showing the ON state for first LED and OFF state for second and in third State first LED is OFF while the second LED is ON.
- So, this simulation will work in this way, if first LED is ON then the second one will be OFF and vice versa.
- You can download this second simulation by clicking on the below button:
Download 2 Led Flashing Project with 555 Timer in Proteus
That's all for today, in the coming post we will have a look how to design a traffic signal flasher with 555 timer in Proteus ISIS, which is gonna be quite exciting tutorial, so let's meet in the next tutorial. Till then take care and have fun !!! :)
How to use LDR Sensor in Proteus
In today's post, I am gonna share how to use LDR sensor in Proteus. Proteus, as we all know, is a very handy software and is used for circuit and PCB designing. It is also used for circuit and programming testing. It is normally used by engineers in their projects and contains a vast list of built-in components. I have posted a lot of tutorials on Proteus and I have got quite a positive feedback from the reader about these tutorials. So, I thought to share another component in Proteus which is quite hidden and I haven't seen much posts on it available online.
So, in today's post, first I am gonna explain what is LDR sensor? and we will see where it is used and how it is used. After that I will design a simple circuit in Proteus in which I will turn control a LED using LDR sensor andwill make it ON and OFF. So, as usual let's start from the beginning so that the newcomers could also get benefit from it.
What is LDR Sensor?
- LDR is an abbreviation of Light dependent resistor. It is also known as photoresistor or photocell.
- Its symbol is shown in the below figure:
- LDR Sensor is used for the detection of light, internally it has a resistance which is sensitive to light as shown in the symbol.
- Whenever light falls on the LDR sensor, its resistance start decreasing and when it comes to dark then its resistance start increasing. Using the value of resistance one can easily detect whether there's light or not.
- It is normally used in light activated switches.For instance, you have seen the automatic street lights, which go ON when its night and automatically go OFF when its day time. In those street lights, LDR sensors are used.
Working of LDR Sensor
- As I explained above, it has an internaal resistance which is very sensitive to light intensity and varies according to it.
- So, one thing is quite clear that LDR sensor is an analog sensor. It gives us different values depending on the light intensity falling on it.
- Let's have a look on the simplest circuit of LDR sensor, which is shown in the below figure:
- Now if you check the above image you can see we have placed a resistor in series with the LDR sensor and have applied a voltage source across them.
- Now when the light will fall on the LDR sensor, its resistance will go LOW and in return the voltage across the LDR will also go LOW and as the LDR will come in dark, the resistance will go HIGH and in return the voltage will also go HIGH.
- Its the simplest working phenomena of LDR sensor. Now if you are using the LDR sensor with some microcontroller then what you need to do is simply give this intermediate connection of resistor and LDR to microcontroller.
Circuit Designing of LDR Sensor in Proteus
- Now we know the basics of LDR sensor and have also seen how it works so now let's design its circuit in Proteus.
- There are two types of LDR sensors available in Proteus which are exactly the same in functioning but are different in operating. Both are shown in the below figure:
- The first one has a digital display along with it on which the voltage value is displayed while the second one a bit more animated and has a torch with it, so when you press the up arrow the torch will come closer and in other words the light is falling on the LDR and when you press the down arrow the the torch will go away and your LDR is in dark now.
- Both of these states are shown in below figure:
- Now you can see both the states quite clearly, in the first state torch is away so LDR is in dark while in second state, torch is close so LDR is ON.
- So, now let's design their circuit to control a LED with LDR Sensor in Proteus. In order to do so, design this simple circuit in Proteus as shown in below figure:
Note:
- I have also designed this circuit on hardware and tested, it works perfectly as shown in the simulation.
- Its a very simple circuit in which I am using a comparator and then giving output to LED. When the LDR is in dark then the LED will remain OFF and when the LDR will go into light then the LED will turn ON.
- Both of these states are shown in below figure:
- Now you can see when the voltage on the digital display of LDR were LOW then the LED was OFF and when Iincreased the voltage then the LED went ON.
- Now let's check both of these states with the second LDR sensor in Proteus, which are shown in the below figure:
- Again quite obvious, when the torch was away then LDR was in dark and the LED was OFF but in second state when I moved the torch close the LED went ON.
- Here's the Proteus Simulation of LDR sensor attached below, download and play with it. :)
Download LDR Sensor in Proteus Simulation
That's all for today, if you have any problem ask in comments and I will reply them. Take care and have fun !!! :)
Interfacing of Seven Segment with Arduino in Proteus
Hello friends, today we are gonna have a look on how to interface Seven Segment with Arduino in Proteus. In my last post, I have posted an Arduino Library for Seven Segment Display, which is designed by our team and is quite basic in functionality. So, if you haven't checked that post then first of all check that one and download the Arduino Library for Seven Segment Display as I am gonna use that library in today's post. Moreover, in order to run this library you are also gonna need to download Arduino Library for Proteus, using this library you will be able to use Arduino board in Proteus so also read that post and download this library and install it in your Proteus.
Again I am mentioning that its the first library designed by our team so its in basic stages, it has few functions and will only display the numeric on the seven segment display which is normally required. I am planning on adding more examples in the library for future use, which will increase the functionality. Anyways that's a future talk, let's start today's post.
What is Seven Segment Display?
Let's first have a look at what is Seven Segment Display. Seven Segment display is nothing but an electronic device used for displaying the numeric data. It's a complex form of LED matrix and is normally used in clocks, LCD displays, calculators etc where there's a need to display the numeric data. It has total seven leds in it which you can also count from above image and by turning these LEDs ON or OFF we can display any numeric on it. For example, have a look at the below image. In this image I have shown numeric 0 on seven segment. Now in order to do so, I just simply turn OFF the centered LED and turn ON all the corner LEDs and it becomes 0.
How does Seven Segment Work?
Now, let's have look at how it works. So, we have seen that Seven Segment is named seven segment because it has total seven LEDs on it so now what we need to do is to control these seven LEDs, also named as segments, and then we can display any character on it. There are two types of seven segments available in the market and named as:
- Common Cathode
- Common Anode
They both work exactly the same and has only a slight difference. They both has total seven pins and each pin is used to control each led and they have an extra pin which is named as Common Pin. In Common Cathode you have to GND this Common Pin, while in common Anode, you have to give +5V to this Common Pin. Have a look at this below image, we have labelled leds with respect to the pins.
Interfacing of Seven Segment with Arduino in Proteus
- Now we know all about Seven Segment Display and know how it works so let's interface Seven Segment with Arduino in Proteus.
- Now, I am assuming that you have installed the Arduino Library for Proteus and have also installed the Arduino Library for Seven Segment display.
- So, now open your Arduino Software and go to File>Examples>SevenSegment>Counting.
- Open this example, in this example I have added a counter which will start counting from 0 to 9 and once it reached 9 then it will start counting again.
- If you can't find this example then you must be making some mistake in installing the library, anyways the code is shown below.
Note:
- In order to run this example you will need two libraries, the inks are given below to download:
/*
Counting
This Arduino example is for Seven Segent display.
It will start the counter from 0 and will end up at 9
and will start again from 0.
This example code is in the public domain.
Created by Syed Zain Nasir at 14 March 2015.
You can get the explanation and latest version of this library at:
http://www.TheEngineeringProjects.com/
*/
#include "SevenSegment.h"
SevenSegment tep = SevenSegment(0,1,2,3,4,5,6);
char arr [10] = {'0','1','2','3','4','5','6','7','8','9'};
int index;
void setup(){
index = 0;
}
void loop(){
tep.display(arr[index++]);
delay(1000);
if(index == 11)
index = 0;
}
- Now open you Proteus Software and design the circuit in it as shown in below figure, I have also attached the file for download at the end.
- Now compile the code and gt the hex file and upload it in your Arduino Properties.
- Now Run the Proteus software, and you will see the seven segment display will start counting, a glimpse of it is shown in the below figure:
- Below is attached the Proteus file and the hex file for the counting example which you simply start and run but again I suggest that you should design it by yourself so that you get something out of it.
Download Proteus Simulation of Seven Segment with Arduino
- One last thing, any kind of contribution to this library from the readers is highly appreciated, design your projects and share codes with us and we will post them on our blog for other readers to get knowledge as knowledge is all about sharing.
That's all for today, hope it will help you in some way. Take care and have fun. :)
Arduino Lilypad Simulation in Proteus
Yesterday, I have posted a new Arduino Lilypad / Nano Library for Proteus in which we have seen how to add that library into Proteus so that you could be able to use these boards in Proteus. That was quite easy. Today I am gonna post a small project in which we will see how to use that library and produce an Arduino Lilypad simulation in Proteus. In this Arduino Lilypad simulation in Proteus, I am gonna use obviously he Arduino Lilypad board along with few LED lightsand will make them blink. Its also quite easy and you can also download the simulation and the hex file at the end of this project but I would suggest you to do it yourself so that you learn something out of it.
Before starting this project, you must have first integrated the Arduino Lilypad Library as without it you wont be abe to do this project. So, if you haven't downloaded it yet then you should read the previous post Arduino Lilypad / Nano Library for Proteus first. Lets get started with this project.
Arduino Lilypad Simulation in Proteus
- Now I assue that you have already downloaded the Arduino Lilypad Library for Proteus and are ready to use it within Proteus.
- So open Proteus ISIS and get these components from the Proteus components library as shown in below figure:
- After getting these components, draw a circuit in Proteus as shown in the below figure:
- You can clearly see in the above figure, the Arduino Lilypad Simulation in Proteus. After that you need to write a code for Arduino Lilypad so that you could get the hex file for it.
- In this project, I have used three LED lights and make them ON and OFF using the switch button. If the button is not pressed then the LEDs will remain ON and when you hit the button , the LEDs will go OFF.
- Copy the below code and paste it into the Arduino software and compile.
int analogPin = A0;
int ledCount = 3;
int ledPins[] = {
2, 3, 4};
void setup() {
// loop over the pin array and set them all to output:
for (int thisLed = 0; thisLed < ledCount; thisLed++) {
pinMode(ledPins[thisLed], OUTPUT);
}
}
void loop() {
// read the potentiometer:
int sensorReading = analogRead(analogPin);
// map the result to a range from 0 to the number of LEDs:
int ledLevel = map(sensorReading, 0, 1023, 0, ledCount);
// loop over the LED array:
for (int thisLed = 0; thisLed < ledCount; thisLed++) {
// if the array element's index is less than ledLevel,
// turn the pin for this element on:
if (thisLed < ledLevel) {
digitalWrite(ledPins[thisLed], HIGH);
}
// turn off all pins higher than the ledLevel:
else {
digitalWrite(ledPins[thisLed], LOW);
}
}
}
- After compiling this code, get the hex file of code. The hex file and this simulation file is also given at the end of this post so you can download it from there.
- Now upload this hex file into this Arduino Lilypad and hit the RUN button
Note:
- If everything's goes fine then as youhit the run button, the LEDs will get ON as shown in the below figure:
- Now, when you press the button, these LEDs will go OFF as shown in the below figure:
- That's all, you have successfully implemented the Arduino Lilypad simulation in Proteus. :)
- In order to download this simulation and the hex file, click on the below buttons.
Download Proteus Simulation
Arduino Lilypad Library for Proteus
Hello friends, few day ago I have posted a tutorial on how to do Arduino Simulation in Proteus. In that post, we have used an Arduino Library for Proteus but as this library is in its initial phases that's why currently it supports only three basic Arduino boards which are Arduino UNO, Arduino Mega2560 and Arduino Mega1280. But as we know there are numerous Arduino boards which are used these days. So, I searched a little and I came across this amazing Arduino Lilypad Library for Proteus which has the support for few other arduino boards, so I thought to share it with you guys. I have tested this library myself as always and its 100% working. I have tested it on Proteus 7 and I think it will work fine on Proteus 8 as well. As we have the support for above three boards in the previous library so the two new boards here are Arduino Lilypad and Arduino Nano, both of them are quite used these days. I have explained it in detail, step by step below, if you still feel problem in any step then ask in comments.This library has the support for following boards:
- Arduino UNO
- Arduino UNO SMD
- Arduino Mega
- Arduino Nano
- Arduino Lilypad
Note:
- This library isn't designed by our team so all credit goes to its creator, who is blogembarcado. Hats off dude !!!
- We are just spreading the knowledge so that more and more engineers could get benefit out of it.
- I have also posted Ultrasonic Sensor Library for Proteus, which you can download, using this library you can simulate Ultrasonic Sensor in Proteus, moreover you can also download different examples on Ultrasonic Sensor Simulation in Proteus to get a complete grip on this sensor.
Arduino Lilypad Library for Proteus
- First of all, download this new Arduino Lilypad Library for Proteus by clicking on the button below:
Arduino Lilypad Library for Proteus
- Once you downloaded the rar file, extract the file named as "BLOGEMBARCADO.LIB".
- Now place this file in the library folder of Proteus, which, in my case, is "C:\Program Files (x86)\Labcenter Electronics\Proteus 7 Professional\LIBRARY". I hope it will give you the idea where to place the file.
- After placing the file in this folder, now open the Proteus ISIS and click on the component selection button.
- In the search box write "Arduino" and the list of all the arduino boards will be shown immediately as shown in the below figure:
- You can see all the five boards in the above figure and you can select any of them.There's also another components in the list which is ultrasonic sensor. Yes, this library also supports ultrasonic sensor but I haven't tested it yet that's why didn't mentioned it, I will test this sensor soon and then will also explain its working.
- Now you can select any of these boards and can start working on them rite away. All the five boards are shown in the below figure:
- The two new Arduino boards in this library are shown below:
- So, now simply design your circuit and write the code in the Arduino ide. After writing the code, get the hex file from arduino software and upload it to these boards.
Note:
- In order to upload the hex file simply double click it and the properties window will pop up. In the Properties window, there will be an option named Program File. In this Program File, browse for the hex file and upload it.
- Now run your Proteus simulation and it will work like charm.
- I will post few projects on these boards soon as soon as I get time to write them, so stay tuned and have fun.
- I have posted a small project on how to use Arduino Lilypad in Proteus which you can read and download from Arduino Lilypad Simulation in Proteus.