On/Off by a push button (SOLVED)

Thread Starter

Pepe333

Joined Feb 12, 2018
86
Hi all!
I need a circuit to power on/off a circuit pushing a button. When I press first time, the circuit is powered, and if I press a second time, the power must go off. I have a microcontroller, and I use an I2C I/O expander, the PCF8574. The idea is to use an I/O of the PCF8574 to maintain/cut the power, and use another I/O to read the push button (when the circuit is powered, press button must cut the power).
So I have:
-Put "0" on "A" maintain the power.
-Put "1" on "A" cut the power.
-Read "0" on "B" cut the power.

The PCF8574 is open drain. (I'm not very sure what that is, but I understand that these I/Os cant "supply" current, only "drain").
The power source is 5V, and the power for the microcontroller is 3.3V
The circuit works if I use 2 push buttons (SW1 & SW2), but I need do the thing using only one SW. And here is my problem.

Can anyone help me?

Thanks in advance for this excellent forum!
 

Attachments

Thread Starter

Pepe333

Joined Feb 12, 2018
86
hi Pepe,
Is there space on the project PCB for a Bistable IC, eg: HEF4013.?
E
Yes, no matter what need to add to the circuit.
Maybe another optocoupler or the biestable, anything!

The problem is how to put GND from SW1, with a 3.3V voltage drop.
 
Last edited:

ericgibbs

Joined Jan 29, 2010
18,873
hi P.
Let us deal with switching of a bistable latch first, then we can look into the power switching once we have the push switch On/Off sorted.
Are you able to sketch out and post a Bistable, say a 4013 IC circuit , using a single n/o push button.
E
 

Thread Starter

Pepe333

Joined Feb 12, 2018
86
hi P.
Let us deal with switching of a bistable latch first, then we can look into the power switching once we have the push switch On/Off sorted.
Are you able to sketch out and post a Bistable, say a 4013 IC circuit , using a single n/o push button.
E
I have a 4027D j-k flip flop, and tested a on/off circuit with a push button, but the problem is it can supply the 70mA I need. Do you mean to use the flip flip between the power source and the microcontroller Vin??
 

Thread Starter

Pepe333

Joined Feb 12, 2018
86
I was fighting with that for a week. Thanks to write in the forum, and the help from ericgibbs I found, at last, the solution.
Tested on protoboard and working! :D

Please, if you see something wrong tell me.

Thanks friends!
 
Top