this post was submitted on 05 Oct 2023
17 points (100.0% liked)
Ask Electronics
3313 readers
21 users here now
For questions about component-level electronic circuits, tools and equipment.
Rules
1: Be nice.
2: Be on-topic (eg: Electronic, not electrical).
3: No commercial stuff, buying, selling or valuations.
4: Be safe.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Are the changes in pitch alone, or does the amplitude change as well?
What happens if you set the frequency to something extremely low? I know that 50Hz is unusable, it will flicker, but does something still hum at 50Hz? What about if you increase the frequency in steps until you approach 200Hz?
Your multimeter couldn't measure anything when you went to 25kHz? That may be an issue of the microcontroller not supplying enough current to charge the gate capacitance on the mosfet in time, or not drain it fast enough to turn it off. If you disconnect the esp from the rest of the circuit, can you measure something then?
If yes, then you'll want to use a push pull pair for driving the mosfet. Or get a mosfet driver, but a bc547/bc549 pair and a bit of passives will be fine, available in through hole, and considerably cheaper.
If no, then either the esp can't go that fast in this implementation (was it a software PWM?) or your multimeter doesn't work in that range.
Interesting suggestions, I would not have tried such low frequencies except based on your suggestion and it turns out that going very low, below 1000Hz and even down to 100Hz causes the power supply whine to almost entirely go away. I also have a 470uF capacitor in between the power rails now too.
This range is a usable - there is no visible flickering even at very low duty cycles.
From what I understand in the reference guides the LEDC library attaches directly to the 80mhz or 40mhz esp32 hardware clock for PWM. Intuitively I'd have guessed that higher frequency would always mean less discernable audible feedback, but seems not in this case.
Before deciding on the frequency, and then mounting the strip in a position where the LEDs are directly observable, you should try moving the LEDs fast relative to your eyes. Eg. take the end of the strip and wave it from side to side. You may notice flicker at frequencies below 200Hz.
Ok, good thinking. I settled on 1000Hz and also made it something in remotely reconfigure should the need arise. That combined with the other suggestions, and getting a better power supply has made the system whisper quiet now.