PHYSICAL
COMPUTING
BLOG



                                   Sensor ResearchIMU Sensor-Testing and Final Thoughts10–16–2023

                        

                p5 code segement for changing virtual arduino position.
                 
                  
                 Arduino code segment for serial print and reading of accelerometer and 
                 gyrometer.

                


    
 IMU Sensor-What exactly does the sensor do? How does it work?

-The IMU sensors are able to measure movement in multiple axes-to get into more specifics, the sensor is able to track the acceleration and angular velocity of an object over a period of time. In addition to that, they are able to measure the tilt of the sensor in accordance with the earth. When integrated with software, the sensor can be used to further determine heading and orientation. 

In terms of the different instruments used to measure acceleration and motion within the IMU sensor, there are
-accelerometers-which measure a changing acceleration from the sensor.
-gyrometers-which measure changing angular motion.
-magnetometers-which measure the magnetic force of the sensor.

When testing out how the sensor worked for myself, I used the example code/followed the tutorial provided here in the link, 
https://itp.nyu.edu/physcomp/labs/lab-serial-imu-output-to-p5-js/

Before working on the p5 sketch, I downloaded the necessary libraries needed for this tutorial, that being the Madgwick Library and the Arduino_LSM6DS3 library, and tested the sensor on arduino. I opened the serial monitor on the arduino and saw that there were six values per line, which changed when I even slightly moved the arduino nano. When it came to working on p5, some complications that I came across was that when I downloaded the p.5 serial control app and tried to connect it to my arduino, it would not give me the option to port my arduino. Eventually, I managed to get the serial information to the p.5 serial monitor within the program itself. Thus, the app was not needed as was stated within the tutorial.  In the end, I was able to move an object with the microcontroller within the p.5 program. It reminded me of the controllers used in virtual reality. Overall, I found it really cool that the sensor was able to capture movement and send those values to the drawn 3d image. 

One potential con for this sensor that could be just my setup is that there appears to be a slight drift in the movement of the virtual arduino in p5. I am not entirely sure if this is a fault with the sensor or with the program itself. 

Potential applications of the sensor?
-navigation systems like GPS
-motion capture / motion tracking 
-measure drones rotation and orientation

I would especially be interested in further researching how imu sensors can used in motion capture. I thought it was very fun seeing the virtual arduino move in respect to the physical one. I want to see and test out more animations/3d objects with the use of the IMU sensor.  

©MMXXILorem ipsum dolor sit ametConsectetur 02026