1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

How to turn off Attiny?

Discussion in 'AVR' started by Drew Keyes, Feb 19, 2014.

  1. Drew Keyes

    Drew Keyes New Member

    Joined:
    Feb 19, 2014
    Messages:
    3
    Likes:
    0
    Location:
    Miami, FL
    I am using an Atmel Attiny 45 as an embedded chip on a project that I’m working on. It is my understanding that once turned on, this chip cannot be turned off without disconnecting its power source. I’m using a 3 V battery and would like to know the most effective way to have it (the chip) disconnect itself from the power source. I should mention that this device may not be used for months, thus it does need to be turned off. Should I use a relay, latching switch or other device or method unknown to me? I have very limited space within which to house the circuitry. Thank you for your replies.

    Drew
     
  2. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,254
    Likes:
    961
    Location:
    Loveland, CO USA
    I am not good with the Atmel Attiny 45 but:
    Slow down the clock! It is programmable. You can divide the clock by 1 through 256. The power is very much related to clock speed.
    Shut down peripherals like the ADC.
    Many of these types of parts have a "sleep" mode or low power mode. I think there is a sleep mode where the CPU shuts down until a timer tuns out. Then it wakes up and can reset the time and go back to sleep.

    We have made products with Atmel and MicroChip with no power switch. The micro pulls so little power that it ships from China with the micro on, just in sleep mode. When a button is pushed the micro wakes up and starts working at full speed. If it is not used for 30 seconds it drops back in sleep mode.
     
  3. Drew Keyes

    Drew Keyes New Member

    Joined:
    Feb 19, 2014
    Messages:
    3
    Likes:
    0
    Location:
    Miami, FL
    Thank you for your advice. I believe the Attiny has a sleep mode. I suppose that I should at least test it to see how long the battery lasts. I may be surprised.

    Regards,

    Drew
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,254
    Likes:
    961
    Location:
    Loveland, CO USA

    Looking at the data sheet.
    Active and working at:
    20mhz 5V=11mA
    12mhz 3.3V=2.5mA
    1mhz 3.3v=500uA
    100khz 3.3V=100uA
    Idle supply current:
    20mhz 5V=3mA
    12mhz 3.3v 1mA
    1mhz 3.3v 140uA
    100khz 3.3v-60uA
    I don't know but it looks like the 3.3v "power down current" is about 0.2uA
    The watch dog timer alone pulls 4uA at 3.3V if you leave it on.
     
  6. Joe G

    Joe G Member

    Joined:
    Dec 18, 2009
    Messages:
    506
    Likes:
    16
    Location:
    Florida. USA
    you could always use and extra i/o pin to keep the power source on (transistor,mosfet,relay...) to the chip and shut it's power source back off, and when needed again, have a momontary switch to turn the unit back on, in-turn the IC pin keeps itself on ?
     
  7. misterT

    misterT Well-Known Member Most Helpful Member

    Joined:
    Apr 19, 2010
    Messages:
    2,697
    Likes:
    368
    Location:
    Finland
    ONLINE
    Neat way to measure battery voltage is to set the battery voltage as the voltage reference and then measuring the internal 1.1V reference voltage.

    For 10 bit conversion the battery voltage is then:

    Vbat = 1.1*1024 / ADC_READING
     
  8. Drew Keyes

    Drew Keyes New Member

    Joined:
    Feb 19, 2014
    Messages:
    3
    Likes:
    0
    Location:
    Miami, FL
    ronsimpson,

    I am still working on the code for this approach to see how viable it is. While I am sure it can be done, I have much to learn about this chip. The datasheet is 234 pages, so the going is slow.

    Joe G,

    I have been working on your approach. Unfortunately, I have not found a viable solution, as it appears as though too many components are required in too small a space - that is unless I have it professionally made (miniaturized), thus pushing it out of my price range. Any suggestions are welcomed.

    misterT,

    I think I found it on Pg. 123, Section 17.3 of the data sheet. I will study and see if I understand it. Please correct my if I'm wrong. Thank you.

    Thank you all for responding.

    Regards,

    Drew
     
    Last edited: Mar 5, 2014
  9. Mike odom

    Mike odom Active Member

    Joined:
    Feb 21, 2010
    Messages:
    670
    Likes:
    52
    Location:
    Kansas City, KS, U.S.A.
    what he means is, instead of bouncing the input voltage off of a set reference voltage, bounce a set voltage off of an adjusting reference voltage. As the battery dies, the reading will get higher and higher, and will max out when the battery voltage gets down to 1.1V. The micro's analog to digital converter has an internal 1.1V bandgap reference.

    Mr. T., this is a really cool way to measure battery voltage. Get better resolution in the 1-2v range.
     

Share This Page