I am not a programmer and i am trying to learn so please excuse me.
I have an application to remotely monitor a motor when its ON and OFF and I am thinking the best option is to use asset tracker with built in “LIS3DH” to detect the motor vibration, so when the motor is ON then I can see that from the acceelerometer range, unless you have a better idea which I will be thankful if you share it with me.
I have a bit of problem in coding wise using the LIS3DH, I can read “t.readXYZmagnitude” but i can not set the threshold in appropriate way because it is difficult to detect, for example when no vibration it reads around 8000 equivalent to 1G, that is fine I can set the threshold to be:
if (t.readXYZmagnitude() > 8500) then the motor is ON,
but the problem is when I shake it it reads negative and reads less than 4000 sometimes while i am shaking it , so i need a help of how to set up the right way to detect the motor if its ON or OFF also is there away to make sleep till the motor vibrant then the electron wake-up and send signal till the motor off again then sleep.
Appreciate your help.