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 !!! :)
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.
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 .... :))
Introduction to Relay
Hello everyone! I hope you will be fine and having fun. Today, I am going to give a detailed Introduction to Relay. In this tutorial, we will learn the basics of relays, the working principle of relays, the types of relays and their applications in detail.
A relay is a simple automatic switch that opens and closes the circuit(either electronically or mechanically) based on its input signal. A relay is an electromechanical switch that uses electromagnetism from a small current or voltage to switch higher current or voltage for different appliances. When a relay is in a Normally Open (NO) state, no current passes through it and when the relay is energized, the current starts to flow and we can say the relay is in a Normally Closed state. You should also have a look at Relay Interfacing with Microcontroller using ULN2003.
A Relay is used to control high-power devices with small current devices i.e. microcontrollers. When a small voltage is applied(normally from microcontrollers) to the input coil of a relay, it gets energized and the relay output changes its position from NO to NC. Relays are also used for protection purposes i.e. overload, reverse, under current, over current etc.
Now let's have a detailed overview of What is Relay???
What is a Relay?
Relay is an automatic switch, which opens and closes the circuit electronically. It uses electromagnetism from small voltage to provide higher voltages. It has two basic contacts i.e. NO (Normally Open) and NC (Normally Closed). When input voltage is applied across its coil, NC changes to NO and NO changes to NC. When input voltage is supplied, we say that the relay is energized. It has several features e.g. it can be used for switching smaller voltage to higher. But it can not be used in power-consuming devices. It has a wide range of applications. It can be used in home appliances, electronic circuits where there is a need of protection, robotics for controlling its motors for the proper motion and many more. A basic relay is given in the figure shown below.
1. Relay Pins
- Relay has total five (5) pins with different individual functions.
- Three pins are at one side of the structure.
- The other two pins are on the opposite side of the structure.
- All of these pins are provided in the table given in the figure shown below.
- I have also made a relay pin configuration diagram.
- Pin configuration diagram is shown in the figure given below.
2. Relay Pins Description
- Each pin has different functions to perform.
- So, we must know about each of the function before using it, for the better use of it.
- All these pin descriptions are listed in the table shown in the figure below.
3. Relay Internal Structure
- Internal structure of any electronic device leads to the better understanding about its working principle.
- I have made a completely labeled internal structure of relay along with its pin configurations.
- Relay internal structure is shown in the figure given below.
4. Relay Pinout
- If you want to know about the pin configuration of any electronic device you must have a look at its pinout diagram.
- Pinout diagram helps us to understand the pin configurations in a better way.
- I have made a pinout diagram which contains relay animation, internal structure and the real image.
- Relay pinout diagram is given in the figure shown below.
5. Relay Working Principle
- Relay works on a pretty simple principle.
- Initially when the power is not supplied and relay is in normally open condition, its contact will be opened.
- When relay is in normally closed condition, its contact will be closed.
- When power is supplied to its coil, it gets energized and its normally open condition is changed to normally closed and normally closed condition is changed to normally open.
- If we want to control the device via relay through a software then we have to attach this device to its normally open terminal.
- When the relay gets energized, that device will be turned on for the appropriate operation.
- Working principle of array can be understand from the visuals given in the figure shown below.
- Initially, when the power is not supplied and you can see the relay has normally closed contact as shown in the figure give below.
- As I have told earlier, when we supply power the normally closed contact will changed its state to normally open contact and vice versa.
- The explanation of the above step is given in the figure shown below.
- From the above figure, you can see contact has been changed to normally open contact.
6. Relay Functions
- Relay has the three basic functions to perform.
- All of these three functions are provided in the table given in the figure shown below.
- Air conditioning control (to limit & control a very high power load) are the examples of on/off control of the relay.
- Limit control includes motor speed control (to disconnect it if it is moving with slow or faster than the desired speed).
- Test equipment is an example of logic operation, which connects the device with no. of test points.
7. Types of Relays
- This section will focus on the major types of relays commonly used these days.
- There are several different types of relays.
- The basics types are listed in the table given in the figure shown below.
- Electromagnetic Relay is made up of magnetic, electrical and mechanical components. It has operating coil and mechanical contacts. When AC or DC supply is provided its mechanical contacts get either open of close. An electromagnetic relay is given in the figure shown below.
- Solid State Relay consists of solid state components. It is used to perform switching operation without any movement in its parts. Its power gain is higher than the electromagnetic relays because it requires low power as in input and provides high power at the output. Solid state is given in the figure shown below.
- Hybrid Relay is made up of electronic components and electromagnetic relays. Its input part consists of electronic circuitry which performs rectifications tasks. Its output part consist of electromagnetic relay. Hybrid relay is given in the figure shown below.
- Thermal Relay works on a very simple principle based on heat effect i.e. the rise in ambient temperature changes one position of the contact to another. Mostly it is used for the motor protection purposes. It consists of temperature sensors and control elements. Thermal relay is given n the figure shown below.
- Reed Relay has two magnetic strips. These strips are known as reed. These are sealed with a glass tube. The reed acts as blade as well as an armature. When magnetic field is applied to the coil. It wraps around the tube and reed start to move to perform the switching operation. Reed relays are given in the figure shown below.
8. Relay Applications
- Relay has a wide range of application in real life.
- Some of the major applications are listed in the table given in the figure shown below.
- Relay can also be used in relay boards for controlling either DC or stepper motor.
- One relay can control a single device, since two relay module has two relays so it can control two device simultaneously.
- Two relay board is given in the figure shown below.
- TV remote is another example of relay applications.
- TV remote is given in the figure shown below.
- Relay can also be used in mobile robots to control their motion properly.
- Visuals for the above step is given in the figure shown below.
9. Relay Simulation in Proteus
- I have made relay simulation in Proteus ISIS in order get a better idea about it.
- As the relay is energized, LED will be turned ON.
- A simple relay simulation in Proteus is given in the figure shown below.
- I have also made another relay simulation in Proteus ISIS as shown in the figure below.
- When the relay gets energized, LED will be turned ON, as shown below.
In the tutorial,
Introduction to Relay, I have discussed the basics of relay. This is a fully detailed article the basically focuses on the the basics of relay including its pins configurations, its functions, types, working principle and many other things. I hope you have enjoyed the tutorial and I am sure you will appreciate my efforts. If you have any sort of problem you can freely ask us in comments anytime. Our team is always there to help you and to entertain you. I will also try my level best to answer your questions. I will share further interesting topics in my upcoming tutorials. Till my next tutorial, take care and bye :)
strong>