Calculating Dropper resistors for Opto on Mains - Page 1
Forum section: electronics / general

author: kolbep
author_rank: Frequent Contributor
timestamp: February 05, 2015, 06:27:14 pm
content: :-DDGood Day.I have a NEC2561A Optocoupler, that I want to run off the mains, feeding a PIC pin.Datasheet says :Code:ABSOLUTE MAXIMUM RATINGS (TA = 25°C, unless otherwise specified)Parameter Symbol Ratings UnitDiode Reverse Voltage VR 6 VForward Current (DC) IF 30 mAPower Dissipation Derating ?PD/°C 1.5 mW/°CPower Dissipation PD 150 mWPeak Forward Current*1 IFP 0.5 ATransistor Collector to Emitter Voltage VCEO 70 VEmitter to Collector Voltage VECO 5 VCollector Current IC 30 mAPower Dissipation Delay ?PC/°C 1.5 mW/°CPower Dissipation PC 150 mWIsolation Voltage*2 BV 5 000 Vr.m.s.Operating Ambient Temperature TA ?55 to +100 °CStorage Temperature Tstg ?55 to +150 °C*1 PW = 100 µs, Duty Cycle = 1%*2 AC voltage for 1 minute at TA = 25°C, RH = 60% between input and outputSouth African mains is 230v, so I have tried to do these sums (based on 20mA, which is below the max spec) :V=230x1.4=331I=0.02V=I x RR=V/IR=331/0.02R=16550R=16k5I am running 2 resistors in series due to their breakdown voltage:R1=8k25R2=8k25E Series Resistor, Closest Higher ValuesR1=10kR2=10kSo The current will beI=V/RI=331/20000I=0.01655Or I= 16mAI have a 1n4147 in paralell with the opto's diode, in the opposite direction (to block the reverse voltage from going into the opto's diode).Does this sound right?Also, on the Transistor side, I have a 4k7 from Emitter to Ground.There is a 4k7 from Emitter to the pic pin.The Collector is on the 5v Rail.Are my resistors fine?

author: SeanB
author_rank: Super Contributor
timestamp: February 05, 2015, 06:42:04 pm
content: You could go higher in value on the mains side Pieter, 1mA or so on the output side and depending on the grade you have a transfer ratio of betweel 50 to 300%. Thus worst case input current is 2mA, so best to run the diode at this current range. 47k for each line side resistor ( still a 0.5W unit for voltage rating) will run cooler, and will have around 2.4mA of current through it.Plus is lower power dissipation, and a bigger gap at the zero voltage mark, though if you want to use as a zero cross detector ( and not as a plain "is Eskom still around" input) you will need to use 4 small signal diodes ( the ones you have are fine) to make a bridge rectifier, though the zero cross will be very narrow unless you use a 24V zener diode in series with the LED to increase the forward voltage it turns off at.If just as a detector of voltage use a single inverter ( or buffer) to give a good logic level ( 4069 is fine here, though you can use a regular TTL 74 series as well) and use a simple peak detector to get rid of the 50Hz pulses. If you just use a capacitor across the opto transistor CE connection use a 100R resistor to limit current in the transistor, then it will last longer.

author: dannyf
author_rank: Super Contributor
timestamp: February 05, 2015, 07:05:33 pm
content: 230v/20ma=11k, give or take.Power dissipation is 20ma * 230v=4.6w when on, and 0w when off.If I were you, I would consider something else.

author: Zero999
author_rank: Super Contributor
timestamp: February 05, 2015, 08:19:44 pm
content: If phase shift isn't a problem, you could use a capacitive voltage dropper.

author: SeanB
author_rank: Super Contributor
timestamp: February 05, 2015, 08:29:46 pm
content: Think Pieter will only be able to reply tomorrow, Stage 3 load shedding means most likely the whole South Coast has been dropped back to the candle age.7 hours today of rolling blackouts, and friends have had no power since noon.

author: kolbep
author_rank: Frequent Contributor
timestamp: February 05, 2015, 08:49:17 pm
content: Ok.With the circuit as is, and a 100k resistor on each leg of the opto,On the pic pin, I am getting a waveform of 3 to 3.4vac. It is not dropping below 3v. So that is good, my program logic will be fine with that.The resistors are a slight bit warm (have had it running for about an hour already), but then again I am using 1/4w resistors.... I will definately up it to 1/2 watt.I am using the resistor between the cap and opto (as per your suggestion Sean)...So it is looking good. Now I just need to update my program for the different uC, and different pins, then to wire up the panel.This is my generator controller project that I am working on.The prototype board I have created with Toner Transfer method. And it is mostly through-hole for now (with the Relay driver transistors being SMD, as well as all the LV resistors being SMD).The Relays, Transistors, and Base resistors are all salvaged from faulty Centurion D3/D5 Gate motor control boards.Once this is working fine on a test site, I will get the Chinese to make me some decent boards (which I think will be mostly SMD... But anyway, back to the Garage.And yes, loadshedding is a b*tch. They just decide to switch loadshedding levels without notice, so you go from no scheduled loadshedding, to 1 or 2 periods per day....That reminds me, I must go charge up my 12 alarm batteries, so that I can run my UPS for the TV, Computer, and Lamp for the next 2.5 hour outage.

author: SeanB
author_rank: Super Contributor
timestamp: February 05, 2015, 09:12:53 pm
content: How is the new soldering iron doing with you? That also needs 230VAC to run, though you can convert it to run off 24VDC if you want. So you are using the high CTR parts, and this allows the low current and high resistor values.As to 12V SLA batteries, i have a few left over from the UPS changover, which have capacity of around 3Ah left, so they are now going into replace other cells that decided to die from all the load shedding. Took 60kg of scrap battery so far, and have about 30kg left at home to go as well ( gate battery also died last year, and fence energiser battery December, and access control battery went last week) to go. Also have UPS battery that went kefoof, replaced with a lead crystal one, 60Ah. I need to buy another though, and refill the petrol mix for the generator, though I have enough for a day or two of operation.There are a lot of petrol stations which do not have generators, though pretty much all the Engen ones do have them, so I can fill up at my favourite one easily. Eishkom says you can expect 4 1/2 hours of shedding in stage 3, I had more than that today, though some areas apparently do not have any at all. Must find time this weekend to service the generator as well, but have enough light with it on, using a 125W MV Beka street light I bought at auction as a dummy load to do voltage regulation. Just bypassed the PC control, though I could have put the twistloc in but I would have problems with stray light.

author: NiHaoMike
author_rank: Super Contributor
timestamp: February 06, 2015, 03:03:05 am
content: Maybe it's worth building a bicycle generator?