Microcontroller : Arduino Uno R3.
Sensor : ADXL 335 accelerometer.
I am trying to use an accelerometer ADXL335 to give me snappy integrated velocity. It was working fine until I connected a switch to my microcontroller. I have enabled the internal pull-down resistor. And all it does is tell me if it's high or low and then interrupts to set a flag. And if it is set, calibration function is carried out to calculate the non-inertial acceleration to be corrected from the receiv d acceleration values.
When the switch is high, I'm getting an error of 0.07Gs which is significant for my application.
I'm using a DPDT switch, one side goes to ground, the middle goes to Arduino Uno with internal pull-down resistor.
Also of note is, I get similar error when I try to note voltage on the accelerometer using a DMM.
I am also trying to make a filter but I'm confused at one thing. What should be my cut off frequency? I want the sensor to give me accurate values for atleast 6 samples per second. And I want to remove drift and noise, so I reckon a bandpass filter would be the best bet. But, should I set the passing frequency according to the sampling frequency I need or the frequency at which the sensor sends data or the sampling rate of the ADC in the micro controller? The datasheet for the accelerometer only shows the bandwidth, how do I figure out the frequency of data relay from that? Or are they the same thing?