Accelerometers

Posted on
  • I'm looking at using an accelerometer to measure the peak or maximum acceleration (deceleration) in a given period of time. I'm wondering if anyone has any better ideas than I currently have. As I see it I am going to have to get the Espruino to read the acceleration at a high frequency.

    -Is there a better way of doing this that doesn't involve lots of cpu cycles?
    -Does anyone know if there are alternative accelerometers that might store this value? (I've started looking at datasheets, but haven't uncovered one yet)

    I'm happy to do some leg work and/or submit any necessary extra modules, I just haven't found an approach I feel is right yet.

  • Mmm... I haven't seen any that let you do that, but there very well may be.

    The ADXL345 has a dizzying variety of options, but I don't recall a way to record peak acceleration (though you can have it drive an interrupt pin if acceleration exceeds a certain level, among many other optional criteria).

  • I think some accelerometers have various filters that you can apply to the acceleration value, but mostly they're filtering out the high frequency stuff.

    I guess it's just a matter of hitting the datasheets, but SPI accelerometers should be relatively fast for Espruino to access...

    The other option is to use an analog accelerometer and either come up with some analog circuitry, or use Espruino's Waveform class to sample the value 1000 times a second or so, and to then iterate over the returned buffer finding the highest value.

  • Thanks for the comments. I've already got an ADXL345 connected, but I guess its a bit chicken and egg - without knowing what the peaks and background levels are it can be difficult to know what thresholds to set for the interrupts and filters.

    I'll carry on having a look through the datasheets, (and do it in a more methodical way) keeping my fingers crossed.

    I'm hoping to avoid the need to put together more circuitry, I'm more of a programmer than electronics person.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Accelerometers

Posted by Avatar for Radar @Radar

Actions