Soft latching circuit, selecting low-dropout voltage regulator (LDO), data logging

Thread Starter

Adam Uraynar

Joined Dec 21, 2015
67
What it's all about
I am planning to build this Low Energy IOT Door Sensor. The idea is to stick it in a professor's door to see when he's available. (It's an issue waiting outside his door all the time.)

I think I can set up another ESP8266 to receive the signal, and log the data with an Arduino. Besides the questions below, I'd appreciate any pointers on the device-to-device communication and data logging. I plan to work that out when building/experimenting with my little experience with ESP8266 and NodeRED hoopla. I'm also just doing this for the learning experience, but it'd be better if the actual application is fruitful.

Brass tacks
The main thing I want to understand is the low dropout (LDO) linear voltage regulator. It seems that the $1.14 AMS1117 is what people are using. But then I find this 38 cent AP7370. I wonder about the difference in specs:
LM1117 AP7370
Voltage Dropout (Max) 1.2V @ 800mA 0.6V @ 100mA
Current - Output 800mA 300mA
Current - Quiescent (Iq) 5mA 2.5µA
Current - Supply (Max) 10mA 300µA

So I read these pages:
  1. https://www.vidatronic.com/5-basic-...when-selecting-an-ldo-for-your-system-design/
  2. https://www.richtek.com/selection-guide/en/selection-ldo-criteria.html
  3. https://www.allaboutcircuits.com/technical-articles/choosing-the-right-ldo-beyond-the-basic-specs/
Voltage Dropout (Max)
The LM1117 is just over a volt at 100mA. So the AP7370 is better, "the smaller the dropout voltage, the greater the useful input voltage from the battery and therefore the longer the run time." [1] Defined, "voltage drop across the regulator where the device can no longer regulate the output voltage." [2]

Current - Output
The LM1117 has a higher maximum it can provide.
Will that four-terminal node in the circuit go over 300mA?
upload_2019-7-18_15-17-38.png
Calculated as 3.3/(110k) or how can that node be analyzed?
Also, the maximum current drawn from a GPIO pin is 12mA (for the ESP8266-01). Would that change.....
upload_2019-7-18_15-31-18.png
Mostly, how much current will the circuit draw?

Current - Quiescent (Iq)
Less is better: "current consumed by the regulator when it is not supplying load current." [3] The AP7370 wins.

Current - Supply (Max)
Maximum current supplied by the battery? Is there a way to test this?
It's from a $8.88 ~100 mAh battery on Amazon: 4.2 V when completely charged to 3.7 V.

TMI
Before I wandered across the Instructable above, I was looking into creating a continuity tester, transmitter and receiver using the Beetle (smallest Arduino). The thought was to have the door's metal plate complete the circuit (continuity), log the data, then send the signal. This way a sleep mode could be used...
 

RPLaJeunesse

Joined Jul 29, 2018
254
My suggestion: Replace Q1 above with a pair of BSS138 logic level NMOS switch FETs, one driven by SW1 and one driven by GPIO0. No need for D1, D2, or R5. R2 helps keep the switch side BSS138 less ESD sensitive, but could be deleted as well. Raise R3 to 100K and the whole thing takes only a few tens of uA when on, only a uA of leakage (if that much) when off. For this application the MOSFET based AP7370 is a good call, you don't need the higher current of the LM1117, which is bipolar junction transistor based - hence the higher quiescent.
 

RPLaJeunesse

Joined Jul 29, 2018
254
Just noticed the GPIO2 connection - could be a problem. If VCC to micro is off then GPIO2, via an internal diode to VCC, may keep M2 from turning on (and VCC from turning on) when S1 closes initially. Consider using another BSS138 like M3, driven by GPIO2, with drain tied where GPIO2 shows now. To save battery bump R2 to 47K and R4 to 470K.
 

Thread Starter

Adam Uraynar

Joined Dec 21, 2015
67
I don't understand why GPIO0 drives a gate, while your new suggestion for GPIO2 drives the drain.
GPIO0 is the power signal pin. GPIO2 is the reed switch signal.
upload_2019-7-29_9-30-33.png
...seems like every configuration has the ~1.5 V on:
upload_2019-7-29_9-29-38.png
 

RPLaJeunesse

Joined Jul 29, 2018
254
Let's step back, ignore what you just did, and start over with the Thursday circuit. Disconnect GPIO2 from the circuit. Add another BSS138 as M5. Connect M5 source to common/ground. Connect M5 drain to node of R2, R4, M2, I2 (note: NOT GPIO2). Now connect GPIO2 to the gate of M5. That's what I meant.
 
Top