Skip to the content.

How to build your router

Build Examples

If you already have a solar router like F1ATB or “Profes’Solaire”, just flash the YaSolR firmware instead of the one you are using. Most hardware used in these routers are compatible with YaSolR.

YaSolR supports many builds and routing algorithms. Before building your router, you need to decide which type of hardware you want to use. Here are below some examples:

The Recycler

Reuse your existing Shelly EM or Shelly 3EM to build a router!

ESP32 RobotDyn AC Dimmer 40A/800V Shelly EM or 3EM
TIP
WARNING

The Minimalist

The Minimalist build uses inexpensive and easy to use components to start a router.

ESP32 RobotDyn AC Dimmer 40A/800V JSY-MK-163T, JSY-MK-193, JSY-MK-194T, JSY-MK-194G or JSY-MK-333
TIP
WARNING

The Elegant

This is an improved version of the Minimalist build using the new JSY-MK-194G which has an integrated ZCD.

ESP32 Random Solid State Relay JSY-MK-194G
TIP
WARNING

The Adventurer

The Adventurer build is for people who are able to mitigate the flaws of the RobotDyn 24A to improve it. The TRIAC can be changed to a BTA40-800B RD91 fixed directly on the heat sink, and the heat sink can be upgraded. See the RobotDyn section for more information.

ESP32 RobotDyn AC Dimmer 24A/600V Heat Sink Triac BTA40-800B RD91 JSY-MK-163T, JSY-MK-193, JSY-MK-194T, JSY-MK-194G or JSY-MK-333
TIP
WARNING

The Elite

The Elite build is for people who want to use a Random SSR instead of a RobotDyn to safely dim more power and have a better Zero-Cross Detection circuit more more precising routing.

ESP32 Random Solid State Relay Heat Sink Zero-Cross Detection Module JSY-MK-163T, JSY-MK-193, JSY-MK-194T, JSY-MK-194G or JSY-MK-333
TIP
WARNING

The Professional

The Professional build uses a Voltage Regulator to control the power routing. This is probably the best reliable and efficient solution, but it is more complex to setup and wire. Voltage regulators like the LSA or LCTC have an integrated ZCD circuit to trigger at the right time based on the input voltage control.

There are multiple ways to control a voltage regulator with YaSolR.

TIP
WARNING

Voltage Regulator + PWM to Analog Converter + ZCD

This option is a good upgrade to a RobotDyn or SSR since it reuses the same components and just replaces the dimmer part with the LSA. It even reuses the existing ZCD circuit, and a dimmer implementation based on a ZCD, as usual, like for the RobotDyn or Random SSR. As such, the LSA behavior is controlled exactly like a RobotDyn or SSR would be controlled.

ESP32 Voltage Regulator Heat Sink PWM to Analog Converter JSY-MK-163T, JSY-MK-193, JSY-MK-194T, JSY-MK-194G or JSY-MK-333
WARNING

Voltage Regulator + PWM to Analog Converter only

This solution skips the need to have a dedicated ZCD and uses a specific implementation in YaSolR which is specific to this PWM to Analog Converter.

ESP32 Voltage Regulator Heat Sink PWM to Analog Converter JSY-MK-163T, JSY-MK-193, JSY-MK-194T, JSY-MK-194G or JSY-MK-333
WARNING

Voltage Regulator + DAC only

Definitely the BEST solution out there

This solution does not need a dedicated ZCD and uses a specific implementation in YaSolR which is specific to a DFRobot DAC.

The big advantage of a DAC module is that is allows to control a LSA directly without the need of an external 12V supply like for the PWM to Analog Converter, and it also does not need a ZCD module.

ESP32 Voltage Regulator Heat Sink DFRobot DAC JSY-MK-163T, JSY-MK-193, JSY-MK-194T, JSY-MK-194G or JSY-MK-333
TIP

Possible Upgrades

Here are below what you can add to upgrade your router:

Hardware Description
A bypass relay to avoid using the dimmer when auto bypass is enabled, and an additional relay to control an external load
A temperature sensor to measure the water tank temperature to automatically stop or start the water heating
A push button to restart the router easily
LEDs to display the system status
A display to show the router information
A PZEM to precisely measure the routed power for each output. Only useful if you have more than one output.

Remote JSY

