230VAC -> 2mA@11VDC 1MHz@3.3Vcc 1mA MPU to drive 50Wmax AC mosfet switch - Page 1
Forum section: electronics / projects

author: szan
author_rank: Regular Contributor
timestamp: December 03, 2022, 09:04:32 pm
content: Hello,I need to drive 50W 230VAC IR light bulb by using AC mosfet switch controlled by small 8bit MPU 1MHz@3.3Vcc*1mA.I've designed such simply 230VAC -> 2mA@11VDC PSU where one of 3.9Vz diodes will be used also as source of true randomness coming from Zener diode avalanche noise ~2V input to ADC MPU pin.MPU will have another one 100nF capacitor and fixed 3.3Vcc with BOD enabled.It looks good in this simplehttp://www.falstad.comsimulation.What do you think ?PS: Of course do NOT try this at home unless you know what you are doing.

author: moffy
author_rank: Super Contributor
timestamp: December 03, 2022, 11:18:32 pm
content: A simple low current PSU from mains that avoids the dissipation of the 100k dropper resistors and uses an X type (Mains self healing) cap instead. It avoids the dissipation and is compact, simple and widely used. Please note components were chosen for convenience of sim not necessarily final design values.

author: szan
author_rank: Regular Contributor
timestamp: December 04, 2022, 12:34:56 am
content: Quote from: moffy on December 03, 2022, 11:18:32 pmYep, I know, but when this high voltage capacitor fails in your design, it will be disasterSmall power dissipation shouldn't be a problem, since it is expected to be less than 1W in my design.

author: moffy
author_rank: Super Contributor
timestamp: December 04, 2022, 12:45:03 am
content: Quote from: szan on December 04, 2022, 12:34:56 amThe 100 ohm resistor acts as a fuse, so if the cap fails the resistor goes open circuit, no problems.

author: szan
author_rank: Regular Contributor
timestamp: December 04, 2022, 01:25:48 am
content: Quote from: moffy on December 04, 2022, 12:45:03 amIt will depend on the size of this 100R resistor - if it will be too small/short than you can have current flow with corona discharge in the air, so my idea is to immerse this circuit in black hot glue or paraffin inside concrete bottom base to avoid any air under/above PCB and it will help additionally to dissipate heat from those current limiting resistors.It could be better to add glass fuse instead of resistor as a circuit breaker

author: mag_therm
author_rank: Frequent Contributor
timestamp: December 04, 2022, 02:29:21 am
content: Quote from: moffy on December 04, 2022, 12:45:03 amHi Moffy,Can you add to your plot of post#1 ?: the instantaneous power in and voltage across the 100 Ohm resistor when circuit is switched on at -85 degrees of the 240V, for 0 to 100 us.You can add a LISN if needed.It would be interesting to see approximate I^2*t in that resistor:at switch onat self healingat short circuit of one of the capacitors

author: moffy
author_rank: Super Contributor
timestamp: December 04, 2022, 04:25:50 am
content: Quote from: mag_therm on December 04, 2022, 02:29:21 amI have included the LTSpice file .asc, so if you want to try it out go ahead.

author: Zero999
author_rank: Super Contributor
timestamp: December 04, 2022, 03:31:06 pm
content: There's nothing wrong with using a capacitive dropper. Use a self-healing capacitor, designed to fail open circuit and it taking out the rest of the circuit will be a non-issue. The 100R resistor will not pop if it's appropriately sized. It doesn't have to be too big, as the peak power rating of wire wound resistors can be a many orders of magnitude greater than the continuous.Regarding the schematic in the original post: what do the SCRs do? The DC voltages on the capacitive divider on the DC side will be purely defined by the leakage currents of the capacitors, which will be unpredictable.If zener diodes are being used for noise, then use a higher voltage zener, which will be more noisy than several lower voltage ones. There's also an optimal current, at which point the noise will be the highest. 2mA is probably too high for most zener diodes, noise wise. It will need multiple stages of filtering to make sure the noise is higher than the ripple.Just use the standard bridge rectifier with a series resistor.

