SKU: OT3561 Artikelnummer: AA686 EAN: 8720618827449
Denna modul omvandlar en spänning på 0V - 10V till en PWM-signal
Specifikationer för spänning till PWM-omvandlaren:
Anslutning:
VCC: + Driftspänning 5V-12V (matning till själva kortet)
GND: - Driftspänning 5V-12V
VIN: + Ingångsspänning 0-10V (denna omvandlas till PWM)
GND: - Ingångsspänning 0-10V
GND: - PWM-utgång
PWM: + PWM-utgång
Arbetssätt:
Anslut driftspänningen till VCC och GND. Anslut dem inte omvänt för att undvika skador på kretskortet och enheterna. Anslut en reglerbar spänning till VIN-terminalen. Spänningsområdet är uppdelat i två typer: 0-5V och 0-10V beroende på valt läge med bygeln. På baksidan av kortet visas detta. Som standard är den inställd på 0-5V.
Utgången är PWM. Duty cycle kan justeras genom att ändra spänningen. Noggrannheten kan kontrolleras genom att justera potentiometern.
Så här kopplar du Spänning till PWM-omvandlarmodul 0-10V till en Arduino UNO eller ESP32, med ett exempelsketch som du kan ladda upp direkt.
This circuit generates a varying PWM signal on pin 9, which the converter module transforms into a proportional DC analog output voltage (0-10V). Open the Serial Monitor to observe the current PWM duty cycle as it ramps smoothly up and down. Measure the VOUT terminal with a multimeter to verify the changing analog voltage.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : PWM to 0-10V Voltage Converter Demo
* Board : Arduino UNO (arduino:avr:uno)
* Parts : PWM naar Voltage converter module 0-10V
* 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.
* ==================================================================
*/
// PWM to 0-10V Voltage Converter Module Demo
// Sweeps PWM duty cycle on pin 9 from 0% to 100% and back
const int pwmPin = 9;
void setup() {
pinMode(pwmPin, OUTPUT);
Serial.begin(115200);
Serial.println(F("PWM to 0-10V Converter Demo Initialized"));
}
void loop() {
// Ramp up
for (int duty = 0; duty <= 255; duty += 5) {
analogWrite(pwmPin, duty);
Serial.print(F("PWM Duty: "));
Serial.print(duty);
Serial.print(F("/255 ("));
Serial.print((duty * 100) / 255);
Serial.println(F("%)"));
delay(50);
}
delay(500);
// Ramp down
for (int duty = 255; duty >= 0; duty -= 5) {
analogWrite(pwmPin, duty);
Serial.print(F("PWM Duty: "));
Serial.print(duty);
Serial.print(F("/255 ("));
Serial.print((duty * 100) / 255);
Serial.println(F("%)"));
delay(50);
}
delay(500);
}
Wiring diagram and example code generated by Codey.online — https://www.codey.online
This project demonstrates generating a 0-10V analog control voltage using an ESP32 and a PWM-to-voltage converter module. The ESP32 sends a 0-100% PWM signal from GPIO 4 to the module, which converts it into a proportional 0-10V DC output suitable for PLCs, VFDs, and dimmers. An external 12V power supply powers the converter module.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : ESP32 0-10V PWM Voltage Converter Demo
* Board : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
* Parts : PWM naar Voltage converter module 0-10V
* 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.
* ==================================================================
*/
/*
* PWM to 0-10V Voltage Converter Demo
* Board: ESP32 DevKit V1
*
* Ramps output voltage from 0V to 10V and back down.
*/
const int PWM_PIN = 4; // GPIO 4 connected to PWM input
void setup() {
Serial.begin(115200);
pinMode(PWM_PIN, OUTPUT);
Serial.println("PWM to 0-10V Converter Demo Started");
}
void loop() {
// Ramp up from 0V to 10V
for (int duty = 0; duty <= 255; duty += 5) {
analogWrite(PWM_PIN, duty);
float expectedVoltage = (duty / 255.0) * 10.0;
Serial.print("Duty: ");
Serial.print(duty);
Serial.print("/255 | Output Voltage: ~");
Serial.print(expectedVoltage, 2);
Serial.println(" V");
delay(50);
}
delay(500);
// Ramp down from 10V to 0V
for (int duty = 255; duty >= 0; duty -= 5) {
analogWrite(PWM_PIN, duty);
float expectedVoltage = (duty / 255.0) * 10.0;
Serial.print("Duty: ");
Serial.print(duty);
Serial.print("/255 | Output Voltage: ~");
Serial.print(expectedVoltage, 2);
Serial.println(" V");
delay(50);
}
delay(500);
}
Wiring diagram and example code generated by Codey.online — https://www.codey.online