Arduino humming noise

Yes but you are wrong about that.
Take this simple code:-

void setup() {
analogWrite(11, 255);
}

void loop() {
}

This is the waveform it produces on an oscilloscope:-


Do you see any form of toggling

at all?
The answer is no, it doesn't toggle.

If you change the code to:-

void setup() {
analogWrite(11, 128);
}

void loop() {
}

Then you see this, look it is toggling.

So to claim the output toggles with a value of 255 IS 100% WRONG

But when you set it to 255, how does it get to 255, it toggles to 255 :wink:

But yes a poor choice of words for 255.

Lets say 254 then it will toggle on and off with a duty cycle of 99.6%

After reading these answers it seems like most people agree it is just the sound of the PWM as the humming disappears when i disconnect the motors

and now that I think about it the humming only started when i added the pwm feature

"What shall we do with the ........."

So change the frequency of the pwm pins to a higher frequency. See this link

https://domoticx.com/arduino-pwm-frequency-and-timers/

Hi,
This is one of two projects in the forum with basically the same problem AND using 9V PP3 batteries.

Tom.. :grinning: :+1: :coffee: :australia:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.