author: mariush
author_rank: Super Contributor
timestamp: December 04, 2022, 03:51:41 pm
content: Capacitive dropper power supply would be fine. Use a diode for half wave rectification, a capacitor and a resistor ... job done.See the appnote from Microchip where you have a couple designs of transformerless power supplies :https://ww1.microchip.com/downloads/en/appnotes/00954a.pdfCould also just use a LR8 linear regulator :https://www.microchip.com/en-us/product/LR8Goes up to 450v input voltage, 12v voltage drop, up to 10mA outputUse a diode for half wave rectification, a tiny capacitor (just enough to guarantee at least 16-20v on the linear regulator at all times) and the regulator will spit out 3.3v at up to 10mAA 5.6v zener followed by a few diodes to drop 5.6v to 3.3v would also work and use little space.

author: szan
author_rank: Regular Contributor
timestamp: December 04, 2022, 06:39:13 pm
content: Quote from: Zero999 on December 04, 2022, 03:31:06 pmI do not think so, while I've implemented in MPU software special algorithm to obtain bits coming from ADC noise voltage input (~2V in my design on 3.3Vcc ), but TRNG at cryptopgraphy level is not needed in this design, so in parallel PRNG computes bytes which are used to turn ON/OFF (for full 230VAC 50Hz period based on PC814A connected to MPU interrupt to sense mains wave) which IR 100W limited to 50W just by adding in series diodeWhen we are talking about SCR it is not full AC mosfet switch, but thanks to diode in series with mosfet (IRF830-500V-N-channel-mosfet total gate charge ~40nC@10V) on the bottom I've common ground since this IR 100W light bulb is powered by half wave of oryginal 230VAC, so idea is to let mosfet turn it on all the time and conduct, while when MPU will be ready to pull down mosfet gate to ground, let it go in some random pattern imlemented in MPU software, so by default when MPU will will not be able to controll this light bulb, AC powered circuit should provide enougth voltage to mosfet gate to keep this something like half AC mosfet switch open by defaultAnyway, I have 0.5A 230VAC fuse and ~275VAC MOV to protect input of this few mA 11Vdc PSU, which is quite standard way in the case of mains powered circuits.

author: szan
author_rank: Regular Contributor
timestamp: December 04, 2022, 07:06:54 pm
content: Quote from: moffy on December 04, 2022, 04:25:50 amI have included real images thanks to company which makes fuses instead of using fusible resistors

author: szan
author_rank: Regular Contributor
timestamp: December 04, 2022, 08:46:03 pm
content: Quote from: mariush on December 04, 2022, 03:51:41 pmA diode 1N407 will be used for half wave rectification to provide by default half power to IR oryginal 100W so we'll get without any MPU controll 50W, which means we extend significantly its lifespan and this is something I've already tested for a long time in my room as aditional source of positive IR red light energy, especialy at those winter days in Europe we have nowNow I've used Maxima A Computer Algebra Systemhttps://maxima.sourceforge.io/to estimate current loses at 11Vgs by using simple 100k/1M resistors on IRF830 500V N-channel-mosfet with total gate charge ~40nQ@10V :Code:(%i1) nQ: 10^(-9);1(%o1) ----------1000000000(%i2) V0: 11.0;(%o2) 11.0(%i3) Q: float(40*nQ);(%o3) 4.0e-8(%i4) C: Q/V0;(%o4) 3.636363636363636e-9(%i5) k: 1000;(%o5) 1000(%i6) M: 10^6;(%o6) 1000000(%i7) Rt: 100*k;(%o7) 100000(%i8) Rb: 1*M;(%o8) 1000000(%i9) R: Rt+Rb;(%o9) 1100000(%i10) V(t):=V0*exp(-t/(R*C) );- t(%o10) V(t) := V0 exp(---)R C(%i11) R: Rb;(%o11) 1000000(%i12) V(0);(%o12) 11.0(%i13) V(1);(%o13) 4.077652026618331e-119(%i14) T: float(1.0/50);(%o14) 0.02(%i15) V(T);(%o15) 0.04495448582310473(%i16) V(T/2);(%o16) 0.7032064732737833(%i17) V(T/4);(%o17) 2.781235553852211(%i18) Hz: 1;(%o18) 1(%i19) T/2;(%o19) 0.01(%i20) ms: 0.001;(%o20) 0.001(%i21) T/2/ms;(%o21) 10.0(%i22) V0/(Rt+Rb);(%o22) 1.0e-5(%i23) mA: 0.001;(%o23) 0.001(%i24) 1.0e-5/mA;(%o24) 0.01(%i25) V0/Rt/mA;(%o25) 0.11(%i26) R: Rt;(%o26) 100000(%i27) V(0);(%o27) 11.0(%i28) V(0.001);(%o28) 0.7032064732737829(%i29) V(T/2);(%o29) 1.253991038348787e-11(%i30) V(0.1*ms);(%o30) 8.355293355474654(%i31) V(0.5*ms);(%o31) 2.78123555385221(%i32) V(T/10);(%o32) 0.0449544858231047(%i33)It looks good in those calculations, since I've 10ms to turn ON/OFF while monitoring 230VAC mains voltage by using PC814A optocoupler connected to MPU interrupt on its failing edge pulled to 3.3Vcc.Now it is time to design real schematics and PCB in Kicad (5.1) and make prototype by using simply thermal transfer then it will be Made in Germany (not china)BTW: MPU will have 512B bootloader capable to update by using... audio output of any PC laptop or maybe even android WAV player thanks to 1 wire optoisolated MPU pin used as encrypted bootloader powered by 5V usb to opto simply PC814A basewd interface

