1

I seem to be going round in circles trying to find the answer to this question, so thought I'd ask the good folk here.

I have an Arduino pro mini 3.3v based project, using lowpower libraries. It wakes up every h hours and takes a reading. I would now like it to still wake up every h hours but in the meantime know whether the item (the board, or its container) has actually physically been moved - like binary, did it move or not at all?

I don't need constant monitoring of position. Once triggered I'd turn off the interrupt until the next wake up event.

In my mind I see the solution as being an interrupt attached to low power device which when moved slightly triggers the event to be recorded.

pseudo code would be:

if ((hour == h_hour) && movementDetectedSinceLastWakeup){
  doStuff();
} else {
  goBackToSleep(2hrs);
}

My question is, what kind of sensor should I consider for this job?

  • 3.3v
  • lowpower
  • can trigger interrupt

EDIT "move" as in it vibrated past some set level.

  • 1
    Define move: physically change location, or just receive some vibration but stay in the same location? – Majenko Oct 16 '17 at 9:36
  • 1
    Ah, good point. Move as in vibrated, hopefully the target level of vibration could be defined. Nice one. – Cups Oct 16 '17 at 10:06
2

There's two basic ways of detecting vibration - one which is quantifiable and one which isn't (much).

The simplest way is a sprint (possibly weighted) inside a metal tube. Vibration causes the spring to move and touch the tube - the resultant circuit is just the same as using a button. Sensitivity can't be controlled (other than maybe "how many times in a given period does the spring touch the tube"), but it's very very simple to use. They are often used in simple movement alarms (for things like bikes, etc).

The second method is to use an accelerometer. These are harder to work with but they do give you the actual amount of vibration at any given time. They are far more sensitive than a simple spring+tube, but since they are an active component they need to be constantly queried (often through I2C or an analog input). That makes them harder to use in a low-power scenario.

Some accelerometers are more intelligent and can be programmed to trigger an interrupt when vibration above a certain level is detected, though again that increases the complexity of working with them.

So in short: the lowest power option is the simple spring+tube sensor - it uses zero quiescent current. The best option is a programmable accelerometer that can trigger an interrupt to wake the main MCU. Which you choose depends on how sensitive you need the device to be...

  • I did not know such a thing existed. Similar to this adafruit.com/product/2384 I am guessing. Vibration momentarity closes a circuit, but, can that evoke an interrupt? – Cups Oct 16 '17 at 10:53
  • 1
    Yes. It's just a button. Only instead of a finger, vibration presses it. – Majenko Oct 16 '17 at 10:53
0

I would say, that a gyroscope would be perfect for physical movement. In case there is change in X, Y or Z axis, it should turn on a flag as an indicator.

The model MPU-6050 would be ok for this project.

  • 1
    A gyro struggles to detect lateral momentum - they only really work for angular momentum (turning). They can't detect if the device has been slid along a desk, for instance. – Majenko Oct 16 '17 at 10:15
  • Can't detect sliding, but can detect start movement, which is (in this case), a key. At least that's how I got the problem. – Jakey Oct 16 '17 at 14:38
  • @Jakey No it can't. Gyroscope is not an accelerometer. – gre_gor Oct 16 '17 at 16:59
  • @Jakey the others are right, a gyroscope is not the sensor to detect a movement, it detects a change in rotation. A accelerometer detects motions and vibrations. It is even very sensitive for vibrations, for example the vibrations of a heavy truck driving through the street. The MPU-6050 is indeed okay (the accelerometer part). I prefer the newer MPU-9250. – Jot Oct 17 '17 at 10:23
  • Yeah, I was thinking about the right thing but my words came out wrong; I understand the difference between gyroscope and accelerometer. Sorry again. – Jakey Oct 25 '17 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.