Skip to the content
PCBKitNew board
2 layers175 × 85 mmControl pcb, the printed circuit board in 3D

ESPHome-based node for energy monitoring with additional functionality

Size
175 × 85 mm
Copper layers
2
Thickness
1.6 mm
Parts
113
Nets
135
Pads
456
Tracks, vias
963, 22
Pours
6
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
5 Mar 2024
Updated
14 Mar 2024

Overview

Control pcb is an open-source printed circuit board by ViKozh, from the ViKozh/ctrl.energy repository on GitHub, published under the MIT licence. It is a 2-layer board of 175 × 85 mm with 113 parts on 135 nets, routed with 963 tracks and 22 vias.

It is built around the ESP32-WROOM-32, DS3232MZ+ and G2RL-1-E DC5, with the IRLML2402, AO6400 and CR2032 among its other parts. Its parts include 36 resistors, 18 connectors, 12 ICs, 12 switches and 10 capacitors. It belongs with the home automation and IoT boards and the ESP32 boards of this library.

Main components

6

README

README.md

ctrl.energy

ESPHome-based node for energy monitoring with additional functionality

Brief Description

This module made for my own house as main power meter sensor and gate / outdoor lights control. There're two ESP32 nodes on PCB. One of them performs energy meter monitoring via RS-485 / MODBUS interface. Another one is used to control sliding gates control with Wiegand-based keys and outdoor lights. Also it monitors gate state.

Hardware

IMPORTANT!!! Working with HOT LINE AC is dangerous and could harm or even kill! Don't do anything if you don't know how it could behave. IMPORTANT 2!!! This hardware works from DC12 power source (J2). It can commutate 5 channels of 16A 230AC via K2-K5 relays.

You can view PCB and schematic in the /hardware folder in this repository. It was made in KiCAD, so you don't need to buy expensive PCB toolkit to modify or view it. Just keep in mind following mistakes (not the only these, I suppose):

  • Incorrect placements for reed switch based relays (K7 and K8). I've found this error only when recieved produced PCBs - so I decided not to fix it.
  • You'll need better heatsink. LM1084-3.3 could be very hot when powered by 12V. So you should use good thermal interface for it.

Note: PCB successfully soldered and working well (it works almost two weeks.)

Capabilities

Energy control node:

  • Temperature monitoring in House Energy Box via D18B20 sensor (J1).
  • Monitor UPS state: battery health (binary sensor) and main power source state (binary sensor) (J3).
  • Monitor state of main power circuit breaker (J4) with auxilary contact like this.
  • Monitor case intrusion to House Energy Box via switch connected to J6.
  • Writing logs and settings to microSD card module (J18).
  • Integrated ds3232 RTC clock (EEPROM and alarms functionality is currently not supported by ESPHome) + cr2032 lithium battery.
  • Modbus / RS485 interface via RS485 to UART converter (J12).
  • UART logs from ESP32 (J9).
  • Power Control for Gate control node to reduce power consumption when Main Power source is off the grid.
  • Send messages of problems, daily and monthly report via Telegram Bot (you should create it, see Telegram bot reference to know how to create own telegram bot).

Gate control node:

  • Control sliding gates in two modes (i.e. full open mode and pedestrian mode) (J16).
  • Sense gate state (opened or closed) with any switch or button (J17).
  • Stores up to 8 Wiegand-26 keys to open gate - use + KEY (SW3) to add a new key, short press - KEY (SW4) to remove one key, long press - KEY to remove all keys from memory of ESP32.
  • RFID (Wiegand-26 protocol) with J15 pins 5-8.
  • Indicates success or failure with red/green LEDs (J15, pins 2 and 3 as control ground pins, pin 1 as +12V power pin for LEDs)
  • Controls up to 5 lamps/zones (HOT ZONE!!! Up to AC 230v) - connect AC power source to J5, connect lamps to J7, J8, J10, J11 and J13.

Configuration

Energy control node:

You should configure secrets.yaml to use telegram bot. Both tg_token_id and tg_chat_id are required for messaging.

Set pincode to define code to arm/disarm case intrusion protection.

Set energy_provider_name to you Energy Company name or anything else.

Set ha_url to your Home Assistant instance URL and grafana_url to Grafana Dashboard. This links will be available in telegram messages.

Another options are pretty common for ESPHome configs. See config.yaml for all required variables.

Gate control node:

This node configuration is also contains common for ESPHome secret variables.

Parts

113
QtyValueFootprintReferences
2210kPCM_Resistor_SMD_AKL:R_1206_3216Metric_Pad1.42x1.75mm_HandSolderR3, R10, R11, R12, R13, R14, R15, R18, R22, R23, R24, R26, R27, R28, R34, R35 +6
7120PCM_Resistor_SMD_AKL:R_1206_3216Metric_Pad1.42x1.75mm_HandSolderR16, R17, R19, R20, R21, R25, R29
71N4007Diode_THT:D_DO-41_SOD81_P10.16mm_HorizontalD3, D4, D5, D6, D7, D8, D9
72N2222Package_TO_SOT_THT:TO-92_Inline_WideQ2, Q3, Q4, Q5, Q6, Q7, Q8
7PC817Package_DIP:DIP-4_W7.62mmU2, U4, U6, U7, U8, U10, U11
5G2RL-1-ERelay_THT:Relay_SPDT_Omron_G2RL-1-EK2, K3, K4, K5, K6
3100nFCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC5, C7, C9
2100kResistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR31, R33
2100uF / 16vCapacitor_THT:CP_Radial_D10.0mm_P3.50mmC2, C4
21kResistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR30, R32
21uFCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC6, C8
2EDR101A1200Relay_THT:Relay_SPST_StandexMeder_MS_Form1ABK7, K8
2ESP32-WROOM-32RF_Module:ESP32-WROOM-32DU3, U9
2IRLML2402Package_TO_SOT_SMD:SOT-23_HandsolderingQ9, Q10
11000uF / 50vCapacitor_THT:CP_Radial_D13.0mm_P5.00mmC1
1100uF / 50vCapacitor_THT:CP_Radial_D10.0mm_P3.50mmC3
110uF / 16vCapacitor_THT:CP_Radial_D5.0mm_P2.50mmC10
1150PCM_Resistor_SMD_AKL:R_1206_3216Metric_Pad1.42x1.75mm_HandSolderR6
11N4002Diode_THT:D_DO-41_SOD81_P10.16mm_HorizontalD2
14k7PCM_Resistor_SMD_AKL:R_1206_3216Metric_Pad1.42x1.75mm_HandSolderR1
168PCM_Resistor_SMD_AKL:R_1206_3216Metric_Pad1.42x1.75mm_HandSolderR2
1AC INTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_HorizontalJ5
1AO6400PCM_Package_TO_SOT_SMD_AKL:SOT-23-6_HandsolderingQ1
1AddressConnector_Phoenix_MC_HighVoltage:PhoenixContact_MC_1,5_2-G-5.08_1x02_P5.08mm_HorizontalJ11
1BollardsConnector_Phoenix_MC_HighVoltage:PhoenixContact_MC_1,5_2-G-5.08_1x02_P5.08mm_HorizontalJ10
1CASE_SENSORConnector_Phoenix_MC:PhoenixContact_MC_1,5_2-G-3.5_1x02_P3.50mm_HorizontalJ6
1CR2032Local:Battery_Holder_CR2032_VerticalBT1
1DC12vTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_HorizontalJ2
1DS18B20 TEMPConnector_Phoenix_MC:PhoenixContact_MC_1,5_3-G-3.5_1x03_P3.50mm_HorizontalJ1
1DS3232MPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU5
1Delete TokenButton_Switch_THT:SW_PUSH_6mmSW4
1EC_RESETButton_Switch_THT:SW_PUSH_6mmSW1
1EC_RS232Connector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_VerticalJ9
1Fence LightsConnector_Phoenix_MC_HighVoltage:PhoenixContact_MC_1,5_2-G-5.08_1x02_P5.08mm_HorizontalJ13
1Front YardConnector_Phoenix_MC_HighVoltage:PhoenixContact_MC_1,5_2-G-5.08_1x02_P5.08mm_HorizontalJ8
1G2RL-2Relay_THT:Relay_DPDT_Omron_G2RL-2K1
1GATES_CONTROLConnector_Phoenix_MC:PhoenixContact_MC_1,5_4-G-3.5_1x04_P3.50mm_HorizontalJ16
1GATES_STATE_SWITCHConnector_Phoenix_MC:PhoenixContact_MC_1,5_2-G-3.5_1x02_P3.50mm_HorizontalJ17
1GLC_RESETButton_Switch_THT:SW_PUSH_6mmSW2
1Heatsink_PadHeatsink:Heatsink_Stonecold_HS-132_32x14mm_2xFixation1.5mmHS1
1INPUT_FUSE_SENSEConnector_Phoenix_MC:PhoenixContact_MC_1,5_2-G-3.5_1x02_P3.50mm_HorizontalJ4
1LC_RS232Connector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_VerticalJ14
1LM1084-3.3PCM_Package_TO_SOT_THT_AKL:TO-220-3_VerticalU1
1MODBUS_UARTConnector_Phoenix_MC:PhoenixContact_MC_1,5_4-G-3.5_1x04_P3.50mm_HorizontalJ12
1ParkingConnector_Phoenix_MC_HighVoltage:PhoenixContact_MC_1,5_2-G-5.08_1x02_P5.08mm_HorizontalJ7
1RFID_READERConnector_Phoenix_MC:PhoenixContact_MC_1,5_8-G-3.5_1x08_P3.50mm_HorizontalJ15
1SD ModuleConnector_PinSocket_2.54mm:PinSocket_1x06_P2.54mm_VerticalJ18
1STATUSLED_THT:LED_D5.0mm_ClearD1
1UPS_DETECTIONConnector_Phoenix_MC:PhoenixContact_MC_1,5_4-G-3.5_1x04_P3.50mm_HorizontalJ3
1Write TokenButton_Switch_THT:SW_PUSH_6mmSW3
1~Package_DIP:DIP-16_W7.62mmU12

The 109 most common of 113 parts.

Questions

How big is the Control pcb PCB?

It measures 175 × 85 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Control pcb use?

113 parts, built around the ESP32-WROOM-32, DS3232MZ+, G2RL-1-E DC5 and IRLML2402. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Control pcb KiCad files?

From the ViKozh/ctrl.energy repository on GitHub, at the commit this page was made from: the board is hardware/control_pcb/control_pcb.kicad_pcb and its schematic hardware/control_pcb/control_pcb.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Control pcb design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 2 layers40 × 40 mmFancyLight V2, the printed circuit board in 3D

    FancyLight V2

    Glebka/FancyLight

    FancyLight - an LED lamp powered by a Li-Ion battery, which can be found in used electronic cigarettes. It charges via a micro USB connector and is turned on and off using a touch button.

    52 parts1
  • 2 layers88 × 100 mmFurnace controller, the printed circuit board in 3D

    Furnace controller

    brrastak/furnace

    Schematics of furnace for glass fusing

    155 parts
  • 2 layers79 × 85 mmDreamstalker PRO v2, the printed circuit board in 3D

    Dreamstalker PRO v2

    orpaltech/dreamstalker

    This device is designed to assist with lucid dreaming. The idea comes from this site: https://smartelectron.ru/projects/pribor-dlya-osoznannyh-snovidenij-dreamstalker-pro.

    112 parts
  • 4 layers90.2 × 95.9 mmPiridium bus, the printed circuit board in 3D

    Piridium bus

    Alan-JH/piridium-bus

    Flight Computer Board for TJ Cubesat Bus design

    162 parts
  • 2 layers90 × 50 mmH2S Sensor, the printed circuit board in 3D

    H2S Sensor

    Global-Health-Engineering/h2s-monitor

    Design and Development of a Low-Cost Hydrogen Sulfide Sensor System for Biogas Monitoring

    56 parts
  • 2 layers62.5 × 44 mmAduio device [roject, the printed circuit board in 3D

    Aduio device [roject

    Harshad-vali/esp32-stereo-audio-recorder

    ESP32-WROOM-32 based stereo audio recorder with dual I2S MEMS microphones, RTC timestamping, and microSD logging. KiCad hardware design + manufacturing files.

    49 parts
  • 4 layers70 × 50 mmTimekeeper, the printed circuit board in 3D

    Timekeeper

    liam-tirpitz/TickTock

    A custom ESP32-based clock platform driving WS2812B/NeoPixel LED displays. Firmware and PCB are display-agnostic, supporting any addressable LED clock with minimal adjustments.

    57 parts
  • 4 layers99 × 146 mmCarte principale, the printed circuit board in 3D

    Carte principale

    Unimakers/CDR-2027

    Ce repo est un site de documentation réalisé par l'équipe des première et deusième années pré-ingénieur de l'école Unilasalle-Amiens, membre de l'association de robotique Unimaker, dans le cadre de leur participation à…

    156 parts1