![]() ![]() But an output pin on a Raspberry Pi is not powerful enough to directly drive a fan, nor is the voltage sufficient for most PC type fans, which tend to run on 12 V DC (though 5 V varieties also exist). ![]() Otherwise, you can hook up an LED with a small series resistor (270 Ω) between the PWM pin and a GND pin by modifying the "duty_cycle" value above you should see the light intensity change. If you have access to an oscilloscope, correct functioning of the hardware PWM can be verified by hooking it up to the pin you chose when enabling the overlay (pwm0 defaults to GPIO_18). Call it "Fan Status" for example, and make note of its index number (shown on the "Devices" page in Domoticz). To be able to monitor the fan status in Domoticz, you need to create a "virtual sensor" of the type "Alert". # Duty cycle can be changed while running echo 999999 > pwm0/duty_cycle # Export PWM channel 0 echo 0 > export # Set the period in nanoseconds echo 1000000 > pwm0/period # cd to the device location cd /sys/class/pwm/pwmchip0 Once you have installed and activated the pwm-with-clk.dtbo overlay linked to above, you should be able to test the PWM by doing (in a root shell): You could of course use a "soft" PWM instead, but these eat up precious CPU cycles, which seems unnecessary when you just want to change the speed of a fan - so this guide assumes the hardware PWM route. There is however an alternative Device Tree Overlay, which activates the hardware PWM clock for general use, see the following guide for how to install it: Using the Raspberry Pi hardware PWM timers. It is launched and runs independently, so that if Domoticz should stop running, for whatever reason, the script will continue to quietly do its thing, keeping your system cool.įirst you'll need to get the PWM activated, which unfortunately isn't as straightforward as one might think the hardware PWM clock is not initialised at boot, and by default only starts up when the on-board soundcard is in use. ![]() Note that this script is not dependent on Domoticz in any way other than for monitoring. The fan's status is monitored and logged in Domoticz (and in the syslog). We may also share this information with third parties for this purpose.If you're not using the on-board audio, you can take advantage of the hardware Pulse Width Modulation capabilities of the Raspberry Pi to control the speed of a small PC fan, based on the system temperature. We will use this information to make the website and the advertising displayed on it more relevant to your interests. Targeting/Profiling Cookies: These cookies record your visit to our website and/or your use of the services, the pages you have visited and the links you have followed. Loss of the information in these cookies may make our services less functional, but would not prevent the website from working. This enables us to personalize our content for you, greet you by name and remember your preferences (for example, your choice of language or region). Functionality Cookies: These cookies are used to recognize you when you return to our website. This helps us to improve the way the website works, for example, by ensuring that users are easily finding what they are looking for. Analytics/Performance Cookies: These cookies allow us to carry out web analytics or other forms of audience measuring such as recognizing and counting the number of visitors and seeing how visitors move around our website. They either serve the sole purpose of carrying out network transmissions or are strictly necessary to provide an online service explicitly requested by you. The cookies we use can be categorized as follows: Strictly Necessary Cookies: These are cookies that are required for the operation of or specific functionality offered. rw-r-r- 1 root root 4096 Nov 16 11:17 ueventįor more information on the files format and accepted values, take a look to sysfs-interface. Lrwxrwxrwx 1 root root 0 Nov 16 11:17 subsystem ->. ![]() Lrwxrwxrwx 1 root root 0 Nov 16 11:17 of_node -> 2 root root 0 Nov 16 11:17 power Lrwxrwxrwx 1 root root 0 Nov 16 11:17 device -> 1 root root 4096 Nov 16 11:17 fan1_fault This specifies any shell prompt running on the target ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |