Радио Лэтуаль
LIVE

Hw-044 - Datasheet

Despite its simplicity, users frequently encounter problems with the HW-044. Here is a debugging table based on real forums and datasheet analysis.

| Symptom | Likely Cause | Solution | |---------|--------------|----------| | No sound, PWR LED off | No power or reversed VIN/GND | Check voltage at VIN pin. Reverse polarity kills the IC. | | Humming or high noise | Shared ground with high-current devices | Create a star ground. Separate digital and power grounds. | | Distorted audio at high volume | Clipping due to high gain | Reduce GAIN setting (float or GND). Lower source volume. | | Clicking or popping | Sample rate mismatch or BCLK unstable | Ensure I²S clock is continuous. Use internal PLL if available. | | Only left or right channel missing | Mono mode enabled (normal) | HW-044 is mono. Combine channels in software. | | Amplifier gets very hot | Speaker impedance too low (<4Ω) or short circuit | Use 4Ω–8Ω speaker. Check SPK+ to SPK- resistance. | | No sound with ESP32 | Wrong I²S pins or format | Confirm BCLK/LRC/DIN assignments. Use i2s_std driver. |


The ESP32 uses 3.3V for both power and analog reference. You can still operate the HW-044 at 3.3V or 5V—but if using 5V, the analog outputs will exceed the ESP32’s ADC range (0-3.3V). Use a voltage divider on the X and Y lines, or power the HW-044 at 3.3V directly.

Optimal wiring for ESP32:

Note: ESP32 ADC is non-linear near the rails. The HW-044 at 3.3V works well, but expect reduced total range (~0.2V to 3.1V). hw-044 datasheet

To solidify your understanding, here is a complete project using the HW-044.

Goal: Control a differential drive robot. Y-axis controls forward/back speed, X-axis controls turning, and the button toggles a headlight LED.

Hardware:

Code Sketch (excerpt):

// ... pin definitions and setup as before ...

int deadzone = 20; // ADC counts int maxSpeed = 255;

void loop() int xRaw = analogRead(xPin); int yRaw = analogRead(yPin);

// Center calibration (replace with your values) int centerX = 512; int centerY = 512;

int xDiff = xRaw - centerX; int yDiff = yRaw - centerY; The ESP32 uses 3

// Apply deadzone if (abs(xDiff) < deadzone) xDiff = 0; if (abs(yDiff) < deadzone) yDiff = 0;

// Map to motor speeds int leftSpeed = constrain(yDiff + xDiff, -255, 255); int rightSpeed = constrain(yDiff - xDiff, -255, 255);

// Send to motor driver (analogWrite for PWM) // ... motor control logic ...

This code creates a classic "tank drive" response: pushing forward moves both motors forward, pulling back reverses, and moving the X axis creates differential steering.


hw-044 datasheet
Ссылка скопирована
Комментарий отправлен