Motorized Colorful Wheel Using Arduino | Arduino Project

by | Apr 15, 2022 | Arduino, Basic Coding, Coding

Introduction

Looking for a fun and creative project that combines electronics, programming, and art? Look no further than building a motorized colorful wheel using Arduino! This project is perfect for beginners and experienced hobbyists alike, and offers a great opportunity to learn about the basics of programming, electronics, and mechanical engineering.

With just a few simple components and some basic coding skills, you can create a mesmerizing and colorful spinning wheel that will dazzle and delight all who see it. So let’s dive in and learn how to build a motorized colorful wheel using Arduino!

The working of this Arduino project will be that on clicking the button, one colorful wheel will spin. The wheel can be on any vehicle or any of your mind’s wonderful creations!

 

Supplies

In order to make a Motorized colorful wheel, we will require the following components:

Components

  • Arduino Uno R3
  • 1 DC motor
  • 1 nMOS Transistor(MOSFET)
  • One 9V Battery
  • 1 Push Button
  • 1 Diode
  • 1 Small BreadBoard
  • 1 Resistor
  • Connecting wires

Circuit Diagram

Steps To Make A Motorized Colorful Wheel Using Arduino

Step 1: Gather all the components on the Digital Board or Physical Table.

Step 2: Plug the PushButton & Transistor into the BreadBoard.

PushButton:

Step 3: Connect the first Terminal of it to the Ground(GND) pin of the Arduino using a black colored wire thru a resistor.

Step 4: Connect the second terminal of it to the 2-number pin of the Arduino on the Digital side.

Step 5: Connect the third terminal of it to the 5V power supply pin of the Arduino Uno.

Transistor:

Step 6: Connect the Gate terminal of it to the 3-number pin of the Arduino.

Step 7: Connect the Drain Terminal of the transistor to the Anode terminal of the Diode, as shown in the figure.

Step 8: Connect the source terminal of the transistor to the GND pin of the Arduino, as shown in the figure.

DC Motor:

Step 9: Connect the first terminal of it to the Anode of the Diode.

Step 10: Connect the second terminal of it to the Positive Terminal of the Battery.

Battery:

Step 11: Connect the Negative terminal of the battery to the GND pin of the Arduino.

Step 12: Connect the Positive terminal of the battery to the cathode terminal of the diode.

Source Code

const int button = 2;
const int motor = 3;
int state = 0;
void setup()
{
pinMode(motor, OUTPUT);
pinMode(button, INPUT);
}
void loop()
{
state = digitalRead(button);


if (state == HIGH)
{
digitalWrite(motor, HIGH);
}
else
{
digitalWrite(motor, LOW);
}
}

Explanation of the Code

1. Initially, we have initialized two variables to the integers, which represent the pin number to which the push button and Motor are connected in Arduino.

2. After that, we initialized one variable, namely state, to 0, which represents the state of the button, whether pushed or not.

3. After that, we have a setup function called only once on every reset.

4. In the setup function, we have configured the motor and button pin for output and input purposes, respectively.

5. In the loop function, which keeps on looping, we are reading the value of the button and storing it in the state variable.

6. Finally, we use the if-else statement, which says that if the button is pressed, give power to the motor; else, don’t give high power to it.

Output

We will get the following output on the successful completion of this  Motorized colorful wheel using Arduino project.

Motorized Colorful Wheel Using Arduino

Till we click the button, the wheel will keep on spinning.

 

More Arduino Projects>>>

You May Also Like To Create…

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *