How to build the Hub B (stand-alone)

The Hub B provides the following functionalities:

  • Infrared transmitter and receiver (ESP32 module 1)
  • 433 Mhz (RC) transmitter and receiver (ESP32 module 2)
  • Buck and Boost converter (Arduino / ATMega328P) with output voltages adjustable in the firmware
  • Radio traffic LEDs

The hub must be powered with a 5V DC power supply through one of the following connectors:

  • USB type C (J3)
  • Micro USB (J1)
  • 5.5 mm power Jack (J2)

The max current (A) of the power supply depends on the number and type of IR LED that you want to drive. For the setup described below in this wiki with 3 high power LEDs, a 3 Ampere power supply is sufficient.

The list of all the components required for the assembly of a full d-diot hub is reported below, divided in categories for better readability.

All the electronic parts are available on the market in generic e-commerce platform (like ebay or amazon) or specialized electronic parts distributor, like LCSC, Digikey, Mouser, etc…

The hub B is built with the d-diot board 4B.

Below the schematics ( pdf format).

You can order the board 4B directly from PCBWay.

Order your board with PCBWay

Two ESP32 - 30 Pin module are required.

You can find it in generic stores for about 3-4€ (example here)

Regarding the microcontroller, which provides the Boost and Buck converter functionalities for the FS1000A transmitter and IR led respectively, you have two choices, depending on your soldering skills and equipment.

Option 1: Arduino Nano board

A standard Arduino Nano board is available in generic e-commerce platforms for few euros.

It has an USB port, so it is easy to program and you don't have to solder the ATMega328 chip to the board. This is the perfect choice if you don't feel like a iron solder hero.

Option 2: ATMega328P

The MCU is available in generic e-commerce platforms for 1 - 2 euros.

The TSOP4838 component is used as IR receiver, while 3 high power (3W) 940 nm IR LEDs with a star heatsink are used as IR transmitters.

The FS1000A module is used as 433 Mhz transmitter, while the RXB6 module is used as 433 Mhz receiver.

A 433 Mhz helical antenna should be soldered on the FS1000A module, while for the RXB6 you can solder an 433 Mhz helical antenna in AE1, or alternatively you can connect an external male antenna to the optional J12 SMA connector.

The case has a hole to host a power switch to completely cut off the power.

Any switch compatible with the dimensions reported in the picture above can be used without any modification. For example I have used one of this.

To complete the build you need the following parts:

  • M2.5 self tapping screw
M2.5 self tapping screw
  • Jumper caps
Jumper caps

The list of all the electronics components required for assembly of the d-diot board 4B is reported below:

