Amazon Dash Button Replica

Discussion in 'The Projects Forum' started by Cassiano Aquino, May 9, 2015.

  1. Cassiano Aquino

    Thread Starter New Member

    May 9, 2015
    4
    0
    Hi Everyone,

    I'm trying to replicate the functionality of the Amazon Dash Button, basically it's a single button user interface.
    The functionality is the following:

    - Short press, goes into operational mode
    - Long press, goes into configuration mode

    This circuit uses one ESP8266 wifi board, and an external circuit.
    In other forum a user has replicated this functionality with the following circuit
    [​IMG]

    This was his description to the circuit:
    "The IRLM is the main switch and when the button is pressed, the gate of it will be pulled down through the diode (which is some kind of schottky - I forgot which, but it probably doesn't matter) and gives power to the ESP. The 'power on' line is a GPIO which does have a pull-up that's already enabled in the boot ROM of the ESP - I think it's GPIO2. This will turn on the BSH111, which will keep the power flowing. Because of the diode, when the button is released the BTN input of the ESP will get high as soon as the button is released, which is how I can detect if the button is pressed only once or is kept pressed. I can also detect a new button press to cancel whatever's going on and go back to sleep."

    So my understanding is the following:
    - User press the switch, VCC is brought UP, which powers on the ESP8266 that will pull up PWR ON.
    - As long as the microcontroller keeps PWR ON UP, current will flow to VCC.
    - BTN will be down while the user holds the switch

    I'm trying to simulate this circuit on everycircuit, without success.

    Here it is the simulation, the top LED is only a load on the line, the switch near the FET on the right is there to simulate PWR ON being pulled up when the lower switch is on.

    So basically to test what I expect is:
    - When turning on the lower switch, VCC will be UP, BTN will be DOWN
    - When turning on the right switch with the lower switch on, VCC will be help UP and, BTN will still DOWN
    - When turning the lower switch off and keeping the right switch on, VCC will be help UP and BTN will be UP
    - When turning on both switches VCC will be down

    But as you can see my simulation is not working, I've tried changing the FET's in multiple ways without success.

    Someone have any clue that may help me correcting my simulation?

    Thanks in advance, any help will be highly appreciated, and if you need more information just ask, I will be glad to add it here.
     
  2. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,574
    230
    PicaxePowerSwitch.gif
    Attached is a circuit I made for a PICAXE microcontroller for Push-ON/Push-OFF or Push-ON/Program-OFF operation. You could adapt the program to monitor the R4/R5 junction input for length of time the button was pressed.

    Ken
     
  3. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    I understand most of that circuit well enough, but I'm mystified by R3. It looks to me like it would dumping 20mA to ground anytime the picaxe is running (more accurately, any time Q1 is active.) I must be misreading something. What's the purpose of R3?
     
  4. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,574
    230
    C1 is to hold the Vcc to the micro up long enough to allow it to end its program, and R3 is to fully discharge C1 after shut down. The values for C1 and R3 can be anything that works for you. Or, you can omit them if that works for you with your micro. Also, D1 and D2 could be Schottky diodes if you want to reduce their Vf voltage drops.

    Ken
     
  5. Cassiano Aquino

    Thread Starter New Member

    May 9, 2015
    4
    0
    Thanks!

    So, if I understood correctly your statement related to C1 and R3, as my microprocessor GPIO will have an internal pullup, they can be completely ommited and controlled by the microprocessor.

    As long as my GPIO pin is UP the circuit will allow flow to VCC.

    Am I right?

    Again thanks for the help, I really appreciate.
     
  6. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,574
    230
    Yes.
    Ken
     
  7. Cassiano Aquino

    Thread Starter New Member

    May 9, 2015
    4
    0
    Hi, sorry about bothering you again, BS108G is discontinued, do you know any component that can replace it on the circuit?
     
  8. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,308
    884
    I should think just about any small-signal N-channel MOSFET, such as a 2N7000, could do the job.
     
  9. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,574
    230
  10. Cassiano Aquino

    Thread Starter New Member

    May 9, 2015
    4
    0
    Thanks everyone!
     
Loading...