To get the gate pull down I placed a resistor across gate to source.
if you set the mode of the pin driving the gate to output and digital write low to it, then you measure 0.02v between mosfet gate and source
- yet the mosfet still conducts and the Peltier continues to cool
- this only happens when the Arduino is powered from a SMPS supply, not if it is powered from a linear supply
The reason for having a pulldown resistor between gate and source (or preferably, between the output pin and source, i.e the other side of the 100 ohm resistor) is to hold the gate low during the time that the Arduinio is powering up and running the initialization code. Once the pin mode has been set to output, the resistor has done its job. 10K is a typical value to use.
You probably need to put a high value resistor (like 47k or similar) between the gate and arduino ground to ensure the gate does not have any floating charge when not being intentionally supplied 5v.
Thanks, that's what I had in mind, but don't know how to derive the R value. It's a little different to dc42's suggestion of source to PWM pin. Does it matter which way I do it.
No rocket science on resistor value between gate and ground. A low value resistor will lower the voltage on the gate, so use a high value resistor to minimize the pin voltage pull down when the pin is supplying 5v. I can't answer to what dc42 is trying to accomplish.