author: szan
author_rank: Regular Contributor
timestamp: December 04, 2022, 09:18:44 pm
content: Here is the victim of our 230VAC control experiments - 100W IR red light bulb - we want to turn it into an artificial sun at home or even something capable of programming dreams by changing the intensity of the IR radiation by using sophisticated MPU software using TRNG to make contact with UniversePS: Here we have already 1N4007 diode in series with this IR red light bulb, so by default we have mentioned half wave 50W @ 50Hz flickering instead of its oryginal 100W 230VAC 100Hz flickering, but we want to manipulate its output power below 50W to around 25W or so but in a non deterministic way but by including some kind of random patterns to its output, so that is why MPU is used

author: Zero999
author_rank: Super Contributor
timestamp: December 04, 2022, 09:32:19 pm
content: Quote from: szan on December 04, 2022, 06:39:13 pmI'm going from my experience of using a zener for an audio white noise generator. The current to the zener needed to be filtered to reduce mains hum down to an imperceptible level. I suppose in this case the filtering of the output can be done in software.QuoteWhat are you talking about? I was asking about the SCRs in your original schematic, near the bridge rectifier. They appear to be not needed.Are you taking the zener noise from the potential divider across the 3.7V? That 100µF capacitor across the 3.7V rail will get rid of most of the noise.Quote from: szan on December 04, 2022, 08:46:03 pmHe's talking about using a capacitive dropper for the DC power supply to the microcontroller. Read the application note he linked to. Here it is again.https://ww1.microchip.com/downloads/en/appnotes/00954a.pdf

author: szan
author_rank: Regular Contributor
timestamp: December 04, 2022, 10:22:57 pm
content: Quote from: Zero999 on December 04, 2022, 09:32:19 pmI do need them since I want to detect the middle of the full 230VAC 50Hz 20ms period, so I need to feed half wave ONLY to get only ONE failing edge on MPU interrupt pin connected to PC814A output pulled up to MPU 3.3VccIf didn't used diode in the PC814A input, than I could get 2 interrupts per 20ms 50Hz mains, so I wasn't able to detect start of full 20ms mains periods and synchronize with IR light bulb which already has 1N4007 diode and I'd like to turn on/off this thing using N-channel mosfet when it doesn't output any power.It is easy to do when you put diode(s) at the input of PC814A as shown in concept schematics marked in red colour by youAdditionally this lower down power dissipation in those 2x100k resistors connected in series with PC814A.BTW: When those additional diodes a used in series withh PC814A, PC817 could be used as well (with additional diode in parallel on its inputs just in case), since for the moment I'm interested in detecting full 50HZ 230VAC mains 20ms periods, not 100Hz 10ms ones.

