orangepi-xunlong / wiringOP

wiringPi for Orange Pi
GNU Lesser General Public License v3.0
396 stars 189 forks source link

Control Fan with orange pi3 lts #62

Open Koichi-san-hu opened 1 year ago

Koichi-san-hu commented 1 year ago

Hi everyone! i am an owner of orange pi 3 LTS, i am doing very well, however i can't figure out how to create a script to be able to command the activation of the cooling fan. the problem is really in the code and how should i use it... i have found so many guides on how to use it for raspberry but not how to use it on orange pi3lts. can anyone help me? Thank you very much P.S. i use it as a home assistant server included in a docker.

Turbine1991 commented 1 year ago

Hang on, how exactly will you go about doing this? You cannot power a fan directly using the GPIO pins. Hence why they tell you to plug it into the 5v and gnd pins in the manual.

You'll need another component like a logic level mosfet which will take its power from the 5v source and then allow you to control the gate using a GPIO pin. And also a resistor. It's exactly the same process as a raspberry pi.