Computing stuff tied to the physical world

Delayed power-up

In AVR, Hardware on Sep 9, 2012 at 00:01

To recall yesterday’s reasoning, I’m looking for a way to keep the RFM12B from starting up too soon and drawing 0.6 mA before the microcontroller gets a chance to enable it’s ultra-low power sleep mode.

The solutions so far require an extra I/O pin, allowing the microntroller to turn power on and off as needed, with the extra detail that power stays off until told otherwise.

But all I’m really interested in, is to keep that RFM12B from powering up too soon. After that, I never need to power it down again (and lose its settings) – at 0.3 µA, the RFM12B’s sleep mode will be just fine.

One solution is to use a dedicated chip for this, which can reliably send out a trigger when a fixed voltage threshold has been exceeded. That would still need a MOSFET, though, so this increases the cost (and footprint) of such a solution.

The other way would be to create a low-speed RC network, gradually charging a cap until a threshold is reached and turns on the MOSFET switch. Lower cost, no doubt, but in fact not flexible enough in case of a very slow power-on voltage ramp, as in the case of a solar cell charging a supercap or small battery. There is just no way to determine how long the delay needs to be – it might take days for the power rail to reach a usable level!

Yet another option is this little gem (thanks for the initial suggestion, Martyn!):

JC s Grid page 32

No I/O pin, no pull-up, nothing!

This trick takes advantage of what was originally considered a drawback of MOSFET switching: the fact that the gate voltage has to reach a certain level before the MOSFET will switch. Assuming that voltage is say 1.5V, then the MOSFET will be turned off as long as the power rail has not yet reached 1.5V, and once it rises above that value, it’ll automatically switch on. Magic!

Does it work? Well, I’m still waiting for some P-MOSFETs to arrive, but I’ve done a little test with an N-MOSFET, connected the other way around and using a 1 kΩ resistor as load. We can look at that combination as a component which has only two pins: a power rail and ground.

If the circuit works as expected, then when applying an increasing voltage, no current will flow until the threshold has been reached, and then it’ll switch on and start drawing current.

As it turns out, this is very easily observable using a Component Tester – like the one built into my scope:

SCR06

The horizontal scale is the applied voltage (from about -5V to +5V), the vertical scale is the current through that component (from about -5 mA to +5 mA). The straight slanted line is characteristic of a 1 kΩ resistor.

But the interesting bit is that little dent: from under 0V to about 1.5V, the circuit draws no current at all. Once 1.5V or more are applied, the circuit starts conducting, and behaving like a plain 1 kΩ resistor again.

Woohoo, this might actually work: just a single P-MOSFET would be all that’s needed!

  1. First off, I absolutely love this blog. This is my first comment, but I’ve been reading it for quite some time now. Now that I have that out of the way…

    It strikes me that given a very slow charging ramp the MOSFET is going to be in its linear zone for quite a while, conducting a little bit of power but not much. What seems likely is that when the supply voltage gets high enough (barely) to turn the gate on it’ll start the load and pull the supply voltage a bit lower, shutting the MOSFET back off. This is all theory of course, I’d like to test it myself but my scope is 100% analog and hence not useful at these time scales.

    In any case, I look forward to seeing how it works for you.

    • I share your concern. Suspect that gradual switching won’t cut it for really slow-rising supply levels. Hope to find out in the coming week… (and thx, glad you like it!)

  2. did you ever consider using the reset signal for the microcontroller as the (control of the) supply for the RM12b ?

    I’m assuming (read: to lazy to look up) if you actually use the reset or that the microcontroller just starts when some voltage is reached.

  3. When you delay powering up the RFM12 outside of the microcontroller’s control, how does the µC then get to know that the RFM12 has just started, so that it can bring it to low power mode ASAP?

    • Good point – I was thinking of just trying periodically to access it over SPI. But in the end, I’m going to dedicate a JeeNode Micro I/O pin to this, it’s must easier to manage, and there is one spare pin – given that the ATtiny84 only needs to support 2 ports.

  4. How much load current capacity do you need? Could you just run the RFM12b’s ground to the microcontroller pin? Then you just switch the pin to output low to turn on the RFM12b. Microcontrollers can generally sink more current than they can supply.

    • About 25 mA. A bit more than one pin can handle (the ground level will rise too much, I suspect). Also, since ground is now effectively through a resistor, it’ll actually change depending on load. This is likely to mess up the SPI communication logic levels.

      A few I/O pins in parallel might work, but I don’t have that luxury.

Comments are closed.