Skip to content

A simple base experiment on Arduino. The goal is to have stable, smooth and precise readings from a potentiometer connected on an analog pin.

License

Notifications You must be signed in to change notification settings

loiseaucreatif/arduino-smooth-analog-input

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

arduino-smooth-analog-input

Introduction

A simple base experiment on Arduino by Loiseau créatif.
Code with comments :-)

The goal is to have stable, smooth and precise readings from a potentiometer connected on an analog pin of an Arduino.

I'm not an expert, there's certainly improvements to make.
This experiment can be a source of inspiration and information for Makers.
Feel free to interact on GitHub ;-)

At start I watched the YouYube Live Bar Arduino #8.
Ubi de Feo talked about Fast Smoothing of Analog Input, and showed his code in action.
This inspired me, so I took up and analyzed his code, and researched more about this topic.

Enjoy!

Methodology

Methods used:

  • Running Average algorythm with a FIFO data structure (First In First Out)
  • Hardware RC Low Pass Filter (see the schematic image)
  • Mapping filtered values

The running average algorythm seems like a good alternative to a simple average to give a smoother output and let the Arduino work on other things.
But it has one big down side: memory use.

The hardware RC Low Pass Filter on the input analog pin smoothes the signal by killing high frequencies.
You can use these components and test other values: 100nF(104) Ceramic Condensator + 10KOhm resistor.
Online Frequency Calculator

Additional informations

You can find additional informations here:

An additional method called Hysteresis can help you to define actions depending on range of readed values.

Schematic

Arduino Breadbord Schematic

About

A simple base experiment on Arduino. The goal is to have stable, smooth and precise readings from a potentiometer connected on an analog pin.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages