Circuit to pull signal to ground through resistor - Page 1
Forum section: electronics / beginners

author: horse_ebookmarklet
author_rank: Contributor
timestamp: February 19, 2022, 05:45:06 am
content: I'm having some lack-of-direction (from inexperience) designing a circuit and I would appreciate some wisdom.I have a existing design, where a physical button that pulls a signal to ground via 100Ohm resistor.I'd like to be able to do this with an I/O pin of my FPGA.My requirements:Pull a signal to ground, via 100Ohm resistorLittle current required; Multimeter cannot reliably measure.Be driven by a 3.3v logic signal, circuit is not active by defaultSurface mount part, minimal part count, minimal BOM costSwitching time is irrelevant (very slow is fine)If I had to chose right now, based on what little I understand, I am leaning towards a mosfet. This is because I don't have to add a unique BOM item for a base current resistor. This seems to be slightly higher cost but less unique parts.Is this the right path to go down? Any specific recommendations on parts? Selecting parts on digikey is impossible when there are so many, and I lack experience.Below are my two current lines of thought. What would I select for for Q1/Q2/R5, assuming these designs make any sort of sense?

author: fourfathom
author_rank: Super Contributor
timestamp: February 19, 2022, 06:34:08 am
content: You need to tell us more about this PWRK signal. Is it DC (and what voltage)? AC?But the MOSFET is probably the best approach as it has a purely resistive ON-state, where the NPN transistor will have perhaps a 0.1V saturation voltage when on. Look for a FET with a low "VGSON". Here's one I pulled up on the Mouser site:https://www.mouser.com/ProductDetail/Vishay-Siliconix/SI2312CDS-T1-BE3?qs=CiayqK2gdcJDWhcnuXp08Q%3D%3D(it costs about $0.40), but there are probably others that are more common and perhaps better.

author: mosafet
author_rank: Contributor
timestamp: February 19, 2022, 07:08:41 am
content: Unless there are special requirements I use the good old 2N7000 or 2N7002 for this type of stuff. I keep hundreds of them on hand.I also use a lot of Diodes Inc DMN and/or DMP devices for tiny high-current situations with very low on-state resistance. I hate soldering those things though so I don't tend to use them unless I'm creating a PCB or modifying a PCB.

author: horse_ebookmarklet
author_rank: Contributor
timestamp: February 19, 2022, 03:41:56 pm
content: PWRK is a DC signal, pulled to 3.3V via 47K resistor. The user-pushbutton pulls it to ground via 100Ohm resistor when pressed. V/IR, current should be 0.2 milliwatts, but I don't have anything that can reliably measure this. I am not sure why the 100Ohm resistor is even there, it contributes so little.I've also thought I can connect this directly to my FPGA I/O, either high-z or ground. So far I am trying to keep the design as isolated as possible. Trying to have buffers on everything, keep the unconfigured FPGA I/O off of the numerous signals of this pre-existing device.So both of you are saying N-Channel mosfet is the way to go. I'll look around for low Vgs(on), digikey it seems easier to search for Rds(on), which I understand the voltage and resistance are related somehow.I plan to build between 100 to 1000 boards, so in quantity the mouser parts are cheap enough.Also, do I have the 100Ohm resistor in the correct place? Its location should matter little for a MOSFET design, right? With the NPN if I had it on the emitter side that would alter the gate current, so it should be on the collector side?

author: langwadt
author_rank: Super Contributor
timestamp: February 19, 2022, 04:02:16 pm
content: Quote from: horse_ebookmarklet on February 19, 2022, 03:41:56 pmif PWRK is only from 3.3V you can connect it directly to the FPGA (keep the 100R for some added ESD protection)

author: horse_ebookmarklet
author_rank: Contributor
timestamp: February 19, 2022, 05:08:21 pm
content: Quote from: langwadt on February 19, 2022, 04:02:16 pmI've noticed that the other data bus signals (also 3.3v) can "leak" backwards into the FPGA when the FPGA isn't powered.I see weird FPGA behavior and my status indicator LEDs flicker in an odd way.Because of this I am trying to have buffers between all FPGA interfaces and the unit that its installed in.I'm not sure how the system would behave if I did this

author: Damianos
author_rank: Frequent Contributor
timestamp: February 19, 2022, 05:09:37 pm
content: As there is a switch, to control the input, there is (probably) also a debouncing capacitor. The role of the 100Ω resistor is to avoid a direct short of the charged capacitor. Depending of the device that reads this signal and the relative physical positions, it may also help to reduce interference and protect the input "from accidents".For the MOSFET, if it will be used, any small signal one with low VGS(th)and low IDSSis appropriate.EDIT: Then use the MOSFET, it will isolate the input.

author: fourfathom
author_rank: Super Contributor
timestamp: February 19, 2022, 05:52:58 pm
content: Can you describe the switch connection more completely? I think we can all make a pretty good guess, but it would be best to see a schematic.And yes, the 2N7002 looks like an excellent choice, with a reasonably low VGS (ON), suitable for 3.3V operation. You can get these for under 15 cents from DigiKey, and for less than 3 cents each from LCSC. The 2N7000 should also work, but it has a slightly higher VGS (ON)and over the full temperature range the margin isn't as good.

author: horse_ebookmarklet
author_rank: Contributor
timestamp: February 19, 2022, 07:30:51 pm
content: Quote from: fourfathom on February 19, 2022, 05:52:58 pmI don't have good schematics of the device I'm working with, mostly reverse engineered.Here is a drawing of the circuit. Note I didn't connect the other 40 pins on the FFC cables, only the signal of interest.I am thinking this device from digikey. Available and cheap. How does this look?edit: forgot linkhttps://www.digikey.com/en/products/detail/diodes-incorporated/2N7002A-7/3451498

author: fourfathom
author_rank: Super Contributor
timestamp: February 19, 2022, 08:29:58 pm
content: OK, thanks, that circuit looks about as we would have expected.You should probably add some transient protection to protect against ESD (electrostatic discharge) from someone zapping the pushbutton when they touch it. The simplest approach would be to add a diode (1N4148 or equiv) from the left-hand connector pin 3 to a 3.3V or 5V supply on your board (diode anode to Pin 3). Slightly better would be a Zener or a TVS (transient voltage suppression diode), between Pin 3 and local ground.I am curious about that 22 pF capacitor on the main board. I assume it's there for switch debounce and some degree of transient protection -- if so it should probably be around 0.1 uF, which will give you a debounce time of around 5 milliseconds (time constant = R * C, or 47K * 0.1u). 22 picofarads is so small it might as well not be there. The circuit will work without that capacitor, but might require more aggressive software debounce.And that OnSemi 2N7002 is perfect.

author: Damianos
author_rank: Frequent Contributor
timestamp: February 20, 2022, 10:00:57 am
content: Generally I agree, more or less, with whatfourfathomsays.If the ESD protection is needed, I think that the simple signal diode is the better solution, because of the high value of the pull-up resistor, the leakage current of a Zener diode may create issues...The mentioned capacitor is probably not 22pF, I guess it is 22nF. Except if it is an "emergency" signal that needs to ensure a "secure" pulse, even with a very short push of the button, using a higher value capacitor, like 220nF or even 2.2μF.The selected MOSFET seems "good enough", except if it will operate at high temperatures that increase the leakage current (because of the 47kΩ resistor).I think that, before the final production, a construction of a few samples and testing, in various conditions, will save materials, time and, finally, money.

author: langwadt
author_rank: Super Contributor
timestamp: February 20, 2022, 01:22:07 pm
content: Quote from: fourfathom on February 19, 2022, 05:52:58 pmthere's also the option of even cheaper pre-biased transistors, aka "digital transistors"https://lcsc.com/product-detail/Digital-Transistors_LRC-LMUN2211LT1G_C12775.html

author: fourfathom
author_rank: Super Contributor
timestamp: February 20, 2022, 06:29:36 pm
content: Quote from: Damianos on February 20, 2022, 10:00:57 amGood point. I've not studied FET characteristics much, so for my own edification I'm figuring this out as I type:The maximum IDSS(drain-source leakage current at zero volts gate voltage) for the 2N7002 is 1uA @ 25C, and 500uA @ 125C. The actual performance is probably better than this (an order of magnitude according to the app notes I'm reading), but let's use the spec we're got. The leakage is spec'd at 60V, and I believe the leakage is somewhat ohmic, so with 5V on the drain the leakage might be 42uA @ 125C. With a 47KΩ resistor that equals a 1.9V drop -- definitely a problem. But if we drop the temperature from 125C down to 75C the leakage drops by a factor of about 20 (see figure 3 in this note:https://assets.nexperia.cn/documents/application-note/AN90009.pdf). That takes us down to 2.1uA, or a 0.1V drop across the 47KΩ resistor. This shouldn't cause a problem. Even if my "Ohmic" assumption is wrong and we use the 60V leakage value we have a voltage drop of 1.1V across the resistor at 75C. Not great, but probably not enough to not work.My conclusion: I agree, it's probably OK, but should be tested at the max design temperature. Better yet would be to change that 47K resistor to say 10K or less.Comments would be appreciated.

author: fourfathom
author_rank: Super Contributor
timestamp: February 20, 2022, 07:55:39 pm
content: Quote from: Damianos on February 20, 2022, 10:00:57 amYes, typical Zener leakage could be an issue, a low-leakage TVS diode would be more suitable.One potential issue with the typical "diode to Vcc" overvoltage clamp is that if the offending voltage has any current in it then the diode can push Vcc above a safe value. This of course depends on the transient source impedance and duration, and the bypass capacitors and the regular load on Vcc. For the typical short-duration, low-energy transient this isn't a problem.

author: Damianos
author_rank: Frequent Contributor
timestamp: February 20, 2022, 09:07:23 pm
content: The document that you provided (thanks for that!) says that the leakage current of a given component is "almost absolutely" depended of the temperature and not the applied voltage. But it also agrees with what you say for the values that in reality will be way lower of the limits. Also, because part of the leakage is due to material imperfections, your assumption of the "somewhat ohmic" behaviour of the leakage seems valid.If the tests of the OP shows a problem with that, I think that the simpler solution is to put a resistor on the new board, at the place mentioned for the ESD protection diode, to "absorb" the leakage, instead of modifying the original board.A note on this: if the 3.3V of the main board is present on a pin of the connectors on the new board it must be used for these two components, if not, then a little more examination is needed. The placement of a somewhat big capacitor between this and the ground, to absorb any ESD and avoid to inject interference, I think is a good idea.Some thoughts about the necessity of additional ESD protection. The original device was designed without that, so probably the internal protection of the MCU that receives the signal maybe is enough. If the button switch is mounted on a grounded (the same as the circuit) conductive panel (like aluminium) then the charge of a hand touching it will be absorbed of the spark there. Also if the flat cables are of the "classic" low voltage type then part of the remaining ESD energy will be distributed and absorbed in more than one places reducing the possibility of a damage to almost zero.

author: fourfathom
author_rank: Super Contributor
timestamp: February 20, 2022, 09:24:29 pm
content: Quote from: Damianos on February 20, 2022, 09:07:23 pmYes, I saw that leakage equation containing no voltage parameter. But there was also the graph showing the real-world leakage vs voltage and there was a strong voltage dependency (because of imperfections). That chart didn't show a linear resistive characteristic, but it definitely sloped in that direction.Quote from: Damianos on February 20, 2022, 09:07:23 pmTrue, but I was thinking about the new MOSFET as well. It may not benefit from the MCU internal protection. I do like your idea of putting a resistor on the new board, in parallel with the existing 47K.I appreciate the feedback!

author: horse_ebookmarklet
author_rank: Contributor
timestamp: April 26, 2022, 02:47:33 am
content: Hey All,Doing some necromancy on this thread. I built the circuit as discussed (pictured in attachment). It doesn't work as I intended.Recall that I am developing a modification for an existing product. The PWRK is pulled to 3.3V by the existing host system. There is an existing user panel button that drives PWRK "low" via 100 Ohm resistor. The purpose of this circuit is to emulate this button press.I expect that this circuit would "leave alone/high-Z" the PWRK signal when the gate is 0v, and "drive it to GND via 100 Ohm resistor" when the gate is 3.3v.It appears that the transistor is allowing some current from PWRK to go somewhere (either the gate or the source...). Not a ton of current, as the PWRK signal (measured at R9) is at ~0.8V.What'd I do wrong here?

author: horse_ebookmarklet
author_rank: Contributor
timestamp: April 26, 2022, 11:20:08 pm
content: I think perhaps I got the mosfet footprint backwards and the body diode is pulling the signal down, hence the ~0.8v. Going to try a white wire.edit: yep that was the problem