### How to design LM324 Astable Multivibrator

This blog post is intended to describe how astable multivibrator works based on LM324 operational amplifier, RC timer and positive voltage divider circuits. This is one way to implement astable multivibrator since additional options are available like: specialized signal generators or 555 timer integrated circuit configured to work as an astable multivibrator.

There are two states related to astable multivibrator based on RC timer or an analog timer (there is also a digital timer integrated into the microcontroller for example, but in general, digital timers are based on astable multivibrators implemented with quartz or resonator external oscillators, since digital timers count PWM/clock oscilations. Anyway, there are different types of astable multivibrators in order to provide clock cycles): charging and discharging.

Charging

To describe charging state we will start from beginning with the completely discharged capacitor C (it has zero volts between pins). Point market with number 3 is connected to inverting LM324 input with zero potential (voltage). Because it is inverting input, the output of the LM324 operational amplifier is set to ~Vcc. Since LM324 output is at a higher voltage in comparison to the point marked with number 3, capacitor C will be charged exponentially with electric current as it is presented in figure #1 (a) and in the related timing diagram (exponential charging). As we can see current flows into the capacitor C at the same time resisted by resistor R. With small resistance R capacitor charging will be faster and vice versa. In time, potential marked with number 3 will be equal (or slightly larger) with potential marked with point number 2. Potential in point number 2 is determined by the voltage divider composed of two resistors R1 and R2. If R1 is equal to R2, potential reference in point number 2 is ~Vcc/2. Now, when potential in point number 3 becomes equal or greater then potential in point number 2, output of the LM324 operational amplifier is set to almost zero value potential (falling edge of the PWM signal presented on the timing diagram, figure #1 bellow). Since, potential at the point marked with number 3 is greater than the output potential of the LM324 operational amplifier capacitor will be discharged in opposite current direction as it is presented in the figure #1 (b).

 Figure #1: (a) Charging, (b) Discharging. PWM Signal, timing diagram (click to zoom); a - charging, b - discharging.

Discharging

Since voltage is almost zero at the LM324 output, potential in point number 2 is ~Vzero/2. When potential at the point number 3 becomes equal or smaller than ~Vzero/2, the output of the LM324 will be set to ~Vcc since the capacitor is connected to the inverting input of the LM324 circuit (rising triggering edge of the PWM signal presented on the timing diagram). If we pay attention here, we can see that two triggering points are necessary for astable multivibrator: first related to charging ~Vcc/2 and the second related to discharging ~Vzero/2, which means that astable multivibrator is nothing else than a comparator circuit with RC timer and positive feedback loop implemented throughout voltage divider R1 and R2 (hysteresis). Since, the output of the LM324 oscillate in time, comparator voltage reference will be set accordingly in following sequence: ~Vcc/2, ~Vzero/2, ~Vcc/2, ~Vzero/2, ~Vcc/2, ~Vzero/2, ~Vcc/2, ~Vzero/2 ... For capacitor: charging, discharging, charging, discharging, charging, discharging … For output of the LM324: logic one, logic zero, logic one, logic zero … where logic one is ~Vcc and logic zero is ~Vzero. If Vcc is +12V, in that case logic one is ~+12V.

 Figure #2.1 Left: Periodic sequence related to the capacitor charging/discharging characteristic in time taken by the oscilloscope C1-72. Right: Charging/Discharging capacitor characteristic taken by the oscilloscope C1-72
 Figure #2.2 Generated PWM - Pulse Width Modulation signal, output from the LM324

Video#: Presented video demonstrates oscilloscope C1-72 measurements related to the capacitor charging/discharging characteristic.

Posted by Zilsel Invent on Sunday, January 31, 2016

Video#: Presented video demonstrates oscilloscope C1-72 measurements regarding the periodic sequence of the capacitor charging/discharging characteristic in time.

Posted by Zilsel Invent on Sunday, January 31, 2016

Video#: Presented video demonstrates oscilloscope C1-72 measurements related to the generated PWM (Pulse Width Modulation) signal captured from the LM324 operational amplifier output.

Posted by Zilsel Invent on Sunday, January 31, 2016