References Description Value Quantity Vendor Link VPN Manufacturer MPN
C14 Capacitor 10 uF SMD 10uF 1 LCSC view C15850 Samsung Electro-Mechanics CL21A106KAYNNNE
C15 Capacitor 0.47 uF SMD 0805 0.47uF 1 LCSC view C15972 Samsung Electro-Mechanics CL21B474KAFNNNE
C5- C6 Capacitor 100 uF SMD 100uF 2 LCSC view C97805 ST(Semtech) CS1C101M-CRE54
C13 Capacitor 220 uF SMD 220uF 1 LCSC view C97815 ST(Semtech) CS1E221M-CRF10
C12 Capacitor 1000 uF SMD 1000uF 1 LCSC view C280406 ROQANG RT1A102M0810
C1- C2- C3- C4- C7- C10- C11- C16 Capacitor 0.1 uF SMD 0805 0.1uF 8 LCSC view C38141 FH(Guangdong Fenghua Advanced Tech) 0805B104K500NT
C8- C9 Capacitor 20 pF SMD 0805 20pF 2 LCSC view C105173 YAGEO CC0805JRNPO9BN200
R5 Resistor 3.3 KOhm SMD 0805 3.3K 1 LCSC view C445653 PANASONIC ERA6AEB332V
R2 Resistor 100K SMD 0805 100K 1 LCSC view C57246 UNI-ROYAL(Uniroyal Elec) TC0525F1003T5E
R1- R6- R9- R10- R12 Resistor 300 Ohm SMD 0805 300 5 LCSC view C61685 UNI-ROYAL(Uniroyal Elec) TC0525F3000T5E
R3- R4- R7- R8- R11- R13 Resistor 10K SMD 0805 10K 6 LCSC view C57859 UNI-ROYAL(Uniroyal Elec) TC0550F1002T5E
L2 Inductor 100uH - 3.2A - SMD 100uH-3.2A 1 LCSC view C429837 TDG TMAX-1365-101-M
L1 Inductor 470uH - 500mA - SMD 470uH-500mA 1 LCSC view C467161 SXN(Shun Xiang Nuo Elec) SMNR8040-471MT
D2- D3 Schottky Barrier Diodes SMD SMA SS54 2 LCSC view C513478 Slkor(SLKORMICRO Elec.) SS54
D1 Blu Led SMD 0805 B-LED 1 LCSC view C84259 Foshan NationStar Optoelectronics NCD0805B2
D5- D6 Green Led SMD 0805 G-LED 2 LCSC view C84260 Foshan NationStar Optoelectronics NCD0805G1
D4- D7 Yellow Led SMD 0805 Y-LED 2 LCSC view C84261 Foshan NationStar Optoelectronics NCD0805Y1
U1 ATmega328-AU microcontroller SMD ATmega328P-AU 1 LCSC view C14877 Microchip Tech ATMEGA328P-AU
U2- U4 ESP-WROOM-32 module 30 pin ESP32_DevKit_V1_DOIT 2 zhenzhen-i view NA NA NA
U3 IR receiver TSOP4838 5V TSOP4838 1 LCSC view C124647 Vishay Intertech TSOP4838
Y1 Crystal resonator 16 Mhz SMD-5032_2P Crystal 16 Mhz 1 LCSC view C251590 SJK(SHENZHEN CRYSTAL TECH) 6I16000F20UCG
F1 Resettable fuse SMD 1210 Polyfuse 1 LCSC view C70190 TECHFUSE SL1210600
SW1 Push button SMD 3x6x2.5 mm RESET 1 Alphago it view NA NA NA
A1 Arduino Nano v.3.0 5V 16 Mhz Arduino_Nano_v3.x 1 cayin35 view NA NA NA
Q1 P channel mosfet THT TO-220-3 FQP27P06 1 LCSC view C462764 ON Semiconductor FQP27P06
Q4- Q5- Q6- Q9 N channel mosfet SMD SOT-23 JST2300 4 LCSC view C404846 JESTEK JST2300
Q2- Q3- Q8 P channel mosfet SMD SOT-23 JST3415C 3 LCSC view C404849 JESTEK JST3415C
AE1 433 Mhz helical antenna Antenna 1 adeleparts2010 view NA NA NA
RF1 FS1000A connector - female pin header 1×03 p.2.54 FS1000A 1 LCSC view C358717 MINITRON MTF185-103SY1
JP2 Male 2.54 mm pin header THT 1×03 V-DATA 1 NA NA NA NA NA
J2 5.5 mm DC Power jack Barrel_Jack 1 Mouser view 710-694106301002 Wuerth 694106301002
J14 5.5 mm DC Power jack IR-OUT-EXT 1 Mouser view 710-694106301002 Wuerth 694106301002
J12 Coaxial SMA antenna connector ANT-EXT 1 LCSC view C411575 Shenzhen Kinghelm Elec KH-SMA-K513-G
J18 USB type A female connector SMD USB-A 1 LCSC view C8328 Jing Extension of the Electronic Co. YJ-USB-AF-SMT-01
J6 Male 2.54 mm pin header THT 2×03 ICSP 1 LCSC view C65114 BOOMELE(Boom Precision Elec) C65114
J7 Male 2.54 mm pin header THT 1×06 FTDI 1 LCSC view C190819 nextron(Nextronics Engineering) Z-211-0611-0021-001
J11 RXB6 connector - female pin header 1×04 p.2.54 - 2 units RXB6 1 LCSC view C225501 CJT(Changjiang Connectors) A2541HWV-4P
J1 Micro USB port SMD USB_B_Micro 1 LCSC view C10418 Jing Extension of the Electronic Co. C10418
J4- J8- J9 Screw terminal 2 pin p.5.08 POW 3 LCSC view C474906 Cixi Kefa Elec KF127-5.08-2P
J5 Screw terminal 2 pin p.5.08 MAIN-SW 1 LCSC view C474906 Cixi Kefa Elec KF127-5.08-2P
J3 USB type C port SMD USB-C 1 fastener-kingdom view NA NA NA
J15- J16- J17 Male 2.54 mm pin header THT 1×02 IR-OUT 3 NA NA NA NA NA
J10- J13- J19- J20 Pin header male 1×15 p.2.54 Conn_01x15_Male 4 NA NA NA NA NA

