$15 Wireless Display

output_Xzmr1W

I’ve been looking for a project to use the ESP8266 (ESP-03) wireless module. While playing around with these modules I figured it would be nice to have a place to send debugging data to without using the the serial terminal. I figured I could hook up a 16×2 display (QC1602A) that I ordered a while ago with the ESP and have a sweet wireless display unit. Unfortunately the ESP doesn’t have enough GPIOs to drive the display. I ended up ordering an Arduino Pro Mini of Ebay to control the display, which would in turn fetch the display data through the ESP.
Continue reading “$15 Wireless Display”

$15 Wireless Display

Analog Smoothing Library for Arduino

I wrote a Arduino library to smoothen jitter in analog output signals. This can be very useful when used with potentiometers, temperature sensors or similar devices.

The analogReadSmooth() function averages consecutive output readings. You can define how many readings you want to average (window size). Choosing a large window size will smoothen the output considerably but will also slow down detection of actual signal changes. You need to adjust the window size according to your needs when instantiating the AnalogSmooth object.

Here a brief usage example:

#include <AnalogSmooth.h>

int analogPin = 1;

// Defaults to window size 10
AnalogSmooth as = AnalogSmooth();

// Window size can range from 1 - 100
AnalogSmooth as100 = AnalogSmooth(100);

void setup() {
  Serial.begin(9600);
}

void loop() {
  // Regular reading
  float analog = analogRead(analogPin);
  Serial.print("Non-Smooth: ");
  Serial.println(analog);
  
  // Smoothing with window size 10
  float analogSmooth = as.smooth(analog);
  Serial.print("Smooth (10): ");  
  Serial.println(analogSmooth);

  // Smoothing with window size 100
  float analogSmooth100 = as100.analogReadSmooth(analogPin);
  Serial.print("Smooth (100): ");  
  Serial.println(analogSmooth100);

  Serial.println("");
  delay(1000);
}

The library can be downloaded on GitHub and then simply needs to be placed in the Arduino libray folder.

Analog Smoothing Library for Arduino