Video#: Presented video demonstrates oscilloscope C1-72 measurements related to the generated PWM (Pulse Width Modulation) time sequence signal captured from the LM324 operational amplifier output.

PWM signal changes in time...
Posted by Zilsel Invent on Sunday, January 31, 2016

LM324 IC operational amplifiers, 4N25 IC optocoupler and design rules.

LM324 is integrated circuit composed of four operational amplifiers packed in DIP/DIL package. Since, astable multivibrator can be implemented on many different ways, LM324 IC is not necessary integrated circuit, which means that other operational amplifiers could be used as well with or without modifications regarding electrical schematic presented on figure #1. For example, astable multivibrator can be implemented with the LM741 (only one operational amplifier) or with the LM393 (two operational amplifiers/comparators) integrated circuits. Anyway, it is very important to pay attention about available current necessary for the load (in our case 4N25 IC), and this article will be concentrate around LM324 IC. For example: circuit from figure #1 is used as PWM generator in order to test DC motor driver/controller (codename SERPENT I), since it has optoisolated input implemented with 4N25 integrated circuit consisted of light emitting diode as a transmitter and light sensitive transistor (NPN) as the receiving side. Now let see some technical specifications related to LM324 and 4N25 since these two integrated circuits are interfaced/connected.

Let’s start from LM324 specification. As we are able to see from figure #3 the LM324 operational amplifier provides typically 40mA (milliamps) as the output current source (40mA is rounded with a red rectangle) at 25 Celsius degrees as common ambient temperature. Pay attention here that the specification for the output current has two parameters: source and sink. In our case source current is required, but there is a certain difference between source and sink. Source means that current flows from the integrated circuit (out of the IC) while sink means that current flows into the integrated circuit. Also, if specification provides source and sink parameters related to the output current that also means that integrated circuit has integrated totem-pole output (name taken from Native American Culture). Anyway, 40mA is typically available as source output current and that is for sure.

 Figure #3: LM324 IC Specification

4N25 IC has two parameters related to LED current as it is specified in figure #4. First photo LED current is Forward current or continuous current and it is set to 60mA (milliamps). Second current is Surge current and it is much higher than continuous current and it means that photo LED of the 4N25 IC is able to handle up to 3A (amperes) for the time interval equal or less with 10 microseconds. But, this is very important parameter since the 4N25 LED will be driven by PWM signal. So, if the logic one part of the PWM signal is equal or less than 10 microseconds that means that we are able to drive photo LED with much higher currents than 60mA, up to 3 A. So, do not forget that with switching modes (PWM - Pulse Width Modulation) we are able to design electric circuits with much higher ratings than it is specified under forward/continuous current.

 Figure #5: 4N25 IC Specification

Figure #5 presents electric interfacing between LM324 integrated circuit and 4N25 integrated circuit. Both ICs are connected to the same ground potential. 4N25 IC is interfaced with LM324 circuit throughout the resistor R led. Let’s say that requirement for photo diode is 20mA. Since LM324 IC provides 40mA as the current output source it is good enough to drive 4N25 photo diode. Since only 20mA is required for the LED that also means that additional 20mA is available to drive some other electronic device beside the 4N25. If, for example, 45mA is required for the photo LED that means that LM324 is not good IC because only 40mA is available at the output. In that case, the additional amplified current source is necessary to be designed in order to drive photo LED. Of course, how much current is requested for the LED depends also on collector current requirements. At figure #5 at the right side, there is a diagram which presents the relationship between LED current and collector current. For 20mA available collector current is between 10 and 15mA depending on the ambient temperature.

 Figure #5: LM324 - 4N25 Interfacing

Regarding voltage divider, it is always good to choose higher resistance values since positive feedback loop only requires certain potential point. If we choose higher resistor values for R1 and R2 PWM timing depends on chosen capacitor and resistor in the RC time circuit. To calculate PWM timing and signal frequency it is necessary to do calculations with equations presented on figure #6. Regarding capacitor, by design rules, the ceramic capacitors (class 1) are the best choice for oscillator circuits and stabilization circuits like it is a low pass filter. Of course, if you don’t have ceramic disk capacitors or multi-layered ceramic capacitor (MLCC) you are feel free to use any type of block or even polarized capacitors like it is electrolytic, but in that case be aware that polarity is right set (negative pole of the capacitor must be connected to the ground mass potential).

 Figure #6: PWM signal timing calculations.

