Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

Press ON hold off and signal to microcontroller

Status
Not open for further replies.

hemnath

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

Source: https://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

  • circuit.pdf
    8.4 KB · Views: 111

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.
 

could you please any reference circuit.
 

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
 

Debounce and timing software. Use interrupts and timers if you want to avoid polling and CPU time hogging timing loops.
 

Attached the modified. Please check and comment. Component selection are ok?
circuit 2021-01-05.png
 
Last edited by a moderator:

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?
 

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).
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top