Amazon Dash Button Replica

Thread Starter

Cassiano Aquino

Joined May 9, 2015
4
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


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.
 

KMoffett

Joined Dec 19, 2007
2,918
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
 

ebeowulf17

Joined Aug 12, 2014
3,307
View attachment 85472
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
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?
 

KMoffett

Joined Dec 19, 2007
2,918
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
 

Thread Starter

Cassiano Aquino

Joined May 9, 2015
4
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
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.
 

KMoffett

Joined Dec 19, 2007
2,918
Top