Here are the components below to build a remote JSY and install the Sender .ino file on a it. This is a standalone application that looks looks like this and will show all your JSY data, help you manage it, and also send the data through UDP. The reading rate is about 20-25 messages per second and sending rate is 3 messages per second (because the JSY exposes 3 new measurements every second).

You can look in the JSY project to find more information about how to setup remote JSY and the supported protocols.

Mean Well HDR-15-5 5V DC ESP32 JSY-MK-163T, JSY-MK-193, JSY-MK-194T, JSY-MK-194G or JSY-MK-333

Alternative: The Shelly Solar Diverter

It is also possible to build a (limited) Solar Diverter / Router with Shelly devices and a voltage regulator.

See this blog post for more information: Shelly Solar Diverter

Alternative: Home Assistant Solar Diverter

It is also possible to build a (limited) Solar Diverter / Router with Home Assistant and a voltage regulator + Shelly dimmer.

See this blog post for more information: Home Assistant Solar Diverter

Selecting your Hardware

ESP32 Boards

Here are the boards for which firmwares can be downloaded. If yours in not listed, just ask: it may be possible to add it.

Board UARTs Ethernet
ESP32-DevKitC (recommended - 3 UARTs) 3  
ESP32-S3-DevKitC-1 (recommended - 3 UARTs) 3  
T-ETH-Lite ESP32 S3 (recommended - 3 UARTs) 3
ESP-32S 2  
WT32-ETH01 2
Olimex ESP32-POE 3
Olimex ESP32-GATEWAY 3
WIPI 3 3  
TinyPICO 3  
Denky D4 3  

Dimmers: RobotDyn, Solid State Relay or Voltage Regulator ?

Here are some pros and cons of each phase control system:

RobotDyn (TRIAC):

Solid State Relays:

Voltage Regulators:

Voltage regulators include a ZCD module and a phase control system which can be controlled in many ways. These are the best option: they are big and robust. But they require an additional module to control them with an ESP32.

This is the option and also what is used in the Shelly Solar Router.

Heat Sink:

In any case, do not forget to correctly dissipate the heat of your Triac / SSR using an appropriate heat sink. RobotDyn heat sink is not enough and require some tweaking (like adding a flan or de-soldering the triac and heat sink and put the triac on a bigger heat sink).

It is best to take a vertical heat sink for heat dissipation. In case of the RobotDyn 40A, you can install it vertically.

Relays: Solid State Relay or Electromagnetic Relay ?

For bypass relays used for outputs

For external Relays

Also to consider:

How to choose a Solid State Relay ?

Where to buy ?

Here is the non exhaustive list where to find some hardware to build your router. Links are provided for reference only, you can find them on other websites.

ESP32 Boards

   
ESP32-DevKitC (ESPRESSIF Official Store) - Any version will work: 32 NodeMCU, 32s, 32e, 32ue, etc
ESP32-S3-DevKitC-1/1U (ESPRESSIF Official Store)
LILYGO T-ETH-Lite ESP32-S3 (Ethernet)
WT32-ETH01 v1.4 (Ethernet)
WiFi Pigtail Antenna for ESP32 boards supporting external WiFi antenna

RobotDyn

   
RobotDyn AC Dimmer 24A/600V Includes ZCD, supports Phase Control and Burst mode
RobotDyn AC Dimmer 40A/800V Includes ZCD, supports Phase Control and Burst mode
Triac BTA40-800B RD91 here or here if you want / need to replace the Triac inside your RobotDyn
Heat Sink for Random SSR and Triac (there are many more types available: take a big heat sink placed vertically)
IMPORTANT
  1. It is possible to switch the TRIAC of an original RobotDyn AC Dimmer with a higher one, for example a BTA40-800B BOITIER RD-91
    Ref: Triacs gradateurs pour routeur photovoltaïque.

  2. The heat sink must be chosen according to the SSR / Triac. Here is a good video about the theory: Calcul du dissipateur pour le triac d’un routeur (from Pierre)

  3. Make sure to improve the RobotDyn wiring/soldering

Random and Zero-Cross SSR

Random and Zero-Cross SSR  
LCTC Random Solid State Relay (SSR) that can be controlled by a 3.3V DC signal, (Other LCTC vendor link). Supports Phase Control and Burst mode, See How to choose a Solid State Relay ? below
Zero-Cross Solid State Relay (SSR) that can be controlled by a 3.3V DC signal Supports Burst mode, See How to choose a Solid State Relay ? below
Heat Sink for SSR (there are many more types available: take a big heat sink placed vertically)

