Interfacing Relay with evive

About This Tutorial
This tutorial explains interfacing of a relay module with evive for controlling high power circuits like AC bulb with help of evive.
Tutorial Info

Components Required

Image Component Quantity Available in Kit
evive 1
USB A-B Cable 1
5V Relay module 1
Bulb 1
  • None
Bulb Holder 1
  • None


In this tutorial, you will learn about the functioning of the relay and how to interface it with evive.

A relay is a switch that is operated through an electrical signal. There are different types of relays available some of them include electromagnetic relays, reed relays, contactor, solid state relays etc. They are mainly used in controlling high power circuit with a low power signal. For example, with the help of a relay, you can control an AC bulb with evive. You can control high power AC as well as DC circuits with the relay. Relays have a wide range of application in industries as well as in a large number of robotics related projects. 

Working of electromagnetic relays


Relay Working

A relay consists of an electromagnetic coil and a Single pole double throw switch (SPDT). An SPDT switch has one input and two outputs. As seen in the image there is a part in the symbol with marking NO, NC, and COM on it, that is an SPDT switch.

In this COM is the input of the switch, NC means normally closed and NO means normally open. Both NC and NO are outputs of SPDT switch. The contact that connects the output to input in SPDT is called pole. The spring-like structure symbolizes an electromagnetic coil.

When the coil is not energized NC and COM remains connected in SPDT. As soon as the coil is energized  NO and COM gets connected. Actually, when the coil is energized magnetic field is generated around it, the pole gets attracted towards this field and it shifts itself from NC to NO. Hence NO and COM get connected. As soon as coil gets de-energized coil losses its magnetic field and pole moves back to original position and NC and COM gets connected again. 

evive Notes Icon
Note: Whenever pole shifts from NO to NC or vice versa a sound of switching comes from relay. 

The coil is energized by supplying an electrical signal to it. Depending upon types of signaling you can have relays like 5 V dc relay, 12 V  dc relay etc.  You can use both 5V and 12V type relay with evive. 5V relay can be controlled by any digital pin and 12V relay can be control by motor terminals of evive. Through digital pin coil of the relay is given 5V that energizes it.

In this example, you will be controlling a 230V AC bulb with evive with help of a 5V relay. The relay will be controlled by slide switch 1 on evive.

Specifications of relay

  • 5V  TTL control signal
  • Maximum AC current and voltage: 10A 250VAC
  • Maximum DC current and voltage: 10A 30VDC
  • 5V relay used in this example has 3 pins that are to be connected with evive. These pins are GND, VCC and Signal. 
  • The module also has an on board LED that glows whenever NO and COM gets connected.

Circuit diagram

Image below shows the circuit diagram of the relay with evive for controlling an electrical bulb. Here VCC and GND of the relay are connected to 5V and GND of evive respectively and Signal pin is connected to digital pin 2 on evive.

You can use the AC supply plug available n your home for power the bulb. Out of the two wires plugged in an plug connect one to COM of the relay and one directly to bulb holder.

evive Alert
Be careful while using the AC supply in this project. It is advisable to work under the supervision of someone who has decent knowledge of AC supplies.

PictoBlox Program

Follow the steps:

  1. Open PictoBlox.
  2. Select the board as evive:
    Selecting Board
  3. Connect the evive.
    Select Port
  4. Create the following script using when evive starts up block:
    Interfacing Relay with evive
  5. Upload the code onto evive:
    Upload Code

You can download the PictoBlox program from here: Interfacing Relay with evive


Share this Tutorial
Share on facebook
Share on twitter
Share on pinterest
Share on reddit
Share on print
Featured Projects

Leave a Reply