Bestilt før kl. 14.00 på hverdage = afsendt samme dag 30 dages fortrydelsesret 1 års garanti
← Terug til oversigten

Tilslutningsdiagram og kodeeksempel

Sådan tilslutter du Justerbar step-down module 3-40VDC til 1.5-35VDC LM2596 til en Arduino UNO eller ESP32, med en eksempelsketch, du kan uploade med det samme.

LM2596 Step-Down spændingsovervågning

Dette projekt overvåger udgangsspændingen fra den justerbare LM2596 step-down-konverter ved hjælp af den analoge pin A0. Forsyn modulet fra Arduino 5V/VIN-pin, og drej på det indbyggede potentiometer for at se den målte spænding blive opdateret i Serial Monitor (sørg for, at udgangsspændingen ikke overstiger 5V).

Tilslutningsdiagram: Justerbar step-down module 3-40VDC til 1.5-35VDC LM2596 på en Arduino UNO
Tilslutningsdiagram · Klik for at forstørre
Tilslutningstabel: Justerbar step-down module 3-40VDC til 1.5-35VDC LM2596 på en Arduino UNO
Tilslutningstabel · Klik for at forstørre
LM2596_Step_Down_Voltage_Monitor.ino · kompileret og testet
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : LM2596 Step-Down Voltage Monitor
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : Adjustable Step-down Module 3-40VDC 1.5-35VDC LM2596
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

// LM2596 Buck Converter Voltage Monitor
// Reads the regulated output on analog pin A0.
// Note: Keep the output voltage at or below 5.0V to protect the analog pin.

const int sensePin = A0;

void setup() {
  Serial.begin(115200);
  while (!Serial) {
    ; // Wait for Serial Monitor
  }
  Serial.println(F("LM2596 Step-Down Voltage Monitor Initialized"));
  Serial.println(F("Adjust the trimmer potentiometer on the module."));
}

void loop() {
  int rawValue = analogRead(sensePin);
  float voltage = rawValue * (5.0 / 1023.0);

  Serial.print(F("ADC Value: "));
  Serial.print(rawValue);
  Serial.print(F(" | Output Voltage: "));
  Serial.print(voltage, 2);
  Serial.println(F(" V"));

  delay(500);
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Forsyn ESP32 med LM2596 buck converter

Denne opsætning bruger LM2596 step-down-modulet til at regulere en 12V DC-strømkilde ned til 5V for at forsyne ESP32 via dens VIN-pin. Før du tilslutter udgangen til ESP32, skal du bruge et multimeter og dreje på den onboard trimmerpotentiometer, indtil udgangen måler præcis 5.0V. ESP32 blinker med sin onboard status-LED og rapporterer uptime via Serial for at bekræfte stabil drift.

Tilslutningsdiagram: Justerbar step-down module 3-40VDC til 1.5-35VDC LM2596 på en ESP32 DevKit V1
Tilslutningsdiagram · Klik for at forstørre
Tilslutningstabel: Justerbar step-down module 3-40VDC til 1.5-35VDC LM2596 på en ESP32 DevKit V1
Tilslutningstabel · Klik for at forstørre
Powering_ESP32_with_LM2596_Buck_Converte.ino · kompileret og testet
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : Powering ESP32 with LM2596 Buck Converter
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : Adjustable Step-down Module 3-40VDC 1.5-35VDC LM2596
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

// Onboard LED on ESP32 DevKit V1 is on GPIO 2
const int LED_PIN = 2;

void setup() {
  Serial.begin(115200);
  pinMode(LED_PIN, OUTPUT);
  
  Serial.println("LM2596 Step-Down Module ESP32 Power Demo");
}

void loop() {
  digitalWrite(LED_PIN, HIGH);
  Serial.print("ESP32 running stably on buck converter power. Uptime: ");
  Serial.print(millis() / 1000);
  Serial.println(" s");
  delay(1000);

  digitalWrite(LED_PIN, LOW);
  delay(1000);
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Set for nylig

Membraan 4x4 Matrix-tastkontakt

Membraan 4x4 Matrix-tastkontakt

€ 1,60