Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5089

Python • Re: 5V fan wont turn on using code

$
0
0
Which transistor are you using ? What is value of resistor ?
Any errors from the python code when you run it ?

My debug procedure would be
- check the fan
disconnect the fan from the breadboard circuit and connect its two wires direct to VCC 5V and GND.
expected: the fan starts to turn
if not working: fan is bad or 5V is too low voltage for the fan.
connect the fan back to your circuit

- check the transistor with 3.3V control signal
disconnect the GPIO 18 wire from the adapter, keep the other end connected to resistor
connect the open end to VCC 3.3V
expected: the fan should start
connect the wire back to the GPIO pin
if working: done, check your code

- check the transistor with 5V control
Do this only if you have a mosfet transistor.
disconnect the GPIO 18 wire from the adapter, keep the other end connected to resistor
connect the open end to VCC 5V
expected: the fan should start
if working: Transistor switches with 5V, but not with 3.3V. Possibly you have a mosfet with too high threshold voltage.
Buy a logic level mosfet.

Statistics: Posted by ghp — Wed May 01, 2024 3:59 am



Viewing all articles
Browse latest Browse all 5089

Trending Articles