Turn ON/OFF Battery Powered Toy with Pushbutton

I'm looking to turn ON or OFF my arduino toy using a push button. Does anything need to be written in the code to handle power on/off? :fearful:

How much current does this toy consume?

Do you want it off as in low power mode (sleep) or do you want to control the power to just the toy?

The toy consumes 1.0A current. I just want to control power to the toy. No sleep mode.

You can get latching push buttons that behave just like a toggle or slide switch - is that what you are thinking of? Toggle and slide switches are probably more common.

...R

encryptor:
I'm looking to turn ON or OFF my arduino toy using a push button. Does anything need to be written in the code to handle power on/off? :fearful:

That may depend on your project, I wouldn't like to turn off an arduino while it's writing to SD for example and would create a routine to safely power it down in such case. But.... if it's no problem for your project, you can simply turn it off.

You could put the toy on the high side of an NPN resistor with its base tickled by an IO pin. Your code would casue the IO to go low and turn the toy off.

That fails safe by my thinking: if the Arduino goes off for whatever reason, the IO pin disappears and the transistor would go off.

Robin2:
You can get latching push buttons that behave just like a toggle or slide switch - is that what you are thinking of? Toggle and slide switches are probably more common.

...R

yeah that is what I need. I understand now that no software is needed for ON/OFF. Afterall, if the device has no power it's not going to read anything.

encryptor:
The toy consumes 1.0A current. I just want to control power to the toy. No sleep mode.

That's a fair amount of power...

whatever a standard little dc motor would use. Maybe 0.3A otherwise said 300mA.

encryptor:
whatever a standard little dc motor would use. Maybe 0.3A otherwise said 300mA.

And 1A start-up or stall probably not unreasonable to allow for.

I want to buy these waterproof latching push button switches, but I don't see any mentioning of use with 3.3v, 3.7v, or 5v. Would these switches work alright for these voltages? It only mentions 12v in the ad.

http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=390714880591

As far as I can see the switches you have linked to do NOT latch - they only stay on while you have your finger on them.

A switch will always work at a lower voltage than whatever is specified.

...R

damn, thanks for the heads up!