This is my first project, and i'm a newbie on arduino. I'm trying to dim a 3w led trhough analogWrite to a Driver, but it seems that i don't get how to... as led stays on without considering A3 values i send to.
My board is an arduino mini pro 328p 5v, which i power on usb.
After plugging it to Pin3, I still have not been able to at first shut the led off, to afterwards code the values to dim the light. It stills output as full open light.
The led driver is powered by 7.5v DC
here is my test code.
void setup()
{
}
void loop()
{
analogWrite(3, 0); // analogRead values go from 0 to 1023, analogWrite values from 0 to 255
}
Perhaps you start reading and understanding the alnalogWrite sample http://arduino.cc/en/Reference/AnalogWrite provided on the Arduino website. The code you posted above is missing an essential line in the setup that configures your pin 3 as an output.
Also, you may want to urgently mount your LED to a heat sink with some thermal tape, thermal epoxy or screws and thermal paste. If the LED gets the full 700mA for too long it will overheat and that will dramatically reduce its lifetime!
Perhaps you start reading and understanding the alnalogWrite sample analogWrite() - Arduino Reference provided on the Arduino website. The code you posted above is missing an essential line in the setup that configures your pin 3 as an output.
Headroom, there's no pinMode missing, if that's what you're implying
Thx awol, as i read analogwrite function doesn.t require to be declared to be on output mode.
Any tip to explain why doesn.t react to pwm led driver?
By the way, once i get it working i will consider heatsink as i want to drive it on short pulses, and right now i use it for test purpose, so it doesn.t ouput that much heat.
Well that code you posted only ever sets pin 3 to off so I am not sure what you expect it to do.
Have you connect the arduino's ground to the ground of your dimmer board?
Perhaps you start reading and understanding the alnalogWrite sample analogWrite() - Arduino Reference provided on the Arduino website. The code you posted above is missing an essential line in the setup that configures your pin 3 as an output.
Headroom, there's no pinMode missing, if that's what you're implying
Yup, that's what I was referring to. Guess I need to do my own reading XD
First, i finally got working the PWM Led Driver thanks to all your comments... basically i didn't plug it to ground .. So much obligated, Thanks.
Now i've got the same problem... with the Led driver that HeadRoom suggested. Great Price though.
I've plugged 9V Battery to IN+/-, LED +/- to V/grnd, and Arduino PIN3 to Led Driver DIM Pin. But it doesn't react at all to PWM = 0, as it always stays on, like PIN3 wasn't even connected to DIM pin.
Again, the ground problem... or i should say my poor knowledge of IC...
So now everything works fine.
And now, hopefully my last question.
With the first board (although Vin Specs are the same or higher as the second one) i can use arduino and led driver just by using a 9V battery plugged to Arduino, and from MiniPro supply the led driver and Led.
On the second board... I cannot figure why it doesn't work, as i have to power the mini with usb, and Led driver with 9V...
I will try to draw a schematic by hand to upload it soon. By the way, did you accomplished powering led driver by using only one 9v Battery on Arduino and nothing else?
Constant current output 300mA~1000mA
Wide input voltage:9~56V
Wide output LED string voltage:2~52V
High efficiency up to 97%
cost <6.00 USD
easily find at local
I have thread title is "Sync a motor to HDMI signal", but don't be influence by title.
The LED driver by PT4115 is working same a way, but it might be no available at local.
The LED driver board I posted is available throug ebay and costs 3,50 not including shipping.
@OP,
No I did not operate that LED driver board from a 9V battery I had three of these to operate a 700mA RGB LED. I would not attempt to do that with a 9V battery
However, If you initial Driver worked from a 9V battery there is no reason the Driver I suggested should not be able to do that. It uses the same IC.