Replace 50k pot with arduino

Wawa:
That's all you need. No Uno, no 12volt supply, no LM317.
Just power an ESP breakout board of your choice with a 5volt cellphone charger with USB connector.
And use a small signal NPN transistor, with base CL resistor, across the DIM pins.
Or an opto coupler, for an extra safety layer.

The ESP32 has more I/O than the ESP8266, and could be more stable (pot and PWM).
No experience there, because I only have used the ESP8266 (Wemos D1 mini).
Leo..

But according to the spec sheet on the meanwell driver the pwn needs to be at 10v?

The Meanwell driver already provides that 10volt internally.

You can lower (load/short) that 10volt gradually with a pot, all the way to 0volt (pot control),
or lower that with PWM (shorting/releasing the DIM pins at a PWM frequency).

With pot/voltage control, actual LED current is controlled (no PWM flicker).
With PWM, the whole driver is turned on/off very fast, but your eyes don't see that.
PWM is much easier to implement, and ok in most domestic situations.

In larger installations (many drivers), external voltage control is preferred.
A more solid external voltage, to make all drivers behave/dim the same.
Leo..

Wawa:
The Meanwell driver already provides that 10volt internally.

You can lower (load/short) that 10volt gradually with a pot, all the way to 0volt (pot control),
or lower that with PWM (shorting/releasing the DIM pins at a PWM frequency).

With pot/voltage control, actual LED current is controlled (no PWM flicker).
With PWM, the whole driver is turned on/off very fast, but your eyes don't see that.
PWM is much easier to implement, and ok in most domestic situations.

In larger installations (many drivers), external voltage control is preferred.
A more solid external voltage, to make all drivers behave/dim the same.
Leo..

couldn't i smooth the pwn with a cap? i have an oscilloscope. So your saying i could just use the 3.3v PWM output from an esp32 to the dim wire and it will operate the light from 0-100 percent brightness with 3.3v?

Actually i have almost 20 of these drivers i would like to build dimmers for

No, you must use a transistor (or opto coupler) to level-shift between the 3.3volt logic and the 0/10volt of the driver.

The 3.3volt pin of the ESP drives the base of a transistor (with a ~0.65volt Base-Emitter threshold).
The transistor amplifies, and the collector (DIM+) switches that 10volt to DIM- (ground).
Leo..

Yes, you can smooth PWM with a cap (between DIM_ and DIM -), but you must experiment with it's value.
You most likely will run into some problems, like a reduced dim range.
Must have a good reason to go there.
Leo..

Wawa:
No, you must use a transistor (or opto coupler) to level-shift between the 3.3volt logic and the 0/10volt of the driver.

The 3.3volt pin of the ESP drives the base of a transistor (with a ~0.65volt Base-Emitter threshold).
The transistor amplifies, and the collector (DIM+) switches that 10volt to DIM- (ground).
Leo..

I have never designed a level shifter before. so i could connect the 10.8v from the driver to the collector of the transistor using the proper resistor value and it would bring the voltage of the line up without allowing the current to flow back into the esp? How would i calculate the value of the 10.8v line resistor. in this case it wouldnt be PWM so i wouldn't have to worry about flickering?

the reason i want to dim so low is because at .7v the output shuts off and i like being able to shut it off with dimming function.

One problem that comes to mind with pwm is the blocking code on an esp for the web server and misc other things. Would the level shifting method require pwm?

Also does anyone know of any digital pots i could use to handle a 12v signal at up to 100kohm?. it seems like that would be the easiest way??

A level shifter is just a name for a circuit that connect two devices working on different voltages.

No... resistor in the collector line.
The transistor acts as a switch, shorting the two DIM pins together (in the PWM rhythm).
There must only be a resistor between Arduino pin and base, to protect the Arduino pin from over-current.

Use a small signal NPN transistor (BC547, BC548, 2N2222, 2N3904, etc).

Collector to DIM+
Emitter to DIM-

Arduino ground to DIM-
Arduino PWM pin, with a 1k resistor in series, to Base.
Leo..

Test sketch.

const byte potPin = A0;
const byte ledPin = 9; // ~500Hz PWM pin

void setup() {
}

void loop() {
  analogWrite(analogRead(potPin) >> 2, ledPin); // read pot, convert 10-bit to 8-bit, write PWM
  delay(250);
}

