Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

230V AC or 24V AC/DC to 3.3V level shifter.

Status
Not open for further replies.

Vangjush

New Member
Hello,

I have drawn the below schematic. The purpose of it is to be able to use eather of the two inputs(not both for one output), and get 3.3V on
the output of the circuit(microcontroller input).
The idea is to use the capacitor to create about 32k reactance and with the 4.7k resistor will allow about 6mA current (on 50Hz) to turn the phototransistor of the optocupler on.
For example for the first output, i want my input voltage to be 230V AC(between 230VAC and GND) and for the second 24V DC(between 230VAC and GND) at the same time.

Unfortunatelly i dont have the parts to test the circuit and at this time is difficunt to get them considering that all shops are closed in my area due to COVID-19.

Do you see any problems with the design or it should work? One thing that i can think of is the zero crossing point if AC voltage in the input is applied.
Will it cause it to turn off?

Thank you in advance.


Καταγραφή.PNG
 
Last edited:
It will give a fluctuating output from an AC input, switching at twice the AC frequency.

Ideally you need a load resistor across the input to the bridge rec, to bypass any leakage on the input connections while the input is open circuit - especially with higher voltages, capacitive coupling in a bundle of wires can cause significant voltages to appear on unloaded wiring.

In industrial-grade input circuits it's also common to have a series low voltage zener before the opto, so signals less than eg. 6V are not passed on at all, for better noise immunity.
 
It will give a fluctuating output from an AC input, switching at twice the AC frequency.

Ideally you need a load resistor across the input to the bridge rec, to bypass any leakage on the input connections while the input is open circuit - especially with higher voltages, capacitive coupling in a bundle of wires can cause significant voltages to appear on unloaded wiring.

In industrial-grade input circuits it's also common to have a series low voltage zener before the opto, so signals less than eg. 6V are not passed on at all, for better noise immunity.
Thank you so much rjenkinsgb.
You suggest replacing the coupling capacitor with a resistor of 32k? To avoid the switching of of the optocoupler on 100Hz can i place a capacitor across the bridge's AC inputs?
 
A capacitor for input current regulation is fine.

One across the AC side of the bridge would not prevent 100Hz switching; the AC polarity will still change, and pass through zero.
That would need a capacitor on the DC side of the bridge plus a series resistor to the LED, so the cap could maintain a somewhat higher voltage than the LED cut-off during the AC zero crossing.

A resistor across the AC side of the bridge would help with noise immunity.
 
A capacitor for input current regulation is fine.

One across the AC side of the bridge would not prevent 100Hz switching; the AC polarity will still change, and pass through zero.
That would need a capacitor on the DC side of the bridge plus a series resistor to the LED, so the cap could maintain a somewhat higher voltage than the LED cut-off during the AC zero crossing.

A resistor across the AC side of the bridge would help with noise immunity.


Something like this rjenkinsgb?
Καταγραφή.PNG
 

Attachments

  • Καταγραφή.PNG
    Καταγραφή.PNG
    57.3 KB · Views: 266
  • Καταγραφή.PNG
    Καταγραφή.PNG
    68.9 KB · Views: 440
Last edited:
I'd think that is pretty close!

Possibly re-proportion the resistances though; eg. change the 4K7 to 3k3 or 3k9 and the 100R to 1K, so the capacitor charges higher above the LED voltage and can maintain the LED current a bit longer.

Note that the 100pF cap is far too small, it would give next to no current. Was it supposed to be 100nF?

For around 20mA you need roughly 0.33uF (330nF) in that location.
 
Hello again rjenkinsgb
You are right, the 100pF was supposed to be 100nF.
In order to achieve 10mA (according to datasheet optocupler is fully on between 5-10mA) the calculations below seem correct to you?

Καταγραφή.PNG
 
Actually i just realized that i forgot the 1k resistance and the forward voltage of the optocoupler's diode. But never the less i dont mind having a little bit less than 10mA.
 
It looks OK; I was not considering the current you would have with the original resistors when I said 20mA..
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top