Transcript for:
555 Timer IC Overview

this video is dedicated to the wonderful 555 timer chip an integrated circuit developed in 1971 by an American electronics engineer Hans kamensin due to its versatility any ease of application this beautiful tiny device enjoys the well-deserved respective engineers and hobbies around the world that over a billion 555 timers are produced annually making it probably the most popular I see ever made today we will look into internal structure and working principles of the 555 then we're going to build several typical circuits based on it and analyze their operation this is Ron Martino [Music] so what is the 555 capable of to answer this question let's take a look at its block diagram the first thing that catches our eye is three 5K resistors connected in series contrary to popular belief it's not them that gave the chip its name in an interview hence kamensen mentioned that it was chosen by the marketing department who thought this name could boost the sales of the product the resistors as we can see are connected between the power pins of the Chip And Thus form a classic voltage divider if for instance we power the circuit from a 15 volt Source a voltage of 5 volts will be established across each of the resistors and the potential it nodes b and a relative to supply ground will be 10 and 5 volts respectively please note that a is not available for external connection while B is connected to pin 5 and is named control this pin is usually connected to an external capacitor that helps filter out power supply noise on comparators but can be also used to fine-tune voltage divider operation and shift switching threshold the input stage of the 555 is represented by two comparators whose inputs are wired to nodes A and B of the voltage divider the principle behind a comparator is fairly simple it has two inputs positive and negative also called non-inverting and inverting respectively a comparator's job is to compare voltages at these inputs if the potential at the positive input is higher than the negative the output will be set to logic 1. otherwise to logic zero please note that comparator inputs take analog levels while its output is digital meaning it only switches between 1 and 0. comparators are commonly used to analyze input signal level in this case a certain fixed voltage which is also called the reference voltage is applied to one of its inputs and the signal to be analyzed is fed to the other as input level exceeds the reference voltage the comparator will switch its state exactly this type of connection is used in the 555 reference voltages are fed to the comparators from the voltage divider and if we again assume the power supply of 15 volts 5 volts will be fed to the input of U1 and 10 volts to the input of U2 please note that the U1 and U2 are connected to the divider with different inputs U1 uses its positive input while U2 is connected with the negative one so a logic 1 will appear at the output of U1 only if the voltage at trig input which stands for trigger is below 5 volts since trig is wired to a negative input you too will output logic 1 if the voltage at thresh input which stands for threshold is above 10 volts because thresh is wired to the positive input so what happens next comparator's outputs are fed to the RS flip flop RS also called the SR latch is actually one of the most basic sequential circuits whose operation is really straightforward it has two stable States and two separate inputs to switch it to set State we need to pulse the S input to reset it a pulse must be fed to the r input please note that unlike most logic gates the latch does not simply respond to input levels but rather retains its state until the next pulse arrives if for instance a short positive pulse is sent to the S input that's a one followed by a zero the flip flop will switch its output to logic 1 and will keep it that way similarly if a pulse arrives at the r input the RS will switch its output to zero and remain in the reset state as we can see the outputs of our comparators go directly to flip flop inputs so by feeding signal to trig and thresh pins we can switch it also take note that the fully flop in the 555 uses a negative inverting output which means a zero will correspond to its set State while one will correspond to its reset state now follow me carefully here applying the potential above two-thirds of the supply voltage to the thresh input will reset the flip flop applying level below one-thirds of the supply voltage to the trig input will set it so here's what you must memorize trig is activated by low level but is used to set the latch thresh on the contrary is activated by high level but used to reset the latch so the switching logic is kind of inverted here but you only got to remember it once high level to reset low level to set as the diagram shows this particular latch has an extra inverting reset input wired to pin 4. it can be used to reset the circuit externally and finally the output stage in 555 it is represented by the inverter gate u3 and the transistor switch q1 if we take a look at full circuit diagram of the 555 we are not going to find a standalone inverter gate here instead we can see a standard push-pull circuit whose purpose is to Output logic 1 and logic 0 levels to pin 3. and the base of the q1 transistor is simply wired to the input of the circuit there's no need to dive into details here all you have to remember is that levels on pin 3 directly correspond to the state of the flip-flop if it is said pin 3 will output logical High if it is reset pin 3 pull output logical low the IC also has an extra output pin called discharge it is an open collector output and if we pull it to the positive power rail with a resistor it will simply Echo levels on pin 3. however if load is wired between pin 7 and the positive rail its logic will be inverted relative to pin 3. you can check out my video on transistor switches for that the link is in the description you are probably eager to build your first 555 based oscillator but before we can jump to that to better understand IC operation I suggest we experiment with the chip in static mode we are going to apply permanent levels to its inputs and observe what happens at its outputs [Music] is the schematic of our first testing rig the circuit will be powered by 15 volts the 555 supports a wide range of Supply voltages from 4.5 volts to 16 volts which by the way means you can use it to drive mosfets please note that all inputs of the circuit except pin 5 do not have internal Pull-Ups this means you may not leave any of them floating so pin 4 must be wired to the positive power rail as we know already it is the extra reset input of the flip-flop which is inverting hence the connection buttons are wired to the trig and thresh inputs and use pull up resistors note that trig is pulled to the positive power Rail and button shorts it to ground with the thresh pin it's the opposite the button will short it to the positive Rail and the resistor will pull it down to ground remember we spoke about different triggering voltage ranges for these inputs trig is activated by levels below 5 volts thresh is activated by levels above 10 volts so this connection will work initially both comparators will output zeros we have 15 volts at the negative input of U1 and 5 volts at the positive input the negative input of U2 is fed 10 volts while positive is set to zero the LEDs are connected to the outputs of the 555 D1 is wired to ground while the D2 is connected to the positive rail as usual we use resistors to limit LED current let's see how it works as I press the buttons the latch switches its state is echoed by the LEDs D1 is on whenever the flip flop is set remember pin 3 is a non-inverting output the D2 State however is inverted thanks to the transistor switch that is wired directly to flip flop output before the u3 inverter since both comparators like I said output zeros at power on the initial state of the flip-flop can be random if we are unhappy with this we can use pin 4 that's the extra reset input to zero the latch when power is applied to do this connect the capacitor between pin 4 and ground there is an alternative way to connect the 555 and get the same functionality here's what it looks like the part that's responsible for setting the flip flop is the same however resetting it is now done via pin 4 the reset input because we do not need the YouTube to reset the flip flop anymore the thresh pin is now permanently grounded which forces the comparator to always output 0. let's check it out looks pretty much the same however in this configuration both buttons close to ground and the pull-ups are connected to the positive power rail in general in electronics pulling up buttons to positive power Rail and shorting them to the ground is considered a more proper way of wiring them than the other way around the reason is that most digital ICS including microcontrollers already have internal pull-ups and if you measure their input voltage most likely you are going to see a high level by pulling their input down to the negative rail with the resistor as we did in our previous example you risk forcing them into an unstable State because these two resistors external and internal may form a voltage divider but in the case of the 555 like I said this is an important since the trig and thresh inputs have no internal Pull-Ups one way or another the use of a pull-down resistor in digital circuits should be avoided if possible [Music] evaporation mode of the 555 that we have just observed is called by stable or simply a flip-flop circuit this means that the device alternates between two stable States and comes from the Latin word by which translates as consisting of two parts the bi-stable circuit however can be implemented in yet another way we can combine the two inputs trig and thresh into one as we already know trig is activated by a low level while thresh is activated by a high level so if we build a voltage divider and apply half to supply voltage to these pins which is 7.5 volts in our case this will again Force both comparators to Output zeros now if we use buttons to pull both the thresh and trig to negative or positive power rails this will also make the latch switch let's have a look there we go the buy stable in fact is a pretty simple mode it's not much different from a regular rs flip-flop the sn7474 for example the 555 however supports a much wider Supply voltage range also it has comparators at its outputs which makes switching smoother and error-free [Music] mono means one in Latin so another mode the 555 can run in is called monostable in this configuration the IC will have only one stable state so once the circuit is switched on it will time once and stop to start it again it must be activated manually the basic connection scheme of a monostable circuit is shown in the diagram most of it is already familiar to us we feed a zero volts pulse to the trig input using a button connected to the ground and a pull-up resistor of 4.7 kiloons is used to provide a positive bias when the button is released as the trick is a setting input the button will be used to switch the flip flop into set mode the reset pin is hardwired to positive rail we do not need it in this configuration however thresh and discharge pins wiring is different they are now connected together along with the C1 capacitor which is wired to ground and the R2 resistor connected to the positive rail so how does the monostable circuit work initially 5 volts from the R1 resistor is fed to the lower comparator's negative input through the trig pin that makes the U1 comparator output 0. the RS flip flop is reset which makes its inverting output output 1. and the transistor switch is on this shorts the C1 capacitor to the ground preventing it from charging because zero volts is fed to the thresh pin from the discharge pin the upper comparator also output 0. the LED is also off because pin 3 is low now the user briefly presses the S1 button zero volts arrives to pin 2 which makes the bottom comparator output logic 1 and switch the flip flop into the set state the LED illuminates at the same time the transistor switch turns off this allows the C1 to start charging through the R2 resistor the voltage at the thresh pin starts to rise as it reaches two-thirds of the power supply voltage which is the switching threshold for the upper comparator a logic one is fed to the r input of the latch making it reset the LED turns off the q1 switch turns on now the system is back to its initial stable state let's see how it works and it looks like we've just come up with a simplistic timing circuit the delay time here will be approximately one second we can observe the rise of voltage on the capacitor using a scope as we can see the cap charges gradually and discharges instantly this is due to the transistor shorting it to ground so the q1 in this circuit therefore performs the function of discharging the capacitor that is the reason why pin 7 of the 555 is called discharge the formula for calculating timer delay is quite simple T equals 1.1 times R times C where R is the resistance in ohms and C is the capacitance and farads it is easy to calculate that one microfarad and one Mega will provide us with a delay of about 1 second to increase it you have to either use a larger resistor or a larger capacitor in circuit design priority is usually given to increasing the resistance since using large capacitors may impact the size and cost of the final product let us use a 5 Megam resistor isn't that beautiful done and the capacitor again discharges instantly and the LED turns off it's important to realize that it's not possible to increase resistance indefinitely that could result in really low charging currents comparable to the leakage currents of the capacitor as a result the cap will simply never charge mastering choice of correct values and ratings usually comes with experience foreign you may have noticed that we never used PIN 5 in any of our circuits it's the control input which is wired to the top node of the 555 voltage divider the purpose of this pin is connection of a small capacitor whose task is to smooth out the Ripple of a power supply a comparator is a very sensitive device an even insignificant power disturbances can affect its operation so in a final product the capacitor at Pin 5 is essential since we use a lab power supply in this video filtering is not exactly necessary and by the way if you're interested in purchasing the DPS 5020 that's the power supply I use in my videos I will leave a link to it in the description the circuit that we have just assembled is also called a monostable or one shot multivibrator a monostable produces a single output pulse of a certain duration when triggered externally why would we need such a device guess what this is a fan rotation detection circuit while pulses are being received from the Fan's hall effect sensor the red LED is lit indicating that the fan is working as soon as the rotor stops for example the motor fails or an object gets into the propeller the indicator goes out and finally [Music] we've gotten to the last part of our video which describes perhaps the most common use of the 555 timer the circuit shown in this diagram is called the a stable oscillator or a stable multivibrator for the sake of clarity we will set up the a stable to generate low frequency pulses and observe the LED flash on its output the first thing that catches our eye in this schematic are the trig and thresh inputs wired together meaning they received the same signal so what's going to happen here when the circuit is powered on the C1 capacitor is discharged and zero volts is applied to both inputs this makes the top comparator output logic 0. the bottom comparator however will output logic 1. this will make the flip flop switch to the set state remember the output is inverted due to this the transistor switch whose collector is connected to the discharge pin will be off so the C1 capacitor will start charging thanks to the positive bias coming from resistors R1 and R2 connected in series the charging speed of the capacitor will depend firstly on its value and secondly on the value of these resistors as soon as the voltage of the thresh input reaches the two-thirds of Supply which is 10 volts in our case the latch will reset this will produce a logic 1 on its output the transistor will switch on and pull the discharge pin to the ground capacitor C1 will now start discharging through the R2 resistor as its voltage drops below one third of the supply that's 5 volts the lower comparator will respond and output a logic 1. the flip-flop will set and the transistor switch will turn off this will bring the circuit to its initial State and the C1 will once again start charging as a result oscillations will set in this circuit in fact is nothing more than a typical case of a feedback loop the signal is simply passed from the output to the input of the IC however due to the presence of an RC circuit formed with R2 and C1 the transition between on and off States is not instant which means the frequency and the duty cycle of our oscillator will be determined by the values of C1 R1 and R2 because the capacitor is charged through both resistors but discharged only through the R2 if we want to get waveform close to meander the resistance of R1 must be relatively low compared to resistance of R2 and if you need to know exact duration of positive and negative parts of the waveform you can use formulas shown on the screen looks like our oscillator is running however duty cycle is obviously pretty far from 50 percent the meander why the reason is because the capacitor charges through both the resistors while it's discharged only through the R2 so the charge and the discharge currents are slightly different how can we make duty cycle adjustment more accurate obviously we must separate the charging and discharging paths from each other to achieve this we need to introduce a couple of diets into our circuit this time the capacitor will charge through R1 D2 and R3 while the D1 will remain reverse biased when the transistor switch turns on and zero volts sets on pin 7 D2 will become reverse biased and the discharge current will pass through D1 and R2 as the total resistance of R3 and R1 is equal to the resistance of R2 and the diets obviously provide the same voltage drop currents flowing over charge and discharge paths will be identical thus the time high and the time low of the oscillating cycle will be balanced as we can see the duty cycle has now approached 50 percent we can in fact come up with an even simpler circuit here we need the R1 resistor because the discharge pin is an open collector output which means it needs a pull up resistor to operate however if we use pin 3 which is remember a push-pull output to drive the capacitor we can drop the extra resistor our revised circuit will now look like this and we can use the discharge output to drive external load the LED in our case in a stable mode the 555 timer can also be used as a pulse width modulation pwm controller to achieve this all we need to do is increase oscillation frequency by reducing the value of the C1 capacitor and replacing the R2 R3 stage with a potentiometer we are also going to need a capacitor at Pin 5 here it is necessary to suppress high frequency noise which may affect the comparators so here comes our pwm we can observe how the LED intensity changes in accordance with the tutor cycle as I turn the potentiometer the output frequency however also changes this is obviously due to change in resistance which affects the parameters of the RC circuit responsible for the switching delay in the feedback loop let us now go back to our previous configuration and use the discharge output to drive the capacitor while the LED will be wired to pin 3. and it looks like our circuit is not working correctly as the potentiometer is turned the LED brightness first starts to drop but then rises again the scope shows that we have some sort of parasite oscillation at the output let us try to lower Supply voltage to 9 volts looks like everything's working fine now and the oscillation is more stable too let us measure it with a multimeter the Meander frequency is about 300 Hertz as I increase the duty cycle to about 80 percent it goes down to some 280 Hertz not too bad let us try to lower the duty cycle it's 360 Hertz now so once again why does the frequency change for the same reason charging and discharging currents of the capacitor flow through different paths the C1 is charged through R2 D1 and R1 and discharged through D2 and R1 this problem is also quite easy to solve in this configuration all we need to do to balance currents is add a single resistor to the circuit can you guess where it should be placed you can pause the video and take a moment to think what's going to happen now charging current will flow over the same path but the discharge current will now go through an additional R3 resistor which will compensate for the R2 naturally the values of R3 and R2 must be the same okay now let's see how it works the frequency is now about 280 Hertz let us increase the duty cycle looks like the frequency has not changed much let's see how we're doing on the low end it's obviously also better but not quite as desired looks like frequency and stability here is due to the time low duration of the cycle changing disproportionately compared to time hydration as duty cycle is adjusted which means the time during which the latch is in the reset state is slightly out of balance with the time it is set as you remember it's the upper comparator that is responsible for resetting the latch incidentally the control pin is wired directly to it so we can try to shift the threshold level of this comparator by pulling pin 5 down to the ground with a resistor by trial and error I came up with a value of 21 kiloms let's see what we got now actually it's pretty good let us turn up the power supply to 15 volts everything is fine here now too the magic resistor at the control pin solved everything I think it's obvious now that the 555 timer cannot boast great stability but that's really not what we expect from it in pwm circuits used to drive high current loads maintaining constant frequency is not that critical let us take a look at a small circuit that can be used to drive any resistive load powered from an AC Source like an incandescent lamp a heater or a DC Electric Motor the 555 configuration is quite typical here the pwm signal produced at Pin 3 is fed to a mosfet driving the load the circuit as you can see is transformerless which means the load is powered by voltage rectified using a diet bridge and the 555 is powered by a simple step-down circuit made of an 18 kilo ohms 5 Watts damping resistor and a 12 volt zener diet last but not least you probably noticed that all circuits shown today have two capacitors wired in parallel with the power supply Y2 why not use a single cap of equivalent capacity the reason is they serve different purposes the 10 nanofarads is there to suppress parasiting self-asillation at high frequencies the 47 microfarads supplies power to the Circuit at switch times what does that mean in a typical scenario when the circuit contains load which is just an LED in our case but could be anything whenever the latch switches power supply voltage may change although these voltage fluctuations are really minor they can disturb the comparators by affecting their switching threshold and thus caused many undesired effects so the 47 microfarad capacitor helps maintain low changes in real designs the 10 nanofarad capacitor is often soldered directly to the power pins of the AC or right next to it the electrolytic capacitor is usually connected directly to power rails where the maximum number of connections of the rest of the circuit is accumulated [Music] as a final note there is also a CMOS version of the ne555 called the lmc555 it can boast better stability higher frequency range 3 megahertz versus 500 kilohertz much lower power dissipation and Supply current spikes and a minimum Supply voltage of 1.5 volts compared to 4.5 volts of the original version also at 5V Supply output is fully compatible with TDL and CMOS logic so if you can get your hands on the LMC 555 it's definitely worth your attention either way the 555 does an excellent job overall and it's low cost makes it perhaps the easiest and most affordable solution for implementing pulse width modulation functionality however if your application requires high accuracy and stability you should definitely look into microcontrollers or if you are building an LED driver there's a bunch of dedicated LED pwm controller ICS that will do their job better than the 555 and that's it for today if you found this video useful please do not hesitate to give me a thumbs up share it in social media and of course subscribe to this channel if you are interested in purchasing components or equipment shown in the video you can find the links in the description or if you really would like to support the channel you can go with YouTube subscription members get access to exclusive content including all diagrams in Japan format Arduino sketch source code and full plain text transcripts of all videos found in this channel to become a member please follow the link found in the description or simply press the join button this was Ronaldinho see you next week [Music]