Connect with us

single switch on off and mode select

Discussion in 'Electronic Design' started by panfilero, Oct 22, 2012.

Scroll to continue with content
  1. panfilero

    panfilero Guest

    Hello,

    I'm trying to come up with a way to only have one button, and use that to power my circuit on and off, and also to flip through different modes of operation.

    For example, my circuit is suppose to blink an LED in different patterns,

    click it once, turns on LED is on
    click it again LED is blinking slow
    click it again LED is blinking fast
    click it again LED is blinking slow (any additional clicking just keeps cycling through these two states)
    hold button down for 3 seconds and circuit turns off

    I've come up with the circuit below (based it on something I saw on the EEVBlog, video blog)

    I haven't breadboarded it yet, I'm not sure if it'll work... does anyone have any better suggestions on how to do this?

    the link below shows what I came up with

    thanks!


    http://s555.photobucket.com/albums/jj477/panfilero/?action=view&current=Switch1.png
     
  2. Guest

    something like this with an LDO with enable input (not tested!)

    LP2981
    Vbat .-----. VCC
    o----------+-------------| |---------------o
    | | |
    | .---+EN |
    o | | '--+--'
    |- | |
    o | | ===
    | | GND
    | |
    +--|>|----+----|<|--------< HOLD
    | | ____
    +-------- | ----|____|--+-> switch input
    | |
    | |
    .-. .-.
    | | | |
    | | | |
    '-' '-'
    | |
    === ===
    GND GND


    switch turns on regulator, mcu set HOLD to keep it on
    switch input can see the switch state

    maybe add a small cap on enable so the MCU has a bit of
    time to set the HOLD pin

    want to turn off, clear HOLD and wait for ever

    -Lasse
     
  3. panfilero

    panfilero Guest

    hey thanks alot, thats a neat little circuit, but isn't your switch_open always tied low? seems like the micro would always see a low there regardelss of what you do with the switch

    thanks!
     
  4. panfilero

    panfilero Guest

    hey thanks alot, thats a neat little circuit, but isn't your switch_open always tied low? seems like the micro would always see a low there regardelss of what you do with the switch. Should there be a resistor between the switch_open and ground?

    thanks!
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-