Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Press ON hold off and signal to microcontroller

hemnath

Advanced Member level 2
Joined
Jun 24, 2012
Messages
689
Helped
61
Reputation
120
Reaction score
57
Trophy points
1,308
Location
Chennai
Activity points
6,496
Hi,

Source: http://circuits-diy.com/soft-latch-switch-circuit/

I need to design a circuit where the button should do three tasks.

1. Power on the micro-controller - (when SW4 is pressed once)
2. acting as an input to the micro-controller - (connect B_ONOFF to microcontroller pin)
3. turn off the micro-controller - (connect AUTO_OFF to microcontroller pin).

For battery monitoring, R15 and R18 are used as voltage divider and connected to microcontroller pin(BAT_STATUS). I have not tested this circuit. Any comments on this to improve. Microcontroller PIC24FJ64GL306 supply voltage is 3V. When the microcontroller pin is connected to B_ONOFF, does the pin gets affected?

I also need to connect 24V DC power to the circuit. When DC power is available, the circuit should operate through this 24V DC. and when it is not available, the circuit operate through 3xAA battery. How can i modify the circuit. Also, i need three tasks from the button.
 

Attachments


betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,707
Helped
4,806
Reputation
9,629
Reaction score
4,587
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
125,273
The usual strategy is to connect the switch in series with the power input and also bypass it with a transistor. The transistor is controlled by the MCU.
When the switch is closed the MCU receives power. The first thing the MCU does is configure to power control pin as an output and use it to make the transistor conduct, keeping the power connected. To shut it down, the transistor is turned off, removing all power until the switch is pressed again.

With suitable voltage protection, the switch can also be used as a logic or analog input.

Brian.
 

hemnath

Advanced Member level 2
Joined
Jun 24, 2012
Messages
689
Helped
61
Reputation
120
Reaction score
57
Trophy points
1,308
Location
Chennai
Activity points
6,496
could you please any reference circuit.
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
18,921
Helped
4,209
Reputation
8,421
Reaction score
4,152
Trophy points
113
Activity points
124,370
Hi,

The given circuit is not bad.
I'd just use microcontroller_vcc as pullup for the pushbutton microcontroller input.
Else the pullup (to battery) continously draws current through the port protection diodes.

Klaus
 

RCinFLA

Advanced Member level 2
Joined
Aug 31, 2010
Messages
590
Helped
187
Reputation
378
Reaction score
186
Trophy points
1,323
Activity points
5,698
Debounce and timing software. Use interrupts and timers if you want to avoid polling and CPU time hogging timing loops.
 

hemnath

Advanced Member level 2
Joined
Jun 24, 2012
Messages
689
Helped
61
Reputation
120
Reaction score
57
Trophy points
1,308
Location
Chennai
Activity points
6,496
Attached the modified. Please check and comment. Component selection are ok?
circuit 2021-01-05.png
 
Last edited by a moderator:

hemnath

Advanced Member level 2
Joined
Jun 24, 2012
Messages
689
Helped
61
Reputation
120
Reaction score
57
Trophy points
1,308
Location
Chennai
Activity points
6,496
I want to provide 24V input also. When 24V is available, the circuit should power ON using this 24V. Switch SW4 is ON/OFF button.

When 24V input is not available, circuit is power ON through battery. What changes should i have to do?
 

hemnath

Advanced Member level 2
Joined
Jun 24, 2012
Messages
689
Helped
61
Reputation
120
Reaction score
57
Trophy points
1,308
Location
Chennai
Activity points
6,496
For Post# 6, I will use 3xAA battery as input. What are the additional components required to pass EU Directive 2014/30/EU Electromagnetic compatibility device (EMC).
 

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top