0
\$\begingroup\$

EDIT: Original post was phrased as XY problem.

What I need to do: Determine if power at "Switched power" is being turned on by SW1/FET combination or other power sources not pictured in the diagram below (there are multiple sources). My first thought was to sample the voltage on the switch line - if it is pulled low, the FET is turning on the power. If it is high, it is not.

Original post:

I'm trying to determine how to measure the voltage V? in the below circuit. It is a high-side switched power circuit using a P-channel FET that is off when SW1 is open.

schematic

simulate this circuit – Schematic created using CircuitLab

However, I'm balancing a few competing problems:

1) Resistance into the ADC is too high. By my measure I'd need to keep the sample frequency <100k per second to get a value (computed from answer to Protection of ADC inputs) but the sample rate is 2 Msps on the processor.

2) I can't decrease R1 enough to fix #1 or the voltage V? will drop too much, possibly turning on the FET or putting it into a partially conducting state with high resistance (aka bad).

3) I can't decrease Rfet or it will pass too much current when SW1 is closed.

Note I don't really need an accurate measurement here, I just need to determine if it's GND or some other voltage value. Aka on or off.

Is there a better way to go about this? I saw mention of possibly using an op amp at the sample point.. Obviously the fewer components the better but whatever is required is required.

\$\endgroup\$
7
  • 3
    \$\begingroup\$ One op-amp in a buffer configuration will most likely suit your needs. - If you don't care about the specific voltage levels, then why are you feeding it into an ADC? Smelly smelly XY XY problem. \$\endgroup\$ Dec 3 '17 at 20:20
  • 1
    \$\begingroup\$ @HarrySvensson: That's an answer, and probably the answer. Would you like to post it as such? \$\endgroup\$
    – JRE
    Dec 3 '17 at 20:23
  • 3
    \$\begingroup\$ @JRE No, I won't post that as an answer, because whatever OP is actually trying to solve has most likely some other better solution. - If someone else wants to post my comment as an answer, that's fine with me, but I won't give an answer to a question that has an XY smell to it. \$\endgroup\$ Dec 3 '17 at 20:30
  • 1
    \$\begingroup\$ @IanBland yeah, but what the OP is doing makes little sense, or only makes sense if there are bizarre constraints applied to this problem. The obvious solution is to use a digital input instead of an analog input. \$\endgroup\$
    – mkeith
    Dec 3 '17 at 21:05
  • 1
    \$\begingroup\$ @HarrySvensson I am now enlightened as to what an XY problem is. I suspected there was probably 1) a way to make this work and 2) a better solution, hence the ask to the community. \$\endgroup\$
    – Ray Ackley
    Dec 4 '17 at 1:52
5
\$\begingroup\$

Since your switch is pulling to ground, and you only want on-off indication, a simple diode circuit should work, assuming you are not using very low voltage logic.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
5
  • 2
    \$\begingroup\$ +1 good suggestion. I'd add 1K or so in series with GPIO. \$\endgroup\$ Dec 3 '17 at 20:42
  • 1
    \$\begingroup\$ This also avoids sequencing issues since the GPIO is pulled up to processor VCC. And diode orientation insures current will not flow into unpowered processor. \$\endgroup\$
    – mkeith
    Dec 3 '17 at 20:54
  • \$\begingroup\$ @SpehroPefhany ya a little extra protection would not hurt I guess though R3 would presumably be large already. \$\endgroup\$
    – Trevor_G
    Dec 3 '17 at 20:58
  • 1
    \$\begingroup\$ I think maybe Spehro is concerned about the path from GPIO, through D1, through the closed switch to GND. Obviously, if the GPIO is configured correctly as an input, this is not a concern. \$\endgroup\$
    – mkeith
    Dec 3 '17 at 21:03
  • \$\begingroup\$ @mkeith ah yes... good point. I did not consider that case. \$\endgroup\$
    – Trevor_G
    Dec 3 '17 at 21:04
2
\$\begingroup\$

1) What's stopping you from reducing the sample rate to 100ksps? That should be a firmware thing.

2) If you just need on/off, then using an ADC is not the way to go. You can use a transistor. Eg- this circuit will respond in less than 10usec or so:

schematic

simulate this circuit – Schematic created using CircuitLab

Or go directly into a GPIO if you feel lucky. However you might need a bit more complex circuit since I doubt (I hope) your schematic does not actually represent the real circuit, since the abs max Vgs for that MOSFET is +/-20V and your shown circuit would put 28V on it.

3) A unity gain buffer op-amp such as MCP6001 will work if you really want to measure voltage.

4) If you can add a diode at the p-channel MOSFET drain you can isolate the output of that particular MOSFET and measure it. It will also allow you to detect a failure of the MOSFET (for example, that caused by excessive Vgs). Cost is a diode and the associated voltage drop.

\$\endgroup\$
2
  • \$\begingroup\$ #1) I'm using TinyCLR - it doesn't look like changing the sample rate is easy, but more importantly I had the feeling I was barking up the wrong tree the way I was doing it. #2.5) Good catch, thanks, that just saved me a FET, a board run, some solder paste, etc etc.. :-) #4) Unfortunately a diode there isn't a good option here as there is a large amount of current (40-60A) being passed so that generates a ton of heat quickly. I have one upstream but is is external to the whole circuit (SOT227 GSXD080A004S1-D3). \$\endgroup\$
    – Ray Ackley
    Dec 4 '17 at 2:08
  • \$\begingroup\$ If there is 40-60A through that particular MOSFET you might want to think twice about switching it that slowly. 8-( \$\endgroup\$ Dec 4 '17 at 6:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.