Tricky push button circuit - Is there a known solution?

rmeldo

Senior Member
Hi,
this is not a Picaxe question but I think it suits the forum nonetheless. It is the kind of “fundamental circuits “ question. I am trying to devise a “button pushed circuit” but I cannot figure out how to do it.

I hope it is allowed.

I am using a NodeMCU (a breakout board for the ESP8266) with a temperature sensor (room temperature measurement), SHT31 (on one of those breakout boards available on ebay).

I plan to make a small board with the sensor on it and I want to solder it directly to the back of the nodeMCU.
The NodeMCU will upload the temperature every 10-15 minutes to a web server. On the board there are two pushbuttons to trigger uploads “on demand”, including the information on which of the two buttons was pressed.

Here attached is the schematics.

temp_sensor_V2.PNG
Because the NodeMCU uses a lot of current when running, the power dissipated by the on board voltage regulator will heat the board, introduce an error in the room temperature reading.

In the past I have kept the sensor away from the NodeMCU but this time I would like to put everything into a small box together.
The solution I think is to send the processor into deep sleep to reduce the current (still 10mA, but this is because of the quiescent current in the regulator. I could replace it with a better one, if necessary)

The wake up (it actually is a restart from reset) happens when the timer attached to pin D0 temporarily pulls low the NodeMCU reset button. I tested and it works.

Here is where I need help please:

I can reset the Node MCU with the either buttons by getting them to pull the reset pin low. The problem I have is that I cannot figure out, once I have released the buttons to let the NodeMcU restart, how to have a “residual signal” of the button having bene pushed so that the information can be detected by an input pin and uploaded, together with the temperature.

I feel that a solution might involve charging a capacitor and perhaps using a diode, to hold the charge for the detection pin. Something like that.

I could do with some advice please. Maybe someone else has had the same problem before?

Thanks
Riccardo
 

techElder

Well-known member
... once I have released the buttons to let the NodeMcU restart, how to have a “residual signal” of the button having bene pushed so that the information can be detected by an input pin and uploaded ...
You could increase the value of C1 and C2 (along with possibly adding a resistor in series with them) until you can get the input to react.

The question is what does it mean?
detected by an input pin
Do you have programmatic control of this input pin or are you saying that the input pin is slow in detecting the change in switch input?
 

lbenson

Senior Member
It's been a year and a half since I fiddled with things 8266, but I remember that much less than 10mA is possible in deep sleep, and there was a persistent bug with deep sleep where it would work repeatedly for a long time (weeks, months), but then the ESP device would fail to come out of deep sleep. The developers were looking into this, and it may have been solved in the time since I've stopped looking into it.
 

inglewoodpete

Senior Member
Can the input pin be configured as a Schmitt trigger? Using a CR pair with a long time constant should hold a high or low state for long enough for the chip to detect it after waking up. Alternatively, you may need to use a small MOSFET to sense the voltage change on the CR network.
 

PhilHornby

Senior Member
I'm thinking you could add one of those Picaxe 08M2 thingies ... to handle the switches, the storing of their 'events' and the resetting of the ESP8266 ;)
 
Top