Power on circuit with 3 inputs triggers + 1 timer trigger

Thread Starter

Monstercrunch

Joined May 3, 2019
3
Hi,

My goal is to power my circuit when one out of three contacts is made. It may be either from one button, one reed switch, one tilt switch and I want to be able to detect which one triggered the power.

I'm trying to design a power on circuit which would have the following functionalities:

1- low power (<5uA) in standby
2- multiple inputs for power on
3- possibility for the uC to check which input triggered the power on
4- repeatable timer trigger (for an heartbeat)


So far I wanted to use the TPL5110 because it checks every points except point 3, ie I can't detect which contact triggerred the power. My circuit contains an ESP32 and the boot time is not short enough so I can check the contact state. This is why I wanted to add a 3bits memory which would be set when the contact is made, then read/reset by the ESP32.

I ended up using a 74HC74 flip flop as told in this post coupled with an OR gate made with diodes. The result circuit is like this (4 inputs version):



Pulling any of SET[1-4] to LOW will flip the associated TRIG[1-4] pin and leave it flipped until RESET. It will also flip the POWER_ON from LOW to HIGH (connected to the TPL5110). Then the ESP32 can read the TRIG[1-4] to check which input triggered the power on and use RESET to, well, reset the bits. If none of the TRIGs is HIGH, it means that the timer from the TPL5110 did the power on.

But as you can see it looks terribly complex!!! As you may have guessed, I'm not any kind of an electrical engineer. So if you think you have a better solution for my problem I would really appreciate you sharing it with me :)

Thanks for reading!
 

Attachments

MisterBill2

Joined Jan 23, 2018
3,884
You can simplify the circuit a bit by using CD4013 D-ffs, and a 4 input CMOS or gate. I am not sure what you mean by "heartbeat, but what I described would leave an LED lit to show which of 4 inputs set the trigger. If you wanted ZERO standby current, but could live with a higher triggered current, you could use 2-pole normally open reed relays and have a much simpler circuit yet. An added benefit is that you would have direct output switching and not need to write any code at all. And with relays the part count would be very low and it would be very robust and ESD-proof.
 

danadak

Joined Mar 10, 2018
3,578
This design a natural for a UP, say an ATTINY series.

1) Can be put to sleep
2) GPIO (button) activity can wake up part
3) Resources to do heartbeat
4) Power up glitch free operation
5) Ability to debounce buttons
6) Determination of active button
7) Easily create state machine for overall operation


Regards, Dana.
 

MisterBill2

Joined Jan 23, 2018
3,884
This design a natural for a UP, say an ATTINY series.

1) Can be put to sleep
2) GPIO (button) activity can wake up part
3) Resources to do heartbeat
4) Power up glitch free operation
5) Ability to debounce buttons
6) Determination of active button
7) Easily create state machine for overall operation


Regards, Dana.
The "additional benefits" of utilizing a microprocessor are that it will always be drawing some power, it will always need a more closely controlled supply voltage, and even if you write the code you will never be sure just what is going on inside it's mind.
And here is an additional consideration about the circuit that you show in post #1, which is that the LEDs, as shown, will clamp the output voltage at whatever their forward drop is, and that may not be adequate to trigger some devices that you connect.
It is still not clear to me what the "heartbeat" function is all about. Does this system need to switch something on periodicly even if nothing else triggers it to switch on? That is my guess, only a guess. And how does the system get switched off? A delayed turn-off is a simple option with a CD4013 or an MC14013 FF if the delay is not too long.
 

danadak

Joined Mar 10, 2018
3,578
Yes on the power, sub 1 uA, basically leakage.

even if you write the code you will never be sure just what is going on inside it's mind.
There are solutions that can be codeless. But even with code these days UPs pretty reliable.
And they are designed at I/O to be glitch free on power up, which of course CDxxxx anything
is not.

will clamp the output voltage at whatever their forward drop is, and that may not be adequate to trigger some devices that you connect.
Processor can handle that issue just by using separate I/O for logic from that of LED drive.

It is still not clear to me what the "heartbeat" function is all about.
Thats normally done with two PWMs slightly offset in period to produce a pulsing/fading
LED drive signal. Done right very smooth fade brighten cycle.

Example


Regards, Dana.
 
Last edited:

Thread Starter

Monstercrunch

Joined May 3, 2019
3
Hi guys,

Thanks for the propositions. To clarify the "heartbeat" my circuit is an IoT device and I want to send an "heartbeat" message every so often so that I know the device is ok.

The uC option is what came to my mind, but with its downsides as it it adds a component to program on the board.

I spoke to a friend who suggested another option using a cap to briefly store the state of the buttons:

trigger_circuit.png

Very simple but my concern is the power consumption of such a big cap as I need it to stay below the LOW level for 250ms (time for the ESP32 to boot up). Will do some math to check if it's viable.
 
Top