1: + power supply
2: - power supply
3: + LED
4: - LED
5: PWM signal.
Since the Vin voltage is between 9 ~ 56 VDC, and the PWM signal HIGH is between 2.5 ~ 6 VDC, how does this work? How can I use my Arduino to provide this PWM signal? Can I hook my arduino ground to the -Vin (24VDC)? I am powering the Arduino with USB cable. Will this fry stuff? can grounds of differing voltages be intermixed??
Arduino supplies the right voltage. Set an Arduino PWM pin as output, tie it to the driver's PWM pin. Do an AnalogWrite with the value you want. Try out some values. It should actually be very easy. Jameco gives that part as 6 weeks. You are a more patient man than I am.
These are just the ones that I found that fit what I was doing. I am still new to this, what would you guys recommend as a suitable replacement in the future. I was wondering why these seemed so obscure...
So after hooking up my system, I burned out the pin #3 on my Arduino. That is the pin I was using to provide PWM to the LED driver. I had my system hooked up identical to the below picture "circuit B" (taken from the suggested post on common grounds). I had an N-channel MOSFET as my transistor. I had all my grounds meet on the bus of a breadboard. I was powering my arduino via USB
After several tests, pin #3 is definitely burned but the rest of the arduino seems to be alive.
So I am still having issues with the setup, and I am now convinced that it has something to do with the N-Channel MOSFET that I am using to turn on and off the LED. If you see the attached schematic, you can see what I am talking about. I have my DVM hooked up as shown and my test sketch is turning on and off the light at about 0.25 HZ. Right now i do not have anything hooked to the dimming pin on the LED driver.
When I hook the driver directly to the power supply, I see +5 VDC at the dimming pin, and shorting it to ground turns off the light (expected behavior according to MeanWell tech support). When I have the driver hooked to the MOSFET switch as shown, I see +5 V at the dimming pin when the light is on (arduino digital pin 2 HIGH), and ~ 23.5 V when the light is off (arduino digital pin 2 LOW)
I have so far burned two of these drivers and two of my arduino PWM pins. Let's just say I'm learning real fast
We will deal with the dimming after I figure out what is wrong with my usage of the MOSFET I guess.
I believe you want to be wired up like this.
Pick the LED indicator method you want (top or bottom).
For direct drive, the top circuit, Higher PWM (analogWrite) values = brighter output.
For the bottom two, the PWM is inverted, so Lower PWM values = brighter output.
Thanks for the info, Crossroads. The top scheme did work!
... But I am still confused as to what was happening with my MOSFET. I thought that you could use them in place of a relay in a situation like this. I wanted one digital pin to control wether or not the LDD-600H was getting power or not, and the PWM pin would control the brightness. When I had teh driver hooked directly to the power supply the errant voltage in the "off" state wasn't there, so I knew it was some issue with the MOSFET I was not seeing.
Even though the light works now, I can't move on till i know what's going on!
The reason that you burned out the Arduino pin is that you didn't have a current limiting resistor on the Arduino side. Take circuit B. When Arduino pin 3 goes high, current is free to not only flow from the emitter (arrow part) to the collector (the current you want, going to the load) but also from the emitter to the base (which connects to the Arduino). Without a current limiting resistor, you are trying to have the Arduino sink an amount of (negative) current limited by the resistance of the wires and the tiny semiconductor junction. This will fry the Arduino pin very quickly.
Going back to circuit B, you need to put about a 1k resistor between the Arduino and the transistor. That will limit the current and save the Arduino from damage.
The transistor allows you to control a large current (emitter to collector) with a small current (emitter to base), but you have to make sure that the emitter to base current is small. Putting a current limiting resistor in there will do just that.
The fundamental problem is that if you connect any constant voltage source (battery, power supply, Arduino output) to ground with a nearly zero resistance connection, nearly infinite current will try to flow. Nearly infinite currents tend to make things go snap crackle pop and then stop working.