First, I'm new to this so please be patient with me.
What I'm trying to do is control my LED set up with my Arduino.
The problem I'm having is that the lights flash and don't dim like they are suppose to I've tried a Mega and a uno with the same results, now I'm aware that the problem is with me and not the product.
the setup is as follows.
24v Dc going into a led driver from the driver on to the led's this circuit is correct I've done it hundreds of times using a potentiometer to dim when needed less light.
this is where the problems begin the driver has got a PWM wire so they can be dimmed using a controller
when I connect this to a PWM pin I get the lights flashing and not dimming at all.
this is the code that I've used it works well with a low power led but not the high power stuff that I'm trying to do.
I'm heading in the wrong direction with this and was wondering if anybody can set me straight?
I feel that I may need to alter the drivers wiring.
In case you are wondering I'm using 6 Cree XML Led's and a Recom RCD/24-1.20/w/x3 driver
Thanks
[/cod */
int ledPin = 8; // LED connected to digital pin 9
void setup() {
// nothing happens in setup
}
void loop() {
// fade in from min to max in increments of 5 points:
for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) {
// sets the value (range from 0 to 255):
analogWrite(ledPin, fadeValue);
// wait for 30 milliseconds to see the dimming effect
delay(30);
}
// fade out from max to min in increments of 5 points:
for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) {
// sets the value (range from 0 to 255):
analogWrite(ledPin, fadeValue);
// wait for 30 milliseconds to see the dimming effect
delay(30);
}
}e]
I wonder if it's to do with the PWM frequency? I can't see a reference to what it needs to be for your controller, but the Arduino pins are 490 and 980Hz. See here for which is which. Could it be too slow for the controller and so it thinks it's actually offing and onning not pwming?
You can roll your own pwm at any frequency you like, by the way, as described here for a 38kHz IR carrier signal, but it's a matter of adjusting the times to give you 5ms per cycle instead of their 26us,
JimboZA:
I wonder if it's to do with the PWM frequency? I can't see a reference to what it needs to be for your controller, but the Arduino pins are 490 and 980Hz. See here for which is which. Could it be too slow for the controller and so it thinks it's actually offing and onning not pwming?
Actually I think it may be the other way around. Looking at page 4 of the datasheet it shows this diagram for "High Frequency PWM" (Note it uses a capacitor and the ANALOG input for this implementation)
Hi Guys,
Thanks for the info, I'm really over my head.
The analogue wire is left unconnected
I have only connected the PWM wire.
I have also seen the diagram with the capacitor and resistor, however I have no idea what size capacitor or resistor to use!!!!!!!
I also thought about the frequency but no idea how to change this or to go around.
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png or pdf?
Have you got the gnd of the LED setup and arduino connected together, they must be so that the PWM signal has a return current path back to the arduino.
TomGeorge:
Have you got the gnd of the LED setup and arduino connected together, they must be so that the PWM signal has a return current path back to the arduino.
Hi KenF,
The answer to your question must be no I do not, nor do I know how to do that, that is probably why it's not working can you show me how to do that?
KenF,
You are a Gem,
It works, it was looking at me in the eyes and I could not see it,
now all I have to do is to change the code so that the ramping up and down will be smooth