Werktags vor 14:00 Uhr bestellt = am selben Tag versendet 30 Tage Widerrufsrecht 1 Jahr Garantie
← Zurück zur Übersicht

Schaltplan und Codebeispiel

So schließt du den Einstellbares Step-down-Modul 3-40VDC auf 1.5-35VDC LM2596 an einen Arduino UNO oder ESP32 an, mit einem Beispiel-Sketch, den du direkt hochladen kannst.

LM2596 Step-Down Spannungsmonitor

Dieses Projekt überwacht die Ausgangsspannung des einstellbaren LM2596-Abwärtswandlers über den Analogpin A0. Versorge das Modul über den Arduino-5V/VIN-Pin und drehe am eingebauten Potentiometer, um zu sehen, wie sich die gemessene Spannung im Serial Monitor aktualisiert (stelle sicher, dass die Ausgangsspannung 5V nicht überschreitet).

Anschlussplan: Einstellbares Step-down-Modul 3-40VDC auf 1.5-35VDC LM2596 an einem Arduino UNO
Anschlussplan · Zum Vergrößern klicken
Anschlusstabelle: Einstellbares Step-down-Modul 3-40VDC auf 1.5-35VDC LM2596 an einem Arduino UNO
Anschlusstabelle · Zum Vergrößern klicken
LM2596_Step_Down_Voltage_Monitor.ino · kompiliert und getestet
/*
 * ==================================================================
 *  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

ESP32 mit LM2596 Buck Converter versorgen

Dieses Setup verwendet das LM2596 Step-Down-Modul, um eine 12V-DC-Stromquelle auf 5V zu regeln und den ESP32 über seinen VIN-Pin zu versorgen. Bevor du den Ausgang mit dem ESP32 verbindest, verwende ein Multimeter und drehe am onboard Trimmer-Potentiometer, bis die Ausgangsspannung exakt 5.0V beträgt. Der ESP32 blinkt seine onboard Status-LED und meldet die Laufzeit über Serial, um einen stabilen Betrieb zu bestätigen.

Anschlussplan: Einstellbares Step-down-Modul 3-40VDC auf 1.5-35VDC LM2596 an einem ESP32 DevKit V1
Anschlussplan · Zum Vergrößern klicken
Anschlusstabelle: Einstellbares Step-down-Modul 3-40VDC auf 1.5-35VDC LM2596 an einem ESP32 DevKit V1
Anschlusstabelle · Zum Vergrößern klicken
Powering_ESP32_with_LM2596_Buck_Converte.ino · kompiliert und getestet
/*
 * ==================================================================
 *  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

Zuletzt angesehen

2G/3G/4G Antenne 5dBi mit IPEX-Anschluss

2G/3G/4G Antenne 5dBi mit IPEX-Anschluss

€ 4,05
L-förmiger TT-Motor für Antrieb 3-6V

L-förmiger TT-Motor für Antrieb 3-6V

€ 2,55
12V einstellbares Zeitverzögerungs-Relaismodul

12V einstellbares Zeitverzögerungs-Relaismodul

€ 2,90
Mini Vierkant-Steckschlüssel M2.5, M3, M4

Mini Vierkant-Steckschlüssel M2.5, M3, M4

€ 1,80
W1209 DC12V Digitale Thermostat-Relais

W1209 DC12V Digitale Thermostat-Relais

€ 2,00
Micro-DC-Motor 3V-6V 8000RPM

Micro-DC-Motor 3V-6V 8000RPM

€ 1,20
LM2596S Einstellbarer Step-Down 4-40V -> 1.25-37V mit integriertem Voltmeter-Display

LM2596S Einstellbarer Step-Down 4-40V -> 1.25-37V mit integriertem Voltmeter-Display

€ 3,99
Lötzinn 50g 0.8mm

Lötzinn 50g 0.8mm

€ 4,15
Ansehen