Question about a on/off switch

Hello,
I have to build a portable Gameboy for a school project (Runs the game „breakout" on a 8x8 LED Matrix „Display")
It has two buttons, one for moving the platform in the game left and one to move it right (all Buttons are on a standard arduino breadboard).
I want to add another button wich acts as an on/off switch. Currently the power source is a 9V battery wich is connected to arduino itself via the power port. The program works perfectly fine but I can't seem to figure out how to make the 3. button act as a on/off switch.

Im happy with any help I can get.

Are you trying to use a momentary pushbutton switch as a non-momentary on-off switch?

Normally, you use a toggle or slide switch, with two stable electro-mechanical states or a "push-on push-off switch" (also with two stable electro-mechanical states).

A momentary switch can work (maybe with a MOSFET and some other circuitry) or maybe you can put the processor to "sleep" and wake it with the same button, but it's usually going to consume some power when "off", whereas an on/off switch completely breaks the circuit when off.

Thanks for the response.

I am currently using momentary switch (like a Button on a XBox/PlayStatio Controller).
I think I can’t change the type ob button I am using because I already build the case for the project.
Im going to look into the MOSFET you mentioned in order to see how difficult it is.

PeterPeterPeter02718283737282:
I think I can’t change the type ob button I am using because I already build the case for the project.

Sounds like a particularly unwise move. :cold_sweat:

9V battery eh?

Is this perchance what you mean?

Not sure you will need an on/off switch as it will pretty much turn itself off in a short time! :grinning:

Presumably you would be using a MAX7219 to drive an 8 by 8 matrix. Its quiescent current is 150 μA which is not too bad and comparable to the "sleep" current of a modified Pro Mini so you could sleep the Arduino and the MAX.

Alternatively, this is the button toggle circuit:

The proper battery for this project is three Alkaline AAs.