The 3d model files and the print instructions of the case are available in thingiverse.

If you don't have access to a 3d printer, you can consider an online 3d printing service.

It is convenient to flash the firmware before installing the modules on the board.

You can find the code as PlatformIO projects here.

The upload and library management with PlatformIO are easier respect to the standard Arduino IDE, so if you have Platformio you can follow this guide to upload the firmware.

If you have soldered the ATMega328P you need to flash it with the Optiboot Arduino Nano new bootloader (ICSP connector J6) and then you can upload the firmware with an FTDI adapter connected to the header J7. If you are using an Arduino Nano board most likely you already have the right bootloader.

See this guide to know how to burn a bootloader to an ATMega MCU.

The two ESP32 modules requires a firmware generated by ESPHome.

  • The configuration yaml file for the module U2 (433 Mhz RC gateway) is here
  • The configuration yaml file for the module U4 (IR gateway) is here

You can follow this guide to see how to install ESPHome and this one to see how to upload the firmware to your device.

Well, this is the most time consuming part of the building, but once you have started the print job, you don't have too much to do except watching your 3d printer at work, so you can proceed with the other steps.

The model files are here.

You need to print the following models (file name):

  • 1 x base.stl
  • 1 x top-simple.stl
  • 1 x board-4B-body-standalone.stl
  • 1 x front-led-cover.stl
  • 3 x ir-led-cover.stl
  • 4 x supports.stl

Some components are THT, while some other are SMD, but generally with a package that is not so difficult to handle. See this to know what tools you need.

Use the interactive BOM tool to see where to place each component for the d-diot board 4B

This is how the board should looks with all the component soldered

The typical jumper configuration is reported below. See the ( schematics) to know more about what each jumper does.

  • JP1: Open, the two pad must not be bridged. Close the jumper if you want to bypass the main power switch.
  • JP2: Bridge the GPIO and D pins with a jumper cap
  • Install the two ESP32 modules, the RXB6 and the FS1000A radio modules
  • Fix the 4 supports to the base with 4 M2.5 screws, place the board into the base of the case and fix it with 4 M2.5 screws
  • Install the three IR led covers and the front led covers to the board-4B-body-standalone part of the case and solder two pieces of wire to the main power switch.
  • Solder two wires to the positive and negative poles of each IR LED, fix the three LEDs to the case with hot glue (or anything else) and install the main switch.
  • Fix board-4B-body-standalone to the base with two M2.5 screws, connect the two wires of the main switch to the screw terminal J5 and connect the IR LEDs wires to the J15, J16 and J17 headers
  • Fix the top-simple part of the case to the board-4B-body-standalone part with 2 M2.5 screws and, if you have soldered the optional J12 connector, install the antenna of the RXB6 radio module. Done!

ESPHome is well integrated in Home Assistant (see here), so adding your device is easy and it explained here.

Below how the Hub B entities looks like in the Home Assistant WebUI

Connect a +5V DC power source to one of the following connectors:

  • J2: barrel jack
  • J1: micro USB
  • J3: USB typoe C

Turn the main switch on and, if all is configured correctly, the entities of the ESP32 module (ESPHome firmware) should show up in Home Assistant.

Read this guide to know how to send an IR code with ESPHome and this one to know how to capture the IR code from your remote. In the ESP32-IR-GW configuration file in yaml format you have an example.

Read this guide to know how to send an RC code with ESPHome and this one to know how to capture the RC code from your remote. In the ESP32-RC-GW configuration file in yaml format you have an example.

In order to have more flexibility in the placement of the hub in your home:

  • The J14 barrel jack offers the possibility to connect external IR LEDs, instead of using the integrated ones. The function of the J14 connector is the same of the headers J15, J16, J17
  • The USB A port (J18) offers the possibility to connect an external and independent IR signal transmitter. See the schematics to know the pinout.
  • getting_started/hub_v3.0/2_hubb_build.txt
  • Last modified: 2021/02/28 11:34
  • by franzunix