schematic review_Switching MOSFETs. - Page 1
Forum section: electronics / beginners

author: clocksticking
author_rank: Newbie
timestamp: June 05, 2024, 07:19:45 am
content: Hi. I'm trying to build a circuit that switches contacts with relays and I want to indicate each contact with LEDs.I wonder if this circuit will work as I intended.considering C2_CC_CTRL = GPIOi wonder when GPIO signal is "high" other chips work as, Q14 MOSFET = "ON", D29 LED = "ON", SW12 Relay = "LOW", Q13 MOSFET = "OFF", D27 LED "OFF".let me know if I've missed any information to present." alt="" class="bbc_img" />

author: aliarifat794
author_rank: Regular Contributor
timestamp: June 05, 2024, 08:28:58 am
content: I think it is better to give a try first. Maybe in a breadboard. Or you can simulate in proteus or something like that.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: June 05, 2024, 11:53:53 am
content: I agree with building things like this on a breadboard.It does not really matter whether this circuit work or does not work unmodified. The goal of building it on a breadboard is to measure all voltages (& currents) and understand why it does (or does not) work.Some hints: R52 and R54 are not reall needed for FET's. But they can save the circuit controlling the FET if the FET gets damaged somehow. Putting a resistor on a breadboard is also just as easy as puttnig a wire on a breadboard.When Q14 is off, D29 and R53 pull the gate of Q13 upwards, but the threshold voltage of D29 may prevent Q13 from fully turning on. (Ugs is o1 to 2V5, and some leakage though the LED probably pulls the FET gate to above 3V5, but it's not a great design.What sort of input signal do you have for Q14?Circuits area easier to analyze and understand if you keep with common conventions: Voltages go from top to bottom, and signals go from left to right.

author: calzap
author_rank: Frequent Contributor
timestamp: June 05, 2024, 02:56:29 pm
content: Curious as to why the relay contacts are being used in parallel. Redundancy for reliability? If it’s for doubling the current capacity, that often doesn’t end well. Some other reason?Mike

author: Kim Christensen
author_rank: Super Contributor
timestamp: June 05, 2024, 03:37:46 pm
content: Quote from: Doctorandus_P on June 05, 2024, 11:53:53 amI agree. There should be a pullup resistor to +5V on the drain of Q14 to ensure the gate voltage on Q13 reaches 5V when Q14 is off.

author: clocksticking
author_rank: Newbie
timestamp: June 06, 2024, 11:07:11 pm
content: thank you for your advise.I also agree that it is better to try it on a breadboard or simulator. I'll find a way to do it.R52 and R54 is there for current limit protection as you've guessed.the signal is GPIO from STM32F407VGT6, 3.3V.the threshold voltage of Q13&14 is 1V so I thought it won't be a problem(since the Id needed is just about 40mA for Q13 and 5mA for Q14).but I'll try it with the pull-up resistance to fully ensure enough Vgs.your advise really helped me, thanks!

author: temperance
author_rank: Super Contributor
timestamp: June 06, 2024, 11:17:53 pm
content: QuoteWhy the signal inversion? Is the relays supposed to be on when Q14 is not driven?

author: clocksticking
author_rank: Newbie
timestamp: June 06, 2024, 11:23:53 pm
content: Quote from: temperance on June 06, 2024, 11:17:53 pmthe relay's datasheet says pin 2 & 7 is for the off and 4 & 5 for the on

author: temperance
author_rank: Super Contributor
timestamp: June 07, 2024, 03:58:07 pm
content: QuoteI get that. But if you remove one inverter and swap C2_CC1 and C2_CC2 you will have the same circuit where High is CC2 and Low is CC1 like in the original circuit.

author: clocksticking
author_rank: Newbie
timestamp: June 09, 2024, 11:10:15 pm
content: Quote from: temperance on June 07, 2024, 03:58:07 pmthat was original circuit but I've put one more inverter to indicate the connection with LED. Do you have any better idea to switch 2 LED with one signal?

author: Kim Christensen
author_rank: Super Contributor
timestamp: June 10, 2024, 02:49:41 am
content: Here's one way to drive 2 LEDs with a logic gate

author: xvr
author_rank: Frequent Contributor
timestamp: June 10, 2024, 09:51:17 am
content: QuoteYes, use 1 pair of relay contacts (unless youreallyneed them to be paralleled, for example for increase current capacity)

author: clocksticking
author_rank: Newbie
timestamp: June 10, 2024, 11:14:14 pm
content: Quote from: Kim Christensen on June 10, 2024, 02:49:41 amI don't get this diagram. Can you describe more details how this is showing the way to switch between 2 LEDs with a single signal?

author: Kim Christensen
author_rank: Super Contributor
timestamp: June 11, 2024, 02:10:42 am
content: QuoteLike this:

author: clocksticking
author_rank: Newbie
timestamp: June 11, 2024, 06:24:19 am
content: Quote from: Kim Christensen on June 11, 2024, 02:10:42 amThanks for your additional explanation. I've never thought of the way you've suggested. I'll examine if this circuit can be applied to mine.How ever, I'll still have to work on the value of resistors, it looks a bit tricky to control Vgs under the Vth since the Vth is just 1V for the fet I'm using.I'm thinking I have to increase the value of resistor for D1 to limit Vgs when the signal is low, I'm not sure if there's a value to keep fet off and D1 to lit up.But again, great thanks for your advise.

author: ArdWar
author_rank: Frequent Contributor
timestamp: June 11, 2024, 06:34:41 am
content: Why would you even need to worry about that? STM32F GPIO is guaranteed to be 0.4V or less when sinking 6mA, implying about to 60 ohm impedance, and in practice it's much lower than that. You're unlikely to draw much more than a couple mA for an indicator LED.Or do you intend to drive some serious current into the LEDs here?

author: clocksticking
author_rank: Newbie
timestamp: June 11, 2024, 07:29:51 am
content: Quote from: ArdWar on June 11, 2024, 06:34:41 amI'm not so worried about the LEDs current. I'm worried that when the signal is LOW, the gate voltage will be over Vth.Which will result in activating the relay even when the signal is LOW.

author: Kim Christensen
author_rank: Super Contributor
timestamp: June 11, 2024, 03:29:56 pm
content: Well, as you can see fromthe 2N2007K's datasheet, the worst case for Vth is 1.0V. As long as the MCU's GPIO pin can sink the required current, and go lower than 1V while doing so, then this won't be an issue. TheSTM32F407VGT6's datasheet(VOL on page 116) shows that if an IO pin is sinking 8mA, then the voltage on it will be no higher than 0.4V as mentioned by ArdWar. (except for PC13, PC14 and PC15 which are only good for 3mA)With modern LEDs even 1-2mA of current will be plenty bright enough for an indicator light. 8mA would be annoyingly bright.

author: kevin.gibbs
author_rank: Regular Contributor
timestamp: October 02, 2024, 01:17:13 pm
content: First, a question: why did you decide to supply the same LEDs with different currents (using different resistors at the same voltage)?Secondly, a remark: Q13 opens through the LED, which drops about 2.1V. So, only 2.9V will reach the transistor. In your case, everything should work, but if you want to change something in the circuit, keep it in mind.

author: PGPG
author_rank: Frequent Contributor
timestamp: October 02, 2024, 02:04:39 pm
content: Quote from: kevin.gibbs on October 02, 2024, 01:17:13 pmDo you think this 4 months old relay circuit is still under designing?