A heat dissipation device for cooling an electronic device. The heat dissipation device comprises a fan, a controller connected to the fan and coupled to the electronic device and a sensor connected to the controller and sending a first signal to the controller by detecting a temperature variation in the electronic device. The electronic device sends a second signal to the controller, the controller changes the speed of the fan according to either the first signal or the second signal.