Gravity_Digital_Wireless_Switch_SKU_TEL0140_TEL0142-DFRobot

Gravity_Digital_Wireless_Switch

Introduction

When building a project that needs to transmit some simple signals wirelessly, have you been bothered by the any of the following problems: Bluetooth's cumbersome AT command configuration and high cost, Wifi's signal limitations and high power consumption, IR emission angle and inability to penetrate through the walls...

This Gravity: Digital Wireless Swtich might be just what you need! Based on 433Mhz RF communication technology, the module includes a transmitter and receiver and features the advantages of simple operation, high scalability, strong penetration, and ultra-low standby power consumption. It is able to transmit digital signals and compatible with any controller that can read and write digital signals. These modules are used on a wide variety of applications that require wireless control, such as, remote control, wireless doorbell, wireless signal transmission, upgrading wired buttons to wireless buttons, etc.

The module transmitter can be used without connecting to the controller. After connecting the battery, you can directly use the digital sensor or the switch button as the "trigger button" for signal transmission. Of course, you can also connect the module to a controller and control the signal transmission through the controller's digital pins. The product adopts the EV1527 encoding format and the four-digit key value code can be combined into 15 different states; the receiver has a corresponding pairing function to ensure that only the paired transmitting device can control the receiver, the receiver supports four working modes: inching, latching, self-locking, and interlocking. It can be paired with EV1527 coded transmitters. One receiver can be paired with up to 32 transmitters. The transmitter and receiver support "one-transmit and multiple-receive" or "one-receive and multiple-transmit" after pairing. Please see the examples part for specific usage.

Application

Features

Specification

Operating current Transmitter Receiver
5V power supply, working 10mA 6mA
5V power supply, standby <10uA 3mA
3.3V power supply, working 8mA 5mA
3.3V power supply, standby <10uA 3mA
Status Transmission distance
Office, no walls 15M
Office, 1 walls 14~15M
Office ,2 walls 13~14M

Board Overview

Transmitter Name Description
Transmitter D0 ~ D3 The digital signal input terminal
powers the external sensor
the green pin receives the high-level transmit signal
Transmitter G-D0 ~ G-D3 Digital signal input terminal
After connecting to the controller, it can supply power to the transmitter, DC 3.3-5V
receive high-level transmission signal
Transmitter BAT IN External power input 3.3-5V
Receiver D0 ~ D3 Digital signal output terminal
the default low level, the received signal is high level
Receiver Button Pairing/mode switching

Receiver operating instructions

Pairing

Mode switch

Note: The receiver is in inching mode by default, the following examples all take inching mode as an example. If there is no requirement for using other modes, you can skip this step

Mode Description
Latching After D0 receives the signal once, it stays high until D1~D3 receive the signal
Self-locking Each time D0 receives a signal, the corresponding output state is inverted once, the same is true for D1~D3
Inching D0 receives the signal and outputs high level, but does not receive the signal low, the same is true for D1~D3
Interlocking When receives the signal D0, D0 stays at a high level, and all the others are low. The same applies to D1~D3.

Press and hold the button for 0.5~1.5 seconds, then release it, the blue indicator light flashes twice, indicating that you have entered the mode switching state, and then you can enter different modes according to the different times of pressing the button within 6 seconds:

Press once to enter the latching mode;

Press twice to enter the self-locking mode;

Press 3 times to enter the inching mode;

Press 4 times to enter the interlocking mode;

According to the mode you need to enter, press the button for the corresponding number of times, and then hold the button for 0.5~1.5 seconds as a confirmation signal. After letting go, the blue indicator light flashes 2 times to set successfully and enter the corresponding working mode. 0.5-1.5 seconds is relatively short, be careful not to press overtime.

Clear pairing

The receiver can store up to 32 sets of transmitter codes. When there are more than 32 sets, the first paired code will be overwritten; Clear all paired transmitters: Press and hold the button on the receiving end for more than 4 seconds. After releasing your hand, the blue indicator light flashes twice to successfully clear all paired transmitters; if the clearing fails, repeat the above operation.

Basic Example 1 - Connects Transmitter to Battery and Sensor

Requirements

Other sensor application scenarios

Note: The sensor can be selected arbitrarily, as long as it is digital. The button and motion sensor are used here as a function demonstration to simulate the function of a wireless doorbell.

Connection

The transmitting end:

** Receiving end: **

Sample code

#define Button_D2 2//Arduino
#define Button_D3 3//Arduino
//#define Button_D2 D2 //ESP32
//#define Button_D3 D3 //ESP32

void setup() {
    Serial.begin(115200);
    pinMode(Button_D2, INPUT);
    pinMode(Button_D3, INPUT);
}
void loop() {
    if (((digitalRead(Button_D2)==1) && (digitalRead(Button_D3)==1))) {
        Serial.println("Someone presses the doorbell");
        delay(3000);
    }
    else if (((digitalRead(Button_D2)==0) && (digitalRead(Button_D3)==1))) {
        Serial.println("Someone passes by but does not press the doorbell");
        delay(100);
    }
    else if (((digitalRead(Button_D2)==1) && (digitalRead(Button_D3)==0))) {
        Serial.println("Someone has waited for a while and then press the doorbell");
        delay(3000);
    }
    delay(100);
}

Result:

*When someone passes by and presses the button, the serial port prints "Someone presses the doorbell"; when someone passes by but does not press the doorbell, the serial port prints "Someone passes by but does not press the doorbell"; when someone comes to the door and stands for a while Press the doorbell, and the serial port prints "Someone has waited for a while and then press the doorbell". *

Basic Example 2 - Connect Transmitter to a Controller

Requirements

Connection

The transmitting end:

Receiving end:

Sample code

The transmitting end:

#define Button_D2 2//Arduino
//#define Button_D2 D2 //ESP32

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  digitalWrite(Button_D2, HIGH);
  delay(1000);
  digitalWrite(Button_D2, LOW);
  delay(1000);
}
}

Receiving end:

#define Button_D2 2//Arduino
//#define Button_D2 D2 //ESP32

void setup() {
    Serial.begin(115200);
    pinMode(Button_D2, INPUT);
}
void loop() {
    if (digitalRead(Button_D2)) {
        Serial.println("Pressed:D2");
        delay(1000);
    }
}

Result:

The transmitter G-D2 sends out signals every 1 second, and the receiver D2 receives signals every 1 second.

Advanced Example 1 - Trigger in multiple states

Requirements

Connection

Transmitting end :

Receiving end:

Sample code

Receiving end:

#define Button_D2 2//Arduino
#define Button_D3 3//Arduino
//#define Button_D2 D2 //ESP32
//#define Button_D3 D3 //ESP32

void setup() {
  Serial.begin(115200);
  pinMode(Button_D2, INPUT);
  pinMode(Button_D3, INPUT);
}
void loop() {
  if (((digitalRead(Button_D2)==0) && (digitalRead(Button_D3)==0))) {
    Serial.println("State:1,Pressed:NONE");
    delay(500);
  }
  if (((digitalRead(Button_D2)==0) && (digitalRead(Button_D3)==1))) {
    Serial.println("State:2,Pressed:D3");
    delay(500);
  }
  if (((digitalRead(Button_D2)==1) && (digitalRead(Button_D3)==0))) {
    Serial.println("State:3,Pressed:D2");
    delay(500);
  }
  if (((digitalRead(Button_D2)==1) && (digitalRead(Button_D3)==1))) {
    Serial.println("State:4,Pressed:D2&D3");
    delay(500);
  }
  delay(100);
}

Result:

Press different key combinations, the serial port will print different status values.

Advanced Example 2 - Transmitter External Power Supply and Jumper Wires

Requirements

The transmitting end:

Receiving end:

Sample code

#define Button_D2 2//Arduino
//#define Button_D2 D2 //ESP32

void setup() {
    Serial.begin(115200);
    pinMode(Button_D2, INPUT);
}
void loop() {
    if (digitalRead(Button_D2)) {
        Serial.println("Pressed:D2");
        delay(1000);
    }
}

Result:

1. Connect the power first, then use the lead/jumper cap to short-circuit the red and green pins of the transmitting D0 port, the transmitter will emit a signal, and the corresponding pin of the receiver will receive the signal at the same time

2. Use the lead wire/jumper cap to short-circuit the red and green pins of the transmitting end D0 port, and supply power to the transmitter through a controllable power supply(Power supply time>60ms). The transmitter port connected to the wire will send a signal at the moment of powering on, and the corresponding pin of the receiver will receive the signal at the same time. If the power supply continues to supply power, the transmitter will always be in the transmitting state.

Transmitter operating instructions

Transmitter Power Supply Description:

FAQ

Q1: The receiver is connected to the controller, the transmitter does not transmit signal but the receiver receives the signal
A: The receiver receives the control of the code, burn the corresponding sample code or burn an empty code to solve the problem
Q2: When using a battery to connect the transmitter and sensor, how to reduce the power consumption as much as possible
A: For some passive sensors, such as button, Collision sensor, magnetic sensor, connect the sensor The red and green wires to the transmitter, disconnect the black wire, which can reduce power consumption
Q3: Can it be used with other transmitters and receivers?
A: Yes, but make sure that the encoding format and rate are the same,different devices D0-D3 may not correspond exactly. The encoding format of the transmitter is EV1527, and the transmission rate is less than 10K; the decoding format of the receiver is EV1527, and the decoding rate is 0~10K.
Q4: Can the receiver directly control the relay?
A: Yes, the positive and negative terminals of any one interface of the receiver is connected to the 3.3/5V power supply, other ports can be directly connected to the relay.

For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents

TEL0140 Schematic

TEL0140 Dimensions

TEL0142 Schematic

TEL0142 Dimensions

DFshopping_car1.png Get Gravity Digital Wireless Switch from DFRobot Store or DFRobot Distributor.