Introducing the Gravity Digital Relay Module – the latest addition to DFRobot’s Gravity series! This module is a little different to the other relays in our store - not only is it compatible with 5V Arduino boards, but also with Raspberry Pi, BBB (BeagleBoard Black), mbed, Intel Joule, Arduino 101 and other 3.3V devices. It is specially designed for low-voltage devices and works well under 3.3V power supplies, just like the Raspberry Pi relay board. In addition, the module has a wide range of power inputs. In our tests, once it reaches 2.8~5.5V, it can also support 1.8V devices. DFRobot’s Digital Relay Module uses a high quality 3V relay. It can handle up to 10A current and mechanical parts are guaranteed up to 100 million uses. An on-board indicator LED demonstrates the relay’s state. Terminals include normally open (NO) and normally closed (NC). The module uses a Gravity-3 pin interface, which requires no soldering for convenient plug and play usage.

Children under 8 years old do not use this module.
Please do not put it on the conductive object when in normal use.
Need to check the circuit before power on, in order to prevent short circuit.
Do not use this module in a system involving personal safety.


Board Overview

Num Label Description
1 - GND
2 + VCC
3 D Control signal
4 NC Normally Closed
5 NO Normally Open
6 N/A Empty Terminal
7 COM Common port



Connection Diagram


Sample Code

 Digital Relay Module  (Arduino & Raspberry Pi compatible)

 This example shows how to use 3V Relay Module(DFR0473).
 Created 2016-12-20
 By Free Li <>

 GNU Lesser General Public License.
 See <> for details.
 All above must be included in any redistribution
/***********Notice and Trouble shooting***************
1.Be ware of electric shock and burn out the circuit board.
2.The input voltage of this module is 2.8 ~ 5.5V.

const int RelayPin = 2;

void setup() {
  pinMode(RelayPin, OUTPUT);
void loop() {
  digitalWrite(RelayPin, HIGH);   //Turn on relay
  digitalWrite(RelayPin, LOW);   //Turn off relay

Expected Results

Relay Principle

When the relay works, the electromagnetic switches off, which makes the circuit closed. When the electromagnet is powered off, the electromagnet loses magnetism, and the circuit is switched off. Therefore, the relay is used to control the operation of the circuit breaker switch.
The advantage of using relay control circuit is to control high voltage with low voltage input. 继电器原理.png

As shown below, this is a schematic diagram of the water level alarm. when the water level reaches the metal block A, the circuit will be bright red light, otherwise the circuit will be a green light. 继电器应用.png


Q1. Working principle:
A. In brief, a relay is an electronic switch, which can use a small voltage to control high voltage or high current.
For any questions, advice or cool ideas to share, please visit the DFRobot Forum.