Skip to content

Final - what worked

I wanted a place to put together all the things that worked. I had so many rabbit holes with things not working, I wanted to have one reference area that was more like an instructable, with what really worked.

Voltage

I changed to a 5V power source. Everything cooled down., but the wifi seemed to have a hard time powering up. I am wondering if the power supply is a part of this. Claude thinks its electrical noise.

  • Voltage → pick the highest minimum requirement among your components

The A4988 VMOT at 8V minimum is the limiting factor

So I will move to a 9V 2A supply, and use a buck converter.

Current Calculation at 12V

  • Current → add up all the requirements
Component Current
Stepper motor (full step, max) 600mA
A4988 logic (VDD from buck) ~20mA
ESP32-C6 (WiFi active, peak) ~500mA
White LED (assume 20mA) ~20mA
Photoresistor ~1mA
Buck converter overhead (~85% eff.) ~15mA
Total worst case ~1,156mA

I need a 1.5 to 2 Amp source.

Href and the tuning

Check the Vref and which motor driver you are using.

A4988 clone

HR4988 (or A4988 clone) driver module. I can clearly see:

  • R4 and R5 are your two sense resistors, both marked R10 = 0.1Ω ✅
  • The trim pot (silver adjustment screw, top center) is your Vref adjustment
  • This confirms your Vref target = 0.48V for full 0.6A
FOR THE A4988
Vref = I_max × 8 × Rsense
Vref = 0.6 × 8 × 0.010
Vref = 0.048V ...

How to Measure and Set Vref

  1. Power the board but don't run the motor
  2. Put your multimeter negative probe on GND (any ground pin on your PCB)
  3. Put your multimeter positive probe directly on the metal top of the trim pot
  4. Read the voltage
  5. Turn the pot clockwise to increase, counter-clockwise to decrease
  6. Adjust until you read 0.40–0.48V

Resource from Zero to Hero for tuning the VREF

One Caution

That driver chip gets hot at higher currents. Once you set Vref to 0.48V, run the motor for a minute and feel the chip — if it's too hot to touch, either add a small heatsink or back Vref down slightly to 0.40V.