LED Blinking using 555 Timer
Hello friends, hope you all are fine and having fun. Today I am going to share my new tutorial which is Sequential LED Blinking Using 555 Timer in Proteus ISIS. If you recall our one of previous tutorials, which was āMultiple LED Flashing Project Using 555 Timer in Proteus ISISā, but in todayās tutorial we are going to take the same concept to a next level and we are going to make the LEDs blink in either ascending or descending order.
It is a very simple tutorial like the previous one, but the only change is, in this project we have added a Shift Register (4017) next to 555 Timer. 4017 is a Serial IN Parallel OUT Shift Register, which means, at input port it takes data in Serial manner and at output port it will give data in Parallel manner. All types of register needs a clock pulse to operate and this clock is provided by Timers or Micro controllers. In this project we will be using 555 Timer to generate clock pulse. 555 Times gives clock pulse at pin # 3 abbreviated as āQā pin. And this clock pulse is given at pin # 14 of Shift Register abbreviated as āCLKā pin. Shift Register (4017) has total 15 pins. 2 input pins, 10 output pins. Input data is given at pin # 13, which is called āEnableā pin and register shifts the data sequentially at its output pins. Shift register has 10 output pins which means it is a 10-bit shift register, which means it executes 10-bit data simultaneously. Now dear friends, letās move towards the hardware of the project but as you know, practice makes a man perfect. Try to do it with your own hand so that, you get to know the practical applications of electrical components in person.
Dear friends, you can also Download the complete simulation of the Sequential LED Blinking Project using 555 Timer, by pressing on the button given below. So, let's get started with Sequential LED Blinking using 555 Timer in Proteus ISIS.
Download Sequential LED Blinking Project Using 555 Timer
Sequential LED Blinking using 555 Timer in Proteus ISIS
-
Weare gonna design a Project named LED Blinking using 555 Timer so let's first have a look at its block diagram.
-
Threshold voltage for 555 Timer is 5 volts, and when voltages exceeds this level, 555 timer triggers and it generates a output pulse at its output pin which is āQā pin.
-
While designing the circuit, First of all 555 Timer will come, secondly Shift Register (4017) will be connected with it and at the end we will plug LED's. The complete circuit flow diagram is shown in figure below:
- Now coming towards the designing of the project, first of all, place the components in your Proteus workspace, as shown below in image:
- Now Output pulse from 555 Timer is connected to input āCLKā pin of Shift Register.
- Since the register being used is 10-bit, and its outputs are Q0~Q9. The pins Q0~Q5 are connected to LED's D6~D1 respectively.
- After that Register output pin Q6 is also connected to LED (D2) and it becomes parallel with Q4. Now LED, (D2) has 2 parallel inputs and it becomes HIGH (turns ON) if any of the two Inputs is HIGH.
- Next we connect the Register output pin Q7 to LED (D3) and then it becomes in parallel with Q3. After doing that LED, (D3) has 2 parallel inputs and it becomes HIGH, if any of the 2 inputs is HIGH.
- After doing that, now we connect registerās output pin (Q8) to LED (D4) and then it also becomes in parallel with Q2, and LED will start glowing if any of the 2 inputs will be HIGH.
- Now at the end, we connect Q9 to LED (D5), and then it becomes in parallel with Q1. Now D5 has 2 inputs (Q9 &Q1) and LED will glow if any of the 2 inputs will be HIGH.
- Now at the end, If you have connected all the components in exact order, and all the connections are OK then, the exact simulation will look like as shown below:
- Now if we run the Proteus simulation and observe it closely, then we will see that, 555 Timer is continuously generating PWM and the Shift Register setās its output ports HIGH from Q0~Q9 respectively.
- First of all Registerās output pin # Q0 becomes HIGH and it send signal to LED (D6) and LED will start glowing. You can also observe this phenomenon in the image given below:
- Then pin # Q1 becomes HIGH and it send signal to LED (D5) and D5 starts glowing. This can be observed in the figure given below:
- Then register's output pin Q2 becomes HIGH and sends signal to LED (D4) and D4 starts glowing. This can also be observed in the figure given below:
- Then Register's output pin Q3 becomes HIGH and send signal to LED (D3) and this LED starts glowing. This stage can be seen in the figure given below:
- Then Register's pin Q4 becomes HIGH and sends signal to LED (D2) and this LED (D2) starts glowing. This process is shown in the image given below:
- And in the next step, Register gets its pin # Q5 HIGH and send signal to LED (D1) starts to glow. This process can be seen in this figure:
- This process keeps on going and when the Register;s next pin becomes HIGH, which is Q6, then it again sends signal to LED (D2) and it starts to glow, and so D3,D4,D5 will glow respectively, and this sequence of LED's blinking will continue, until you stop it manually or by yourself.
- In the beginning, when LED's Started to blink from Left to Right which was (D6 to D1) , this sequence is called Forward Sequence.
- After that, LED's started to blink from Right to Left which was (D1 to D6), this sequence is called Reverse or Backward Sequence.
- We can summarize this whole sequence into a tabular shape, and this table is given in the figure below:
Alright friends, that's all from this post. I hope now you can easily design LED Blinking using 555 timer Project. In the coming tutorials, we will discuss something new regarding 555 Timer applications. Until than, Take Care and Be Safe !!! :)
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 !!! :)
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 !!! :)
Temperature Sensor 18B20 with Arduino
Hello everyone, in today's post we are gonna have a look at how to interface temperature sensor Dallas 18B20 with Arduino. There are many temperature sensors available in market like LM35, DHT11 etc but personally I like Dallas18B20 most of all, as it gives the most accurate result up to four decimal points. It operates on single wire and sends all data through this wire. Another advantage of this wire is you can interface multiple sensors with a single data line. You should also have a look at How to use 18B20 in Proteus ISIS.
In today's post, we are gonna get value from this sensor and then print it over the Serial Terminal as well as LCD. We will get the values in degree centigrade. Its not much difficult to interface 18B20 with arduino and also an Arduino library is also availble, using which you can quite easily interface 18B20 with Arduino. Let's get started with interfacing of 18B20 with Arduino.
Note:
Interfacing of Temperature Sensor 18B20 with Arduino
- As I explained earlier, it works on single wire and hence we are gonna need 1-wire library for Arduino along with 18B20 arduino library.
- Download both of these libraries by clicking on the below buttons:
Download One Wire Library Download Dallas Temperature Library
- After downloading the library, place it in the libraries folder of your Arduino Software.
- Now restart your Arduino software and you will find the Arduino folder in the Examples section.
- Next we need to interface our sensor 18B20 with Arduino so design your circuit as shown in below figure:
- So, connect the sensor 18B20 with Arduino as shown in the above figure, connections are quite simple and are as follows:
- Pin # 1 of 18B20 with GND
- Pin # 2 of 18B20 with Pin # 2 of Arduino.
- Pin # 3 of 18B20 with GND of Arduino.
- Add a pull up resistor of 4.7k ohm at pin # 2 of 18B20.
- Here's the images of hardware, we designed for this project, its a 20 x 4 lcd we have used:
- Below image shows the small 18B20 sensor, used in this project, it looks small but very efficient.
- Here's the image showing the complete project:
- Now, copy below code and upload it in your Arduino board and open your serial terminal.
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
LiquidCrystal lcd(12, 11, 7, 6, 5, 4);
void setup(void)
{
Serial.begin(9600);
Serial.println("Welcome to TEP !!!");
Serial.println("www.TheEngineeringProjects.com");
Serial.println();
sensors.begin();
lcd.begin(20, 4);
lcd.setCursor(5,0);
lcd.print("Welcome to:");
lcd.setCursor(1,2);
lcd.print("www.TheEngineering");
lcd.setCursor(4,3);
lcd.print("Projects.com");
delay(5000);
}
void loop(void)
{
sensors.requestTemperatures();
Serial.print("Temperature : ");
Serial.println(sensors.getTempCByIndex(0));
//lcd.clear();
lcd.setCursor(0,0);
lcd.print("Temperature: ");
lcd.print(sensors.getTempCByIndex(0));
lcd.print("C");
delay(1000);
}
- After uploading the code, when I start the project, it started showing the temperature values as shown below:
- As you can see, its giving the temperature of my room which is 23.56 degree centigrade.
- I have also designed a video for more demonstration which is given below:
- It's quite a simple code and is self explanatory but still if you need help ask in comments and I will help you out.
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
How to Control Relay in Proteus ISIS
Hello friends, hope you all are fine and having fun. In the previous posts, we have discussed DC motor Control in Proteus ISIS and after that we have discussed the Stepper Motor Control in Proteus ISIS and finally we had a look at Servo Motor Control in Proteus ISIS. Now when you talk about motors control then first thing came in mind is Relay, because relay is the best way of controlling any motor. In today's post, we are gonna have a look at How to Control Relay in Proteus ISIS. Relay is a key components of any electronics or electrical circuit and is usually a problem for the engineers and students. Although, its not as difficult as it seems so I thought to post about it.
In today's post, we will first simulate the Relay in a simple circuit in which when you run the simulation, the relay will automatically got activated and after that we will go in a bit detail and will control relay using a logic, i.e. when you provide +5V to it then the relay will go activated and when you give GNd then it will de-energize. I will explain it below in detail how to use it with Microcontroller. Moreover, if you are planning to work on Relay then you should also check What is a Relay and How to use it? and should also have a look at Relay Interfacing with Microcontroller using ULN2003 and finally must check this one as well Relay Control using 555 timer in Proteus ISIS.If you have any questions. related to it then ask in comments and I will try my best to reply your queries. Let's get started with designing of control relay in Proteus ISIS.
Simple Control Relay Circuit in Proteus ISIS
- First of all, we are gonna simulate a simple control relay circuit in which we will manually turn on or off the relay.
- Open Proteus ISIS and select the below components, as shown in below figure, from the components library of Proteus, if you don't know how to do it then check our earlier posts on Proteus.
- Now, design a circuit as shown in below figure:
- The circuit is self explanatory, first we have used a simple 12V battery to power up the simulation, after that there's a small led attached, which will indicate that whether proper power is supplied to the system or not. Next is our relay, which is named as RL1 in the above figure.
- After the relay, we have placed a simple 12V lamp, so now when the relay will be energized, this lamp will glow up and when the relay is de-energized, the lamp will remain off. As in the above figure, the simulation is off, that's why the lamp isn't glowing.
- After designing the circuit, now click on the run button and if everything goes fine, then the lamp will glow as shown in below figure:
- So, now you can see the small led is also ON, I have used green that's why its showing green color indicating that power supply is working.
- If you compare the off state and on state simulation then you will see that the Relay is now connected with second terminal and thus completing the circuit for lamp and lamp is also now glowing.
Complex Relay simulation in Proteus ISIS
- Now, we are gonna design a bit more complex controlĀ relay simulation in Proteus ISIS, it's not much complicated but needs a bit more care while simulating.
- In previous section, we have seen a simple circuit which is operated manually means in order to turn it on or off you have to turn on or off the power supply but normally, it is required that the relay must be controlled by some microcontroller automatically.
- As the microcontrollers normally work on 5V so in order to control a 12V relay using 5V microcontroller, we need to use transistor. In that case, when you give +5V the relay got actuated and when you give GND then relay get turned off.
- So, first of all get these components from the Arduino components library.
- Now, design the circuit as shown in the below figure:
- As this tutorial is about relays so I haven't used microcontroller here, instead I used this logic state, it will work same as microcontroller. So the above circuit is quite similar to the simple circuit we have seen in the above section. The only difference here is the NPN transistor.
- Now, we are not providing the supply directly to the relay, instead we are providing it via this transistor. So, when the logid state is zero means ground, the transistor won't work and the supply cant reached to the relay and when we make the logic 1 means +5V on the base of transostor, then the relay circuit will complete and the relay will be energized.
- Now run the simulation, the off state is shown below:
- In the above figure, you can see that the led goes on because the power is supplied to the circuit but the lamp is still OFF and the relay is also not energized because the logic state is a low level i.e. 0.
- Now click on the logic state to make it on high level i.e. +5V, the on state is shown in below figure:
- Now you can see that as we make the logic state high, now relay got connected and the lamp is also ON. So by comparing both ON and OFF states, you can easily get the idea how the relay is operating.
Note:
- If you are planning on using the relay with microcontroller, then simply remove this logic state and connect the base of transistor with the output pin of microcontroller and when you low the microcontroller pin relay will get de energized and and when you make the pin high, it will get energized.
- That's all for today, hope you have got something out of it. In the next post I will show how to simulate a DC motor using relay. Till then take care. :))
Relay Interfacing With Microcontroller using ULN2003A
Hello friends, I hope you all are doing great. In today's tutorial, I am going to explain the Relay Interfacing with Microcontroller using ULN2003A. In the previous lecture, we have discussed the detailed Introduction to Relay along with its working. Now we are going to practically interface the relay with a microcontroller to design an automatic switch. Relay is a key component in almost every electronic circuit. It can be
used as a switch and can also be used as a voltage regulator.
The microcontroller I am going to use here is PIC18F4552 but you can use any other Microcontroller. You just need to change the syntax of coding but the logic will remain the same. Here, I am using ULN2003A to control the relay and from this relay, we can control anything.
So, let's get started:
Relay Interfacing With Microcontroller
- I am using a 12V relay, meaning we need to provide a 12V at its input coil, in order to get it energized.
- In simple words, when we send the +12V signal from our PIC microcontroller, it will actuate the relay coil and the relay output gets connected and when we make the input LOW, the coil de-energized.
Now, the question is ???
- But the real question is PIC gives 5V at its high signal but the relay operates at 12V so how to convert this 5V signal into 12V?
What's the Solution ???
- The solution to this problem is ULN2003A.
- ULN2003A is used in between the PIC and the relay, so when the PIC sends the HIGH signal i.e. 5V, ULN converts it to 12V, sends it to the relay and the relay gets actuated.
Circuit Diagram of Relay with ULN2003A
- Here's the circuit diagram for this complete project:
- Resistance R1 is used as a pull-up resistance.
- LED is used for the indication, when the relay is actuated LED goes ON otherwise OFF.
- The programming portion is not much, just send high and low signals from PIC to ON and OFF the relay.
That's all for today guys. If you guys have any problem in any part of this tutorial ask in the comments, and I will reply to your queries. Till next tutorial ALLAH HAFIZ .... :))