Wawa:
A level shifter is just a name for a circuit that connect two devices working on different voltages.

No... resistor in the collector line.
The transistor acts as a switch, shorting the two DIM pins together (in the PWM rhythm).
There must only be a resistor between Arduino pin and base, to protect the Arduino pin from over-current.

Use a small signal NPN transistor (BC547, BC548, 2N2222, 2N3904, etc).

Collector to DIM+
Emitter to DIM-

Arduino ground to DIM-
Arduino PWM pin, with a 1k resistor in series, to Base.
Leo..

Do you think i could get the light to shut off at 0.7v with this method? and become fully on? thanks for your help i'm going to try this tomorrow because its getting late i have been up all night looking for a solution to this problem. I am looking forward to trying this out.

notsolowki:
Do you think i could get the light to shut off at 0.7v with this method?

It seems you don't understand what PWM is (Google it).
The transistor switches between 0volt (almost 0volt) and 10volt. Nothing in between.
A PWM value of 255 from the Arduino results in less than 0.2volt on the DIM+ pin.
A PWM value of 0 results in 10volt (10.8volt as you say) on the DIM+ pin.
A PWM value of ~127 results in the LED driver being 'on' 50% of the time (but switching on/off very fast)
Leo..

How about stepping back a little and thinking what other solutions there may be?

One that comes to mind for me is coupling the existing pot to a stepper motor mechanically and driving that from the processor. That way you don't need to know anything about the dimming device at all.

Just seen this thread.

One very big question: Why do you think an LED constant current driver is suitable to control a motor? It
isn't designed for it and will probably fail catastrophically due to inductive kick-back.

To control a motor use a motor driver. Its that simple.

Have you actually said what the motor itself is?

I told you you needed a DAC several post ago. I told you the DAC ref voltage needed to be about 12 VDC. What part of that did you not understand? How many wires go to the motor, it should be two or four. How many HP is the motor? Sorely lacking for information with the exception of some voltages across the pot. How is the pot configured?

Ron

Wawa:
A level shifter is just a name for a circuit that connect two devices working on different voltages.

No... resistor in the collector line.
The transistor acts as a switch, shorting the two DIM pins together (in the PWM rhythm).
There must only be a resistor between Arduino pin and base, to protect the Arduino pin from over-current.

Use a small signal NPN transistor (BC547, BC548, 2N2222, 2N3904, etc).

Collector to DIM+
Emitter to DIM-

Arduino ground to DIM-
Arduino PWM pin, with a 1k resistor in series, to Base.
Leo..

Test sketch.

const byte potPin = A0;

const byte ledPin = 9; // ~500Hz PWM pin

void setup() {
}

void loop() {
  analogWrite(analogRead(potPin) >> 2, ledPin); // read pot, convert 10-bit to 8-bit, write PWM
  delay(250);
}

I used my frequency generator to emulate the arduino. I set the generator to 490hz and it works like a charm. At 97% duty cycle the light is completely off And at 0% duty cycle its fully on. I hope I get the same result from the esp or arduino thankyou

For everyone elses concern, im not talking about a motor anymore, dont ask why. and im sorry for the miss communication.

would there be any reason to change the PWM freq on the esp? I dont notice any flickering i think the LED Driver has some sort of filtering of its own. Could i benefit from picking a different frequency to drive the base of the transistor?

You don't see any flickering of the lights any more above ~100Hz,
but you could see some strobe effect on moving items in the room (spread four fingers, and wave your hand).
I normally use the default 200Hz on LED drivers based on PCA9685 chips.
The default ~500Hz of most Arduino pins is just fine, but don't go a lot higher than that.
If you do, then the (low) dim range could suffer.
Leo..

I found that if I change the default frequency on the esp to 600Hz I get way smoother results. At 1khz I had lots of flickering/glitches throughout the whole duty cycle range.

At 600Hz I get a smooth dimming range almost all the way through the duty cycle.

I used my frequency generator to find a smooth working frequency/duty cycle range.

Do you happen to know how i could check the output of the LED Driver with my oscilloscope while 600w worth of LEDS are connected so i can see exactly how the output if functioning compared to my PWM signal. I have a 4 channel oscilloscope but i'm not exactly sure what i should be looking for or where to connect my probes. I want to make sure they are operating at the maximum output i can get.