Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] Interfacing 230Vac into PIC

Status
Not open for further replies.
PC817 input side and output side max current is 50 mA according to datasheet. Why do you want to know minimum current? Why don't you just provide 10 to 15 mA and see?
 

Refer to figure 4 on the data sheet. The minimum LED current is specified at 1mA but only gives 80% CTR. That *may* be enough if the output side current is kept low. 2mA is required to get 100% CTR and the optimum current is around 15mA.

CTR = Curent Transfer Ratio, it's a measure of how much the current through the opto-transistor is controlled by the current through the opto-LED. It isn't a linear relationship so the figure has to be specified under particular conditions.

Brian.
 

Thanks, I would like to try all methods one by one... but the component suppliers here are simply too not competitive... Imagine they don't even have optocouplers and triacs in store...

I would like to tryout a capacitive dropper, which the components are more of a hope to be available here.

With a 225K capacitor parallel to a 470K resistor at the L arm, as the dropper; 100ohm resistor at the N arm.
The two arms are connected to rectifier (I'm planning to use 4 1N4007 diodes as bridge), a 1000uF smoothing capacitor,
100ohm bleeding resistor, and finally 5.1V Zener diode to get a 5Vdc logic level into the microcontroller.

Will this work? How do I choose the ratings for the components, I do realize this requires isolation, but that doesn't matter for the time being.
Is there any other drawbacks on this design?

Please advice... Thanks

- - - Updated - - -

PC817 input side and output side max current is 50 mA according to datasheet. Why do you want to know minimum current? Why don't you just provide 10 to 15 mA and see?

I need to know the minimum operating current, I have a SFH620A now, I connect 5 470ohm resistors to each AC arm and to the input pins of the opto; which makes a total of 4.7K ohm. The opto wouldn't activate...
 

Use opto couple(4n35) and interface the life and neutral voltage with 33k connected to in4007 in uni direction and 33k with 6.1volt zener diode in opposite direction respectively to the light emmiting diode side and connect your 5volts dc voltage to the basic of the opto coupler and take your output from the emmitter of the opto couplier which can be further amplified.
 

Hi!

Always have in mind that interfacing with AC is dangerous. But you will most likely need to even for the simplest PSU, lights & relay project.

That said, kindly read this App Note from Microchip:
https://ww1.microchip.com/downloads/jp/AppNotes/00521c.pdf

Since most PIC have clamping diodes on most inputs it comes down to limiting current and clamping diodes will do the rest. So a single high value resistance will suffice (5MOhm or so, please read the App Note for details). Alas, some inputs do not have clamping diodes (some special function I/O pins) and will require an external diode, this is too covered in the App Note.

The App Note talks about PIC16C5X family which is a small part of Microchip offerings but most common 16F, like 16F84, 16F628, 16F630, 16F819, 16F877 have the same I/O pin structure.
The only needed safety check is that the pin has clamping diodes, which can be checked on each product Datasheet. For the extra careful voltage rating on clamping diodes should be checked too, although it always seem to be 1000V+)
 

@gbarco, the resistor method is only suitable if the VSS pin of the micros is referenced to the other AC wire, in this application a 5V PSU is also connected. Bear in mind that any connection to any part of the incoming AC circuit makes it absolutley unsafe to interface to anything else. It only works when the micro and it's circuit is self-contained and has no outside connections.

Brian.
 

Agreed @betwixt.

Very important not to try this without shared reference voltages.
Trying to do this on an AC that not working as a reference to VSS and GND pins of the PIC may lead to unexpected results since the voltage difference from GND to the peak AC could be anything and be way over the limit of the diodes.

Still very usable for most projects where the PSU is referenced to the same AC signal that we try to interact with.
 

I suggest using a power supply circuit to do this, to convert a 230vac to +5v that can be feed to a microcontroller. It has to be the simplest and safest solution.

230Vac --> small power transformer --> 7805 circuit --> optoisolator --> pic input

Opto-isolator to isolate the high-power circuit from the low-power PIC circuit.
 

Guys thanks for the input, I built a capacitive dropper to regulate the signal to 5V, limited the current to minimum with limiter power resistors at both AC arms. The current is sufficient to drive EL817 optoisolators (i think it's a china version of the PL817, but with only one channel). I connected the transistor side of the optoisolator to Vcc of uCU and the input port. Works like a charm. Is there anything fault in this design?

Please suggest all possible problem to arise. Thanks :D
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top