Introduction to Motors

(0 review)
Free
Check out

In this project we’re going to learn about the testing of dc motors and its connections. And also learn how to control them dc motors using the motor driver IC and there connections.

DSC_0149

KIT: Junkbot Edu kit.

Hardwire required:

  • Arduino Uno
  • Dc motor
  • Motor driver IC
  • Connecting wires
  • USB cable

Code brick program:

Screenshot (129)

Fritzing image:

motors.png

How to test a dc motor:

  1. How to connect dc motor to Arduino Uno:
  • Connect the positive wire (red wire) of the motor to the 5v pin and negative wire (black wire) of the motor to the GND pin (ground pin) of Arduino .

Now the motor rotates in clockwise direction when you reverse the connections red wire to GND and black to 5v of Arduino motor rotates in anti-clockwise direction.Screenshot (95)

  1. Controlling motors with motor driver IC:

To control the directions of the motors we use motor driver IC and the connections are stated below.

  • Connect the 5v and GND of Arduino Uno to Vcc and GND pins of motor driver IC.
  • Connect the 8,9,10 and 11 pins of Arduino to A-1A, A-1B, B-1A and B-1A of motor driver IC respectively.
  • Set pins 8 and 10 of Arduino to HIGH and connect the positive (red wire) of right motor and left motor respectively.
  • Set pins 9 and 11 of Arduino to LOW and connect the negative (black wire) of right motor and left motor respectively.

 

  1. How to write code using the code bricks:
  • Open the code bricks software.
  • Click on the events and drag 1and change the control of key according to your preference so when press the key the robot moves.
  • Click on the events and drag 2and change the control of key according to your preference so when key is released the robot stops moving.

 

  • Click on robots block and drag 3 and 4 to make the right motor rotating in forward direction.

 

  • Same procedure to left motor drag5 and 5 to make the left motor rotating in forward direction.

 

  • Now to make your robot moving the forward direction connect all the the blocks above as shown6 and change the control key from space to W.

 

  • So when you press W the robot will move forward when you release the W 7 it stops.

 

 

  • Reverse direction of robot can be done by using the same blocks but by just changing the HIGH and LOW options8 and changed the control key to S.
  • So when you press S the robot will move forward when you release the S 9it stops.

 

  • To turn right the right motor should go in reverse direction and the left in forward direction as illustrated and changed the control of key to 10 D.

 

  • So when press you D the robot will move forward when you release the D 11 it stops.

 

 

  • To turn left the left motor should go in reverse direction and the right motor in forward direction as illustrated and change the control of key to 12 A.
  • So when press you A the robot will move forward when you release the A 13 it stops.

 

 

  • To stop both the motors when space key is pressed

NOTE: You can change the control keys on your keyboard as per your requirement.

 

  1. Establishing connection:
  • Even though you connected Arduino to your computer, it won’t start communicating with codebricks until you connect them manually.
  • This is represented in codebricks, with dot to show status.
  • If the color of dot is red (as illustrated below), it means the communication is not started yet.14
  • Click connect.
    Screenshot (138)
  • Select the corresponding serial port.

15

  • The dot will turn from red to green, representing the connection established.

16

  • Connect the USB cable to arduino and laptop.

 

 

  • Go to BOARDS and select Arduino uno 17
  • Go to CONNECT and select the usb port and wait until it says15 serial port connected.

 

  • The dot will turn from red to green, representing the connection established.16

 

  • Once port is connected upgrade the firmware19 and wait until it uploads 20.

 

So after the upload is finished try using your specified keys to control the motors.

 

Course Features

  • Lectures 0
  • Quizzes 0
  • Duration 50 hours
  • Skill level All level
  • Language English
  • Students 7
  • Certificate No
  • Assessments Self
  • MOTOR CONNECTIONS

Reviews

Average Rating

0
0 rating

Detailed Rating

5 stars
0
4 stars
0
3 stars
0
2 stars
0
1 stars
0
Free