MEAS Vibration Sensor // Interrupt

Hi All,

I have a horizontal MEAS vibration sensor set up to my analogue input at the moment which lights a digital LED when vibrations over a certain threshold are detected. I now want to expand this project further in to allowing the arduino UNO to wake upon a vibration and light the LED giving better battery consumption from a 9V.

I have read that the arduino wake libraries via interrupts require digital and not analogue inputs is this correct? At the moment my MEAS sensor is going directly in to A0 and GND, what changes would I need to make if I were to move this over to digital? I know the arduino already has an analogue to digital converter but I assume this is bypassed if I want to use an interrupt.

I now want to expand this project further in to allowing the arduino UNO to wake upon a vibration

If the processor has to be on to read the sensor, this is a non-starter (forgive the pun).

Some smarter I2C accelerometers have configurable interrupt outputs (though I think these tend to be “knock” events), and can operate themselves on very low currents.
be aware, though, that these are often low voltage devices, and will either require a low voltage (generally slower) processor, or logic level-shifters.

I assumed the sensor would not require the processor to be on as it produces +/-90v which could be picked up as an interrupt on pin2?

Have you got a link to this device? Some code?

Sure here is the sensor:

https://www.sparkfun.com/products/9199

int val0=0;// the readings from the analog input
int val1=0; //second value
int high = 50;// the high threshold in order to show it is a knock
int sensorIn = A0; //the analogue sensor number in
int calc; //constant to hold our calculation value for evaluation
int ledPin = 13;


void setup()
{
Serial.begin(9600);
pinMode(ledPin,OUTPUT);
}

void loop()
{
val0=analogRead(sensorIn);//read input
calc = val1-val0;
if(calc>high)
{
  Serial.println("MASSIVE");
  digitalWrite(ledPin,HIGH);
  delay(1000);
}
else
{
  digitalWrite(ledPin,LOW);
  //Serial.println("-");
}
val1=val0; //store our last reading ready for the next calc
delay(1);        // delay in between reads for stability        
}

As posted above the code monitors the analogue input, reads the value, checks whether it falls within a threshold based on a previous value recorded. If it reaches threshold it tells the LED to light up and then reset.

This all runs fine from a 9V but to conserve battery I want to use the vibration sensor to wake the arduino when it hits the threshold, which I think can only be done by interrupts on digital pins.

I want to use the vibration sensor to wake the arduino when it hits the threshold,

You could do this with an external comparator, but otherwise, you're stuck, because the processor currently "defines" the threshold.

Hmmm I see now. I would likely have to switch to something along these lines then: http://www.miniinthebox.com/vibration-switch-sensor-module-with-dupont-cable-for-intelligent-car-blue_p421813.html which allows digital output (1 or 0) and I can then call the arduino out of sleep. Downside is I would have to supply 3.3v to it which may be a drain on battery life.

Looks as though this is the solution..

http://www.scienceprog.com/thoughts-on-interfacing-piezo-vibration-sensor/

Hi,

Did this achieve you the power consumption reduction you needed? That LM741 op-amp would be consuming power all the time added to the power consumed and wasted by the Arduino’s onboard voltage regulator since you’re using 9V as an input.

What gains were you expecting?
Geoff