PWM fluctuations with Wi-Fi STA #12455
Replies: 7 comments 16 replies
-
I use a 12V bulb connected to ESP32-PICO-MINI-02 via an IRLB8314 MOSFET (same situation with other transistors) with a driver based on two transistors in a two-cycle emitter repeater scheme |
Beta Was this translation helpful? Give feedback.
-
Which PWM frequency and duty cycle have you set when it happens? Is there any WiFi activity when the fluctuations happen? |
Beta Was this translation helpful? Give feedback.
-
If I call machine.reset(), the oscillations stop completely for a while while the reboot is in progress |
Beta Was this translation helpful? Give feedback.
-
Try a 1000uF electrolytic capacitor on the 3V3 supply on the ESP32 to help remove any voltage fluctuation caused by WiFi activity. |
Beta Was this translation helpful? Give feedback.
-
I have tested the PWM with & without WiFi. Test condition freq=1250Hz, duty_u16=5000 and duty_u16=100. Output load to GND 560Ohm. ESP32 test board is an Wemos ESP32 Lite. ESP-IDF 4.4.2 |
Beta Was this translation helpful? Give feedback.
-
I changed the transistor connection scheme, used a different driver and supplied 5V to the gate. Now everything is stable |
Beta Was this translation helpful? Give feedback.
-
I have found the partial solution on ESP32 for sending infra-red remote-control signals. Emitting infra-red (IR) remote-control signal requires turning on and off PWM pulses (of fixed frequency) at specific time intervals. Very often, this was interrupted by Wifi/BLE/etc interrupts, and the signal was corrupted, leading to randomly failed attempts. ESP-IDF does provide functions for enabling and disabling interrupt by mask, as well as getting enabled interrupt masks. These functions are respectively: In general, perfectly solving this problem is not possible because in a complex situation with potential Wifi/BLE/hardware-IO/etc inputs at any time, you have to sacrifice some for others. So if the PWM is perfect, then you will end up with randomly failed Wifi/BLE/hardware-IO/etc reception. However, if the period is short, you can use my trick to ensure at least that during this short period, PWM signal is stable and uniform. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I use PWM to control the lights.
If I turn on Wi-Fi in STA mode, at low duty PWM there are noticeable non-periodic faint fluctuations of light. If I turn on AP mode Wi-Fi, everything is normal, the light is constant.
ESP-IDF v.4.4.4, micropython 1.20
Beta Was this translation helpful? Give feedback.
All reactions