Motor R3 shield to control 120mm case fan

I am struggling to find some code to "borrow & edit (trial and error style)" to drive a 3 pin fan from one of the plug outputs on the R3 Motor shield.

It's not been for lack of effort searching, but possibly for lack of skill searching.

I have an "Enermax quiet" 12 V fan (plugged into the orange "out ~5"), and have a 12V DC source fed into the "v in" and "gnd" pins.

Were I smarter I would write up my own code, but unfortunately I am brand new to Arduino and code-writing.

I'm using the Mega 2560 R3 and the Motor R3 shield, if that makes any difference...


Did you look at the schematic for the board? If you had, you would notice that the orange connection points are to connect 5V devices. There is no way that the 5V power source is going to drive your 12V fan.

The ~5 part means that analogWrite(5, someValue) will control the speed of the 5V device connected there.

I have an in line charge pump to boost it to 12V.

Running the fan from one of the screw terminals is fine with me too.

I am happy to start with a 4.8 v (or whatever) motor if someone might point me to a working sketch to control it.

Thanks! :slight_smile: