so if the transistor is open, 0V is on the PWM input, and when it is closed 5V is on the PWM input. No, the base should be connected to a GPIO, via a (4K7) resistor, the emitter should be connected to GND, and the collector should be connected to the PWM input of the FAN, AND via a (10K) pullup resistor to 5V. When I connect it to a different GPIO I can now actually control the fan properly using pigpio: Indeed my GPIO18 has died, I cannot control an LED or anything else with it :/ Luckily the overall unit seems to still work. Or did I misunderstand you here?Īlso, out of curiosity, what exactly do you mean by "the GPIO is closed"? The emittter-PWM control connection must go through the 2K2 resistor, and a 4K7 between the Base and GPIO15. Regarding the NPN: as far as I understand I have to connect the Base to GPIO15, the Collector to +5V, and the Emitter to the PWM control wire of the fan. _PWM_dutycycle(self.gpioId, speed*self.maxDut圜ycle/100.) ![]() ![]() _PWM_dutycycle(self.gpioId, self.maxDut圜ycle.) # to ensure it also starts rotating at lower speed, we briefly set it to full speed Print("Setting fan speed to " + str(speed)) Def _init_(self, gpioId, frequency = 800, verbose = False):
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |