Skip to Content

Hardware Connection



Overview of RBgrid Sensors Connection

RBgrid sensors and modules are a ready-to-use solution for measuring electrical power using the ESP32 microcontroller.


Main Components

Main Measurement Components

  • Microcontroller: ESP32-WROOM-32 or ESP32-WROVER-32 (dual-core, 240 MHz)
  • Zero-Cross and Voltage Sensor: zero-crossing and voltage sensor with galvanic isolation from AC mains
  • Current Sensors:
  • ACS-712 contact sensor with high measurement quality
  • SCT-013 current transformer, contactless. Adapter for sensor connection
  • Storage memory: memory module for storing settings, statistics data and economics for long-term periods
Zero-Cross and Voltage Sensor
Mandatory use of the sensor, without ZC detection and voltage RBgrid will not function.
Storage memory
Without the memory module, device settings will not be saved. This module is also mandatory for using RBgrid.



Connection Diagram


Zero-Cross and Voltage Sensor: Connection to Electrical Grid

info
ZC&VAC sensor     →  ESP32
─────────────────────────────────────
GND               →  GND
VCC               →  3.3V
Vsen              →  GPIO35
ZC                →  GPIO18
WARNING! High Voltage!
- For AC connection, use a 1-2A circuit breaker for protection
- Perform all work with the voltage disconnected
- Use insulated tools
- Check for absence of voltage with an indicator


Connecting SCT-013 Current Sensors

  1. Installation on wire:
  2. Open the SCT-013 sensor clamp
  3. Clamp ONLY the phase wire (L)
  4. The arrow on the sensor should point towards the load
  5. Close the clamp until it clicks

  6. Connection to controller:

info
SCT-013 sensor adapter   →  ESP32
─────────────────────────────────────
GND                      →  GND
VCC                      →  3.3V
SIG                      →  GPIO32/33/34/36/37/38/39
Use SCT-013 sensor adapter
For convenient connection of SCT-013, use the adapter.


Connecting Additional ACS712 Sensors

To connect ACS712 sensors, use these GPIO32/33/34/36/37/38/39 pins:

info
ACS712 Module     →  ESP32
─────────────────────────────────────
GND               →  GND
VCC               →  5V pin
OUT               →  GPIO32/33/34/36/37/38/39 (available ADC1 pins)
ACS712 Calibration
ACS712 sensors require zero point calibration. Attention!!! Sensor power supply is 5V


Connecting Memory Storage

For the memory storage module, use the SPI bus:

info
Memory Module     →  ESP32
─────────────────────────────────────
GND               →  GND
VCC               →  3.3V
CLK               →  GPIO14
MISO              →  GPIO12
MOSI              →  GPIO13
CS                →  GPIO15
GPIO Connection
The memory storage module uses the SPI bus to connect to the microcontroller. By default, the HSPI bus is used,
but you can connect to VSPI and change the settings in the WEB App



Controller Power Supply


Basic Requirements

  • Voltage: 3.3V DC
  • Current: minimum 500mA (1A recommended)
  • Stability: ±1% for accurate measurements
Power Supply for ESP32-WROOM-32 or ESP32-WROVER-32 Modules
Use stable AC-DC power adapters. Power quality is critical!
Unstable or noisy power will lead to:
- Inaccurate measurements (reading drift)
- False Zero-Cross triggers
- Controller resets

Use linear regulators or quality switching power supplies with filtering.



First Power-On


Pre-Power Checklist

  • ☐ Check all connections are correct
  • ☐ Ensure no short circuits
  • ☐ Verify VCC of all sensors and modules = 3.3V (only ACS-712 VCC=5V)
  • ☐ Current sensors are installed correctly (arrow towards load)
  • ☐ Circuit breaker and fuses


  • Common Issues and Solutions

    Problem Possible Cause Solution
    No voltage readings Phase not connected to ZMPT107-1 Check L and N connection
    Zero current readings Sensor on neutral wire Move to phase wire
    Unstable readings Poor controller power supply Use stabilized PSU
    Negative power Current sensor reversed Rotate sensor 180°
    No Serial communication Wrong port speed Set 115200 baud



    Safety Measures

    LIFE THREATENING!
    - 220V voltage can be fatal
    - Always disconnect power before changing connections
    - Use RCD for additional protection
    - Do not work with electricity alone
    - When in doubt, consult a qualified electrician


    • Insulated tools (screwdrivers, pliers)
    • Voltage indicator (tester)
    • Dielectric gloves
    • Safety glasses
    • Rubber mat



    Conclusion

    RBgrid provides everything necessary to build an electrical energy monitoring system. Built-in components and connectors simplify connection, while exposed GPIO pins allow functionality expansion as needed.