Arduino with Relay switch

This is part of the starter blog for Arduino basics. Check out here to see all of them.

A relay is a MEMS(micro electrical and mechanical system) that is used to control large current circuits without the control circuit actually being a part of the large current circuit. The working is somewhat like this,

  1. When a current passes through a-b, the coil gets magnetised.
  2. This pulls the switch pole-nc.
  3. This connects points pole-no, switching on the external circuit connected via pole-no without actually being a part of it.

Here we are going to run a motor using a relay module. A motor draws much more current than the Arduino UNO can provide. The pin current of Arduino UNO is a maximum of 50mA whereas a simple DC motor typically requires around 800mA, some geared ones require even more current. So we are going to use a relay to run the motor. Lets get started!

~What you need~

These are the parts you will be needing for the project. Your PC is needed of course.

  1. Arduino UNO
  2. 9v or 12v Relay module
  3. LED
  4. 1k resistor – 2pcs
  5. Jumper wires

~What to do~

Let’s move on to the circuit. The relay module has pins mentioned pretty clearly. You can also follow exactly as below.

  1. Wire the following circuit on the breadboard. Here AA battery is shown just as a reference. You can use any cell (9-12v) as per the motor you use.
  2. Type the following code in the IDE and upload it.
  3. There you have it! The motor runs clockwise for 5 seconds and counter-clockwise for 5 seconds.

Alright. You can improve on the project also. Try the following,

  1. Try changing the delay time and observe what happens.
  2. Try changing the motor to a mini-bulb and see it blink.

You can also move on to other projects if you are done with this one. Check out the following links.

Make sure to ask any queries in the comment section below.

 

Arduino with relay switch

Leave a Reply

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

%d bloggers like this: