Noise when running DC motor with PWM

I'm trying to control the speed of a walkman motor with PWM from the Arduino board. It works all right, but i have this super anoying ca. 400 Hz tone disturbing everything.

The tone is obviously coming from the Arduino board, and it doesen't change when i change the PWM.

Even if i disconnect the PWM pin from the motor driving circuit, leaving only the ground connected i can still hear the tone faintly in the background.

If i reset the board the tone dissapers, but comes again at the same time as the sketch starts running on the Arduino board. But it is gone in the few seconds i takes from rest to the sketch is running (old Atmega 8 board).

I tried powering the Arduino board both from USB and external PS. without any difference.

Does anybody have an ide to the cause of this tone ?



there are two possible fixes:

  • try to change the PWM frequency ( search the forum with Google for this), and
  • it may help to add a honking big bypass capacitor on the power supply goigng to the motor-- something like 1000Uf.

Really though, what you describe is the coils of the motor resonating at audible frequencies., so without changing the PWM frequency it will be hard to stop.



I will try the bypass cap. first, and then look into the PWM frequency.