# Building the Samovar

- Link: https://www.samovar-tool.ru/en/2021/03/23/building-the-samovar/
- Published: 2021-03-23T23:55:03+03:00
- Author: kosoj.diy

**Building the Samovar takes 2–4 hours and requires no soldering of SMD components.**
The core is an ESP32 board (38 pin), to which you connect: 3–4 DS18B20 temperature
sensors (boiler, column, head), an MPX5010D pressure sensor, a 28BYJ-48 stepper 
motor with a ULN2003 driver (the take-off unit), a 12V peristaltic pump, an SSR-
25DA relay (heating) and a 1602 LCD display with I2C. Connections are made with 
terminal blocks and Dupont connectors. Power comes from a 12V 5A supply. The enclosure
is a standard DIN-rail box or a 3D print. The wiring diagram is available on EasyEDA,
and the 3D models of the enclosure are on Thingiverse. After assembly, the sketch
is uploaded through the Arduino IDE, and the controller is ready to work. The only
critical point: the correct connection of the DS18B20 (the data line with a 4.7 
kOhm pull-up to 3.3V).

You have the necessary parts, and all that is left is to decide how you will build
the Samovar: using a [board](https://easyeda.com/editor#id=9fff0b41932c4a909fb1f289e9e3ccf0),
point-to-point wiring, or a breadboard, and build the Samovar.

[ ](https://raw.githubusercontent.com/LKosoj/Samovar/master/Fritzing%20scheme/Samovar_bb.png)
[](https://i0.wp.com/raw.githubusercontent.com/LKosoj/Samovar/master/Fritzing%20scheme/Samovar_bb.png?ssl=1)
[ ](https://raw.githubusercontent.com/LKosoj/Samovar/master/Fritzing%20scheme/Samovar_bb.png)

Wiring diagram (click the diagram to open it in a new window).

The diagram shows all the parts and how they connect to the ESP32 pins. If you chose
to build on a board (a ready-made one or a breadboard), we recommend mounting the
ESP32 and the stepper motor driver on sockets. If you accidentally ruin the driver
or the ESP32, or you need them in other projects, you will be able to take them 
off the board.

When installing the step-down voltage regulator, **first** set the voltage on it,
and only then install it on the board, to avoid applying excess voltage to the ESP32
and the sensors.

For the stepper motor to work correctly, the driver must be configured:

⌊Icon of the digit 1 — a step of the take-off program⌉⌊Icon of the digit 1 — a step
of the take-off program⌉ The RST and SLP pins must be supplied with 3 V; the board
has a jumper H1 for this, and all three pins must be shorted.

⌊Icon of the digit 2 — a step of the take-off program⌉⌊Icon of the digit 2 — a step
of the take-off program⌉ To improve the stability and smoothness of the peristaltic
pump, you can short the stepper motor driver pins MS1, MS2 and MS3 (this refers 
to the driver) to 5 volts (the board has switches SW1 for this).

You can read more about the stepper motor driver [here](https://robotchip.ru/obzor-drayvera-shagovogo-dvigatelya-a4988/)

Values of the capacitors and resistors (see [here](https://easyeda.com/editor#id=9fff0b41932c4a909fb1f289e9e3ccf0)
for where to place them): R4k7 – 4.7KOhm; if a button is installed, you need to 
install a resistor R10k – 10KOhm. Capacitors C1 and C2 – rated for DC voltage of
at least 15 volts, capacitance 100 – 400 µF. Capacitors C3 and C4 can be added but
are not required: DC voltage above 5 volts, 100-400 µF.

⌊Warning icon — safety rules⌉⌊Warning icon — safety rules⌉ When installing the capacitors,
keep in mind that the total capacitance of the capacitors at the regulator input
must be greater than that of the capacitors after the regulator output. That is,
the capacitance of C3+C4 must be less than C1+C2. Also, do not connect power to 
the board without the ESP32.

**Read more**

After soldering the electrolytic capacitors onto the printed circuit board, I installed
a 5V regulator. I applied 12 to it. I set 5 with the trimmer and disconnected it
from 12. I put the ESP on the header, but with USB power it won’t start. I pulled
it out, waited a bit, connected it again, and it started. I began looking for the
cause. It turned out the regulator was broken down and shorting. After some googling
I found the following: if the capacitance of the capacitors at the output exceeds
the capacitance of the capacitors at the input and there is no load, then when switching
off the regulator can be broken down by the residual reverse voltage. You need to
install a reverse diode.

A protective diode in the regulator circuit

Although a voltage regulator has protection against overloads in various modes (
as well as overheat protection), it can fail if the output voltage exceeds the input
voltage. A large capacitor connected at the output to smooth out voltage ripple 
increases the risk of this situation at low output current draw, especially when
another part of the circuit is powered from the regulator’s input voltage. A similar
mode occurs if the regulator is used to charge a battery and the battery becomes
overcharged at the end of the process.

![Photo of the Samovar build — the board and components](https://i0.wp.com/www.samovar-
tool.ru/wp-content/uploads/2021/03/ne1ufm_qjuycyicqdmv9.jpg?resize=200%2C200&ssl
=1)

A protective diode in the circuit of an integrated regulator, Fig. 1.

The capacitors located after the diode bridge can discharge before the capacitor
at the regulator output does. In that case the device can fail within tenths of 
a second. That is why the capacitor at the output always has a smaller capacitance
than the one at the input. For safe operation you can place a protective diode between
the input and the output, through which excess current will be drained from the 
circuit output (Fig. 1). For more details see [here](https://electronics.stackexchange.com/questions/317068/reverse-current-blocking-on-switching-regulator)

For how to connect the water pump for cooling, see [here](https://www.samovar-tool.ru/en/2021/10/15/cooling-pump-pwm-connection/)

Connecting the reflux level sensor (it connects to the VOLUME or LEVEL connector,
depending on the board version, by wire colors and by pin order in the connector):
blue is ground, yellow is signal, brown is power. The level sensor has a trimmer
resistor. If you use a round sensor, its resistor is hidden under the top cover.
The cover must be opened, and by turning the trimmer resistor on a running column
you adjust the sensitivity of the sensor (clockwise lowers the sensitivity, counterclockwise
raises it). On a rectangular sensor the trimmer resistor is on the side of the housing.

![Photo of the Samovar build — connecting peripherals](https://i0.wp.com/www.samovar-
tool.ru/wp-content/uploads/2021/11/h7d94db16f3cc4c75835eb25bfaf28795k.jpg?resize
=715%2C402&ssl=1)

If you need to change the reaction time of the reflux level sensor, it is set here:

In the file logic.h, around line 698

    ```wp-block-preformatted
    //If we have already reacted, we need to wait 40 seconds, because the process is inertialalarm_h_min = millis() + 1000 * 40;
    ```

40 is the number of seconds after which the power will be cut again when the reflux
level sensor trips. With a reflux level sensor installed this works in any mode,
since it is part of the safety group, to prevent the column from flooding.

in Samovar.h, around line 193:

    ```wp-block-preformatted
    #define WHLS_ALARM_TIME 3 //Seconds before the reflux level alarm triggers.
    ```

Because of reflux fluctuations the sensor can flicker; this parameter sets how many
seconds of continuous level sensor triggering must pass before it is considered 
to have tripped.

What follows applies only to operation in pre-flood mode:
in Samovar.h, around line
540:

    ```wp-block-preformatted
    #define TIME_C 5 // Wait time in minutes for the pre-flood mode program
    ```

 – this is the time after which the Samovar will raise the voltage if the reflux
level sensor has not tripped.

Connecting the servo to the SERVO1 connector on the board (by wire colors and by
pin order in the connector): brown or black is ground, red is power; yellow or white
is signal;

Connecting the water flow sensor to the WATERSENSOR connector on the board (by wire
colors and by pin order in the connector): yellow is signal, black is ground, red
is power.

 * ![Samovar board and take-off unit — components for the build](https://i0.wp.com/
   www.samovar-tool.ru/wp-content/uploads/2021/03/plata-i-uzel-razbora.jpg?resize
   =864%2C1024&ssl=1)
 * Board and take-off unit
 * ![Photo of the Samovar controller — electronics installation](https://i0.wp.com/
   www.samovar-tool.ru/wp-content/uploads/2021/03/fgjcvhybnojmsdlf95w.jpeg?resize
   =526%2C776&ssl=1)
 * Samovar in its enclosure
 * ![Photo of the Samovar controller — the assembly process](https://i0.wp.com/www.
   samovar-tool.ru/wp-content/uploads/2021/03/cxkwtavwlmzj9ozplini.jpeg?resize=497%
   2C512&ssl=1)
 * Samovar in its enclosure
 * ![Photo of the Samovar controller — connectors and connections](https://i0.wp.
   com/www.samovar-tool.ru/wp-content/uploads/2021/03/img_8989.png?resize=768%2C1024&
   ssl=1)
 * Samovar in its enclosure
 * ![Photo of the Samovar controller — the finished board](https://i0.wp.com/www.
   samovar-tool.ru/wp-content/uploads/2021/03/img_8987.png?resize=768%2C1024&ssl
   =1)
 * Appearance of the finished device
 * ![Photo of the Samovar controller — general view](https://i0.wp.com/www.samovar-
   tool.ru/wp-content/uploads/2021/03/img_8949.png?resize=768%2C1024&ssl=1)
 * Testing

### Like this:

Like Loading…

### _Related_
