At 02:31 1998-10-04 +0000, you wrote: >Seth Fischer wrote: >> Is there a better or more efficient way of obtaining 5V d.c. with a >> small compact circuit? > >Depends on the current you want. ;-) A PIC doesn't take much, but are >you driving anything with it? > >I've never done it, but I've seen described a simple high voltage >capacitor, then a diode forward biased, then into a 5V2 zener with an >electrolytic capacitor across it. - The posted schematic censored, because : - You cant have a diode in series with the cap, then it will only give power on the first cycle. Instead, simplest allowable: X2 cap O--[R1]--+--||---. Line | | 1N4001 '-[R2]--X----AK----+-----O +5V | | 230VAC 5V6 K --- + Zener A --- Elytic Neutral | | O----------------+----------+-----O 0V In the power cycle, as the voltage rises positive current flow thru X2 cap, voltage is limited by the zener, and fed to the elytic; as voltage go down the zener works in forward and charges X2 cap with mains negative peak voltage. You need an series resistor R1 to limit inrush current; Think about when this device is connected to mains during 230VAC peak voltage which is 320V. Or if shortly disconnected during positive peak, and reconnected during negative peak, (connecting using bad connectors, or switch) the cap has to change voltage by 640V. Huge peak! R1 should be wire wound or carbon composite to survive peaks well. Also check the stated max voltage peak for the resistor, it should stand the very high peaks that can occour in the mains net! I use to dimension R1 resistance and power for 20 to 50 V RMS drop, and select at least double power rating to survive peaks better. Also, if disconnected during cycle high voltage, the wall plug will be dangerous to touch. Therefor a resistor R2 should discharge the X2 cap from 300V to 50V in half a second (my opinion). The peak voltage is limited by the cap so a class 350V resistor is probably enough. Measure the RMS voltage you get, and calculate the power the resistor has to withstand. The cap should be X2 type. Theese can take lot of over-voltage. To calculate current: it is charged 50 times per second from -320 to +320V minus the peak viltages across the limiting resistor, minus the putput voltage, minus two diode forward drops, approximate total 570V charge. I= 50/s * C * 570V Also the current through R2 contributes, but not with all currens it supplies, as it is not in phase with the cap current. The zener should be at least 1,3W type to handle the rush current. To cheaply double current, use the current through X2 cap both ways: X2 cap O--[R1]--+--||---. _____ Line | | | | '-[R2]--+-|AC +|--------+-------+-----O +5V | | | | | | 5V1 K --- + | | Zener A --- Elytic Neutral | | | | O------------------|AC -|--------+-------+-----O 0V |_____| Full wave rectifier But here you can«t as easily control a TRIAC as neither PIV Vdd nor Vcc ar commont to any mains line. Possible to couple the signal around though, but better solution is the discrete capacitive pump described below, applied on the first cirquit. However, with bothe the designs above there might be undesirable high noise and spikes on the output. Also, specifically with the first one, the voltage will drop some between charge pulses. Two solutions: Select higher voltage for the above zener, and 1) add a 70L05 or better. (78L05 consumes pretty much power itself) 2) add a second shunt regulator ( R and Zener, and probably poutput cap ). In the case 2 you can omit hte first zener after selecting the elytic to withstand highest possible voltage. To get more power there ar lot of more tricks. For instance use a capacitive charge pump. No need to use those relatively ecpensive ready-made chips. Instead build a discrete, that operates directly on the input, after the X2 cap and input resistor. For a current doubler: Design it to during the charge cycle charge two small elytics in series, and during no charge, connect them parallel (one of them is the output cap from which you get continuous power out. It only takes one transistor, two 1N4001 and two 1N4148 diodes and a resistor, if i remember correct. I leave the rest as a practice for the interested ;) (I have not seen the design anywhere else, but designed it for a very peculiar application where i had to get the supplu power from very weak pulses.) Using charge pumps and other tricks we can 1) Use smaller X2, R1, and R2 = cheaper, smaller, less heat 2) If heat is not a big concern, maybe omit the expensive components X2 and R1, just using R2 (with higher voltage capability needs) It is of course also pretty easy to extend the designs to generate negative and/or multiple voltages. When testing: remember that you are working with mains power! A isolation transformer is very good for laborating. Theese cirquits are even more exciting than assembler! :) Have fun /Morgan / Morgan Olsson, MORGANS REGLERTEKNIK, SE-277 35 KIVIK, SWEDEN \ \ mrt@iname.com ph +46(0)414 70741 fax +46(0)414 70331 /