This is a mains 230V AC load current indicator and is a LIVE CIRCUIT, so take care. The Resistors have to be a fusible ceramic wire wound.

More at Mains Voltage and Power Circuits

Mains Current LED Indicator

This circuit has been drawn from my memory and i have not tried it out again, just see if it is ok and then try. You should use the fuse of 1A a slow blow if you want but it is very important. You can design the shunt R3 and Fuse rating as required by your load.

Note that this circuit is to be put in series with the load like an ammeter. If you put it across the supply like a voltmeter it will fuse out or burn out. This circuit has to be enclosed in a plastic sealed enclosure to avoid contact.

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.

CD4538 is a dual Monostable Multivibrator. When you trigger the chip the output sends off one single pulse or one high-low event.

Mixed Circuits Analog with Digital

The T+ pin 4 of U1a is the positive edge trigger or raising edge trigger input, the T- pin 5 is falling edge or negative edge trigger input. Now see the image of the single pulse above which shows both the edges, If this is the input pulse at pin 5 then the falling edge turns the output pin 6 from low to high, this output remains high for time T = R2 * C1 and then goes low again, The output Q at pin 6 also looks like the image of pulse above.
Monostable Multivibrator CD4538

The Output pin 7 is the complementary state of pin 6, it is the reverse state or inverted form of pin 6 output.

Now why is a slope shown in the edges, this i have exaggerated a bit so that it can be explained. But then there is a slight slope due to gate input and output capacitance.

In fact if you had a wire or twisted track coming to the input and the R2C1 was in nano seconds, then you would see a ringing at the edges, a tiny peak or spike, which will have giga hertz frequency components, in fact a square way may be many sine waves put together, this you know from a spectrum analyzer.

Two Stage Sequential Timer

CD4538B can give an output with pulse width of 1uS and above. 74HC4538 gives 120nS to 60 Seconds pulses. The above circuit produces a pulse of width T = R3 * C2 after a delay of T = R2 * C1. Some Chips formula is T = 0.7 * R * C .

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

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

I had to once interface an high voltage circuit to PC, The uC had to communicate thru RS232–Comm port–Serial Port.

Part of the 80C31 8051 SBC

Even though i had isolation at the sensors and actuators to make doubly sure the PC also has been isolated. There are chips that are available for this purpose, The circuit above is built with discrete and passive components except for the opto 4N35. You can use MCT2E and CNY17-3 Optos too. For MCT2E some tweak may be needed as current transfer ratio is 20, for the other two CTR is 100 so above design will work.
RS232 with Opto-Isolation

The circuit derives power from PC but does not load the PC supply. Any voltage above 5V applied to the PC connectors may lead to damage of motherboard in PC. Old PCs were more vulnerable but PCs today maybe a bit rugged at the Ports. Due to internal current limits and clamping.

The VCC, VDD and Agnd are derived from PC no other power needs to be applied on PC side of opto. On uC side of opto the uC power supply lines +5 and gnd has to be used. There is no copper link between the two sides and depending on opto a 1KV isolation is possible if PCB is well designed. The PCB should show the visual isolation above and components should be laid on separate areas of PCB to prevent creepage.

The LEDs are to indicate the port activity Rx and Tx, they are not required once testing is over. The circuit can be simpler, but this worked for me and it is not tested at very-high buad rates.

The levels of RS232 are not TTL like 0-5 we have both polarities +10 and -10. The circuit has to change that to drive the Opto Leds.

RS232 software. Understanding RS232 Serial Port Communication.

This is the best Instrumentation OpAmp, Great CMRR, ensure supply has no ripple and keep analog and digital grounds separate. Ri can be replaced with a trimpot and resistor to alter gain. Connect a preset ends to pins 1 and 8 and preset wiper to VCC for Offset Null when high gains are configured.

Thermocouple and Pt-100 RTD

The Input zeners and diodes form a protective clamp for all voltages above VCC-VDD. If supply is changed to +12 -12 change zeners to 12V zeners. Use similar Zeners at output to protect Output from being zapped by overvoltages or high energy – voltage*frequency transients. Add plastic capacitors across Rf for damping AC operation or ripple. Also avoid floating inputs by providing a bias.

3 Op-Amp Differential Instrumentation Amp

Vout = (Vp – Vn) * (2Rf+Ri)/Ri

Related Reading