Understanding Power Requirements in MCU Applications

Discussion in 'Embedded Systems and Microcontrollers' started by afhaque89, Mar 8, 2011.

  1. afhaque89

    Thread Starter New Member

    Mar 8, 2011
    6
    0
    Hi all! Let me begin by saying I am a newbie, who having built a pressure sensing prototype using an arduino, is now trying to build a standalone pressure sensor.

    My major challenge right now is trying to reduce the size of the overall prototype to where I can ideally run off of coin cell batteries or 3 AAs.

    But I really don't think I understand the process of evaluating the power needs of a given project. Most of the newb resources just assume a 5V power supply...

    What would be most helpful for me is if somebody could walk me through how in this project the author knows to use a 5V power source. I looked at the datasheets of all components used and couldn't quite figure this out.
    (My project seems most similar to this one):

    http://www.avrprojects.net/index.ph...ter&catid=38:avr-projects-with-leds&Itemid=58

    For reference:

    Attiny2313 VCC: 1.8 - 5.5V
    TCN75 (Temp Sensor) Operating Voltage: 2.7 - 5.5V
    Individual LEDs Forward voltage (whatever that means?): 1.8V
    LED Forward Current: 30mA

    All help is seriously appreciated!
     
  2. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    First how long do you want it to run for?

    Ahh LED display, not long on batteries.
     
  3. afhaque89

    Thread Starter New Member

    Mar 8, 2011
    6
    0
    Well... there are a few ways I can look at the run time.

    Ideal scenario #1: As long as possible (Up to a month of continuous run)

    Less ideal scenario: For about a week of continuous run

    Best worst case scenario: It needs to work for 2 hours at a time, with an on/off switch.

    ----------------------------------------------

    This is going to sound stupid... but how do I figure out how long any specific set of batteries will last in my kind of configuration?

    And secondly... why "Ahh" against LED display? Is there a better (more power efficient option)?
     
  4. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    LCD displays are much more efficient but are driven differently than LED displays. Some PICs like the 16F917 have a LCD glass driver built in, not sure how you'd do it with an arduino.
    [​IMG]
     
  5. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    Batteries are rated in Amp-Hours or Milli-ampere-hours. What the number means is that it will supply that amount of current for an hour. It will also supply half that current for two hours or one tenth that current for ten hours.

    Each of the ICs and components in a design can be assigned a number representing the current draw. It is a simple matter of summing the currents and finding an appropriate battery.

    Now for a run time measured in months you should be looking at an average current draw in the micro-ampere range.

    Example: You have a Li-Ion battery that supplies 3.8V @ 1850 Milli-ampere hours. If your board draws 50 micro-amperes then it will last about 4.2 years. If the draw increases to 1 milli-ampere then you will get 77 days or about halfway between 2 months and three months.

    That should give you some ideas
     
  6. afhaque89

    Thread Starter New Member

    Mar 8, 2011
    6
    0
    Well with the Arduino I used a 16x2 LCD display. But that definitely required the 5V power supply. I was hoping the LEDs would take less power... but I guess I was wrong.
     
  7. afhaque89

    Thread Starter New Member

    Mar 8, 2011
    6
    0
    Okay this makes a lot of sense. Thank you! But how does the voltage requirement work? And how do I determine the current draw of the IC? (Sorry for all the questions)
     
  8. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    A typical 2x16 LCD without backlight draws about 2mA, your Arduino (the IC by itself) probably 1mA per MHz. The temperature sensor should show that data in the datasheet.
     
  9. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    A freshly charged Li-Ion battery will output about 3.8 V, that's just a feature of those kinds of batteries. Similarly a fresh alkaline flashlight battery will put out about 1.6 V. Each type of battery has a discharge curve that will show voltage as a function of time with the CURRENT drawn as a parameter. The discharge curve for 10 mA will look different than the discharge curve for 50 mA. A key feature of the Li-Ion battery is that after an initial drop the voltage will stay nearly constant until the battery is almost drained. Then the voltage will head for zero very quickly.

    For the current drawn by various components you have to track down the individual datasheets for each part and find the relevant information. It is in there.
     
  10. afhaque89

    Thread Starter New Member

    Mar 8, 2011
    6
    0
    Okay thanks a lot for your help.

    Your response led me to a new question though. I am actually trying to get away from using the Arduino. At this point I am working towards implementing an ATTiny2313.

    How do I determine the rate in MHz of the processor in my application? As far as I understand this has something to do with the oscillator choice, so how do I determine what crystal to use if any?

    Any reference place would be great. The information has been really helpful so far.
    Okay! So let's say the sensor I am using required a 5V input.

    If I need my application to run off of 2-AA alkaline batteries, can I use a step-up converter to take the initial 3.2V (1.6*2) and take it to 5V?

    And will my step-up converter continue to provide regulated 5V as the batteries begin to discharge?

    Again thanks a ton to you both for the help!
     
  11. mjhilger

    Member

    Feb 28, 2011
    119
    16
    Several of the questions you are asking cause engineers to spend several hours to make choices and tradeoffs. You have been getting great advice already.

    I am not very familiar with the micro you are presenting. However, this info still applies. The speed of the micro is directly proportional to its computational power. An instructions of the micro take x number of clock cycles to execute. Microchip PIC 16xxxx or PIC18xxx take 4 clocks per instruction. So if you have a given time to use your data and do something, then you have to adjust your processor speed to meet that window. If speed is not a big problem, like a digital scale where the user sets down an unknown weight and reads the readings. If it takes 750 milliseconds or 750 microseconds, the user probably will not notice. But 750 milliseconds lets you run the processor at a much lower speed - lower power usage. This is the trade off you must determine.
    Again not familiar with your micro, but many low power micros, allow the clock speed to be switch from a very low speed to a higher speed. So you might be ON but in the very low speed waiting on a key press or something that kicks off your need to process. Then if you need the higher processing power to process, you switch to the faster speed; do you business then switch back down to the slow speed.
    Determining the amount of power (mA's necessary for the micro) can be empirical where you just bound its usage under low usage and high usage and get a good feel.

    You should probably plan on running the micro directly from the batteries. If your sensor requires 5V, several IC's exist to provide 5v from your 2AA's. Check Maxim Max1595 or Max619. I'm sure other manufacturers offer similar also. If you run the micro off batteries and sensor off 5V, you might need to provide interface between the two for proper matching. When you don't need the sensor, you switch off all that circuitry and conserve power.
    This is a lot to throw at you if all this is new, but this is how you design to conserve. And because you are switching things in and out and changing the micro speed, there is no absolute calculation for power usage unless you can provide absolute user usage requirements (like X number of times an hour).
    I hope I have not thrown too much at you. But you asked how you choose speed/power supplies and determine power - this is it.
     
    afhaque89 likes this.
  12. afhaque89

    Thread Starter New Member

    Mar 8, 2011
    6
    0
    Oh I definitely know the value of the advice. I am quickly realizing that there is a huuuge difference between "tutorial follower" and "component chooser/circuit builder".

    Thanks a lot for the explanation on clock cycles. I followed it pretty well. I have no idea how to implement the "wake/sleep" cycles you describe in code... but that is clearly for another day!
     
Loading...