Electronics > Beginners
1 button power on\off + UI button
(1/4) > >>
ignislion:
I am in the process of making a very simple beginner project in a somewhat serious manner with own PCB, plexiglass cover, lion battery with charger etc. all fancy and shining ready-to-use device, no more breadboard+modules crap. Just for fun and practice.

It is basically a bunch of sensors over atmega8 and display. Because you know everyone needs to know how many moisture you have in your air sometimes =)

What I am interested to do is 1 button device. 1 click to power on, then clicks to switch what to display then hold on to power off. To make this I mix some tricks I already know with parts I own.

The idea is when you press the button current goes to VCC through diode and powers on the controller which then pulls up MOSFET by PCON pin. then you can use the button to interact with SW pin by clicking. And if you press the button for a couple of seconds PCON goes low and power switches off.

Well, my question is "am I doing it right?". Because for me as a beginner it seems a little too easy to work fine =)

Thank you for your time!
ignislion:
Sorry I had to clarify +5V is a source of power VCC is just going to the controller and other stuff.
ignislion:
I swear there was someone's comment!
Ian.M:
That's not going to work unless you can drive PCON to about +7V when you want the BSH105 NMOSFET to stay on.  Its typ. gate threshold voltage is 0.58V, and to get it turned hard on, the gate needs to be  at least double the threshold voltage above the source, which is providing the MCU Vcc.

I assume SW is meant to be an output going to a MCU input pin.   The 100nF filtering cap  needs to go to ground not +5V_in otherwise you risk blowing the input pin when +5V is first applied, before the button is pressed and the MCU is powered.
ignislion:
Oh, I see.

So maybe use p-channel MOSFET?

The capacitor is a sad mistake.
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod