English
English
简体中文
Contact Us
Register
Log In
layoutIndex

WBRx Series Modules

Last Updated on : 2022-05-20 07:55:56download

This topic describes information about implementing serial communication between WBRx series modules and MCUs.

Overview

WBRx series is the Wi-Fi and Bluetooth Low Energy (Bluetooth LE) combo module developed by Tuya. It supports both the access point (AP) mode and station (STA) mode for Wi-Fi connection as well as a connection over Bluetooth LE.

Serial communication protocol

Serial Communication Protocol
Serial Communication Protocol for Low Power Consumption
Serial Communication Protocol for HomeKit

Serial communication between a module and an MCU

  • Connection between a module and a 3.3V MCU
    WBRx Series Modules

    The VCC pin is the power pin of the module. The TXD and RXD pins are used for serial communication. The connection in the circuit diagram above does not apply to the WBR1 and WBR1D modules.

  • Connection between a module and a 5V MCU
    In the following circuit diagram, voltage level translation can be implemented with a bidirectional voltage-level translator, a MOS transistor, or a triode.

    WBRx Series Modules

    The VCC pin is the power pin of the module. The TXD and RXD pins are used for serial communication. The connection in the circuit diagram above does not apply to the WBR1 and WBR1D modules.

  • Connection between a WBR1x module and a 3.3V MCU
    The WBR1x series includes WBR1 and WBR1D.

    WBRx Series Modules

    The 3.3V pin is the power pin of the module. The VCC/VIN is the internal power pin used for the level translator. The TXD and RXD pins are used for serial communication.

  • Connection between a WBR1x module and a 5V MCU

    The internal TXD pin of WBR1 has been connected to a level translator. In the following circuit, a triode is used to translate voltage. If you want to use n-channel MOSFET, see N-channel MOSFET level translator and design your circuit.
    WBRx Series Modules

    The 3.3V pin is the power pin of the module. The VCC/VIN is the internal power pin used for the level translator. The TXD and RXD pins are used for serial communication.

Level translator reference

  • N-channel MOSFET level translator
    In the following circuit diagram, an N-channel MOSFET and a built-in body diode are used to implement two-way communication.

    WBRx Series Modules

  • NPN triode level translator
    In the following circuit diagram, an NPN triode is used to implement one-way communication.

    WBRx Series Modules

Design specification

  • The following table lists the specification and pin information of WBRx modules for serial communication with an MCU.

    Module model Input voltage (TYP) Input current (MAX) TX pin No. TX silk screen RX pin No. RX silk screen
    WBR2D 3.3V 392 mA 7 TX/B1 5 RX/B2
    WBR2 3.3V 380 mA 7 A14 5 A13
    WBR3N 3.3V 392 mA 16 TX/PB1 15 RX/PB2
    WBR3L 3.3V 324 mA 16 TXD 15 RXD
    WBR3 3.3V 324 mA 16 TXD 15 RXD
    WBR3D 3.3V 392 mA 16 TXD/PB1 15 RXD/PB2
    WBR3T 3.3V 392 mA 16 TXD/PB1 15 RXD/PB2
    WBR3S 3.3V 392 mA 16 TXD/PB1 15 RXD/PB2
    WBRG1 3.3V 392 mA 16 TX1 15 RX1
    WBRU 3.3V 324 mA 15 TX 16 RX
  • The following table lists the specification and pin information of WBR1x modules for serial communication with an MCU.

    Module model Input voltage (TYP) Input current (MAX) TX pin No. TX silk screen RX pin No. RX silk screen
    WBR1D 3.3V 392 mA 2 TX/PB1 3 RX/PB2
    WBR1D-IPEX 3.3V 392 mA 2 TX/PB1 3 RX/PB2
    WBR1 3.3V 324 mA 2 TX 3 RX
    WBR1-IPEX 3.3V 324 mA 2 TX 3 RX
  • Power supply to the module:

    • Given that the supply current for 3.3V modules must be greater than the maximum input current, a supply current of at least 500 mA is recommended. The total capacity of the external filter capacitor must not be less than 10 μF.
    • Place the filter capacitors C1 and C2 near the power pin of the module.
  • Pins of the module:

    • The reset pin or enable pin of the module is a hardware reset pin. The module has internal weak pull-up resistors configured. If the pin is not used, it can float. If a module has been paired, this pin cannot be used to clear pairing information.
    • When the module is powered on, the user I/O starts and outputs information. Remember to block the information during the software development process.
    • Other unused pins can float.
    • For more information about the pin definition, see the datasheet of each module.
  • Power-on sequence of the module

    • Every time a module is powered on, the voltage ready time is not greater than 40 ms.
      WBRx Series Modules
  • Antenna clearance description

    • Do not use metal shells and shells with metallic paint or coating in the direction of the antenna radiation. Do not use metal objects such as screws and rivets near the antenna, which might affect the antenna efficiency.

    • Try to increase the distance from the top shell to the antenna to minimize the impact on antenna performance.

      WBRx Series Modules

    • Try to increase the distance from the upper and bottom shells to the antenna to minimize the impact on antenna performance.

      WBRx Series Modules

    • Keep the module away from speakers, power switches, cameras, HDMI, USB, and other high-speed signals to avoid interference.

    • Avoid metal shielding near the antenna. If co-channel interference occurs, you must evaluate the impact on the antenna performance and ensure the isolation from interference.

  • Placement

    • Horizontal placement
      We recommend that you place the module at the edge of the backplane with the antenna facing outward, and flush the module’s GND terminal with the backplane’s GND terminal. Both terminals are fully connected.

      WBRx Series Modules

    • Embedded placement
      Embed the module into the backplane through a slot that is flushed with or deeper than the module’s GND terminal. The side of the slot must be 15 mm or farther from the module’s board edge.
      A wider slot can achieve better performance that is still weaker than that of horizontal placement.

      WBRx Series Modules

    • Vertical placement
      Insert the module vertically into the backplane slot with the antenna facing upward. The module’s GND terminal and the backplane’s GND terminal must be fully connected. We recommend that you keep a clearance distance of 15 mm or more around the antenna.

