+ Reply to Thread
Results 1 to 18 of 18
  1. #1
    Join Date
    May 2011
    Posts
    16

    Red face Noise on input signal

    Hi guys,

    new to this so looking for advice. I have a PIC16F88 that has been configured to receive analog inputs on pin 12 using ADCIN command and then strobe a LED as an output on pin 8 using HIGH/LOW commands. I noticed that when the LED strobes, it induces the strobe signal on the analog input. I have played around with the circuit to ensure good ground planes exist etc but still same problem. Has anyone experienced this before and how can I eliminate it?

    thanks

    mark.

  2. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825

    Default Re: Noise on input signal

    If you want real help, you have to post the circuit.

    Cheers

    Al.
    All progress began with an idea

  3. #3
    Join Date
    May 2011
    Posts
    16

    Default Re: Noise on input signal

    Sure Al, please see attached image. Thanks Mark.
    Name:  PIC16F88_diagram.JPG
Views: 301
Size:  61.9 KB

  4. #4
    Join Date
    May 2008
    Location
    Italy
    Posts
    825

    Default Re: Noise on input signal

    Did you set all the unused pins as outputs (using the tris register) and set them to low? If not please do it! Never leave floating inputs. If they cannot be set as outputs, then you must ground them.

    Cheers

    Al
    All progress began with an idea

  5. #5
    Join Date
    May 2011
    Posts
    16

    Default Re: Noise on input signal

    Hi Al,

    Went back and grounded the unused pins. Still get the pulse on the analog signal. Anything else I missed?

    cheers

    Mark.

  6. #6
    Join Date
    May 2008
    Location
    Italy
    Posts
    825

    Default Re: Noise on input signal

    Is C11 (decoupling) connected directly to pin 14 ?

    Add a large capacitor to the output of your regulator ( say 220 uF)

    X5-3 point goes to a pic pin. Is it an input? If yes and you have nothing connected to the terminal, then you have to ground or pullup also X5-3

    Cheers

    Al
    All progress began with an idea

  7. #7
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191

    Default Re: Noise on input signal

    Quote Originally Posted by aratti View Post
    X5-3 point goes to a pic pin. Is it an input? If yes and you have nothing connected to the terminal, then you have to ground or pullup also X5-3
    Another vote for pull-up or pull-down (some high but reasonable value would be OK). Floating input will see your LED transient (voltage/current change) and interpret that as an input signal (=working as a sensitive receiver).

    -Gusse-

  8. #8
    Join Date
    Feb 2011
    Location
    Michigan, USA
    Posts
    33

    Default Re: Noise on input signal

    If X5-2 is power to your sensor, then maybe try a capacitor there.
    But first I would try what aratti said and use bigger caps by the regulator.

    Mike -

  9. #9
    Join Date
    May 2011
    Posts
    16

    Default Re: Noise on input signal

    Thanks guys. I will try your suggestions. I will double check the TRIS registers to ensure they have the correct setting. By the way C11 is connected directly to Pin 14 and the input signal is from a low impedance source.

  10. #10
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    867

    Default Re: Noise on input signal

    You need to check your grounding paths. If this circuit is built on a breadboard, it may not be easy to resolve this. Ground loops are a concern in most ADC problems. Try to get your ground routed like this
    Input -> 7805 -> Output transistor -> Microcontroller.

    Any changes in this sequence can contribute to the problem.

    Another possible problem is the rate at which you read the ADC. Do you filter the readings you get ??

  11. #11
    Join Date
    May 2011
    Posts
    16

    Default Re: Noise on input signal

    Hi Jerson, yep have tried ground planes on a PCB. Slight improvement but same issue. Good point regarding sampling rate. Its 50us as defined in the code. The source has inbuilt filtering. I don't use any averaging of the sampled data.

    Someone online mentioned that the PWM setting can affect the ADC?

    thanx

  12. #12
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    867

    Default Re: Noise on input signal

    No, the 50uS is the sampling time. If you happen to read your ADC at varying intervals(due to different paths of code execution), that affects the reading stability. Try to put the ADC read inside an ISR so that it reads at a constant rate. Then perhaps the coupling will break and get you stable readings.

  13. #13
    Join Date
    May 2011
    Posts
    16

    Default Re: Noise on input signal

    Hmmm...have tried the suggestions and still same problem. The interference is definitely induced by the strobe pulse. When the strobe is not triggered the signal is fine. Very strange.

  14. #14
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    867

    Default Re: Noise on input signal

    can you post your code? Might help identify any issues in code if present.

  15. #15

    Default Re: Noise on input signal

    Another vote for adding a large capacitor to the output of your regulator to supply the fast transient current demand when the LED comes on. Choose a type that has low ESR / ESL such as a ceramic in the 1-10 uF range. Leave the 0.1 where it is. You can prove if it's current induced noise or a software problem by either removing the LED, or making it's series resistor about 10X larger temporarily. Are you seeing the noise on the Power pin of the PIC too?

  16. #16
    Join Date
    May 2011
    Posts
    16

    Default Re: Noise on input signal

    Hi guys, I rechecked the circuit last night. I made the following changes to the bread board,

    1) Connected unused pins to each other then to ground.
    2) Set unused pins to LOW state.
    3) Set TRIS registers to output for unused pins.
    4) Changed the capacitors on the 7805 to ceramics.

    and after this the circuit worked fine. The pulse traced was still there but is was <<1mV which is good enough for me.

    I tried the 220uF capacitor but the 7805 and 16F88 started overheating so figured that wasn't a good idea. Maybe 7805 oscillation? The noise is originating from the power source and can be eliminated by using a battery supply.

    It was interesting that before grounding the unused pins I measured the signal from them and found that they had a low level sinusoidal output (about 0.3V p-p I think). However when I grounded them it seemed to dampen the interference. So all is good. Thanks to everyone for their suggestions.

    cheers

    mark.

  17. #17
    Join Date
    May 2011
    Posts
    16

    Default Re: Noise on input signal

    Hey guys,

    Was just reading online that some people tie each unused pin to ground using a resistor (about 1k)? I tied mine directly to ground. Is this the correct method?

    http://www.piclist.com/techref/logic/xtrapins.htm

    c
    heers

    Mark.

  18. #18
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    139

    Default Re: Noise on input signal

    The only real benefit I know if with using a resistor, if you accidentally set the pin to a high state, the pin will be fried due to a direct short to ground. With a resistor the current will be limited and prevent damage to the pin.
    Shawn

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