control its spin rate with a message received from the digital pins (Max/MSP)

I'm guessing you mean via a Serial connection over the USB maybe?

Either way if all you want to control is speed that can be easily done using one of the PWM pins on the Arduino. However, because of the back EMF created by the motor you should switch it on by using a transistor or MOSFET with a protection diode. See the section on protection diodes for relays here http://www.kpsec.freeuk.com/components/diode.htm to get an idea. You'll probably also want to put a small ceramic capacitor (0.1 - 1.0 uF) across the terminals of the motor to smooth the switching noise.

If you want to control speed and direction of the motor you'll need an H-bridge.

By the way, since you say the motor is 5V I would be really careful about sharing the power line between your Arduino and motor since the motor will add a lot of noise to your circuit. If you must use the same power bus, put a big old capacitor from +5V to GND (100uF at least, the more the merrier).

hello, the answer is: I do not know, I put them back to pin 3 and 4 and still the same. The speed does not change with the message I receive from Max/MSP (0-255).

On the H-Bridge the connections are like on here:http://itp.nyu.edu/physcomp/Labs/DCMotorControl

except the switch pin (deleted from code as well)

1, Funny thing: If I unplug Motor Logic Pin1 (which is digPin 4 (LOW) ) the FAN still spins with the same speed. Does it just need HIGH to work?

2, Could anyone tell me what messages a PWM FAN needs in HIGH and LOW as minimum (lowest speed) and maximum (fastest)? Do I have to change both or just one to change the speed? 5V and 12V fans I am using.

Hello, on the playground page for "Using an Arduino to control the speed and direction of a DC Motor" it says that the schematics for that project are wrong, does anyone know where to get the correct schematics?

I couldn't find any info on the correct schematics.Looking at the parts, it seems that the relay is to actuate the motor from the external power supply (not 5V from Arduino).If that is the case, how can you write PWM to a relay and control the speed of the motor?In my understanding, a relay is either ON or OFF...