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

The Input Impedance of this module is very high and is symmetric. This circuit can be used for strain gauges and for four wire measurements. If inputs are in mV use OP07. The merit is that it uses only 2 OpAmps yet has high differential Input Impedance.

Dual Differential Amp – Interactive Simulation

The Outputs of Opamps are low impedance but still have limits they cannot drive more than a few mA of Current into the Load. If low ohmic value loads are to be applied use external transistors as amplifiers. If inputs Vn-Vp are floating Outputs may be random or Oscillating, it is good to have a bias network of 10M resistors to a potential even zero or COM this enables Vout when input floats.

Two Op-Amp Differential Amplifier

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

Related Reading

Precision Instrumentation Amplifiers

The circuit uses opto-coupler MOC3041 of Motorola and the Triac BTA16-600 of STMicro as a solid state switch or relay. Four Switches boost or buck the mains voltage, keeping output within limits.

Power Electronics Design Methods

It also uses the LM324 quad opamp from National Semiconductor which is low power and single supply. As the MOC3041 switches the Triac at zero crossover there is no inter-winding short of transformer on crossover hopefully, the control circuit is designed in such a way that more than one triac will not be turned on at a time, i would like you to give feedback.

555 multivibrator like power oscillator

This circuit is a design concept, not tested by me and i did it just to explain some ideas.

Solid-State Stabilizer Step up 110V AC

The triac will switch at zero cross over because of MOC3041, hence no problem of an interwinding short, but then control circuit may fail or malfunction, so use fuse as shown . Also a snubber made of a 47E resistor and 0.02uF 630V pl cap in series must be placed across each triac.


Battery and Energy Management

Use heatsinks for all parts that heat, air circulation. Use Presets with series resistor as required so that you can test or calibrate. This Stabilizer should not be used with Inductive loads like motors or solenoids it may be ok for lighting and small electronics. If input voltage is 230V put the two 110V windings in series in proper polarity. BTA16600 is a ST part, metal tab is electrically insulated, 16A and 600V.

All mains wiring and connections should be designed for high voltage and current, They should be isolated visually from control circuits by 10 mm or more.

It can Stabilize Mains voltage to around +/- 10% . It can be used for both 110V AC or 220V AC inputs with modifications. The Output is 220V AC. There is an overload, under voltage and over voltage trip circuit.

Mains Stabilty and Supply Regulation

U2A and U2B are two comparators which controls relays K2 and K3 Respectively. One Boosts the voltage (Step-up) when mains supply is low. The other Bucks the voltage (Step-down) when mains voltage goes beyond a limit.

UPS Power Inverter and DC to AC

U2C and U2D work like a window comparator to trip the unit above and below certain preset limits. This circuit is clubbed with a Mains control relay K1 which can be Turned ON-OFF with two pushbuttons.

Stabilizer Step up 110V AC to 230V AC 500VAThis circuit is a design i did, not tested by me as yet.With some tweaks and modifications it might work.

Put a 0.1uF 1KV pl cap across all relay contacts to avoid sparking. Relay current paths should be large and direct to supply, or when relay operates ground will lift and cause malfunction.All mains wiring and connections should be designed for high voltage and current, They should be isolated visually from control circuits by 10 mm or more. If input voltage is 230V put the two 110V windings in series in proper polarity.

Electric double layer capacitor an eFlywheel

Put one LED with resistor for boost and buck indication if required. Use Presets with series resistor as required so that you can test or calibrate. The 1M dead band or hysteresis resistor can be varied from 330K to 10M as performance demands, this resistor stops oscillation or chattering of relays.

If output impedance of a point is a high value then connecting another circuit at that point will load it resulting in malfunction or error. Buffers are used as interface between circuits. Low impedance of an output means it can source sink lot of current, when you need 2 opamps use LF353 or TL072 which are dual opamps.

Blind Dial Proportional Temperature Controller

A non-inv FET input is the best buffer, for inverting buffer use high R values Using very high R values like 2.2M or higher requires a glass epoxy PCB and guard rings around pin 2, 3 to prevent leakage currents on the PCB reaching the PINs. Also moisture and dust has to be prevented by using RTV coating or Varnish. Use 78L05 79L05 for the dual supply required by this circuit.

Buffer or Unity Gain Op-Amp

Vout = -(Vin) for inverting

Vout = Vin for non-inverting

 

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.

This is the Analog front end of the 80C39 Process Controller. The analog input is protected by a Zener barrier, low leakage. You could use clamping diodes too.

The non-inverting low-offset amp offers high input impedance. After further amplification it reaches the VCO LM331. The pulse train from the VCO reaches the uC port and is gated and measured by the MCS48 firmware. The voltage is deduced from the Frequency or Pulse width.

Voltage to Frequency Converter AD Interface

You can get a resolution near to a 8-10 bit A/D converter. It does not work for negative voltages. It is a low cost Voltmeter or Process Display solution.

80C39 and MCS48 based Process Controller is the main circuit that has the LED 7 segment display for output and push keys for input.