MPU 6050 Teapot Project

by MissionCritical in Circuits > Arduino

10166 Views, 11 Favorites, 0 Comments

MPU 6050 Teapot Project

thbmnl.jpg

In our previous Blog, we discussed the basics of M.P.U. 6050,which is an Accelerometer and Gyroscope for our Arduino Board, today in this Blog, we will use our M.P.U. 6050 to control a Graphic unit or say Model Paper Plane, which is commonly known as Teapot, with our M.P.U. 6050, so let’s get started!

Supplies

Watch the Video!

Brush Up the Basics

Capture.JPG

in our previous Blog post, we have Briefly covered Arduino M.P.U. 6050 Interfacing and we will use similar concepts, so it would be advisable to glance through this Post !

Connections

vlcsnap-00002.jpg
vlcsnap-00001.jpg
ckt1.png

The connections are almost same as before, only modification is that we need to use Interrupt pin so we Connect INT to D2.

connections for our Arduino UNO and NANO are as following:

VCC - 5v

GND - GND

SCL - A5

SDA - A4

INT - D2

( connections Fritizing File is added in this step for further clarification )

Downloads

Get IDE Ready

vlcsnap-00004.jpg

for this project, we will need two IDE or say Compilers, one is our Arduino IDE, and other one is Processing IDE

Arduino IDE :

The Arduino Integrated Development Environment (IDE) is a cross-platform application (for Windows, macOS, Linux) that is written in functions from C and C++. It is used to write and upload programs to Arduino compatible boards, but also, with the help of 3rd party cores, other vendor development boards.

Processing IDE :

Processing is an open-source graphical library and integrated development environment (IDE) built for the electronic arts, new media art, and visual design communities with the purpose of teaching non-programmers the fundamentals of computer programming in a visual context.
Processing uses the Java language, with additional simplifications such as additional classes and aliased mathematical functions and operations. It also provides a graphical user interface for simplifying the compilation and execution stage.

Links to Download :

https://www.arduino.cc/en/Main/Software

https://processing.org/download/

Code Arduino!

vlcsnap-00007.jpg
vlcsnap-00006.jpg
vlcsnap-00008.jpg

We will be starting the Code with Arduino IDE.

  • First lets import I2C dev and MPU 6050 libraries (Link attached in this step)
the library we used in previous tutorial is different from the one used here.
  • go to Examples and open DMP6 example
  • jump to line 100 and comment this definition line.
//#define OUTPUT_READABLE_YAWPITCHROLL
use " // " to comment the line and remove " // " to uncomment the lines
  • Uncomment the 117th line and we are good to go, so we will simply upload the code to Arduino board.
#define OUTPUT_TEAPOT
Remember the Comport of Arduino and Close the Comport

Download the Library here!

Code Processing IDE

a00003.jpg
a00002.jpg
  • Open the Library location of Processing Software by default location path is my documents in windows.
  • Paste 2 libraries (linked below) to the Library folder of Processing.
  • Open the attached example code ( attached in this Step ).
  • Change COM port( it should be the same com port that you used to upload code on Arduino.)

Download the Library here!

Run the Code!

asdas.JPG
a00004.jpg

all the code is successfully uploaded on both Arduino IDE and Processing, its time to Hit Run and enjoy the Awesome Animation!

We can literally play with this for hours, almost everyone is stuck inside lock-down, and this would be a fun experiment to try. This tutorial wasn’t technical, yet this visual processing game is very satisfying and worth the efforts.

Make a Paper Plane! ( OPTIONAL )

ppr.jpg
a00005.jpg

it would be great to make a Paper plane and Attach MPU 6050 Sensor on it, but why reinvent the Wheel? here is a blog about how to make a paper plane : https://www.instructables.com/id/Worlds-best-Paper...

simply use Double sided tape and attach the sensor on Plane!

Thank You!

1.gif

I hope you guys liked this simple yet Fun tutorial, if so give this Blog a thumbs up, share it with your friends and don’t forget to subscribe to Mission Critical, it’s totally Free, anyway I will see you guys in the next one, Goodbye!

also, checkout our social media links!

Patreon - https://www.patreon.com/missioncritical
Twitter @ akshaymomaya1

Instagram @officialmissioncritical

Facebook https://www.facebook.com/officialmissioncritical/