Let's Make Robots!

PortmannFilter, a way to smooth your RSSI Signal.

Hello,

I would like to present you my self-made filter. It's called PortmannFilter. It can be used to smooth your RSSI data of an RF-Link reciever. Feel free to ask me questions and use it. But please declare in your project the usage of my filter. 

The Arduino measures an analog signal from the RSSI pin of the reciever. Then it does the same again. Afterwards the PortmannFilter compares the two values and smoothes them and too low values are getting ignored. 

Greets the_droid

 

/*
 PortmannFilter.pde

 This is a filter for smoothing RSSI-Measurements. The filter ignores unusable data and smooths it. 
 Please note that the given voltage in a Arduino-Microcontroller environment is about 1.5V. 


 Author: Cédric Portmann (cedric.portmann@gmail.com.)
 Copyright (C) 2013 Cédric Portmann
*/


void setup() {
  
  Serial.begin(9600); // initialize serial communication at 9600 bits per second
}


void loop() {                          // the loop routine runs over and over again forever
  
  

  int sensorValue = analogRead(A0);    // read the input on analog pin 0
  float voltage = sensorValue * (5.0 / 1023.0);   //convert the value to Voltage
  
  
  int sensorValue2 = analogRead(A0);  // read the input on analog pin 0
  float voltage2 = sensorValue2 * (5.0 / 1023.0);  //convert the value to Voltage
    
  
  if(voltage > 1.7 && voltage == voltage2)  // Ignore data with a voltage less than 1.7, because of the given voltage in a Arduino-Microcontroller environment.
  {
    
  Serial.println(voltage);               
  }
}