I am working on a project where I need the Arduino to 'sense' at what direction its moving. For example, I want the Arduino to 'sense' that it is moving towards 'forward' direction, 'backwards' direction etc.
Is that possible using an Arduino? Can I use a motion sensor to do this (probably not)?
Can any one please help me to find the right 'direction'?
1 Answer 1
For this you need a acceleration/gyro sensor, like the MPU6050.
By tracking x/y/z movements, you can define what is forward/backards etc. Also you can track angles/tilts (in 3 directions).
See an example how to use it here: MPU-6050
-
Thank you, I don't wanna go deep here, but is there a library present which I could use to make my work easier?James Brotherhood– James Brotherhood2018年08月07日 14:07:20 +00:00Commented Aug 7, 2018 at 14:07
-
You can change the example as library, or maybe this link helps: maker.pro/arduino/tutorial/… I never tried the MPU6050 myself.Michel Keijzers– Michel Keijzers2018年08月07日 14:10:16 +00:00Commented Aug 7, 2018 at 14:10
-
1Well I tried by borrowing one from a friend, it worked 😮 thanksJames Brotherhood– James Brotherhood2018年08月07日 16:04:15 +00:00Commented Aug 7, 2018 at 16:04