I seem to have the Mosfet wired in OK. I had it controlling a 9v led, fading up and down perfectly. When I wire it up to the 16v track i get a strange result - the mosfet can no longer be switched off and the voltage ranges from 16v and 24v when a PWM signal is altered.
Can someone give me clue if I have the right mosfet or if there is a better way of doing this.
bobster:
I seem to have the Mosfet wired in OK. I had it controlling a 9v led, fading up and down perfectly. When I wire it up to the 16v track...
Just how are you doing that?
Which PWM pin are you using?
If you digitalWrite a "1" to it does it go full on, and, if you digitalWrite a "0" to it does it go off?
It's running a motor, basically, but I'll bet there's no "flyback" diode across +V and that module's D terminal.
the very basic sketch i have been using for testing is here, I've been altering the output to pin 9 from 0 to 255. Should I be using a digitalwrite?
I'm not sure about the diode but I thought the module dealt with that?
bobster:
the very basic sketch i have been using for testing is here, I've been altering the output to pin 9 from 0 to 255. Should I be using a digitalwrite?
I'm not sure about the diode but I thought the module dealt with that?
If you have the motor/slot between +V and the FET module's "D", then there ought to be a diode across the motor/slot as previously described. (There's nothing on the board that way, it's an off-board consideration.)
void setup ()
{
pinMode (9, OUTPUT);
}
void loop ()
{
// ramps up and back down, then takes a 2 sec
// rest and starts over
analogWrite(9, 10);
delay (1000);
analogWrite(9, 75);
delay (1000);
analogWrite(9, 150);
delay (1000);
analogWrite(9, 250);
delay (1000);
analogWrite(9, 150);
delay (1000);
analogWrite(9, 75);
delay (1000);
analogWrite(9, 10);
delay (1000);
analogWrite(9, 0):
delay (2000);
Anyway, do show your work, sketch and photo your set-up.
D5 and D6 have a situation where very low PWMs are greater than the numbers (that's mentioned in the 'Reference'), that's why I asked how digitalWrite worked. Just trying to help you wring this out.
Has anyone found a solution to this issue. It seems to me that the issue is most likely a wiring one with the mosfet and not a software issue. Any help would be appreciated and I'll post a schematic of how we're running it in another reply.