author: Zero999
author_rank: Super Contributor
timestamp: December 04, 2022, 11:05:20 pm
content: Quote from: szan on December 04, 2022, 10:22:57 pmWhere's the opto-coupler on your schematic?There are better ways to do zero crossing detection, which don't need an opto-coupler and SCRs, assuming no isolation is required.

author: szan
author_rank: Regular Contributor
timestamp: December 05, 2022, 11:10:41 am
content: Quote from: Zero999 on December 04, 2022, 11:05:20 pmI use AC opto-coupler PC814A to sense 230VAC@50Hz half sine wave and in MPU software pin change interrupt can be used to estimate zero cross time as well as maximum voltage, so I'm able to synchronize to full periods of mains sine wave and turn on/off half AC mosfet switch when light bulb outputs minimum power - in this case while I have 1N4007 diode in series with light bulb, I'm able to detect 10ms period where there is no power output, so I have a lot of time to control N-channel mosfet.

author: Zero999
author_rank: Super Contributor
timestamp: December 05, 2022, 11:23:27 am
content: Quote from: szan on December 05, 2022, 11:10:41 amOh, I see they're not SCRs, but diodes. The PC814A is not an AC opto-coupler. It only has one LED emitter. Either way, it's not needed, as the MCU is powered off a non-isolated PSU.Take the zero crossing before the bridge rectifier, with an additional diode to prevent the filter capacitor backfeeding. I made a mistake on my previous post so deleted the schematic. Here's the corrected version.

author: szan
author_rank: Regular Contributor
timestamp: December 05, 2022, 03:21:16 pm
content: Quote from: Zero999 on December 05, 2022, 11:23:27 amPC814 is AC input photocoupler and I need it since I might need for testing purposes power MPU from battery and debug its pins by using logic analyser connected via USB to PC laptop, so it helps a lot.

author: mag_therm
author_rank: Frequent Contributor
timestamp: December 05, 2022, 07:02:47 pm
content: Quote from: moffy on December 04, 2022, 04:25:50 amI ran your circuit in qucs, Thanks.In case anybody is inclined to use that circuit: ( and check following calculations before using)For normal operation, switch on, when the 1 uF capacitordoes not fail:The switch on voltage for example at -85 degrees applies about 300 Volt across the 100 Ohm.The instanteous power in the resistor is about 1080 Watt, with an average of about 500 Watt over 150 microsecond.I looked at two ratings of the 100 Ohm sacrificial resistor1206 0.25Watt eg Yageo data sheet.That resistor has a maximum rated voltage of 5 V, and its maximum overload Test voltage is 12.5 V.So it would be exceeding its test voltage by 25 times during normal switch-on.Maybe it would melt at first switch on.2512 1 Watt to 3 Watt eg Multicomppro Pulse Withstanding Resistors series MCPWThat resistor has a single impulse rating tested by 50 pulses at 1 minute intervals for a resistance shift of 1%.The rating for the 100 Ohm resistor is about 500 Watt for a pulse of 150 microsec (last graph in datasheet)So it is on the limit, might survive in normal switch-ons.The question is then, whether the sacrificial resistor of that high pulse rating would open early enough in the positive half cycle upon short in the 1 uF.The 11V Zener CDZV11B has a rated current of 5 mA and absolute max of 100 mW , 9 mA.If the 100 Ohm did not open before 5 millisec of the half cycle, that output voltage would increase to 20 Volt by the zener's impedance.I have also seen zeners fail to Hi Z, if so the zener would not protect the electro or output voltage during the following half cycles.The Microchip Doc AN954 refers to UL requiring input fuses and varistor.I didn't find latest UL docs, anyway have no need to purchase them.

