Power switch PMOS controlled by button or Microcontroller (or both)

Thread Starter

Bruno Malbusca

Joined Apr 30, 2017
9
Hello,
I´m trying to design an analog circuit to use a push button to turn on an MCU and then use it the same push button to change modes. A "one push button circuit". To achieve that, I used a pmos to work as a switch on the power signal and then used a 2 nmos circuit for or signal circuit that controls the pmos. In beginning, the pmos gate is at 5V by the pull-up resistor 14. When the user makes a long press on the button, the nmos1 will turn on and consequently put the pmos gate to 0V. This will turn on the pmos and power the MCU, which will turn I/o port D6 to high (still pressing the button) that turn nmos2 and will keep the pmos ON. I then tested the circuit on the simullide and everything worked so far (files attached).

Things started to go wrong when I converted this to a real circuit. I used for nmos DMN53D0LQ-7 and for pmos I tried 2: PMN30XPX Nexperia, AOTS21115C‎ . To choose the transistors I looked to vth and I make sure the vth levels are compatible with TTL 3.3V (checking current vs vg and saturation zones), leakage currents, and vds. The nmos side worked as intended but the pmos didn´t work. The behavior was different on the two pmos. The AOTS21115C‎ never fully turned on but showed an interesting output, oscillated between 0.2V and 1.1V. The PMN30XPX was always on, never turned off. Any suggestions will be welcome.

schematic.png
 

Attachments

peterdeco

Joined Oct 8, 2019
484
Hello. If I understand you correctly, what you are trying to do is something that can be done with code. A pushbutton on an input pin could wake up the microcontroller from a sleep state. It waits until the switch is released. Another push starts a timer and when the timer counts to say 1 second, it advances the mode. It then waits for the release and waits for another press. On one of our products, the micro will generate a beep the same number of times as the mode. Mode 1 beeps once, mode 2 beeps twice and so on.
 

Thread Starter

Bruno Malbusca

Joined Apr 30, 2017
9
Hello. If I understand you correctly, what you are trying to do is something that can be done with code. A pushbutton on an input pin could wake up the microcontroller from a sleep state. It waits until the switch is released. Another push starts a timer and when the timer counts to say 1 second, it advances the mode. It then waits for the release and waits for another press. On one of our products, the micro will generate a beep the same number of times as the mode. Mode 1 beeps once, mode 2 beeps twice and so on.

Not really. I want to switch off/on completely the circuit, so the MCU will not have power at the beginning which is different to having the MCU in Sleep Mode.
 

AnalogKid

Joined Aug 1, 2013
10,987
The main goal is having only one button on the PCB to do everything, such turn on and then choosing views.
I'm not a big fan of not answering the question that was asked, but this seems like an obvious clarification:

Can't the MCU handle that logic? First press from sleep is wake; all subsequent presses are views. You could even throw in a reset: an extra-long press puts the MCU back to sleep.

ak
 

MrSalts

Joined Apr 2, 2020
2,767
I'm not a big fan of not answering the question that was asked, but this seems like an obvious clarification:

Can't the MCU handle that logic? First press from sleep is wake; all subsequent presses are views. You could even throw in a reset: an extra-long press puts the MCU back to sleep.

ak
A friend of mine bought a Hollywood movie prop with a one-button interface as you described. It was initially quite non-intuitive and difficult to work with but once we took it apart and realized how little space the engineer had to work with, our opinions of the engineer changed - the whole thing was quite remarkable with 15 modes, LEDs, and OLED display.

We turned it into an interactive museum piece with the one-button controlled via WiFi and a web interface. The web users just selected the function they wanted and JavaScript took care of the rest so they didn't have to navigate the awkward one-button interface at the museum.

all that to say, a simple microcontroller and one button should be able to easily handle the task.
 
Top