0% found this document useful (0 votes)
277 views8 pages

DIY - Relay Switch Motor Controller - Arduino - 4 Steps (With Pictures) - Instructables

This document provides instructions for building a motor controller using two relay switches and an Arduino. The components used are listed, including an Arduino UNO, 9V battery, jumper wires, small motor, and 5V relay switch module. The motor and power supply are connected to the relay switches. Then the Arduino is connected to power the relay module. The code is provided to turn the motor on for 1 second in each direction by controlling the relay switches with digital pins 7 and 8 on the Arduino. In summary, this instructable shows how to build a basic motor controller circuit using relays controlled by an Arduino.

Uploaded by

virat rehani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
277 views8 pages

DIY - Relay Switch Motor Controller - Arduino - 4 Steps (With Pictures) - Instructables

This document provides instructions for building a motor controller using two relay switches and an Arduino. The components used are listed, including an Arduino UNO, 9V battery, jumper wires, small motor, and 5V relay switch module. The motor and power supply are connected to the relay switches. Then the Arduino is connected to power the relay module. The code is provided to turn the motor on for 1 second in each direction by controlling the relay switches with digital pins 7 and 8 on the Arduino. In summary, this instructable shows how to build a basic motor controller circuit using relays controlled by an Arduino.

Uploaded by

virat rehani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Projects Contests Teachers

