I am using PWM to control the speed of the fan on my RPi 2. The problem is, when I am PWMing it, a clicking sound can be heard from the fan.
I am using a 6v power supply for a 5v fan to compensate for the voltage drop over the transistor. Even when I am using a 5v supply the clicking sound can be heard. Here is how I have it set up:
My code (or at least the important part of it) is shown below:
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setup(32, GPIO.OUT) base=GPIO.PWM(32,10) #this defines board pin 32, gpio pin 12, and makes the PWM 10 times per second, I think base.start(0) base.ChangeDutyCycle(0) ... if temp>40000: #set fan speed to 80% base.ChangeDutyCycle(80)
How do I do this so that the fan makes no clicking sound?