Thanks @Mr_Ploppy, that's great!
I've just looked at the datasheet and it says there's a maxiumum zero-g offset for the accelerometers of 90mg (or 25 typical) - so that's 8192*90/1000 = 737 maximum, or 205 normally!!
So it's hardly surprising that some people are finding the step count going crazy - @Mr_Ploppy's accelerometer isn't broken or defective, it's actually well within spec.
The datasheet (https://kionixfs.kionix.com/en/datasheet/KX023-1025%20Specifications%20Rev%2012.0.pdf) does hint that the offsets can be due to things like stress (so the PCB expanding/contracting slightly and squashing the accelerometer) so it may not even be something we can calibrate for as it may change depending on temperature.
I think I'd mentioned this at the time with this updated peak detector, but the old one required that the acceleration be below a threshold, then above in order to trigger - and I don't think it would have suffered as much with this. We could always look at doing a slightly different method of peak detection.
© Espruino, powered by microcosm.
Report a problem