Electronics > Projects, Designs, and Technical Stuff
Low Voltage Detection & Power Cut IC
forrestc:
--- Quote from: JDW on September 02, 2019, 10:12:22 am ---Thank you for your other suggestions. Using 3.3V goes against the advice of Ian M. who recommends I use 5.0v instead since I will have a 1.5m cable between my PIC board and the sensor, so I will need to ponder your suggestions along side his.
--- End quote ---
Let's do some quick math:
Assuming 100mA @ 3.3V:
1.5m cable, let's assume it's 24AWG (tiny). Looking up the ohms per foot, and calculating the resistance of this amount of wire, you find that the resistance is 0.128\$\Omega\$.
At 100mA, 0.128 Ohms. E=IR. 0.1A times 0.128\$\Omega\$ = Voltage drop is then 0.0128V. Yes, 1 hundredth of a volt. You need to double it since it's a round trip thing, so I'll say 0.025V.
Let's assume it's 1A. Then it's 1A * 0.128\$\Omega\$ , or 0.128V. Or 0.25V.
You're not going to get enough voltage drop over 1.5M of cable, assuming any reasonable wire gauge and any reasonable current, to matter. If your current is closer to 1A than 0.1A then you'll just need a bit larger cable.
If the device is normally 0.1A, with brief surges to 1A, that's where capacitance at the end of the cable comes in. It averages the peak out.
Now, there are other reasons why 3.3V might not be a good idea, but that's more about signal integrity. A car can be an electrically noisy environment, although the newest cars are much quieter than the old ones were mainly because of how many electronics are used in cars. I'm not sure moving to 5V is going to gain you a lot in this department. Depending on the specifics of the situation, a good shielded cable will likely be more useful. If you find you have communication problems, then sometimes moving to a more robust signalling method can help, but that would probably mean moving to RS-422 or similar on both ends of the wire.
JDW:
--- Quote from: forrestc on September 03, 2019, 07:07:41 am ---The loss due to resistance in the wire is related to current. E=I*R... If the voltage normally at the sensor board is very close to 3.3V under normal operations, but you see brief spikes being lower, the simple solution is to add capacitance to the sensor board so that the capacitors provide the power during the demand surges causing the spikes. I'd only consider moving to 5V if your average voltage at the board is too low due to voltage drop.... Add enough capacitance to the sensor board such that you never have a power droop under normal use. Don't over do it, but make sure that it is sufficient and then some. You may already have enough on the board.
--- End quote ---
I know what the wire resistance will be for the 1.5m cable, although contact resistance of the connectors at either end (which IanM. was considering) is something I have not considered yet. But thank you for indicating that use of 3.3V isn't altogether a bad idea. I like the 5V idea, but it adds a heck of a lot of complexity, cost and board space to the design.
The fingerprint sensor draws less than 200uA when sleeping, 48mA when awake but its LED off, and 76mA when it's awake with LED lit. The datasheet says current could spike up to 130mA, but that would but the limit and only for short durations. In my own measurements using a Fluke 8845A benchtop meter I don't see current spikes above 80mA.
I've measured the input capacitance at the Fingerprint sensor. There are several ceramic caps in parallel, all yielding a mere 12uF total, which certainly isn't enough.
Using a shielded cable would be a good idea, but I also need to consider ease of mounting which a flat, thin cable would provide. The wires should probably be 22AWG for the sake of durability, and certainly no thinner than 24AWG. Adding a shield would make the cable thicker, which means it could not fit nicely in between panel plastics like a thinner cable.
--- Quote from: forrestc on September 03, 2019, 07:07:41 am ---2) Introduce the circuit I described in to the PIC, and then program the PIC in such a way that if a glitch occurs, it powers off the device, and leaves it off for some reasonable amount of time has passed. The PIC can also be set up to only power on the device after power is good for a certain amount of time, which will avoid a certain additional class of power-on glitches on the 3.3V rail.
--- End quote ---
I fully understand that my PIC has a Comparator, DAC and Vref=1.024v (which is stable for Vdd 2.5V and higher). (My PIC also has internal Brown-out LO enabled, which keeps the PIC in RESET when Vdd falls below 2.35v~2.58v.) While I could indeed use an interrupt in conjunction with the Vref and Comparator, the fact is that I sometimes write to the high-endurance flash inside the PIC which takes 2.5ms-max during which time interrupts must be disabled. That 2.5ms is probably short enough not to pose a problem, but using the TLV3012 GeorgeOfTheJungle proposed along with two 1% voltage-divider resistors and a P-MOSFET (DMG2301L, which you proposed) would be a bullet-proof external solution that would be faster than using the PIC.
So if I set aside the 5V idea and stick with 3.3V, I would need the following:
• Low-voltage detection and power cut for external fingerprint sensor using TLV3012, DMG2301L, R1=1M-ohm(1%), R2=820k-ohm(1%) -- yielding a nominal trigger threshold of 2.76v and a worst-case threshold (1% resistor tolerance considered) of 2.73v, which is higher than the 2.70v mentioned by the sensor manufacturer. My PIC can monitor the output of the op-amp in the TLV3012 to know which power to the fingerprint sensor is being switched OFF or ON.
• Add capacitance on Fingerprint sensor side (to be decided).
• Add ESD protection ICs, one IC for each side of the cable, for Rx & Tx. (I would assume this is prudent.)
• Additional short-circuit protection for possible cases where Vdd gets shorted to ground? (Could occur if someone took a pair of scissors and cut through the cable.)
• Use N-MOSFETs to cut Rx & Tx at the same time Power is cut to the fingerprint sensor, as per IanM. But I am still not clear on Vgs vs Vgs-thresh, so if anyone reading this could kindly steer my feeble brain in the right direction, I would appreciate it. Toward that end, here is the content of Reply#27 which never got a response from anyone...
--- Quote from: Ian.M on September 02, 2019, 08:51:35 am ---N.B. a 2N7000 is *NOT* suitable unless you run your supply to the sensor at >7V as its max. Vgs threshold voltage is 3V, so it wont reliably stay on with 5V on the gate and a 3.3V logic '1' signal on the channel, which only gives 1.7V Vgs. You need one with a max threshold voltage <1.5V to guarantee a full logic '1' level at the sensor RX pin. <1.8V threshold will work with a possible slight reduction of the logic '1' level but still within spec.
--- End quote ---
I know BJT's well but not MOSFETS, so I'd like to clarify. I can find parts with a "Vgs" spec as low as 2.5V and a "Vgs-thresh" spec as lows as 300mV, so am I right to assume that the "Vgs" spec is different than what you were talking about in that the "Vgs spec" is the absolute max voltage when measured across the Gate and Source? Consider these 3 parts.
If the "Vgs spec" is the absolute max, then it would be prudent for me to choose the highest "Vgs spec" that can accommodate the lowest "Vgs-thresh" -- for example, these parts.
Lastly, I am seeing "Rds-ON" as high as 3.5-ohms in some of those parts I linked for you. I would assume this should be a non-issue on light of my 9600bps data rate?
forrestc:
--- Quote from: JDW on September 03, 2019, 07:53:40 am ---I fully understand that my PIC has a Comparator, DAC and Vref=1.024v (which is stable for Vdd 2.5V and higher). (My PIC also has internal Brown-out LO enabled, which keeps the PIC in RESET when Vdd falls below 2.35v~2.58v.) While I could indeed use an interrupt in conjunction with the Vref and Comparator, the fact is that I sometimes write to the high-endurance flash inside the PIC which takes 2.5ms-max during which time interrupts must be disabled. That 2.5ms is probably short enough not to pose a problem, but using the TLV3012 GeorgeOfTheJungle proposed along with two 1% voltage-divider resistors and a P-MOSFET (DMG2301L, which you proposed) would be a bullet-proof external solution that would be faster than using the PIC.
--- End quote ---
I think what you might be missing is that the Comparator is able to expose all of it's pins to the external world, and doesn't rely on the PIC CPU to operate. It will operate whether interrupts are enabled or not. So you effectively have a TLV3012 inside. No need for an external part to get exactly the same functionality.
At initial power on, the PIC's comparator wouldn't be configured to be connected to the FET. So the unit would stay off until ready.
Once your PIC has started, you enable the 1.024v reference, enable the comparator, and assign pins. At this point forward the comparator works just like a TLV3012. You use the same divider 1M and 820K, hooked up to the comparator input pin. The output pin is just like the TLV3012 and hooked to the FET. Once set up, it's just as fast as the TLV3012 (well, that's not true, the one in the PIC responds in 0.8uS max, vs the 12uS of the TLV3012 so the PIC is actually a lot faster).
The main advantage of this (other than the part savings) is that you can gain some software control as well. If you find you have a glitching power supply on startup, you can then delay the power on for the device. You can also force minimum off times after a drop.
I also notice that the comparator can be configured in software to add some hysteresis which will prevent 'chattering' near the threshold. I.E. once it shuts off, the voltage on the reference pin has to rise to 1.224V before the unit comes on automatically. With a normal comparator, you'll find you have glitches as the voltage crosses the threshold unless you add feedback circuitry, this avoids that hassle.
The interrupt I suggested only comes into play if you also want to turn off the TX pin to avoid currents through the TX pin powering the remote device, which is a definite possibility. Which you're already aware of:
--- Quote from: JDW on September 03, 2019, 07:53:40 am ---• Use N-MOSFETs to cut Rx & Tx at the same time Power is cut to the fingerprint sensor, as per IanM. But I am still not clear on Vgs vs Vgs-thresh, so if anyone reading this could kindly steer my feeble brain in the right direction, I would appreciate it. Toward that end, here is the content of Reply#27 which never got a response from anyone...
--- End quote ---
You probably don't need to cut the sensor TX/PIC RX line. You're concerned about power from the PIC TX line being fed into an off sensor, and it powering up the device, not the other way around.
The software interrupt would probably work really well, well except when it is too slow. Other options:
1) Use a NPN transistor with the base fed from the pic TX line with an appropriate series resistor, the emitter to ground, and a pullup from the collector to the switched Vcc for the sensor. The size of the pullup resistor combined with the cable capacitance will determine the maximum baud rate (smaller=faster). You'll also need to set the pic to invert the TX line so the inversion done by the transistor is undone. I've done this numerous times and it works well depending on the baud rate. I think I'm running a 10K resistor at 19,200 with much worse cables than you have. Note that since serial idles high, generally this isn't going to consume any meaningful current until there is data on the line. You'll also want to make sure that the Vce(sat) is low enough to end up with a voltage below VIL on the sensor (the low voltage threshold) since the transistor can't pull the line down below Vce(sat).
2) Replace the NPN transistor with a N channel fet. This would avoid the potential Vce(sat) issue, but only with a correct FET selection (see below). The Rds(on) will need to be low enough such that the voltage divider created by the pullup resistor and Rds(on) doesn't introduce the same VIL issue.
3) Use a tri-state buffer gate. These are available around ten cents US in reasonable quantities. After some digging, I found the SN74LVC1G240 which has a active-low output enable which matches the polarity of the output of the comparator when driving a P-Channel FET. There are also active-high output enables. You'd power these from the same VCC as the PIC, and then tie the OE pin to either the output of the comparator, or the switched HV rail depending on the OE polarity. This would effectively turn off the TX pin when the power goes off. Note that the SN74LVC1G240 I mentioned has an inverting gate, so you'd need to invert the TX pin on the PIC like the above solution. Some of the others don't invert, but the ones I found don't have an active-low OE pin, and I think I'd want to tie this to the output of the comparator so that this pin shuts off as quickly as possible instead of starting after the PCH fet turns off.
4) A probably non-option: Use a fet as a 'true switch' in the dataline. I can't get my head around how this would work reliably in the signal line without a lot more circuitry. I'll explain below.
But first to help you with the FET questions:
If you look at Figure 2 in the 2n7000 datasheet at https://www.onsemi.com/pub/Collateral/2N7000-D.PDF, you'll find a chart which shows the drain current at a certain gate voltage.
If you look at this chart, you will find that in order to reliably get 200mA through the device you'll need at least 4V of Vgs, which is the voltage between gate and source. This is more than 3.3V. If you look at 3V, you'll find that the mA is pretty close to zero... so it really isn't all that functional at 3V. Vgs(th) is the point where the fet is just starting to turn on, not the point where it is fully on.
Compare figure 2 at the DMG2310L datasheet at https://www.diodes.com/assets/Datasheets/DMG2301L.pdf . Note at 3V you can actually push 10A through it. The Vgs(th) of this part is down around 1V, and you'll note that the Id at this level is also close to zero.
Another chart of interest in the DMG datasheet is figure 4. This is Vgs voltage vs on-resistance. You'll notice that the resistance doesn't really start dropping until somewhere just below 2V. At 3V, it's pretty close to as good as it can get, and any additional voltage isn't really all that helpful. So this Fet is really useful only above 2V with 3V or over being ideal.
In option #2 above, I said that you'd need a N channel FET. I just did a quick search, it looks like a FDV301 would probably work - in fact the Fairchild datasheet shows this very application. There are others, that's just the first one I found. I typically don't use N channel fets since I'd typically need a higher Vds, and at the voltages I use, NPNs are much more widely available and less expensive.
A quick hint: The spec which is usually listed in the part summary which will quickly tell you if you should look further is a line which will be something like:
Rds(on) = 5\$\Omega\$ @ Vgs = 2.7V.
This says the transistor will have a resistance of 5 ohms at 2.7V. If you don't see a reasonable value below the voltage of operation, look on.
One other note before I move on: There is one area where Vgs(th) is important - that is to turn *off* the device. If you have a very very very low Vgs(th) being driven by something which can't get Vgs lower than the number shown, you won't be able to turn off the device.
There are other interesting characteristics, but those are probably the biggest ones to watch for.
Now, back to option #4:
So, let's assume you put a fet in the data line as a switch. I.E. you break your dataline, and insert the fet into the dataline with G and D attached to the two sides of the 'break'. With a N channel FET, to turn the FET on you would have to raise the gate above the voltage S terminal by the voltage described above. So in your 3.3V data line, you'd need something like 7 volts on the Gate terminal to turn on the data line when the data line is high (since you start with 3.3V, then need 3V more or so).
With a P channel FET, you need to have the gate voltage below the S terminal by the appropriate voltage described above. This is why the specs in a P-channel datasheet are almost all negative. So for high voltages on your data line @ 3.3V, this is easy, you just yank the gate to zero and you get -3.3V. But now, what about low... Well, at 0V on the data line, your 0V gate voltage isn't going to be low enough to turn the FET on, which will result in a floating dataline. To fix this you'd have to have the gate voltage be below zero.
I'm sure there might be tricks to make this work with a FET inline as a switch, without a lot of level shifting of the Gate, etc., but I find options 1,2, and 3 above to be a lot more straightforward.
JDW:
--- Quote from: GeorgeOfTheJungle on September 03, 2019, 09:52:10 am ---If the voltage regulator on the board is a switching one, the figures @5V should be about the same. If it's an LDO they'll worsen and won't be any advantage in moving to 5V.
--- End quote ---
The Fingerprint sensor board has a Holtek 5301 LDO that outputs 3.0V to power the ARM processor and Winbond Flash chip:
https://www.eevblog.com/forum/projects/low-voltage-detection-power-cut-ic/?action=dlattach;attach=820047;image
Thank you for the capacitor calculations. I found those details very helpful.
--- Quote from: forrestc on September 03, 2019, 10:06:03 am ---I think what you might be missing is that the Comparator is able to expose all of it's pins to the external world, and doesn't rely on the PIC CPU to operate. It will operate whether interrupts are enabled or not. So you effectively have a TLV3012 inside...
--- End quote ---
Oh, my... You're right. Beautiful observation!
I am humbled by the time spent on the rest of your amazing post. I need time for my fleshly CPU to process it all. :-) But you have put me squarely on the right track. I will proceed with my original plan to use 3.3V across the cable.
THANK YOU!
Ian.M:
Re: O.P's reply #27
The problem with component distributor parametric searches is usually they employ web developers to build them who don't have even half a clue about hands-on electronics, and the result is signed off on by a MBA who's probably never picked up a hot soldering iron. For most device parameters, for them to be meaningful you need to store both a minimum and a maximum value. Exceptions are specific maximum limit parameters which don't have a meaningful minimum.
e.g for a BJT, for its large signal gain hFE, lets say 100 to 400, the database would need a field for each limit. OTOH for IC(max), you only have a single value, lets say 600mA.
Therefore if the parametric search doesn't offer you two columns min. and max. for all such parameters and let you make multiple (and ranged) selections in each its borked and once you've got some possibles, you'll have to do a lot of extra work checking datasheets to confirm the actual limits are suitable.
It looks like Mouser's MOSFET 'Vgs - Gate-Source Voltage' parameter is just a nominal working voltage, i.e. the device will turn on in a usable fashion with that much voltage on the gate (relative to the source). It isn't the max voltage you can put on the gate without risking device destruction by gate oxide breakdown, it isn't the threshold voltage (which they have as a separate parameter, but don't have separate min. and max. limit columns for), and certainly isn't the gate voltage needed to pass a particular current. If you select 5V and 4.5V for Vgs, you'll get *MOST* of their 5V logic level drive capable MOSFETS, but that's no help whatsoever if you need 3.3V drive capable ones. To find them follow my Vcc/2 rule of thumb and look for Vgs_th in the range 1.65V to 1V: https://mou.sr/32tazAp You don't want too low a minimum as you don't want to risk the MOSFET turning on with a little stray voltage on the gate. You will have to check datasheets before ordering to confirm parameter limits.
Most regular MOSFETs have an abs. max. Vgs rating (gate oxide breakdown safety limit) of around 20V. Some low voltage MOSFETs have a abs. max. Vgs rating of only 8V. Typical gate drive (Vgs) in practical applications is often between 50% and 75% of the abs. max Vgs rating.
For the sensor RX line cutoff circuit I proposed, with the gate tied to 5V, Vgs would be 1.7V with a logic '1' on the line. For the MOSFET to stay on, max. Vgs(threshold) would need to be <1.7V You only get away with working right down to the threshold voltage because a CMOS logic input draws negligible current. If you have 3.3V sensor Vcc, andyou want to use the MOSFET to block voltage on sensor RX when off, it isn't going to work without a pullup and will need a very low threshold MOSFET, certainly below 2V and preferably below 1V so it isn't relying on the pullup to 3.3V for the majority of the risetime.
I *REALLY* don't recommend that. Better to bite the bullet, pay the extra and add a 74LVC1T45 buffer in the sensor RX line with VCCB from before your sensor power switch P-MOSFET, VCCA from after it and DIR tied to Gnd to make it one way , B(in) to A(out), to guarantee there's no current into sensor RX with the sensor Vcc off.
N.B. if you add two extra wires to the sensor cable to bring far end Vcc and far end Gnd back to the main unit, and use a regulator with enable and a feedback pin for the sensor Vcc supply in the base unit, you can remote regulate it to 3.3V AT THE SENSOR , and put everything required for the sensor interface with power monitoring and switching, including the sensor Vcc monitoring, except for the sensor ESD protection and extra bulk decoupling cap decoupling cap, in the main unit. There are a couple of other tricks to it needed for reliability e.g. at the main unit end fit a silicon diode between Vcc out and Vcc feedback so it doesn't blow the sensor with gross overvoltage if the feedback wire comes loose, and a few hundred ohms resistor between Gnd out and Gnd feedback for the same reason.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version