DC motor speed controllers

Astable multivibrator from figure #1 can be used for DC motor speed regulation by very small changes under schematic presented on figure #1. First change: resistor R in RC timer circuit could be replaced with potentiometer configured as a variable resistor. By doing so, PWM timings could be changed at runtime providing different frequencies for DC motor speed regulation, for details click here. Second change: voltage divider could be implemented with two resistances and one potentiometer in between, providing user configurable voltage reference by changing resistance in time, in order for the PWM signal to be generated with different frequencies suitable for DC motor speed rotation control, for details click here.

This is all good and very simple to build, free running astable multivibrator (PWM generator) as DC motor speed controller with only few external components around operational amplifier. With provided equation in figure #6 it is possible to do calculation in order to choose right capacitor and resistors for desired PWM frequency, but that is not all. Generated frequencies depend on the chosen operational amplifier. For example LM324 operational amplifier has limitation regarding high frequencies, which means that it is not possible to generate PWM signals at MHz scale (for example), since it has very small slew rate value. Slew rate value is one important parameter regarding operational amplifier and describe operational amplifier speed capabilities in term of PWM signal changes at output pin. Higher the slew rate value (volts per milliseconds mS or volts per microseconds uS) means faster or high speed operational amplifier output capable to generate PWM signals at MHz scale or more.

Anyway the best way to check this is to play with different types of operational amplifiers with different slew rate values. For example: LM324 has slew rate 0.5V/uS, mc4558 has 1.2V/uS while TL074 has slew rate 13V/uS. TL074 is a high speed operational amplifier because voltage change at output pin is much faster in comparison to the mc4558 and LM324 operational amplifiers. In the next article you will see that PWM signal is not “clear” (not smooth square wave signal) signal regarding some operational amplifiers like for the LM324 operational amplifier in comparison with the mc4558 op amp.

Related videos (Astable multivibrator implementation with the LM324):

Related to the first video: Pay attention on LED blinking. At some point in time, PWM frequency becomes higher, so it looks that LE diode does not blink at all, but it actually blinks with very high speed not visible to the human eye wink emoticon. Frequency is regulated by changing R (resistance) with potentiometer (potentiometer is used as variable resistor) in the RC (resistance-capacitor) timer circuit, at the same time changing RC constant.

This is astable multivibrator - PWM generator, based on LM324 operational amplifier, RC timer and positive feedback voltage divider. It's going to be used as a test circuit in order to control DC motor speed rotation by using SERPENT I as DC motor controller/driver. Pay attention on LED blinking. At some point in time, PWM frequency becomes higher, so it looks that LE diode does not blink at all, but it actually blinks with very high speed not visible to the human eye ;-) Frequency is regulated by changing R (resistance) with potentiometer (potentiometer is used as variable resistor) in RC (resistance-capacitor) timer circuit, at the same time changing RC constant.
Posted by Zilsel Invent on Saturday, January 16, 2016

This is astable multivibrator - PWM generator, based on LM324 operational amplifier, RC timer and positive feedback voltage divider. It is used to control DC motor speed by using SERPENT I DC motor driver/controller. Video made by web camera.
Posted by Zilsel Invent on Saturday, January 16, 2016

This is astable multivibrator - PWM generator, based on LM324 operational amplifier, RC timer and positive feedback voltage divider. It is used to control DC motor speed by using SERPENT I DC motor driver/controller. Video made by tablet camera (better sound, but anyway it depends on PWM generated frequency).
Posted by Zilsel Invent on Saturday, January 16, 2016

Related articles:
SERPENT I - DC motor controller/driver
zilsel-invent assumes no responsibility or liability for any errors or inaccuracies that may appear in the present document.
Specification and information contained in the present schematics are subject to change at any time without notice.