Using a relay for motor control

From Interaction Station Wiki
Revision as of 15:27, 12 July 2024 by Zwanw (talk | contribs) (Created page with "===Using a relay for motor control== Relays are versatile electronic switches that can power on and off many devices. Here we will discuss a simple circuit to turn on and off...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

=Using a relay for motor control

Relays are versatile electronic switches that can power on and off many devices. Here we will discuss a simple circuit to turn on and off your DC motor. In this example, we will use a Arduino UNO, but any microcontroller that outputs 5V on its digital pins will work. What you will need is the following:

1 x Arduino UNO (or other microcontroller) 1 x 5V relay board 1 x A dc motor 3 x jumper cables

Wiring your motor with a relay


Wiring your relay can be done like this:

[[File:How-To-Use-A-Relay-With-Arduino.jpg|300px]

There are three pins on the board that allow you to connect the relay board to your Arduino. These should be connected as follows:

Arduino -> Relay Board

5V -> VCC GND -> GND D2 -> SIG/IN

Relayterminalsandpint.png

Now let's connect the motor to the relay. First connect the ground (-) of the power supply directly to the motor. The connect your power