I'm using my arduino to dim my leds via PWM and a mosfet. Is if possable to add another MOSFET on the same negitive wire and hook it up with a pot?
The idea would be to leave the PWM sketch running so the led has a sunrise and sunset dim. Going all the way from 0 to 255. But the pot would alow me to turn down the power without editing the code. Make since?
mcreefer:
I'm using my arduino to dim my leds via PWM and a mosfet. Is if possable to add another MOSFET on the same negitive wire and hook it up with a pot?
The idea would be to leave the PWM sketch running so the led has a sunrise and sunset dim. Going all the way from 0 to 255. But the pot would alow me to turn down the power without editing the code. Make since?
No, wiring a second mosfet in parallel to the first one, but controlling this added mosfet with a variable gate voltage via a pot would only allow you to manually increase the brightness on the led, at the point where you are overriding the duty cycle value of the pwm controlled mosfet.
Thinking a little more - are you considering 2 MOSFETs with supply-load-Drain-source-drain-source-Gnd?
Maybe if you PWM'd both, one from a 555 putting out pulses, and the other from the Arduino.
Are we talking about high current LEDs? or just regular 10-20mA? If they are lower power, a low value potentiometer wired in series will limit the maximum current (and hence brightness).
You want the Pot resistance to be at the normal setting near the middle of it's range (e.g. use a 200 Ohm pot if you will typically use 100 ohms) and make sure the power rating of the pot is 2 or more times what the expected power is (pots can't dissipate full power near the low end of travel).
If they are high power LEDs you probably want a current limit that is controlled by the pot.
CrossRoads:
Thinking a little more - are you considering 2 MOSFETs with supply-load-Drain-source-drain-source-Gnd?
Maybe if you PWM'd both, one from a 555 putting out pulses, and the other from the Arduino.
It is high power. 2Amps. The point of this is I'd be able to give a finished lighting product to someone with a preset time and dim sketch running. So I don't want the end user getting into the sketch because the LED is to bright when its at full power. So I would like to wire in a pot (not sure if it would use a mosfet or not, I guess thats the advice I'm looking for is how to wire this in) so they can turn down the overall brightness but my code would still be intact and thinking its running at full power.
Ok So I think I got it. I was going about this wrong. I can hook a pot up to my arduino and tell the sketch to use the read as the max value. This will take some changes in my sketch but in the end I think it will work as desired.
Here's my source. Except mine would be a 20W LED on a MOSFET.
Exactly - if you can read a pot, take that 10-bit value & shift it right 2 bits, you have an 8-bit value you can use as analogWrite for PWM, or use it influence the PWM you use otherwise.