Computing stuff tied to the physical world

Capacitive transformer-less supply

In Hardware on Nov 13, 2011 at 00:01

The first AC-mains powered current node configuration used a resistive transformer-less supply. It took about an hour to charge with no load, and consumed about 0.26 Watt.

This is an improved version, using a capacitor:

JC s Doodles page 20

(Whoops, I see I forgot to draw the 470 kΩ resistor across the 22 nF cap, to discharge it when disconnected!)

The 4.7 kΩ 1/2W resistor limits inrush current – the worst case being when the cap is empty and plugged in at the top of the AC mains cycle. It’s also a “fusible” resistor, meaning that it’ll act as a fuse when overloaded for any reason. This won’t be enough to protect the circuit, let alone a person touching this circuit, but it will prevent a fire in case of a catastrophic short (which could otherwise pull over 16 amps until the mains fuse blows).

As before, it’s charging the supercap – supplying nearly 1V in this case:

DSC 2724

The 470 kΩ resistor right across that yellow 22 nF capacitor quickly drops the residual charge once unplugged.

Charging appears to go a bit faster, but there’s a problem because I’m running the ATtiny with a disabled brown-out detector (BOD). This means the ATtiny isn’t kept in reset as the voltage ramps up. As a result, it’s trying to run even at low voltages (and is bound to malfunction at voltage levels under 1.8V), but more importantly: it’s going to consume current while trying, which will prevent the supercap from charging! Which is is exactly what I see: the supercap voltage is barely rising above 1.34 V.

The BOD is an important hardware feature for circuits like these. It keeps the ATtiny in reset until the power reaches a certain level. That level is configurable for 1.8V, 2.7V, or 4.3V via the ATtiny’s fuses. In this case, 1.8V seems like the proper value to use – it will be too low for the RFM12B module which requires at least 2.2V, but this way the ATtiny can continue to run correctly even at lower levels, and then decide whether it wants to enable the RFM12B or not.

Unfortunately, I’m going to have to improve the sketch first. Right now, it just starts up and tries to do its thing, without consideration for the current voltage. Leaving the unit on for over two hours didn’t lead to a packet transmission, and only got the voltage up to about 1.8 V, whereas it keeps on rising with the ATtiny disconnected. Clearly, the ATtiny needs to become more aware of its current power state before it can act as a reliable AC current sensor. That’s the trouble with ultra-low power systems: it can be tricky to get them right!

Drat, it looks like I just messed up the fuses on the ATtiny, because I can’t reprogram it anymore. That’s the trouble with low pin-count controllers: it’s easy to mess them up!

Time to go back to separate power supply and JNµ test rigs. Let’s not muddle the issues any more than needed.

The good news is that this supply now consumes half of the resistive version, i.e. 0.13 Watt. Note that the power consumption of the resistive version could have been halved as well (see this comment). So in this case, the extra efficiency of the cap seems to be going into supplying a bit more current, i.e. charging the supercap faster.

Progress nevertheless (says the optimist): lower power consumption, faster start-up!

  1. Is there any particular reason to use a 0.47F super-capacitor? If you can make it smaller, say, 470uF, the charging speed will be much faster, and it should still be big enough to support sending a RF packet once in a while. The suggestion is to increase the capacitance of the X2 capacitor to at least 0.22uF. The 22nF capacitor you are using results in large reactance (about 120K under 60Hz), which limits the charging current to only about 1mA.

    • Sorry, what I meant to say is ‘Another suggestion is to increase…’.

    • The 22 nF is intentional: 1 mA @ 220V = 0.22W (if it were resistive), which is already on the high end for my purposes. I’d like to have probably up to 2 dozen of these around the house eventually, each drawing no more than around 0.1W. Not there yet, but I hope to get enough energy out of a 1 mA trickle to keep an AC power monitor going with a packet every 10s or so. See upcoming posts… you’re a little ahead of me with your suggestions :)

    • I could be wrong but I thought a capacitor doesn’t dissipate power (except on its internal esr) because its voltage and current are always out of phase in an AC circuit. So the only power dissipation will come from the 4.7k resistor, X2’s internal esr, and the zener diode, which should sum up to be very small. But my electronics knowledge is very primitive, so I could be totally wrong :)

  2. While you are staying with the large storage/minimum consumption model, might I suggest splitting the IN4148’s. One ahead of the supercap is the reverse blocker, the one after provides the forward diode drop you need downstream. The cap “aims” higher and energy stored is proportional to that V squared.

    I’d include a 0.22uF decoupler after the final diode, I’m wary of the high frequency ESR of the supercap, unless the loads have sufficient local decouping already.

    When RSTDISBL allows the RESET function on Pin1, I think that ADC0 is still selectable. That should give a chip Vcc estimate via the internal pullup to decide the state of charge. The dV/dt is roughly constant if the chip is put to sleep while waiting for a healthy supply rail.

    Is there enough in the power budget to run an integer FFT on a small number of sampled half waves? Aligning to the zero crossing point and ‘faking’ the missing negative-going values will be reasonably effective. Turns out an accurate hardware zero-cross detector (and hence Hz estimator) is non-trivial.

  3. Does that mean I can extract more energy @ 4V with say 9V and a 5V zener than with 4.7V and a 0.7V forward diode drop? (ignoring for the moment that the supercap only goes up to 5.5V)

    I’m not sure you need the RESET / ADC0 trick. One way to determine VCC is to use it as ADC supply, and then measure the 1.1V band-gap relative to it. I think that works on an ATtiny as well.

    I really like the idea of the FFT / zero-crossing. So you’re saying we could try to estimate the 50 Hz phase from the ripple and charge curve on the supply voltage? Hm, that’d be really cool – then a real power estimate could be done, even with inductive load – at no extra cost in circuitry!

    I think my first goal needs to be to get this capacitive supply + a suitable cap dimensioned properly to keep the JNµ going as AC power detector. Once the hardware is stable, there’s lots of tricks we could try to play to get the maximum amount of information out of the supply and current-sense signals.

    Stay tuned – I’ve done some experiments already, so there are a few more weblog posts queued. But I don’t want to spoil the fun… meanwhile, I’ll think some more about this. An ATttiny can do quite a bit with very little energy, the only serious Joule-consumer really is the RFM12B in transmit mode.

  4. You supply(and the whole circuit) actually consumes less. The 22n cap will limit the current to about 1.5mA, but on a positive half wave you get the zenner conducting and dropping 5.1V and on the negative half you have just a diode. So your total power disspiation is `(1.5e-3)^2*4.7e3 + 1/2*1.5e-3*5.1 + 1/2*0.7` = 15mW aprox. This is active power, reactive power is not measured.

    BUT BUT BUT BUT! there is a problem. It depends on what zenner diode you have used. A zenner diode needs a minimum current flowing through it to ensure that the voltage across it goes to the specified one, 5.1V in this case. For a 1W zenner(the ones i can typically find) this can be as high as 10mA, but it is really manufacturer dependent. You should fin a 5.1V 0.2 or 0.5W diode that requires a current on the order of micro amps to work. So, it might actually be the diode that limits your voltage rising. I’ve had this same problem with a lower current circuit, microamps inplace. I ended up using a 12V zenner followed by a 3.3V regulator with a quiescent current of microamps. When there was no load, the voltage across the zenner went up to 10V, when there was load, it dropped till about 5, so at no moment it actually functioned as a zenner diode regulationg to 12V(except at power up in transient).

Comments are closed.