Low power design considerations

  • Control the on/off condition of the module to achieve overall low power consumption.

    WBRx Series Modules
    As shown in the circuit diagram, the MCU can control the switch S1 with the GPIO pin to power on/off the module. When the MCU has data to report to the cloud, it turns the S1 on. Then, the module can receive data from the MCU and report data to the cloud and the client. When data reporting is completed, the module will be powered off and consume no power.


    Disadvantage: Current sinking occurs. When the switch S1 is turned off, the current from the MCU can flow into the VCC pin of the module through the UART pin because the TXD and RXD pins of the MCU and the module are still connected. The TXD and RXD pins of the module are high so the current sinking will increase the consumption of the module.


    Solution 1: Optimize the software of the MCU without hardware modification.

    When the MCU detects the data reporting is completed, the program proceeds with the following steps.

    1. Set the TXD and RXD pins of the MCU as GPIO pins that are configured as the open-drain or weak pull-down mode.
    2. Turn the switch S1 off to power off the module.
    3. This way, when the MCU has data to report, it turns the S1 on firstly.
    4. Then, it configures the TXD and RXD pins as the UART to establish communication with the module for data transmission.

    This solution does not apply to MCUs whose UART pin cannot be configured as the open-drain or weak pull-up mode. If the UART circuit has a pull-up resistor, one terminal of the resistor must be connected to the VCC pin of the module, or you can directly remove this resistor.

    Solution 2: Add a level translator to the circuit without software modification. See the circuit diagram in the preceding sections Level translator reference and Connection between a module and a 3.3V MCU and embed a level translator in the UART circuit.

  • Pull down the module’s clock enable (CEN) pin or reset (RST) pin to reduce the idle consumption.

    WBRx Series Modules
    As shown in the circuit diagram, the MCU can control the CEN or RST pin with the GPIO pin to power on/off the module. When the MCU has data to report to the cloud, the GPIO outputs high to power on the module. Then, the module can receive data from the MCU and report data to the cloud and the client. When data reporting is completed, the GPIO outputs low and the module runs in reset mode with low power consumption.


    Disadvantage: If the CEN or RST pin has an internal pull-up resistor, when the module runs in reset mode, this resistor can consume power.

RF test items and metrics

The antenna is susceptible to the distance from the shell to the surrounding components. We recommend that you test the radio frequency (RF) performance after the final test. The RF test items and metrics are listed in the following table.

No. Test item Test metric
1 Increasing indoor distance ≥ 25 m
2 Increasing outdoor distance ≥ 75 m
3 Total radiated power (TRP) of the finished device signaling mode (11B 1 Mbit/s test mode) ≥ 10 dBm
4 Total isotropic sensitivity (TIS) of a finished device ≤ -62 dBm
  • Items 3 and 4 must be tested in a dark chamber of the antenna manufacturers or certified organizations.
  • The test items apply to most Wi-Fi products, excluding certain special products.