Shop OBEX P1 Docs P2 Docs Learn Events
Power Questions — Parallax Forums

Power Questions

Kit MortonKit Morton Posts: 39
edited 2007-10-19 17:39 in Propeller 1
Hi all,
I am designing a battery powered device and have I have a couple questions.
First because this is a battery powered device, I need to know the battery level. So what is the easiest way to detect battery voltage with the propeller?

Secondly this device has to be shutdown properly. So the propeller has to be able to control it's power supply, so it can turn off when its done. How would I go about doing this?

Any ideas would be great.

Thanks,
-Kit

Comments

  • AleAle Posts: 2,363
    edited 2007-10-18 05:34
    For battery powered devices, the best is to use a DC-DC converter, flyback, boost, charge-pump, whatever you think is more appropriate. These converters will not only giveout clean stabilized 3.3 VDC but also many of them have shutdown inputs. Texas Ins has plenty of them, for instance. I used the TPS60120/TPS60140 with good results, but I do not shutdown completely the circuit, I put it to sleep smile.gif
    I almost forgot, for battery level, I use an ADC smile.gif, in the case of the propeller... a cheap sigma delta ADC per soft could be very useful... connected to a voltage divider

    Post Edited (Ale) : 10/18/2007 5:39:08 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-18 06:27
    The Propeller can do ADC using 2 I/O pins, 2 capacitors, and a couple of resistors. The Demo Board has an ADC like this for use with the microphone. The voltage range is roughly 0-3V, so you'd need to use a voltage divider across the battery to drop the voltage to something in this range. Since there's very little current involved, you can use high value resistors to reduce the "wasted current" in the voltage divider to something in the low microamps range.

    Power switching is always a problem since you don't want the switch to consume much current and, when the processor shuts off its own power you don't want glitches as the Processor's own power drops below where it's working reliably, etc. There are some low dropout regulators with a power enable terminal that reduces the regulator's power consumption to the microamp or even nanoamp level. To turn the system on, you'd have a pushbutton that would pull up this enable pin by charging a capacitor that would hold the enable pin high for a while even if the pushbutton were released. Once the Propeller were to initialize itself, it can set one of its I/O pins high which would keep the enable pin high through a 220 to 470 ohm resistor. To turn itself off, the Propeller would just have to set the I/O pin low. This would discharge the capacitor, drop the enable, and the supply voltage would drop. Eventually, the Propeller's brown-out circuit would force it into reset.

    You could try to keep the Propeller running. If you switch to the RCSLOW clock and stop all the cogs but one, then have that sit at a WAITPNE waiting for an I/O pin to be brought high (by a power on pushbutton), the current consumption would be on the order of microamps. If you use a regulator with a very low quiescent current and low ground terminal current, you might do well enough to just let it run.

    Post Edited (Mike Green) : 10/18/2007 6:36:31 AM GMT
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-18 07:13
    Something like the Charge Pump Ale and Mike refer to looks ideal; the datasheet is very comprehensive wrt all datails. Allowing your system to be rum from two batterie cells only (@1.2 or a.5V nominally each) or - even a 3V Lithium cell (but enough current??) - seems a great advantage in size and weight.

    However when you do not use a precision ADC - or have an independent voltage reference for it - it is of not so much relevance where within (or even a little bit "without") 3.0 to 3.6V the Prop runs!
  • DarrenYDarrenY Posts: 61
    edited 2007-10-19 08:10
    Mike Brown said...

    Power switching is always a problem since you don't want the switch to consume much current and, when the processor shuts off its own power you don't want glitches as the Processor's own power drops below where it's working reliably, etc. There are some low dropout regulators with a power enable terminal that reduces the regulator's power consumption to the microamp or even nanoamp level. To turn the system on, you'd have a pushbutton that would pull up this enable pin by charging a capacitor that would hold the enable pin high for a while even if the pushbutton were released. Once the Propeller were to initialize itself, it can set one of its I/O pins high which would keep the enable pin high through a 220 to 470 ohm resistor. To turn itself off, the Propeller would just have to set the I/O pin low. This would discharge the capacitor, drop the enable, and the supply voltage would drop. Eventually, the Propeller's brown-out circuit would force it into reset.

    What value capacitor would be needed for the 'charging capacitor' ?
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-19 17:39
    The enable pin will be most likely high-imp, so it depends on your own "pull-down", lets say 20k for - say - t=2 seconds => I*t = C*U => C = t *I/U = t/R = 2/20k = 100nF
Sign In or Register to comment.