Zero-Cross Detection Modules

Please note that the JSY-MK-194G has an integrated ZCD and can be used with a Random SSR directly without the need of an external ZCD module.

Zero-Cross Detection Very good and dedicated ZCD modules - Required to use a SSR
ZCD module from Daniel S. and its DIN Rail support
UPM-01 DIN Rail Mount for PCB 72mm x 20mm for the ZCD module above to mount on DIN Rail. Alternative link

I often have some spare ZCD modules since I do some batch ordering on PCBWay. If you are interested in one, please have a look at the availabilities in the Pro page.

Also, do not forget that ZCD circuits are already included in RobotDyn (or other brands) dimmer boards! So a good idea is to use such board but only for the ZCd module. For example, on AliExpress, you can buy a cheap RobotDyn dimmer board for 3 euros with an included ZCD circuit (https://fr.aliexpress.com/item/32802025086.html). This ZCD circuit won’t be as good as a specialized one, but it can be enough for most cases.

TIP

If you have access to a 3D printer, you can also print the DIN Rail mounts.

Other SSR:

Voltage Regulators

   
Loncont LSA-H3P50YB (also available in 70A and more). Includes ZCD, supports Phase Control and Burst mode
LCTC Voltage Regulator 220V / 40A or more models without heat sink but 60A, 80A, etc (also available in 70A and more). Includes ZCD, supports Phase Control and Burst mode
3.3V PWM Signal to 0-10V Convertor or this link or this link or this link. Required to use the voltage regulators to convert the ESP32 pulse signal on 3.3V to an analogic output from 0-10V (external 12V power supply required)
DAC: DFR0971 (based on GP8403), DFR1073 (based on GP8413), DFR1071 (based on GP8211S)
Heat Sink 10-60A for Voltage Regulators or this link or this link or this link

Electromagnetic Relay

   
1-Channel 5V DC / 30A Electromagnetic Relay on DIN Rail Support: here, here, here, here
2-Channel 5V DC / 30A Dual Electromagnetic Relays on DIN Rail Support: here, here, here, here, here

Measurement Devices

   
JSY-MK-163T with a clamp Used to measure the grid power only.
JSY-MK-194T or JSY-MK-194G with 2 clamps Used to measure the grid power and total routed power. There is also another version with a tore and a clamp.
JSY-MK-333 Used to measure the grid power of a 3-phase installation
Peacefair PZEM-004T V3 100A Openable (with clamp) official, with connector, USB-TTL Cable. Can be used to measure each output individually and more precisely. Several PZEM-004T can be connected to the same Serial port.
Shelly EM (or any other alternative sending data to MQTT)

Temperature Sensors, LEDs, Buttons, Displays

Temperature Sensors, LEDs, Buttons  
DS18B20 Temperature Sensor + Adapter (easier to use to install in the water tank - take a long cable)
Push Buttons Amazon (16mm) AliExpress (12mm) for restart, manual bypass, reset
Traffic lights Lights module for system status AZ-Delivery, AliExpress
Screens  
SSD1306 OLED Display 4 pins 128x64 I2C
SH1106 OLED Display 4 pins 128x64 I2C
SSD1307 OLED Display 4 pins 128x64 I2C

Mounting Accessories

   
Electric Box
Extension boards (pay attention to the distance between header, there are different models. This one fits the ESP32 NodeMCU above)
DIN Rail Mount for ESP32 NodeMCU Dev Kit C
Distribution Module / More choice
DIN Rail Clips for SSR
AC-DC 5V 2.4A DIN Adapter HDR-15-5 Amazon, AliExpress. Can be used to power the ESP when installed in an electric box on DIN rail. Also if you need, a 12V version s available: HDR-15-15 12V DC version
3D Print enclosure for JSY-MK-194T. You can screw it on an SSR DIN Rail to place your JSY on a DIN Rail in this enclosure.
3D Print enclosure for JSY-MK-194G. You can screw it on an SSR DIN Rail to place your JSY on a DIN Rail in this enclosure.
Dupont Cable Kit
100 ohms 0.1uF RC Snubber (for RobotDyn AC dimmer and Random SSR: can be placed at dimmer output)

Default GPIO pinout per board

The hardware and GPIO pinout are heavily inspired by Routeur solaire PV monophasé Le Profes’Solaire from Anthony. Please read all the information there first. He did a very great job with some videos explaining the wiring.

Most of the features can be enabled or disabled through the app and the GPIO pinout can be changed also trough the app.

Here are below the default GPIO pinout for each board.

Tested boards:

FEATURE ESP32 NodeMCU-32S esp32s3 wt32_eth01 T-ETH-Lite esp32-poe esp32-gateway wipy3 tinypico denky_d4
I2C SCL (Display, DFRobot, etc) 22 22 9 32 40 -1 -1 -1 -1 -1
I2C SDA (Display, DFRobot, etc) 21 21 8 33 41 -1 -1 -1 -1 -1
JSY Serial2 RX 16 16 16 5 18 35 -1 4 4 22
JSY Serial2 TX 17 17 17 17 17 33 -1 25 25 21
Light Feedback (Green) 0 0 0 -1 38 -1 -1 -1 -1 -1
Light Feedback (Red) 15 15 15 -1 46 -1 -1 -1 -1 -1
Light Feedback (Yellow) 2 2 2 -1 21 -1 -1 -1 -1 -1
OUTPUT #1 Bypass Relay 32 32 40 12 20 -1 -1 -1 -1 -1
OUTPUT #1 Dimmer 25 25 37 2 19 -1 -1 -1 -1 -1
OUTPUT #1 Temperature Sensor 18 18 18 15 3 -1 -1 -1 -1 -1
OUTPUT #2 Bypass Relay 33 33 33 -1 15 -1 -1 -1 -1 -1
OUTPUT #2 Dimmer 26 26 36 -1 7 -1 -1 -1 -1 -1
OUTPUT #2 Temperature Sensor 5 5 5 -1 16 -1 -1 -1 -1 -1
Push Button (restart) EN EN EN EN EN EN EN EN EN EN
RELAY #1 13 13 13 14 5 -1 -1 -1 -1 -1
RELAY #2 12 12 12 -1 6 -1 -1 -1 -1 -1
System Temperature Sensor 4 4 4 4 4 -1 -1 -1 -1 -1
ZCD (RobotDyn, ZCD, JSY-194G) 35 35 35 35 8 -1 -1 -1 -1 -1
PZEM-004T v3 Serial1 RX 14 14 14 -1 -1 36 -1 26 26 25
PZEM-004T v3 Serial1 TX 27 27 11 -1 -1 4 -1 27 27 33

-1 means not mapped, either because this is not possible (for example some boards to not have enough UART to support at the same time JSY and PZEM), or because the mapping is just not defined by default and you need to go in YaSolR GPIO section to define to the pin you want.

The website display the pinout configured, the pinout layout that is live at runtime and also displays some potential issues like duplicate pins or wrong pin configuration.

Wiring

How to wire RobotDyn dimmer

The diagram below shows how to wire dimmers based on RobotDyn modules.

You can click on the diagram to open the interactive mode or download the image.

How to wire Random Solid State Relay dimmer

The diagram below shows how to wire dimmers based on Random Solid State Relay.

You can click on the diagram to open the interactive mode or download the image.

How to wire PWM controlled Voltage Regulator dimmer

The diagram below shows how to wire the PWM->Analog 0-10V module to control a LSA or LCTC voltage regulator.

You can click on the diagram to open the interactive mode or download the image.

How to wire DAC controlled Voltage Regulator dimmer

The diagram below shows how to wire the DFRobot DAC to control a LSA or LCTC voltage regulator:

You can click on the diagram to open the interactive mode or download the image.

How to wire Bypass Relay

The diagram below shows how to wire the bypass relays to force heating through the relay and not using the dimmer for this output feature,

You can click on the diagram to open the interactive mode or download the image.

How to wire JSY and PZEM

The diagram below shows how to wire the following optional YaSolR measurement devices and where to put the clamps:

You can click on the diagram to open the interactive mode or download the image.

How to wire accessories

The diagram below shows how to wire the following optional YaSolR accessories:

You can click on the diagram to open the interactive mode or download the image.

How to wire Random SSR with JSY-MK-194G ZCD

The diagram below shows how to wire the Elegant, which is composed of a Random SSR and a JSY-MK-194G which does both the measurement and the Zero-Cross Detection.

You can click on the diagram to open the interactive mode or download the image.