Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP32-Based Battery Welding Station with TFT Display and Rotary Encoder

View and Edit Project In Cirkit DesignerImage of ESP32-Based Battery Welding Station with TFT Display and Rotary Encoder

Circuit Documentation

Summary

This circuit is designed to control a welding pen using an ESP32 microcontroller. It includes a rotary encoder for user input, a TFT display for visual feedback, LEDs for status indication, a piezo buzzer for audio feedback, and a solid-state relay (SSR) for controlling high-power devices. The circuit also includes a toggle switch and pushbuttons for additional user controls.

Component List

  1. Esp32 on Baseboard

    • Description: Microcontroller used for controlling the circuit.
    • Pins: GPIO23, GPIO22, GPIO1/TX, GPIO3/RX, GPIO21, GPIO19, GPIO18, GPIO5, GPIO17, GPIO16, GPIO4, GPIO0, GPIO2, GPIO15, SD1, SD0, CLK, V, G, GPIO36, GPIO39, GPIO34, GPIO35, GPIO32, GPIO33, GPIO25, GPIO26, GPIO27, GPIO14, GPIO12, GPIO13, SD2, SD3, GND, 5V, 3V, TX, RX, VCC, D22, D21
  2. Rotary Encoder

    • Description: Used for user input to adjust settings.
    • Pins: clk, dt, sw, gnd, +
  3. Round TFT Display

    • Description: Provides visual feedback to the user.
    • Pins: RST, CS, DC, SDA, SCL, GND, VCC
  4. Pushbutton

    • Description: Used for user input.
    • Pins: Pin 3 (out), Pin 4 (out), Pin 1 (in), Pin 2 (in)
  5. 12v Battery

    • Description: Power source for the circuit.
    • Pins: -, +
  6. MOSFET Bank of 40xIRF540N

    • Description: Used for switching high-power loads.
    • Pins: Drain A, Drain B, Source A1, Source A2, Gate A1, Gate A2, Gate B1, Gate B2, Source B1, Source B2
  7. 18650 Battery Welding Pen

    • Description: The welding pen controlled by the circuit.
    • Pins: + INPUT, - INPUT
  8. SSR-40A

    • Description: Solid-state relay for controlling high-power devices.
    • Pins: -, +, Lin, Lout
  9. RGB LED

    • Description: Provides visual status indication.
    • Pins: B, G, R, GND
  10. Piezo Buzzer

    • Description: Provides audio feedback.
    • Pins: pin 1, pin 2
  11. Toggle Switch SPST

    • Description: Used for toggling the ready state.
    • Pins: L1, COM
  12. LED: Two Pin (green)

    • Description: Provides visual status indication.
    • Pins: cathode, anode
  13. LED: Two Pin (red)

    • Description: Provides visual status indication.
    • Pins: cathode, anode

Wiring Details

Esp32 on Baseboard

Rotary Encoder

Round TFT Display

Pushbutton

12v Battery

MOSFET Bank of 40xIRF540N

18650 Battery Welding Pen

SSR-40A

RGB LED

Piezo Buzzer

Toggle Switch SPST

LED: Two Pin (green)

LED: Two Pin (red)

Code Documentation

#include <TFT_eSPI.h> // TFT display library
#include <Preferences.h> // Persistent storage library
#include <ESP32Encoder.h> // Rotary encoder library
#include <Ticker.h> // Timer library

// Pin definitions
#define RST_PIN 15
#define CS_PIN 5
#define DC_PIN 2
#define SDA_PIN 23
#define SCL_PIN 18
#define ENCODER_CLK_PIN 32
#define ENCODER_DT_PIN 33
#define ENCODER_SW_PIN 25
#define ACTIVATE_PIN 12
#define RESET_PIN 0 // EN