Pages: [1]   Go Down
Author Topic: Soft switch  (Read 789 times)
0 Members and 1 Guest are viewing this topic.
California
Offline Offline
Sr. Member
****
Karma: 3
Posts: 444
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've got an ATmega328 running off 3v at 8MHz. I'm hoping to get my project powering on and off from a tactile button that will also have functions during the program. I also have limited space left on my board so I'm trying to keep the number of components low. I came up with this circuit and was hoping that it, or something similar might work. I've been trying it out (not the input part yet) and found two issues. First, it takes about 3 seconds for the arduino to set the pin high and keep it on with the pin being set high in startup. Second, it seems to stop working when I go from 3.3 to <3v from the cr3032 battery.

Using the power down function only brings me down to 0.17mA which only gives me about 40 days of "standby time." I'm hoping there's some way to get my circuit to work.


* softswitch.gif (5.56 KB, 615x456 - viewed 39 times.)
Logged

texas
Offline Offline
God Member
*****
Karma: 27
Posts: 862
old, but not dead
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Read the datasheet on the cpu for insight on lowering the sleep current more.  You may wish to power down some internal features before going to sleep.
Logged

Experience, it's what you get when you were expecting something else.

London
Offline Offline
Edison Member
*
Karma: 48
Posts: 1484
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe I'm missing something, but how do you get the ATmega to read an input when it doesn't have a ground connection?
Logged

California
Offline Offline
Sr. Member
****
Karma: 3
Posts: 444
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Read the datasheet on the cpu for insight on lowering the sleep current more.  You may wish to power down some internal features before going to sleep.
I'll take a look. Edit: I'm using avr/sleep.h and avr/power.h to call "SLEEP_MODE_PWR_DOWN". I thought that powered down the most stuff.

Maybe I'm missing something, but how do you get the ATmega to read an input when it doesn't have a ground connection?

It wouldn't be doing anything until the switch cause the NPN to saturate, then the arduino set the output to high, keeping it saturated when the button isn't pushed anymore.
« Last Edit: February 17, 2013, 11:59:10 pm by stoopkid » Logged

Siena Italia
Offline Offline
Full Member
***
Karma: 2
Posts: 149
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You may find it useful to read Nick Gammon's page on sleep mode power saving.  There are some functions that are not turned off by POWER_DOWN that you can turn off in other ways.  Ciao, Lenny
http://www.gammon.com.au/forum/?id=11497
Logged

California
Offline Offline
Sr. Member
****
Karma: 3
Posts: 444
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You may find it useful to read Nick Gammon's page on sleep mode power saving.  There are some functions that are not turned off by POWER_DOWN that you can turn off in other ways.  Ciao, Lenny
http://www.gammon.com.au/forum/?id=11497

Hey wow, disabling ADC got me down to 37uA. That helps a whole lot!
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You may find it useful to read Nick Gammon's page on sleep mode power saving.  There are some functions that are not turned off by POWER_DOWN that you can turn off in other ways.  Ciao, Lenny
http://www.gammon.com.au/forum/?id=11497

Hey wow, disabling ADC got me down to 37uA. That helps a whole lot!

You will have that thing running off a potato with two different type nails stuck in it in no time.  smiley-wink

Logged

London
Offline Offline
Edison Member
*
Karma: 48
Posts: 1484
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Maybe I'm missing something, but how do you get the ATmega to read an input when it doesn't have a ground connection?

It wouldn't be doing anything until the switch cause the NPN to saturate, then the arduino set the output to high, keeping it saturated when the button isn't pushed anymore.
I was missing something, the connection between the switch and the base of the transistor smiley-sad
Looks, at first glance, like the two wire just cross over each other.
Logged

texas
Offline Offline
God Member
*****
Karma: 27
Posts: 862
old, but not dead
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You may find it useful to read Nick Gammon's page on sleep mode power saving.  There are some functions that are not turned off by POWER_DOWN that you can turn off in other ways.  Ciao, Lenny
http://www.gammon.com.au/forum/?id=11497

Hey wow, disabling ADC got me down to 37uA. That helps a whole lot!

That's why I told you to read the datasheet, there is much more than sleep modes to getting your sleep power down to uA.  PIC chips are the same way, you have to turn things off to really get the power down.  Also, turning off modules you don't need helps the ADC do a cleaner conversion.  I put PIC chips to sleep durning an ADC conversion for low noise readings.
Logged

Experience, it's what you get when you were expecting something else.

Pages: [1]   Go Up
Jump to: