<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[M5Stick Cplus - max PWM frequency]]></title><description><![CDATA[<p dir="auto">I am trying to create a fan control system for my networking rack that is in the media room. The idea is for it to control the speed of the fans (regular 12V fans) based on temperature but to turn the fans off while I watch a movie to keep the noise down. To do this I want to use <a href="https://esphome.io/" target="_blank" rel="noopener noreferrer nofollow ugc">ESPhome</a> which integrates into Home Assistant. I got the basics down but I am having an issue with the PWM frequency.</p>
<p dir="auto">I am using G26 as the output for my PWM signal and I get a terrible whine from my fans as the frequency is way too low, likely around 1kHz. In <a href="https://esphome.io/" target="_blank" rel="noopener noreferrer nofollow ugc">ESPhome</a> there is a way to adjust the frequency but if I do, the PWM signal just stays put at 6% duty cycle. This may indeed be an issue with <a href="https://esphome.io/" target="_blank" rel="noopener noreferrer nofollow ugc">ESPhome</a> but to be sure I'd like to know what the M5Stick cplus is capable of in terms of maximum frequency for a PWM signal. Also, is there a better output pin to use? The ones on the other end of the device are being used with an ENV III sensor, but I could swap things around if it makes a difference.</p>
<p dir="auto">If this is not feasible (PWM frequency can't be 20kHz or above) then what can I do considering that most M5Stack hardware is partially, or not supported at all, in <a href="https://esphome.io/" target="_blank" rel="noopener noreferrer nofollow ugc">ESPhome</a>?</p>
]]></description><link>https://community.m5stack.com/topic/4105/m5stick-cplus-max-pwm-frequency</link><generator>RSS for Node</generator><lastBuildDate>Fri, 15 May 2026 14:47:28 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/4105.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 07 Mar 2022 16:15:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to M5Stick Cplus - max PWM frequency on Mon, 07 Mar 2022 20:01:46 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/amr" aria-label="Profile: amr">@<bdi>amr</bdi></a></p>
<p dir="auto">I used this <a href="https://github.com/espressif/esp-idf/tree/5faf116d26/examples/peripherals/ledc/ledc_basic" target="_blank" rel="noopener noreferrer nofollow ugc">example</a> to verify that the PWM frequency can easily go higher than 20 kHz. Tested with an M5StackCPlus using GPIO26 and a PWM frequency of 100 kHz.</p>
<p dir="auto">That said, I have no idea how this translates into ESPHome though, sorry.</p>
<p dir="auto">Note: the three values <code>pwm frequency</code>, <code>duty resolution</code> and <code>duty</code> are dependent from each other. Check the documentation <a href="https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/16858</link><guid isPermaLink="true">https://community.m5stack.com/post/16858</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Mon, 07 Mar 2022 20:01:46 GMT</pubDate></item></channel></rss>