Analog To PWM for LDD-H Drivers

I'm currently working on an LED light for my reef aquarium, using Mean Well LDD-H DC-DC drivers. I was planning on buying an off the shelf controller, but as I'm short on cash I am trying to control my light using analog/0-10v input via an Arduino board.
I found this simple sketch that should do the basic conversion of analog to pwm: analogWrite() - Arduino Reference

int ledPin = 9; // LED connected to digital pin 9
int analogPin = 3; // potentiometer connected to analog pin 3
int val = 0; // variable to store the read value

void setup()
{
pinMode(ledPin, OUTPUT); // sets the pin as output
}

void loop()
{
val = analogRead(analogPin); // read the input pin
analogWrite(ledPin, val / 4); // analogRead values go from 0 to 1023, analogWrite values from 0 to 255
}

My problem is that it's not working as I expected it to do. The LEDS don't dim at all and the just blink. Can anyone point me on the direction of why things aren't working? Or if anyone has a sketch that will accomplish my goal, I'd love to see that too.
LDD-H datasheet for those unfamiliar with them: http://www.mouser.com/ds/2/260/LDD-H-spec-766227.pdf

So how have you wired it up?
Have you got a 10V supply?
Have you got a transistor driving it?
Have you got a smoothing filter on the PWM output?

Analog out produces a PWM signal, not a constant voltage. That may be why your LEDs don’t dim. But anyway, circuit diagram is needed here to understand better what you’re trying to do.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

What is the exact model number of your MeanWell unit?

Thanks.. Tom.. :slight_smile:

The mean well is a LDD-1000h, my setup uses 2x 1000h & 2x 700h for 4 total channels but I'm just trying to get 1 channel to work first.
Excuse the crude schematic, I know the pin layouts are not true to form but it should be understandable(if not I'll redraw it).
Wvmarle: the pwm output goes to the LDD driver that then outputs the voltage for the LEDs.

LDD drivers can be PWM dimmed with 5volt.
Just connect the DIM input (and ground) to the Arduino.

Need to see a full diagram, with supply (voltage/current) and number of LEDs in a string, etc.
Leo..

Crusader68:
The mean well is a LDD-1000h, my setup uses 2x 1000h & 2x 700h for 4 total channels but I'm just trying to get 1 channel to work first.
Excuse the crude schematic, I know the pin layouts are not true to form but it should be understandable(if not I'll redraw it).
Wvmarle: the pwm output goes to the LDD driver that then outputs the voltage for the LEDs.

Sorry Not posted? ? ?
Tom... :slight_smile:

Second try

Ground wire is needed between Arduino and LDD supply(-).
The 10k resistor might prevent dimming to fully off.
Remove (use a direct connection) if this is a problem.
Can use max six LEDs in a string on a 24volt supply.
Leo..

Image inline for convenience, saves downloading:

Crusader68:
Second try
7c62cf223d1e24e5f498ecdb68a7e29f9b0511dd.png

am trying to control my light using analog/0-10v input via an Arduino board

You might be trying but that is not what you are doing.

You have no smoothing capacitor on the PWM output and no driver to 10V, so you are not feeding the controller with a 0 to 10V analogue signal. You are feeding it with a 0 to 5V PWM signal.

Don't know where this 0-10volt comes from.

The LDD driver OP linked to has an input range from 0-6volt.
And can be dimmed with 5volt PWM.
Switch points are 0.8volt and 2.5volt, so even ok with 3.3volt logic.

It seems that it didn't work, because OP didn't connect grounds.
Leo..

Don't know where this 0-10volt comes from.

Good point.

One sees the MEAN WELL PWM dimming 10V mythology on many forums, again and again, year after year.

MEAN WELL drivers like these boost drivers or those buck drivers specify the PWM voltage to be within a 2-10V or 2,5-6V range, so indeed Wawa is correct: What an Arduino or compatible μc can supply from an output pin is all that's needed for PWM dimming.

Too few people bother reading a product's specification sheet these days, so it seems.

Wawa:
LDD drivers can be PWM dimmed with 5volt.
Just connect the DIM input (and ground) to the Arduino.

Need to see a full diagram, with supply (voltage/current) and number of LEDs in a string, etc.
Leo..

Wawa, which negative terminal on the LDD should the ground from Arduino be connected to - should it be the input side or the output side of the LDD?

Thanks.

--equipoise

Never used an LDD. I make my own LED drivers.
But I suppose Vin (power supply) ground must be shared with Arduino ground.
Leo..