2
\$\begingroup\$

I would like to power my Attiny13a MCU with a transformerless capacitive power supply. The MCU itself needs only a few milli amps and it will drive 2 LEDs at 15mA each through it's digital pins. So I guess total power consumption might be less than 50mA at 5V.

I have come up with this circuit but I have a few concerns.

enter image description here

  • Would this circuit work fine with my MCU?
  • Sometimes there is a power outage and my home inverter starts supplying square wave ac - will this damage this circuit?
  • Should I use a 65V smoothing capacitor instead of the 25V one?
  • Would those 1/4w resistors do their job or should I get 1/2w ones?
  • Do I really need the resistor before the zener diode? if so is 100R correct?
  • I saw another circuit which has an additional resistor. Is that really needed?

enter image description here

As for safety concern the project will be enclosed in a plastic box placed in the ceiling where no one can reach and I will also add a warning label.

Thanks in advance.

\$\endgroup\$
6
  • \$\begingroup\$ Every part serves a purpose. 100R limits current from 4kV induced transient from lightning. Is it enough? \$\endgroup\$ Oct 4, 2017 at 12:05
  • \$\begingroup\$ I see it's used as a safety-fuse resistor right. So it can be placed in either side of the ac line right? \$\endgroup\$
    – Kokachi
    Oct 4, 2017 at 12:37
  • \$\begingroup\$ sure as long as you don't put scope ground on V- \$\endgroup\$ Oct 4, 2017 at 12:38
  • \$\begingroup\$ This circuit is not mains isolated so you should never connect a scope to it directly unless the mains comes in through a mains isolation transformer. \$\endgroup\$ Oct 4, 2017 at 12:42
  • \$\begingroup\$ @TonyStewart.EEsince'75 So if 100R is not enough then how much would you recommend? \$\endgroup\$
    – Kokachi
    Oct 4, 2017 at 12:48

2 Answers 2

4
\$\begingroup\$

You're trying to make a "capacitive dropper circuit".

The circuit topology looks fine to me but not the component values.

That 1.2uF cap is far too large, make it 470 nF.

Re-calculate that value by following the procedure described here.

You do not want only 470 ohm across that capacitor, it will BURN. The reason to have a resistor there is to discharge the capacitor when the circuit is disconnected from mains voltage. A 1 M ohm resistor is what you want to be using.

The extra 100 ohm resisor is not really needed but can help protection against voltage spikes so I would place it anyway. 100 ohms is OK Ideally you would be using a "fusable resistor" (a resistor which also acts as a fuse).

Would this circuit work fine with my MCU?

Sure, an MCU does not care where the DC voltage comes from as long as it is DC of the correct value.

... supplying square wave ac - will this damage this circuit?

No that should not matter.

Should I use a 65V smoothing capacitor instead of the 25V one?

No, that is not needed as the voltage is not going to exceed 25 V anyway.

Would those 1/4w resistors do their job or should I get 1/2w ones?

Do the calculations and you will know.

Do I really need the resistor before the zener diode? if so is 100R correct?

Since there is already a series impedance (the capacitor) before the bridge rectifier, no you do not need the resistor. However with the resistor you might get a more smooth supply voltage. 100 ohms is a good starting point but it also depends on the current you need.

That 470 uF capacitor is also much to large, a 100 uF would be more than enough.

\$\endgroup\$
9
  • \$\begingroup\$ Thanks for the answer. I have only two X rated capacitor values in hand. 1.2uF and 0.01uf. I also have a 0.1uF X2 safety capacitor but thats rated only 275V AC. I thought that a 100nF cap will only give 7mA of current right? \$\endgroup\$
    – Kokachi
    Oct 4, 2017 at 12:34
  • \$\begingroup\$ Yes, 100 nF will give about 7 mA. If you have two of those 1.2uF caps you could put them in series and that would do the job. With 1.2 uF you would get about 90 mA so the zener diode would dissipate 0.5 W when the MCU is doing nothing. But you have a 1W zener so that's OK. \$\endgroup\$ Oct 4, 2017 at 12:40
  • \$\begingroup\$ don't try UPS on square wave \$\endgroup\$ Oct 4, 2017 at 16:18
  • \$\begingroup\$ @TonyStewart.EEsince'75 how to solve the square wave problem> \$\endgroup\$
    – Kokachi
    Oct 5, 2017 at 5:19
  • \$\begingroup\$ @Bimpelrekkie For the safety resistor I did the calculation P=IxIxR with a 470nF cap and got 0.1W power dissipation but for the 1Mega bleeder resistor I do not know what power rating? \$\endgroup\$
    – Kokachi
    Oct 5, 2017 at 7:07
2
\$\begingroup\$
    1. Minimize C1 as this is big and cost sensitive.
    2. Maximize R1 as yours drains 6 watts.
    3. choose C2 for the right C1/C2 voltage ratio so LDO won't dropout.
    4. Adjust any value and scope V, I or P or RMS and change any value. I just lumped the total load into one 30mA White LED.
    5. Consider a Polyfuse for 100R rated for > 500V
    6. Change my 240V sine (350Vp) to simulate your typical brown out
    7. tweak the design so it's right 1st time and choose Watt size.

Simulate my design changes Rev A

enter image description here

Note there are 2 user push button switches to change simulation mode. Note the 240 square wave will damage the series 100R to Zener. Cap values give <5% ripple V.

\$\endgroup\$
12
  • \$\begingroup\$ Don't use a zener, use a 0.5V dropout LDO I'd still like a zener at the input of the LDO (a zener at max LDO input voltage for example), when the MCU is off, drawing no current, the input voltage could rise too much, damaging the LDO. Or if C2 breaks then at least damage will be limited. \$\endgroup\$ Oct 4, 2017 at 13:57
  • \$\begingroup\$ Good point, lets put the zener back in. then raise R1 to 10M ( cap bleeder) I suggest 330nF and 330uF but a 240V p square wave ia big problem for R1 with 235V spikes.or more \$\endgroup\$ Oct 4, 2017 at 14:50
  • \$\begingroup\$ @TonyStewart.EEsince'75 So the square wave can damage the circuit? Also how did you determine the value of cap 10pF for the MCU? \$\endgroup\$
    – Kokachi
    Oct 4, 2017 at 16:39
  • \$\begingroup\$ not needed just e-cap on zener , that was just stray capacitance so simulation would not make a spike on opening inductive in zero time \$\endgroup\$ Oct 4, 2017 at 18:00
  • \$\begingroup\$ @TonyStewart.EEsince'75 I remember an old post where someone suggested an that I always use a 0.1uF ceramic decoupling cap for ATtiny mcus. \$\endgroup\$
    – Kokachi
    Oct 5, 2017 at 6:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.