Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Auto Off & ON/OFF Switch using PIC ?

Status
Not open for further replies.

aljamri

Member
Good evening everybody,

Two weeks ago, I've been adviced by one of my friends to try MIKROC to do my projects.
After ups and downs, I've sent my "Hello World" during my last hloyday.

To widen the chance of getting answers, being familliar whith both, Assembly and C, I've got two question:

1- How to make Auto Off in my PIC projects?

2- How to make ON/OFF process achived with single push-button or tectile switch?

Are these operations achived by SoftWare, or its Hardware?
 
Voltage regulator with on/off

I've done it with a voltage regulator with on off. The power switch just puts voltage to the regulator and after it starts up, the uC holds the pin high. When you want to shut it off, just drop the pin to low and off it goes.

I think for a lot of applications, it's never really off. I am working on a Freescale project right now and all we do is shut everything down (all other chips are powered from uC ports) and stop. The "off" current is very low.
 
I'm thinking of the type of interlock used in ON/OFF control circuit used in Ladder diagram to start equipment using push button which seals the circuit by activating a separate relay contact as in the last picture in this page:

ISA | PLCs are logical choice
 
What you're asking about is probably Sleep mode. You set all the pins in a minimum-current state (like all LEDs off) and Sleep mode can effectively turn off the controller until a specific event wakes it up. In Sleep, the current consumption is very very low, it depends on the controller and the options you've got selected.

The Sleep current consumed by the controller may be dwarfed by the quiescent current drawn by the reg. Some regs are much much better than others in this regard. As noted, some regs have a Disable function, but using than would turn off the controller entirely so no background tasks (like a clock) could be done in Sleep, and greatly limit your options on how it could be woken up.
 
Darn! You can't look at jpeg's or program listing attachments in those threads without registering... How anal...
 
Don't cost nothin' ;) I put in the links because I thought there was more options that people might be interested in seeing.

So here's mine.

Pushing SW1 powers Vdd through D3. The programs pulls P1 high, turning on Q2/Q1, which latched on the power to Vdd. The program then sets an interrupt for P2, and goes on it's merry way. When SW1 is pushed again P2 is pulled high and the program jumps to a shutdown routine that pulls P1 low, turning off Q2/Q1 and goes to END. The program can also shut the power down as part of another routine. R8/R9 provides pullup/pulldown for P2. D3 isolated R8/R9/P2 from Vdd. C1/R5 provides a slight delay in the loss of Vdd, so the program can END gracefully.

Ken
 

Attachments

  • PicaxePowerSwitchBasic.gif
    PicaxePowerSwitchBasic.gif
    17.8 KB · Views: 622
Last edited:
Here is a switch I use. It employs a voltage regulator with enable pin.
 

Attachments

  • SwlfSwitch.JPG
    SwlfSwitch.JPG
    106.6 KB · Views: 463
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top