LM311 Square Triangle Oscillator for PWM

LM311 is a comparator, It operates from single 5V supply or dual supplies,input current 150 nA, 50 V-50 mA output drive capability. TTL-CMOS compatible output.

Even LM324  used as a  comparator Water Level Indicator with Reed Relays

The Output is open collector so it can sink current but cannot source, a totem pole output can source and sink. In this Circuit R2 is the source or pull-up.

LM311 Square Triangle Oscillator for PWM

The Output being high or low depends on which input is more dominant or positive. If + or non-inverting input is more positive than the – inverting input then output of LM311 is high impedance or high Z as output transistor of LM311 is turned off, but output goes high due to R2 pull-up 1K, so you can apply a load of 10K and above for source. When the – input or inverting input is more positive, output goes Low as transistor turns on, now a current of upto 50mA can sink here, a LED or Relay can be driven.

Mixed Circuits Analog with Digital

On turn on C2 capacitor is discharged and pin 3 the inverting input is at a lower potential than pin 2 the non-inverting which is at 2.5V. Hence output goes high and C2 starts charging thru R5, When C2 charges a little beyond 2.5V pin 3 is more dominant and output goes low now, this slowly discharges the C2 bringing the voltage at pin 3 again below 2.5V so output goes high again. This process goes on, hence it oscillates. The charging and discharging is at the rate of R5 * C2 approx. , R3 serves as hysteresis or feedback to ensure clean turn on and off.

Fixed frequency Variable duty cycle with 555

This circuit is based on a very old application note from exar, in this the frequency is fixed by IC1 and IC2 -P1 controls the duty cycle. you need to compute the R and C values to get what you need,  LM555 data sheet.

You have to study the circuit and do something more innovative perhaps, just copying is ok for learning but it will get you nowhere, so learn and then innovate, the eagle circuit is given below so you can learn by editing it, also design a PCB with it, and you can even make a PCB at home to learn, but it is always good to get PCBs done by a PCB vendor, but you should understand his problems, then you will design well, so make a few PCBs.

Fixed frequency Variable duty cycle with 555

Edit the circuit eagle cad file del00012.zip

Isolated dual power supply from 5V

This is a unregulated supply for low power circuits. You may be able to regulate the outputs with zeners or small regulators like 78L05.

The transformer can be hand wound in a mini ferrite pot core. you can use 2N2222 or any other fast transistor. The transformer should have 1KV isolation. The dot polarity of TR1 should be properly observed, else it may fail to oscillate or give output.

Simple WorkBench Dual Power Supply – del20033

Diode should be fast recovery type, for less than 100mA use 1N4148. transformer, pri-20-20, sec-60-60, a SWG-AWG to suit the current you

design for, any fast switching transistor would work, no regulation, use regulators like 78L12 if you want, circuit like multivibrator used for flashing LED lights.

Isolated dual power supply from 5V

The Source file in CadSoft EAGLE format is here del00010.zip

Frequency Divider 74HCT4040

U1 7555 is a CMOS version of 555. The 555 here is in Astable Oscillator mode, C1 and C4 are decoupling capacitors 0.1uF value, ceramic disc.

Mixed and Interface Circuits

The output is around 100kHz, If C3 is plastic or mica the frequency output will be stable with temperature. It is better to use a crystal oscillator.

Frequency Divider 74HCT4040

The 555 output is fed to clock input of 4040, the output of 555 will be a square wave, on every high to low transition (falling edge or negative transition) the counter increments by one and the output is 12 bit binary.

Read more at my Digital Timers, Counters and Clocks

If input frequency is F the final output at Q12 is F/4096. The period T = 1/F.
If you make the 555 run at 1Hz, C3 around 7uF, Then this circuit becomes a long duration timer, the Q12 period will be 4096 seconds or 68 minutes.