author: Zero999
author_rank: Super Contributor
timestamp: December 05, 2022, 09:48:34 pm
content: Quote from: mag_therm on December 05, 2022, 07:02:47 pmYou've selected the wrong components.1) Use an X-rated suppression capacitor, which will not fail short circuit.https://www.ttieurope.com/content/dam/tti-europe/manufacturers/kemet/resources/Kemet%20Safety%20Capacitors%20Overview.pdf2) Use a wire wound resistor, with a high peak power rating. Thin film resistors are crap at handling high instantaneous power pulses.https://4donline.ihs.com/images/VipMasterIC/IC/VISH/VISH-S-A0011539484/VISH-S-A0011539484-1.pdf?hkey=6D3A4C79FDBF58556ACFDE234799DDF03) Who cares if the zener pops? If there's a really big voltage spike, such as a lightning strike, the whole thing will be toast anyway. A MOV will protect against small spikes, but there are lots of perfectly reliable products without them.

author: mag_therm
author_rank: Frequent Contributor
timestamp: December 05, 2022, 10:00:46 pm
content: I didn't select the components, I modelled the circuit proposed by Moffy, where he wanted the 100 Ohm resistor to be a protective device.I was trying to show that if it is to be a protective device to prevent overvoltage on output, it might fail at switch on.

author: Zero999
author_rank: Super Contributor
timestamp: December 05, 2022, 10:25:48 pm
content: Quote from: mag_therm on December 05, 2022, 10:00:46 pmIt won't fail if the correct type of resistor and capacitor are used.Another way of ensuring safety is to use a fusible resistor, which is flame proof and designed to fail open circuit, without blowing up and causing a fire, but it's impossible to protect semiconductors such as the zener diode.https://www.ttelectronics.com/TTElectronics/media/ProductFiles/Application-Note/UL-Recognised-Fusible-Resistors.pdf

author: szan
author_rank: Regular Contributor
timestamp: December 09, 2022, 12:05:54 pm
content: Quote from: Zero999 on December 05, 2022, 10:25:48 pmIt is not life critical application, but simply controling 50W-100W IR light bulb and additionally PCB will be hidden inside concrete bottom sealed with black hot glue.MPU will have installed boot loader capable to upgrade its software by using optical insulated one wire encrypted interface (PC814A) on one of its pins, so it can be easy upgraded when needed even by using smarphone/PC audio jack by soundI'll provide Kicad schematics there - the only problem to solve right now is to have a common ground to rectified full bridge 230VAC mains vs half wave rectified load and AC mosfet as a switch controlled by MPU, however I think I've found solution, so I will send more detailed circuit schematics, since those circuit concepts send in one of my posts were made by using FALSTAD simulator as a feasibility study.Anyway, I'll use 1A fuse with MOV and will not play with any kind of a fusible resistor after watching those OMG images provided by Littelfuse

author: szan
author_rank: Regular Contributor
timestamp: December 09, 2022, 06:01:09 pm
content: Quote from: mag_therm on December 05, 2022, 10:00:46 pmI've decided to use classic fuse and MOV (in parallel to mains of course) to be able easy replace fuse and my guess is that 1A@230VAC should be fine since I use 100W IR light bulb which already has diode 1N4007 in series to limit its power down to half so it is about 50W, but of course switch on when it is cold (room temperature 22*C) might cause temporary higher current draw than expected: 50W/230VAC@50Hz ~217mAHowever, probably it will be good idea implement in MPU software something like 1s or more soft start where MPU turns off light bulb at the begening of its code and than turns on 16th, 8th, 4th, 2th, 1th half wave 230VAC mains period to ensure light bulb turn on slowly for its rated 100W/2 ~50W power when the circuit is turned on.Anyway, IR light bulb will be always turned on at very low power output (~0W), so it also should help not to fire 1A fuse in series with this load and half wave AC mosfet switch at the bottom.Additionally, some kind of soft start implemented in MCU shoukd help extend overall lifespan of this 100W IR light bulb, however it is already done by limiting its output power to 50W@230VAC simply by installing in series 1N4007 diode and It works since I've many such 100W IR light bulbs running for months right now in my room