I am using an Arduino Mega for an autonomous vehicle. I have 4 motors (each uses 2 pins) and then I need to connect each motor to another pin to be able to control the speeds of the wheels. This is 12 pins total. I am wondering if using all these pins is causing the humming noise or of it is something else. Here is a pic with all the connections
The smoke alarm batteries are a problem, as they can't provide enough current for motors.
Please take a few minutes and read How to get the best out of this forum.
oh what kind of batteries should I use then?
A 6xAA battery pack works well for small motors,

or for longer run times, a larger RC battery pack, 7.4 to 12 V.
It is very likely that the humming noise comes from the motors if the motors were driven with PWM.
Does the noise go away if you disconnect the motors?
the noise stops completely when I disconnect the battery from the arduino
I have asked i different question:
Battery stays connected only disconnect the motors
Sorry, Yes it stops when I disconnect the motors
You posted in the Uncategorised section. It clearly says you should not post in this forum section. Why does this section exist if you are not allowed to post here? I don't know.
I'll move it to a note appropriate section.
If your sketch uses pwm (analogWrite) then this is causing the humming noise.
upload a testcode that does analogWrite with
low values
alternating
with analogWrite(myMotorPin,0)
I had to say it ![]()
What song is the Arduino humming ?
Hi, @asaroli
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
Do you have a DMM? Digital MultiMeter?
Are you running some basic test code. or code from the Examples of the Library you are using?
A copy of your code in code tags would be good.
Thanks.. Tom...
![]()
Is it hummong while your motors are turning or when they are idle too?
If its when theyre turning its because its the frequency of the pwm pins
The mega pwm frequenfy defaults are either around 400 or 800khz.
This is well within the audible range of human hearing. If you raise the pwm frequency the motors wont hum
A list of all the frequencys they can be changed to and an explanation is here
As a further simple explanation on frequency
The pwm value you write is the duty cycle. Basically its what part of a second will the pin be high and low.
So 255 the pin will be toggled high the whole second. 128 the pin will be high for half a second. 64 the pin will be high for quarter of a second
The frequency is how fast this switching changes over a second. At 1khz the switching speed of the pin is 1000 times a second. If you wrote a value of 128 the pin will be switched over a second 500 times to low and 500 times to high.
A bit outside of even young ppl's hearing range.
400 to 800 Hz⦠that I can still hear!
a7
Haha oops that was a typo!
As an old joke has it.
Why does an Arduino hum?
Because it doesn't know the words
This is nonsense.
Toggled means a switch between high an low.
I said toggled to reference that it will be switching between high and low for the duration of the second
