• 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.

How to turn off Attiny?

Thread starter #1
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
 

ronsimpson

Well-Known Member
Most Helpful Member
#2
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.
 
Thread starter #3
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
 

ronsimpson

Well-Known Member
Most Helpful Member
#4
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.
 
#5
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 ?
 

misterT

Well-Known Member
Most Helpful Member
#6
I suppose that I should at least test it to see how long the battery lasts.
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
 
Thread starter #7
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.
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.

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 ?
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.

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
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:

Mike odom

Active Member
#8
misterT,

Forgive me if I am unable to follow your thinking. Would you be kind enough to expand on this a little more. Thank you.

Thank you all for responding.

Regards,

Drew
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.
 

Latest threads

EE World Online Articles

Loading

 
Top