PWM and audio noise


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: PWM and audio noise

    To make this as simple as possible, all this is, is a 5v power supply, a PIC, and two 1/4" jacks that share ground. The PIC is only connected to +5v and ground. The CCP1 pin isn't connected to anything. This is on a breadboard. I am getting a lot of noise that goes up and down in pitch as the duty cycle goes up and down.

    Code:
    Duty var byte
    Main:
    
    For Duty = 0 to 255 ' Gets brighter
    pause 100
    PWM 1, Duty, 1000
    Next Duty
    
    For Duty = 254 to 0 step -1 'Gets dimmer
    pause 100
    PWM 1, Duty, 1000
    Next Duty
    Goto Main
    Name:  Screen Shot 2018-03-26 at 10.02.18 AM.png
Views: 2135
Size:  35.9 KB

  2. #2
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: PWM and audio noise

    I would add a 0.1 uF cap to the output of your 78L05. I've had noise issues that affected the power supply, which in turn affected everything. A simple .1 ceramic cap fixed a multitude of gremlins.

  3. #3
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: PWM and audio noise

    What are you using to connect to the jacks, how far apart are they, what does the board layout looks like, is there a ground plane, is there a decoupling cap on the PIC, how does the 9V ground relate to whatever you have connected, and probably a few more questions once you answer these. There are pretty sharp edges on the steps, so you may be generating RF that is rectified by whatever you are using to listen to audio.

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: PWM and audio noise

    Where is the .1Uf decoupling cap directly at the PIC power pins?
    Dave Purola,
    N8NTA
    EN82fn

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: PWM and audio noise

    Quote Originally Posted by Dave View Post
    Where is the .1Uf decoupling cap directly at the PIC power pins?
    I added at .1uF to the 5v and that did seem to reduce the noise a bit. Not to an acceptable level, but it did help.

  6. #6
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: PWM and audio noise

    Add capacitors close to noise source(right across pin of PIC). 1,10 and 100nF in parallel.
    Also Breadboard have large capacitance between 2 rows of pin. Try to put ground next to PWM pin.
    Use short leads, as stray inductance plays large role. Also try to create star ground point.

  7. #7
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: PWM and audio noise

    I agree, Where did you place the .1Uf cap? At the supply? If it work's at all in reducing the noise, then you are on the right track.
    Dave Purola,
    N8NTA
    EN82fn

  8. #8
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: PWM and audio noise

    On larger projects I may use over a dozen 0.1 uF (and one or two 0.01 uF) caps to filter board noise. I also add 10 uF and 100 uF caps near the power supply. I filter both the input to the LM7805 and the output. I use a 47 or 100 ohm resistor between my power source and voltage regulator to further filter the power supply. Invariably, whenever I'm getting unexpected behavior, it's often due to insufficient capacitive filtering. In other words, wherever you think, then add another one or two.

  9. #9


    Did you find this post helpful? Yes | No

    Default Re: PWM and audio noise

    Quote Originally Posted by Charlie View Post
    What are you using to connect to the jacks, how far apart are they, what does the board layout looks like, is there a ground plane, is there a decoupling cap on the PIC, how does the 9V ground relate to whatever you have connected, and probably a few more questions once you answer these. There are pretty sharp edges on the steps, so you may be generating RF that is rectified by whatever you are using to listen to audio.
    I'm using a small bread board. The PIC and power supply are on one side of the bread board. The jacks are on the other side. The jacks are your typical enclosed 1/4" stereo jack like a Switchcraft 112BX. I'm using some higher end shielded instrument cables to connect to a guitar and a little test amp on my bench.

Similar Threads

  1. Play & Record PWM audio?
    By Art in forum General
    Replies: 8
    Last Post: - 12th April 2015, 11:45
  2. Replies: 1
    Last Post: - 4th March 2013, 21:57
  3. Fan causing noise in audio circuit
    By The Master in forum Off Topic
    Replies: 11
    Last Post: - 28th August 2011, 11:47
  4. PWM - Mosfet/motor introducing noise
    By DynamoBen in forum Off Topic
    Replies: 11
    Last Post: - 18th October 2007, 15:37
  5. Input Noise
    By PJALM in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 28th February 2006, 19:26

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts