How to make arduino uno sleep or turn off

Hi,
I am making an automated door opening system with an arduino uno for that project I need to make my arduino uno to sleep or to turn off with one push button and turn on with the same push button that is used to turn the arduino off, so I would really appreciate if any one could help me with the code for this.

please explain WHY you want to let an Arduino UNO sleep.
If you are talking about an Arduino UNO the best way is to let it running and just it do "nothing" - or to be precise: let it wait for the button press.

Are you in the same class as @blixen66 ?

[quote="noiasca, post:2, topic:963924"]
please explain WHY you want to let an Arduino UNO sleep.
[/quote
Actually I need to make my arduino uno use low power and detache all the components connected to it and preserve battery life.Thanks for your quick reply.

No and this my first post on the forum.

ok, to go further we’ll need to see your working code and circuit diagram / schematic..

the Arduino UNO is not a good base for usecases with "low power" consumption. There are several components on the board which makes "low power" useless. Are you prepapred to use another board or make your own bare bone board?

More information needed.

What battery and how long do you want it to last.

As already mentioned, for low power sleep a UNO is a very poor choice, complete waste of time really.

Would the mechanism to operate this be running off batteries too? Low power systems are generally used in battery operated units where mains electricity is not available.

I am using a 9.6v 1800mah battery pack and I want it to last more than 4 hours or more than that.

This will run without batteries too but as the main power source I need to use batteries.

Sorry, i'm not quite understanding your reply.

Are you saying that the door opening mechanism will be powered from mains electricity, but the Arduino must run from batteries?

If you only need 4-5 hours of operation, then the battery pack may be ok - I've not used a plain old UNO in this way myself.

As others have commented, an off the shelf Arduino UNO would not be the board of choice for long term battery operation measured in months or years.

See: Gammon Forum : Electronics : Microprocessors : Power saving techniques for microprocessors

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.