Go Down

Topic: Arduino, two buttons powering and digital inputs in the same time (Read 1 time) previous topic - next topic

matveev-ruslan

Hi, I have following circuit:



It's key fob for remote lock. In order to save the battery arduino starts up (powered) only when one of those buttons are pressed (I know about sleep modes and stuff like that, but I prefer to avoid it). Press button, power on arduino, arduino determines which button is pressed and doing something - that's complete behaviour.

The question is: can it somehow burn Arduino or it's input pins (overvoltage), if Arduino is connected to 12v battery through it's RAW pin?

yendis

Watch out for
1. Bat2 being out of limits for the Arduino to work correctly (I dont know the figures for that). 
2. When the 12v batt is connected you may get backflow of current through bat2 if the voltage is lower than output of on board reg.  You could add a diode to prevent that though.

I cant see how input pins would be overvolted though.

What voltage is bat2?
Chris

matveev-ruslan

I cant see how input pins would be overvolted though.
What voltage is bat2?
It doesn't really matter what voltage is on the battery (say 10v), overvoltage is described here:

http://electronics.stackexchange.com/questions/212408/arduino-two-buttons-powering-and-digital-inputs-in-the-same-time

septillion

Changing to RAW doesn't change a thing.

Also, using sleep mode is wayyyyy better. No hassle of start up times and you can put the ATmega in a low power mode all the time. Now you're just wasting it when you power the ATmega up with everything enabled. Just put the ATmega to sleep, remove the power LED and most important, turn of the transmitter.
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

matveev-ruslan

Changing to RAW doesn't change a thing.

Also, using sleep mode is wayyyyy better. No hassle of start up times and you can put the ATmega in a low power mode all the time. Now you're just wasting it when you power the ATmega up with everything enabled. Just put the ATmega to sleep, remove the power LED and most important, turn of the transmitter.
Yeah yeah yeah sleep mode always better I know it :) So input pin protection is still necessary as it suggested on stackexchange right?

septillion

So why not use that easy route?????

What do you mean with protect the inputs? The diodes are only there to use two buttons and GND stays GND... Btw, use schottky diodes so you're sure you don't drive the pin out of spec ;)
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

matveev-ruslan

So why not use that easy route?????
What do you mean with protect the inputs? The diodes are only there to use two buttons and GND stays GND... Btw, use schottky diodes so you're sure you don't drive the pin out of spec ;)
Not using this route because "unknown" amount of power will be consumed by the internal voltage regulator in this case + removing power led + more complicated logic, but I'll keep it for the plan B :)

By protect inputs I mean suggestions from stackexchange (latest circuit), as you can see there is another couple of diodes connected to input pins to make sure that there is no "out of spec" voltage. Schottky will help, but won't solve everything.

septillion

Power reg => you can look up
Not removing power led (even in this circuit) => If you can't do a simple thing like that why bother saving power in the first place?
More complicted logic => I can't see any

And for the question, you're on THIS forum now, not on stackexchange. Post updates here or just abandon this thread...
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

matveev-ruslan

Power reg => you can look up
I know that I can, same as I know that it will be more than zero, so I don't see any reason to feed it while I don't need it.

Not removing power led (even in this circuit) => If you can't do a simple thing like that why bother saving power in the first place?
I can do it sure, but I'm not trying to solve the problem using brute-force methods, so if I don't need the device to be powered while I'm not using it, first thing for me will be to look how I can make it to be completely powered off, well if this doesn't work, then I always have another solution.

More complicted logic => I can't see any
Well that's good for you, but to me switching off RF transiever, putting Arduino into deep sleep, reacting on interrupts, waking up looks more complicated than what I've described.

And for the question, you're on THIS forum now, not on stackexchange. Post updates here or just abandon this thread...
Wow, had a bad day? We are here first of all to help each other to solve the problems related with Arduino isn't it? And I really doubt that you're the one who's in charge of saying somebody (not just me), something like "...or just abandon this thread". Say it to yourself when looking at yourself at the mirror next morning ;)

septillion

I'm really not the only one that considers that cross posting ;) If you want help, all the up to date info should be in the thread, not somewhere on the internet.

And brute force method??? Powering the arduino + tranceiver via a button matrix and relying on someone pressing the button long enough is more brute force in my book...
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

yendis

Wow, had a bad day? We are here first of all to help each other to solve the problems related with Arduino isn't it? And I really doubt that you're the one who's in charge of saying somebody (not just me), something like "...or just abandon this thread". Say it to yourself when looking at yourself at the mirror next morning ;)
I agree with septillon. Referring us to some other (long-winded thread) on another forum put me off bothering to contribute any more.   
Chris

matveev-ruslan

I'm really not the only one that considers that cross posting ;) If you want help, all the up to date info should be in the thread, not somewhere on the internet.
Okay then I'm sorry for my words.

And brute force method??? Powering the arduino + tranceiver via a button matrix and relying on someone pressing the button long enough is more brute force in my book...
Who said that it's complete circuit? ;) There is another part which is responsible for keeping Arduino "on" while it's doing it's job and switching it off only when it's done.

matveev-ruslan

I just don't know how to explain suggestions given me by the people from other forums rather than copy paste. So let's start it this way... a friend of mine (he is not forum member at all, and of course he is not "another" forum member, he is not using internet at all), okay so that is what was his words when I've presented this circuit to him:

Quote
Issue is that when you press a button, the corresponding pin will be connected directly to ground, which will be at -0.7V relative to the processor's ground (also already noted). That may generate a current from the processor's ground, through the pin's internal protection diode, and then out the pin to the actual ground. If that happens, it could be a lot of current, because there's no resistors anywhere in the circuit to control it. On other hand, if the internal diodes have the same forward voltage as your external diodes then maybe no current. But it seems iffy.
But I'm not sure, if this suggestion is still applicable in the scenario where Arduino is connected through RAW pin to 12v battery. Unfortunately I can't forward this question to my friend, because he's on vacation now, so I need your help guys!

alnath

Who said that it's complete circuit? ;) There is another part which is responsible for keeping Arduino "on" while it's doing it's job and switching it off only when it's done.
then, you should have included this 'another part' in the circuit, always better to play with all cards in hand . And remember that if that 'another part' is activated by an arduino output, push the buttons need to be pushed long enough (several seconds) to allow the arduino to start up and launch its sketch

Paul__B

OK, as to the original question, let's be clear - you are applying a negative 0.7 V to the input pin when you press the button, which is somewhat out-of-spec and will to some extent be stressing the input protection diodes.

You can correct for this by putting a 4k7 resistor in series with each input.  Note that you show no pull-ups so you cannot reliably read the inputs unless you set the input pins to INPUT_PULLUP.

And remember that if that 'another part' is activated by an arduino output, push the buttons need to be pushed long enough (several seconds) to allow the arduino to start up and launch its sketch
The Arduino does not require several seconds to start up - only milliseconds.

You are getting confused with the bootloader which waits a few seconds to see if a download is required, but this happens on reset, not power-up. :smiley-lol:

Go Up