Simplest way to invert when the LED is lit: (looking for a rework suggestion) - Page 1
Forum section: electronics / beginners

author: Odd
author_rank: Regular Contributor
timestamp: September 26, 2024, 08:18:38 am
content: The "Fault" is a digital open drain output with 10k pullup to 3.3v it as active low. (when there is a fault, it is pulled low)As you can see, I made an error so the LED is on when the line is high.The resistors are 0402, FET is SOT23-3 it is quite compact.What would be the neatest way to fix it?

author: Ian.M
author_rank: Super Contributor
timestamp: September 26, 2024, 09:43:36 am
content: We'd need a good closeup photo of that section of the board so we can see footprints and clearance round them.I'm assuming the LED FA1 needs to stay where it is. One approach would be to patch in a suitable P-MOSFET. Ideally it would be source to VCC, then a resistor from its drain to the LED anode, but if its Vgs_threshold is low enough, it might be acceptable to have the resistor in series with its source. If there's room round the 2N7002 footprint a SOT23 P-MOSFET skewed on the footprint to get its source and drain in the correct places, with a bodge wire from the gate pad to its gate pin could work . . .

author: PGPG
author_rank: Frequent Contributor
timestamp: September 26, 2024, 09:54:06 am
content: - delete MOSFET,- short its D and S pads,- cut the LED cathode connection to GND,- connect MOSFET G pad with LED cathode.or...- change the FAULT1 output logic.

author: Odd
author_rank: Regular Contributor
timestamp: September 26, 2024, 10:16:11 am
content: Thank you, - I cannot change the output logic directly as it is from an ASIC.If I were to replace the NFET with a PFET :I would connect it's Source to VCC , Drain to Resistor, LED, to GND. - and it should lit up when Gate is low, (and not pulled up to VCC) - (assuming this is correct)Would it also work if the Resistor and/or LED were between the VCC and Source, and drain was connected to GND?Aka: could only the FET be replaced by a PFET ?

author: tszaboo
author_rank: Super Contributor
timestamp: September 26, 2024, 10:19:04 am
content: Just to state, this is a very bad way of driving a FET. The Gate voltage needs to be higher than the datasheet value, because you put the LED in series with the gate and ground. Don't do that. Place the LED on the same side as the resistor.And how to invert it? Replace R with the LED, and remove the FET, and short out two of the pads.

author: Phil1977
author_rank: Frequent Contributor
timestamp: September 26, 2024, 11:13:16 am
content: If you can't directly connect the LED between +3.3V/5V and the open collector output then it´s possible to drive a PNP-bipolar transistor with it.If you insist on using FETs then you should probably take a small logic IC with a Push/Pull output.

author: Odd
author_rank: Regular Contributor
timestamp: September 26, 2024, 11:17:46 am
content: I forgot to mention that the open drain output is specified as 3mA max, that's why I do not drive a LED directly.

author: tszaboo
author_rank: Super Contributor
timestamp: September 26, 2024, 11:39:20 am
content: Quote from: Odd on September 26, 2024, 11:17:46 amJust set the LED current to be less than 3mA. Modern LEDs are plenty bright at even 1mA for indication.

author: magic
author_rank: Super Contributor
timestamp: September 26, 2024, 11:52:21 am
content: Fix what?One prototype board?A run of 1000 boards?The design of future boards?I suppose "rework" implies one of the former. So if the LED has to stay where it is, and the board is what it is, I would suggest finding some SOT23 logic level P-ch MOSFET and installing it on the N-ch's footprint upside down and rotated, so that S goes to the resistor, D goes to the LED and G stays where it is. Unfortunately, you can't leave D and S where they are because the body diode would conduct all the time. The FET must be a type which is reasonably turned on with just ~1.8V (the LED's forward voltage) gate voltage, otherwise you may be forced to also replace the resistor with a lower value and, if doing it on multiple boards, sample-to-sample variation may occur.A PNP might work instead without rotating, but only if you have a place to install a base (formerly, gate) series resistor and if VCC is no more (for long term use, ideally less) than 5V.

author: Odd
author_rank: Regular Contributor
timestamp: September 26, 2024, 12:47:33 pm
content: I decided to just improvise this on the current batch (5 boards * 3 LED's)Please verify that I did not cock up somethingThe PFET datasheet:https://www.lcsc.com/datasheet/lcsc_datasheet_1810171817_Alpha---Omega-Semicon-AO3401A_C15127.pdf

author: PGPG
author_rank: Frequent Contributor
timestamp: September 26, 2024, 12:53:22 pm
content: You have told that FAULT1 comes from 3V3 powered something, but you never said if VCC is 3V3 or 5V.There were some sentences about 3V3 and 5V and you didn't questioned it so I'm not sure what is VCC.And being correct/not correct of this circuit strictly depends on it.

author: Odd
author_rank: Regular Contributor
timestamp: September 26, 2024, 01:11:03 pm
content: VCC is 3.3v - FAULT1 is open-drain, pulldown to GND, 2mA max, with a 10k pullup to VCC. (the 10k pullup is defined by chip manufacturer)

author: BrianHG
author_rank: Super Contributor
timestamp: September 26, 2024, 02:27:01 pm
content: Just use an PNP transistor in emitter follower configuration.Wire the LED from VCC to a current limiting resistor to the 2N3906 emitter.Tie the collector to GND.Tie the base to your IO pin.Remember that you will loose 0.7v, IE the transistor output will pull the emitter down to ~0.7v when the IO pin is low.IE:, with your LED tied to a 3.3v VCC, when on, it will get ~2.6v max when on.With you LED tied to a 5v vcc, when off, the LED will get around 1v, when on, the LED will get around 4.3v.Adding a diode in series with the 5v feeding the LED means off = ~0.3v, on = ~3.5v.Driving the base with 1ma should give you over 150ma output to work with.

author: magic
author_rank: Super Contributor
timestamp: September 26, 2024, 02:33:31 pm
content: Quote from: Odd on September 26, 2024, 12:47:33 pmLooks OK, and it may even work without moving R44 from its original position.(But moving it is better for a future production fix.)