I'm planning to create a project in which 20 or so household lamps are triggered by infrared sensors. Fading up as you walk towards them and slowly fading off again if the infrared sensors detected value is less than it was in the loop before.
I understand most of what I need to do, The main issue is that I'll need to control 20 MOSFETs with PWM.
Is this possible with any of the Arduino? I can only see up to 12 PWM pins on the MEGA.
Is it possible to use PWM while charlieplexing MOSFETs? Would this solve the issue?
How about using one of the chips with PWM outputs? I think most pulse low to turn on, so you'd want high side switching (PNP) and probably resisitors force a minimum load (i.e. >=5mA)for proper switching.
Think TLC5490, maybe WS2801/WS2803, parts like those.
I started looking about and stumbled across this PWM shield http://practicalmaker.com/tutorials/pwm-shield-documentation that allows control of 32 PWM pins.
Do you think this is a good route to take?
You're going to build up another card with MOSFETS and connectors for the lamps & stuff? Personally I would just put the TLC5940s on that card and connect over. If you find it easier to use this and then wire over to the MOSFETs, go for it.
Try 1 MOSFET & lamp before you get too far, make sure the High Side switching works as intended.