Search Log In(https://www.instructables.com/account/login/?nxtPg=) Sign


(/projects) (/contest) (/teachers)
(/)

DIY: Relay Switch Motor Controller - Arduino


By Simple-Circuits (/member/Simple-Circuits/) in Circuits (/circuits/) > Arduino (/circuits/arduino/projects/)

202,946 591 47 Featured

Download Favorite

auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=b41f824e53a37004c4c4e842747858a8)
(https://content instructables com/FNS/3H7F/I9UDIRDM/FNS3H7FI9UDIRDM jpg?

(/member/Simple-Circuits/)
By Simple-Circuits (/member/Simple-
Circuits/)
SimpleCircuits More by
(http://www.youtube.com/channel/UCh5aXlcWXmVQ4ipj0y3qjbw?
the author:
&ab_channel=SimpleCircuits)

Follow

About: Youtube: www.youtube.com/channel/UCh5aXlcWXmVQ4ipj0y3qjbw?&ab_channel=SimpleCircuits More About


Simple-Circuits » (/member/Simple-Circuits/)
DIY: 5V Relay switch motor controller - Arduino

Hello everyone,

In this tutorial, we will be building a motor controller using two relay switches and an arduino.

Components used in this project:

SainSmart UNO R3: http://www.amazon.ca/gp/product/B00E5WJSHK?psc=1&...


(http://www.amazon.ca/gp/product/B00E5WJSHK?
psc=1&redirect=true&ref_=oh_aui_detailpage_o09_s00)

9v battery: http://www.amazon.ca/Tenergy-Charger-250mah-Recha...
(http://www.amazon.ca/Tenergy-Charger-250mah-Rechargeable-Batteries/dp/B0045WGWCE)
http://www.dx.com/p/dd15-dc-9v-battery-button-pow... (http://www.dx.com/p/dd15-dc-9v-
battery-button-power-plug-for-arduino-2560-2560r3-uno-uno-r3-328-5-pcs-
273059#.VVLGlK1VhBcWires:)

M-F jumper wires: http://www.amazon.ca/Accmart-Flexible-Breadboard-...


(http://www.amazon.ca/Accmart-Flexible-Breadboard-Adapter-Colorful/dp/B00SM375JQ)

Motor: http://www.amazon.ca/6760RPM-Rotary-Speed-bornes-...
(http://www.amazon.ca/6760RPM-Rotary-Speed-bornes-
%C3%A9lectriques/dp/B00RKCV0R8/ref=sr_1_9?ie=UTF8&qid=1432000905&sr=8-
9&keywords=9v+motor)

5V relay switch: http://www.amazon.ca/SainSmart-2-CH-2-Channel-Rel...


(http://www.amazon.ca/SainSmart-2-CH-2-Channel-Relay-
Module/dp/B0057OC6D8/ref=sr_1_1?ie=UTF8&qid=1432001003&sr=8-1&keywords=relay+5v)

 Add Tip V Ask Question | Comment Download


Step 1: Connect the Motor & Power Supply

auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=9e1895ec7dc88b74dfe1fa60a92a19e2)
(https://content instructables com/FLJ/BSNC/I9UDIRNF/FLJBSNCI9UDIRNF jpg? auto=webp&frame=1&width=1024&height=1024&fit=bounds&m
(https://content instructables com/FUZ/RJ2V/I9UD

Connections:

Motor positive - Relay switch 1 COM input

Motor negative - Relay switch 2 COM input

9v battery positive - Relay switch 1 NO & Relay switch 2 NO

9v battery negative - Relay switch 1 NC & Relay switch 2 NC

Each relay switch has three inputs

NO (Normally open) ,COM (Common) and NC (Normally closed)

In this project, both wires from the motor will connect to both of the COM (middle) inputs of the
relay switches.

The positive wire from the 9v battery will connect to both of the NO (top) inputs.

The negative wire from the 9v battery will connect to both of the NC (bottom) inputs.

This external power supply (9v battery) will be used to power the motor. This can be changed to
control the speed of the motor.

 Add Tip V Ask Question | Comment Download


Step 2: Connect the Arduino

auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=5ed05dd9510e562b0fbdcfb8997b19d2)
(https://content instructables com/FY5/5M1H/I9UDIRTP/FY55M1HI9UDIRTP jpg? auto=webp&frame=1&width=1024&height=1024&fit=bounds&m
(https://content instructables com/FXY/22JL/I9U

Connection:

Arduino 5v pin - Relay module VCC pin

Arduino GND pin - Relay module GND pin

Arduino pin#7 - Relay module IN1

Arduino pin#8 - Relay module IN2

After we finish connecting the motor, all we need to do is power the relay switch module itself.
using the arduino, we can connect the wires and send signals to activate the relay switches.

 Add Tip V Ask Question | Comment Download


Step 3: Upload the Code:

auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=eae95643cd05b89aa6aed2fdf035a226)
(https://content instructables com/FSZ/9W9E/I9UDJ29R/FSZ9W9EI9UDJ29R png?

#define CW 7 //CW is defined as pin #7//

#define CCW 8 //CCW is defined as pin #8//

void setup() { //Setup runs once//

pinMode(CW, OUTPUT); //Set CW as an output//

pinMode(CCW, OUTPUT); //Set CCW as an output//

void loop() { //Loop runs forever//

digitalWrite(CW,HIGH); //Motor runs clockwise//

delay(1000); //for 1 second//

digitalWrite(CW, LOW); //Motor stops//

digitalWrite(CCW, HIGH);//Motor runs counter-clockwise//

delay(1000); //For 1 second//

digitalWrite(CCW, LOW); //Motor stops//


}

//end of code//

Download the code here:

https://drive.google.com/open?id=0Bwb-DkQkOX3jfkdI... (https://drive.google.com/open?
id=0Bwb-
DkQkOX3jfkdIRVRCYjRRZlJ5MUdtWlFHbWJDb3BvZlNGbXF5eTRTZUdJMUVjRjVaYlU&authuser=0
)
 Add Tip V Ask Question | Comment Download

Step 4: Done!

auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=0adaf730db6a05aa8a02b9cb6c3be2fa)
(https://content instructables com/FX0/QSUL/I9UDIRUV/FX0QSULI9UDIRUV jpg?

If everything was done correctly, you should end up with a motor that spins clockwise for 1
second and counter-clockwise for 1 second.

As always, you can modify the code and change the voltage for your own projects.
If you want to see this project in action, please click on the link below:

DIY: 5V Relay switch motor controller - Arduino

 Add Tip V Ask Question | Comment Download

Participated in the
View Contest
Move It (/contest/flexbot/)

2 People Made This Project!

Farooqitj MattH320
(/member/Farooqitj/) (/member/MattH320/)
made it! made it!

Did you make this project? Share it with us!

I Made It!

Recommendations

-Cube-Solver-2/) (/Rock-Paper-Scissors-Using-Tinkercad-Circuits- (/Basics-of-Arduino-TINKERCAD/) (/Laser-Cut-Infinity-Dodecahedron-Fusio


and-A/)
s Cube Solver (/Rubiks-Cube-Solver- Basics of Arduino (TINKERCAD) (/Basics- Laser-Cut Infinity Dodecahedron (Fus
aaedmusa (/member/aaedmusa/) in of-Arduino-TINKERCAD/) by Mukesh_Sankhla 360) (/Laser-Cut-Infinity-Dodecahedr
s (/circuits/gadgets/projects/) (/member/Mukesh_Sankhla/) in Grades 6-8 Fusion-360/) by thomasj152
Rock Paper Scissors Using Tinkercad
 22 8 2.6K Circuits and Arduino (/Rock-Paper-  (/)  212 8 13K  141
Scissors-Using-Tinkercad-Circuits-and-A/)

w 1  69 8 8.7K

(/contest/bigsmall23/) (/contest/home23/) (/contest/gamedesign2023/)

 V |
Add Tip Ask Question Post Comment

We have a be nice policy.


Add Images Post
Please be positive and constructive.

47 Comments

(/member/ndrsym02/) ndrsym02 (/member/ndrsym02/) Question 7 weeks ago on Step 1

Answer / Upvote
hi sir , how to add pir sensor on this circuit for maing it sensing motion

(/member/dbutler22/) dbutler22 (/member/dbutler22/) 1 year ago


Reply / Upvote
Great Tutorial. So simple to follow. How could I make the motor run one way until it hits a limit switch
the run the other way until it hits another?

(/member/JohanG18/) JohanG18 (/member/JohanG18/) Question 2 years ago on Introduction

Answer / Upvote
Good Day , This I Build works well on DC motor , but I am busy with a AC 220 Volt Split Phase motor.
The motor is fitted with a centrifugal switch and that cause the problem Once the motor is CW motion
you cant change the direction before the centrifugal switch closes.
Some more information :
1/2 Hp 220 Volt Motor with Starting Winding, Red and Brown Wire Live and Neutral Starting Capacitor
330 Uf in series with Live

Directional , Crossover Switch was in Place before I get a Two Channel , Opto Isolated Relays
controlled by my Spark-fun Red Board , Same as UNO

Red and White is the Running Winding and desperately connected to Live and Neutral

Is there a other way to make the relays both "Low" to let the centrifugal switch close and to start the
CCW Motion

The motor starts perfectly with manual switch in both directions Amps 3.5 on 50 hz 220 Volt

I am 64 Years old on Pension and electronics and Programming was never part of my Scope

Help will be appreciated , Only God can Safe my 30 Year old Speed Queen

You might also like