Arduino Project

Arduino Tilt-Controlled DC Motor with MPU6050

Kit purchase

Looking for parts? Check out our all-in-one kits below — packed with components, beginner-friendly guides, and tons of fun.

1.png__PID:e0199962-91ac-47de-843b-816a1d4face7

Name

Includes Arduino board

PURCHASE LINK

Ultimate Sensor Kit

Arduino Uno R4 Minima

Universal Maker Sensor Kit

×

Course Introduction

In this lesson, you’ll learn how to build a simple tilt-controlled motor system using the Arduino UNO R4, an MPU6050 sensor, and an L9110 motor driver.

Tilting the MPU6050 forward makes the motor spin forward, and tilting it backward makes the motor spin in reverse. The greater the tilt, the faster the motor rotates, and when the board is level, the motor stops.

Note

If this is your first time working with an Arduino project, we recommend downloading and reviewing the basic materials first.

1.1 Install Arduino IDE(Important)
1.2 Introduction of Arduino IDE

Required Components

In this project, we need the following components:

SN

COMPONENT INTRODUCTION

QUANTITY

PURCHASE LINK

1

Arduino UNO R4 Minima/Arduino UNO R4 WIFI

1

2

USB Cable

1

×

3

Breadboard

1

4

Wires

Several

5

L9110 Motor Driver Module

1

×

6

MPU6050 Module

1

7

TT Motor

1

×

Wiring

5.png__PID:48f79ccb-87f2-4113-95c6-f7f8d0723dd9

Common Connections:

MPU6050
SDA:
Connect to SDA on the Arduino.
SCL: Connect to SCL on the Arduino.
GND:
Connect to breadboard’s negative power bus.
VCC: Connect to breadboard’s red power bus.

TT Motor
Connect to MOTOR A on the L9110 Motor Driver Module.

L9110 Motor Driver Module
GND:
Connect to breadboard’s negative power bus.
VCC: Connect to breadboard’s red power bus.
A-1B: Connect to 6 on the Arduino.
A-1A: Connect to 5 on the Arduino.

Writing the Code

Note
You can copy this code into Arduino IDE.
Don’t forget to select the board(Arduino UNO R4 Minima/WIFI) and the correct port before clicking the Upload button.