DRIVE MULTIPLE INPUTS WITH AN OUTPUT - BSS138 / BSS123 MOSFET - Page 1
Forum section: electronics / beginners

author: ieeeHuseyin
author_rank: Contributor
timestamp: May 14, 2024, 10:48:21 am
content: Hello,I want to control multiple mosfets via a mosfet with raspberry pi.Total number of mosfets to be switched is 180. (BSS138 or BSS123)I will only use it for on-off operation, not for PWM.I have shown the connection diagram below.Is there a mistake in this idea? Or can I do it in a different way?Should I add Gate limiting resistor for mosfets?

author: mariush
author_rank: Super Contributor
timestamp: May 14, 2024, 12:21:09 pm
content: I think it would be best to give more details about what you're trying to do because turning on 180 mosfets at a time is uncommon. And probably a p-channel mosfet would be better idea, not a n-channel to turn on all 1800.The mosfets are crappy and you also have a 1k ohm on the drain, so it seems like each mosfet would turn on and off a low amount of current.I would be concerned by the input gate capacitance times 180 ... you'll get quite a high spike each time you turn them on... I would have one resistor on each gate, a low value like something between 1 ohm and 10 ohm, and you'd want a gate to drain discharge resistor for each mosfet (something like 10-100k) anyway.But it would make more sense to reduce the number of components, by using mosfet arrays or other devices.For example, DMN3401 is dual n-channel mosfet in a small 6 pin package and it's 11 cents if you get 100 :https://www.digikey.com/en/products/detail/diodes-incorporated/DMN3401LVQ-7/17840213SSM6N56FE-LM from toshiba is another good example, dual n-channel mosfet at 15 cents if you get 100 :https://www.digikey.com/en/products/detail/toshiba-semiconductor-and-storage/SSM6N56FE-LM/5056497An even better solution - if the maximum current per mosfet is less than 140mA - would be a chip like ULN2003V12 (the mosfet version of the classic darlington version ULN2003A):Diodes Inc ULN2003V12 TSSOP :https://digikey.com/en/products/detail/diodes-incorporated/ULN2003V12T16-13/5054227Diodes Inc ULN2003V12 SOIC :https://www.digikey.com/en/products/detail/diodes-incorporated/ULN2003V12S16-13/5054094TI ULN2003V12 TSSOP :https://www.digikey.com/en/products/detail/texas-instruments/ULN2003V12PWR/3455513TI ULN2003V12 SOIC :https://www.digikey.com/en/products/detail/texas-instruments/ULN2003V12DR/3455512You can also get them on LCSC.com :https://www.lcsc.com/search?q=uln2003v12Basically it's 7 n-channel mosfets with built in esd protection, gate resistors, gate-source resistors, 100mA per channel with 3.3v signals, 140mA per channel with 5.0v signals, maximum 500mA through all 7 mosfets at a time.There's also a 4 mosfet version called ULN2003F12, still same limitations of 100mA/140mA , 500mA in total :https://www.lcsc.com/product-detail/Darlington-Transistor-Arrays_Diodes-Incorporated-ULN2003F12FN-7_C155522.htmlYou'd be able replace your 180 single mosfets with 26 uln2003v12 chips or 45 uln2003f12 chips.

author: ieeeHuseyin
author_rank: Contributor
timestamp: May 14, 2024, 01:03:40 pm
content: I will actually have a main pcb which will consist of an RPi.One bus cable is attached to this PCB.Sensors will be connected in parallel to this cable bus (I2C).One of the lines in the cable bus is the reset line of the sensors.I want to reset the sensors via this line with RPI. I will also use Mosfets for this.

author: CaptDon
author_rank: Super Contributor
timestamp: May 14, 2024, 01:29:36 pm
content: I can honestly say your circuit as shown seems to have no practical purpose? Why do you need to turn on 180 FET's that only seem to provide a current path through a resistor from +3.3vdc to the return rail?? Also, you would have to turn on the driver to turn off the 180 driven FET's. R25 at 1K would probably need an abnormally long time to pull 180 gates up to 3.3vdc due to all of the gate capacitance X 180 in parallel. Maybe give more detail?

author: mariush
author_rank: Super Contributor
timestamp: May 14, 2024, 02:26:20 pm
content: Quote from: ieeeHuseyin on May 14, 2024, 01:03:40 pmThen it doesn't make sense because all your sensors would reset at the same time.i2c as a bus is not designed to have more than 128 devices on it, and that's provided you can give each sensor a unique address. A lot of sensors will only give you 2-3 address bits to change at best, so you're unlikely to have even 16 sensors on one i2c bus without address conflicts.Have you considered using multiplexer chips? for example TCA9548A bi-directional 1 to 8 i2c multiplexer :https://www.digikey.com/en/products/detail/texas-instruments/TCA9548APWR/3615458Solves the unique address issue, you can put up to 8 of these on a i2c for a total of 64 devices on a bus, and you can have only one active out of the 8 at any time.Also, instead of playing with the reset, you could simply cut off power and give power back?

author: CaptDon
author_rank: Super Contributor
timestamp: May 14, 2024, 05:40:09 pm
content: So, although not shown, can we assume that there will be a reset line taken from the junction of the mosfet and resistor for each of the 180 mosfet/resistor junctions and taken out to a sensor? Is a reset signal that has a low of perhaps .05vdc and a high of 3.3vdc the proper reset levels for your sensor? As another poster stated, all sensors will be driven to reset at the same time which I guess is what you want. As for the I2C side of things, that can be tricky, and with 180 sensors on the same bus I think you will have signalling issues from loading, cable capacitance, poor signal shape and ringing. Probably best to break the sensors up into groups of 16 or similar? With 180 sensors I could run a large factory. What in the world are you actually doing???

author: ieeeHuseyin
author_rank: Contributor
timestamp: May 15, 2024, 05:30:14 am
content: I have attached the connection diagram of the sensors below.There is no problem with I2C addressing. They are grouped in groups of 30.But the reset line is common for all of them.Instead of controlling the reset line, the energy of the sensors can actually turn on and off. This can create a similar situation.Or the reset lines can also be grouped in groups of 30.So, is there a different integrated or circuit to reset so many ic(180) from a single point?

author: pcprogrammer
author_rank: Super Contributor
timestamp: May 15, 2024, 06:13:28 am
content: Looking at your setup, you can go with a single gate solution instead of MOSFET's. From the main MCU drive the 6 inputs on the MUX boards and from each board drive the 30 sensors. Reduces the load and within the 74 logic series there will be gates that can drive 30 inputs. No fanout listed but think of the SN74AHCT1G125 or 74LV1T126GV which are level translating line drivers.

author: kevin.gibbs
author_rank: Regular Contributor
timestamp: July 30, 2024, 03:11:57 pm
content: The gate capacitances of 180 transistors add up. When closed, a rather large pulse current can flow through transistor Q1. Therefore, it is desirable to install resistors in the gate circuit.