Author Topic: [Arduino Circuit Question] Using a Capacitor to Smooth Out the Messy Noise or Un  (Read 752 times)

0 Members and 1 Guest are viewing this topic.

Offline AlexUASTopic starter

  • Newbie
  • Posts: 1
  • Country: us
To whom it may concern,

Hello. I have a question about how to smooth out the noise/messy signal using a capacitor when it comes to controlling a joystick with an Arduino.

The link is pasted down below to view a photo. There are three photos within a link; Arduino/joystick diagram, photo, and signal wave.

LINK : https://imgur.com/a/dARk6hX

As you can know, the signal is not always constant as shown in one of the photos. The signal is received by a pin A4 (Analog Pin) on Arduino Mega.

My goal here is to get rid of the unstable-messy signal wave and to smooth it out using a capacitor.

Does anyone have any ideas on how to wire a capacitor to smooth out the messy signal? And also, what type of capacitor should I use?

If someone could paste the diagram on how to wire a capacitor and also show an electrical calculation with a detailed explanation, that would be very helpful.

Best Regards,
Alex
 

Offline Abdurrahman YAMAN

  • Newbie
  • Posts: 8
  • Country: tr
Hi Alex,

The data that you shared is not messy, it moves around 342 and 344. With 10Bit ADC there shouldn't be a problem.
How accurate do you need to measure the signal?

Regards.
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4247
  • Country: nl
You can use a small capacitor like 100nf connected from the arduino pin (A4 in this case) to ground. That can smooth the signal, but it might not kill the small noise you are seeing. This can be addressed in software, by using a moving average filter.

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2417
  • Country: us
I agree, the data you are showing is very normal for a digitized analog input, for the most part changing between two adjacent values. That's not noisy, that's just the result of digital being digital -- there's no between value to report. You'll have better luck smoothing this in software if it's even a problem for your application.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf