Saturday, September 25, 2010

MSP430 Low Power Experiment

One of the primary reasons why I got so excited when Texas Instruments announced the Launchpad was because I've been looking at getting into low power embedded systems, which is exactly what the MSP430 architecture is designed for.  After my initial hello world blink programs, I set one of the controllers up with 20F worth of super capacitors and a raw LCD screen to see how long it could run on so little storage.
This was supposed to be a quick little experiment to see exactly how low power these controllers are, but it's been running for more than three weeks already, and there's still another 0.15V left on the capacitors down to the rated minimum voltage...

NOTE: I have built on the progress I made on this project by building the LCD into a full 4 digit low power display, which I am currently using as a clock.  See the write-up for more information.


So, it turns out these little buggers are VERY low power.  Clearly, with the addition of some sort of energy harvesting system, be it solar or otherwise, this controller could clearly run indefinitely.

Parts list:
  • MSP430G2231
  • 2x 10F 2.7V super capacitors
  • 1x 12.5pF 32kHz quartz crystal
  • 1x 4.7kΩ resistor
  • 1x raw liquid crystal display (sourced locally at Halted) (Good possible replacement on Digikey)

How I did it

The key steps I took to get the power consumption so low for this experiment were two-fold.

First, I extensively used the sleep-mode on the controller.  I have it setup to only wake 32 times per second, which means that the rest of the time is spent with only the crystal oscillator running, which consumes VERY little power.

The second trick I used was using a raw liquid crystal display.  LCDs are typically seen sold in large modules with 14-16 pins and their own HD44780ish driver chip.  This is much preferred, because driving the raw LCD is a friggin pain in the ass.  LCDs contain an ionic fluid, which in the precess of a voltage potential will rotate to polarize light in one direction or the other.  With the addition of filters on the front of a screen, rotating the light will cause the screen to appear dark or light.

This voltage potential rotating molecules is great because it draws little current, since the display is based on a voltage, instead of a current like in LEDs.  Unfortunately, this voltage will also start separating the fluid into its positive and negative parts.  Left on for too long (typically on the order of seconds), the LCD fades back to its natural state.  To prevent this, the driver must alternately bias each cell first positively, then negatively.  This is done by alternating the voltage on the back-plane of the LCD, with unlit cells following the back-plane bias to prevent them from being enabled.  This is particularly visible on some LCD-based watches, like the TI eZ430-Chronos, where you can see a flickering as the cells are alternately biased.  I chose a refresh rate of 32Hz, which seemed to work well for my LCD.

As you can see, the single digit of the LCD plus the back-plane consumed all eight pins of the MSP430... Some trickery might be possible to allow these same pins to be used for N.O. push buttons (consider biasing the LCD with only the pull-up/down resistors), but clearly this is an expensive display, from a hardware point of view.  I'm planning to do some experiments with the ICM7211 chip by Maxim to see how well it works at driving an entire 4 digit LCD display.


UPDATE (9/29/2010): This thing is still running... I'll update when it finally dies...

UPDATE (10/11/2010): It's still running.  Caps are down to 1.73V, which is below the msp's rated voltage, but it keeps spitting out numbers.  I don't know if I'm more surprised that the processor is still running, or the LCD.

UPDATE (11/2/2010): Still freakin running.  Caps are down to below 1.7V, hardly above the bias voltage on the LCDs, so you can hardly see the digits and they take half a second to really resolve.  Conclusion is that with a tiny solar panel, this thing could run indefinitely.  I'm going to have to be careful on power budget as for anything else I add, since a single digit display by itself isn't entirely useful.  There is a lot of potential for this controller.  I'm packing it in to free up the breadboard now.  Happy hacking.

UPDATE (2/6/2011): Having disassembled this project after finishing this experiment, I have come back and soldered the circuit together, with all four digits usable.  See the write-up for more information.


  1. oh sweet! Maybe you should let it keep going. Thank for posting the code and the explanation!

  2. Oh, it's definitely still running. I'll update the post when it finally dies. I expected the supercaps to self-drain by now; I've abused them quite a bit...

  3. Fantastic project! I may link to this in my next post on LPM's. (Hopefully I'll get to it soon...)

  4. have you measured the actually current consumption? looking at your code, it looks like Port 2 was left uninitialized so it's probably burning more power than it could because they're floating inputs. the following lines should help:

    P2DIR = 0xFF;
    P2OUT = 0;

  5. Where did you get the super cap's? If you have time and desire, I would be interested in a post about your experience with them.

    I do not know much about super-cap's but am excited about the kind of potential they have for driving an MSP430 design.

    Very awesome small project! :-)

  6. Why didn't you use the MSP430 LCD driver module? I bet it consumes less power than the LCD driver in the LCD screen...

  7. @Adrian: I don't have any equipment to measure current this low. I've been meaning to hack together a current measuring op amp, but just haven't had the need

    @NJC: I got the super caps from Digikey for $4 a piece. They have a relatively high internal leakage rate, but that might just be because I've abused them quite a bit (dead shorts, charging at 2A, etc)

    @Anonymous: G Value series and the few F series in DIPs MSP430s don't have LCD drivers. The LCD doesn't have its own driver; I'm creating my own LCD driver in software. That's why it has so many pins into the breadboard, and I can only drive 7 segments, using all 8 pins. I have some ICM7211 chips in my junk box, so once I have the time I'm going to play with driving all four digits.

  8. Is this still running?

  9. I see those LCDs on the shelves at Halted all the time and never knew how people actually made them work... Good to see one put to use!

    Also, small world..

  10. what is the part # for the supercaps? and (sorry for the blonde question) but how exactly do you charge them, any special circuit? and could you share the part number for the LCD display, it looks really useful.

  11. @logan: The caps are Digikey #493-3295-ND. The super caps will pull as much current as they can until they get to voltage, but I typically rely on my voltage regulators limiting the current to 1-1.5A (One of the nice features of the 7805). If you want a slower, more controller charge, look at the charge circuit on my dot-matrix clock build:

    Note that the large resistors in parallel with the caps are to swamp out the internal leakage resistance of the capacitors to prevent one from leaking current more than the other and eventually over-charging one of them.

    As for the LCD, it is a raw LCD (no controller like the standard HD44780) I picked out of a junk bin at my local Halted for $1. I've been working with another reader to try and find them online, with no success...

  12. These Halted stores. You've mentioned them in the past. I presume they are a chain found only in the region where you live? And that reminds me of the Fryes chain. At one point they planned on opening stores here, and well before the colossal blunder that made 2008 so awful for retail they stopped those plans.

  13. does the east coast have anything like halted or Frye's? Haven't found anything

  14. @Doctor Who: You might find Google a very informative resource on the subject.

    @Anonymous: There are good lists online of salvage electronics stores throughout the US, but I would guess there probably aren't any near by. I would expect you to have to order parts online. Digikey is outstanding.

  15. could you post the lcd config? i mean the pins and how you connect them, thank you so much

  16. The exact pinout is long-lost. The pin connections are purely a function of your specific LCD and the single array of bit fields. Just rebuild the digits[] array for however you happen to hook them up.

  17. Excellent idea. Presently I am trying something similar. I will keep following.

  18. Hello Kenneth,
    I am using the MSP430 to generate sensor data, connected by ADC and want to read it from LCD screen. For the C code, how can I write the ADC data into the LCD? Could you help me with that? Is there any source that I can look up? Thanks.

  19. Hi Keneth,

    Can you tell what is the programming environment you used?
    I've been using Arduino for prototyping but now it's time to skip to a dedicated uC for my project.
    Thank you.

    1. I've been using the Launchpad hardware and Code Composer Studio 5.2 for MSP430, but you may be more interested in sticking with AVR hardware, in which case I use avr-gcc, avrdude, and AdaFruit's tinyISP.

  20. Hi Kenneth,

    Have you ever worked with the AFE Series? I'm trying to use your project as a guide to having my MCU display to a 2 digit LCD via an ICM7211. Thanks

  21. hey i want to reproduce this i have everything but i dont know where i must conect the lcd with the msp430 pins. I have 1 lcd with 27 pins it was of an old casette stereo i have. I would be so glad if you could help on this its for a proyect we must build an egg incubator. Thanks

    1. That completely depends on the pinout of the specific LCD you have. I've found the easiest way to figure out the pinout is to probe the pins randomly with a 5V ~10kHz square wave until segments go dark.

  22. This is awesome. I've been starting myself with aMSP430 launchpad tutorial but had some issues with hardware. I'm still trying to connect it the same way you do. Can you provide some more detailed schematics on how you connected everything?