20 sensors to make decision of controlling 48 MOSFETS

hi guys noob here.

I need to be able to sense 20 analog signals and control 48 MOSFETS with my board. I only have 12 digital pins and 6 analog pins, I believe. How can I do this?

The conceptual issue I'm having is that my network of MOSFETS needs to be able to hold their switch state/gate high or low, which means the board needs to KEEP the signal high or low for their respective MOSFETS. But how can I possibly hold the signal high or low when I need to switch between the mosfets to control them? There is no way I can send 48 parallel signals to my network.

Now I have found this cool shield from Sparkfun Mux Shield II - DEV-11723 - SparkFun Electronics but I am afraid it wont work for the reasons mentioned above. essential it uses shift registers and multiplexers to give me 48 pins.

Someone has suggested using SparkFun I2C Expander Breakout - PCF8575 found here SparkFun I2C Expander Breakout - PCF8575 - BOB-08130 - SparkFun Electronics ... stating that it will give me all the pins I want by connecting multiples of this device to I2C, but again I am not sure if this will work and/or how it would work.

Can someone please take the time to explain, in as much detail and simple terms as possible, how I can accomplish this goal.


You can daisy chain 6 74HC595 (or equivalent) shift registers to get the 48 latched outputs. That is probably what is on the first shield. For analog inputs there are analog multiplexers of various channel numbers (CD4051 is 8 channels). You could have 3 4051s each outputtig to an analog channel. That gives you 24 input channels. What kind of speed to you need for the sample rate? The I2C expander is another way to increase the number of digital inputs, but I think shift registers are faster.

I think what you are afraid of is with shift-registering the output keeping the respective output HIGH or LOW even when not addressing it, the shift-registers have set/reset flip-flop outputs so once set or reset they stay that way.

Tom.... :slight_smile:
How much experience have you with electronics programming and hardware.

thank you Ground and Tom for your time.

ohhh ok so the outputs are latched!... yes this was my conceptual dilemma.

Can any one confirm that this Mux Shield II DEV-11723 latches the output.. I'm pretty sure it does. This quote from the user guide "If the row is an output, the control lines are used as clock and latch lines to the shift registers." does this mean that outputs are latched?? If I can use this shield it would probably be best so I don't have to wire all the components myself.

Ground, I don't need to sample the sensors at high speeds, nothing close to the rate of the board. as long as I can get the data relatively fast I'm ok, relative to changes in environmental conditions, like changes in light conditions, shadows and what not.

Tom, my experience is strictly academic, too much theory, not enough application. That said, as a fourth year Comp Eng student I feel ashamed I didn't know the answer to my question. I do have lots of programming experience, but limited programming hardware, although we have done some more in 4th year, doing it now actually. in short Junior!... and I have Junior level knowledge of electronics... but it's all theoretical.

I will look in to implementing both your suggestions, but would appreciate some more of your time! lol ... kind of on strict deadlines over here.