Anyone doing an arduino controller?

DWZM, could you explain a little bit how that works?

Sure.

The rectangular blocs near the sides of the schematic are "standard" shield headers. The text next to each pin is essentially the "arduino" name for that pin.

On the left side, you see a 3-pin IC with four caps. The IC is a VLDO (very low dropout) voltage regulator. The caps are there to filter it's input and output. Together, those 5 components create a regulated 10v power supply.

In the middle, there's a 6 x 2 pin header. This provides six spots to connect a 2-wire harness. There's six because that's how many PWM pins we have on an Arduino. Each set of pins is a "channel" of control for dimming ELNs.

The left side of each pin pair is connected to the 10v power supply on the left side of the schematic. This provides +10v to the ELNs. The right side of each pair of pins is where we are controlling things.

Now, look at the right side of the schematic. There's the two tall rectangles which represent the digital I/O pins from the Arduino - 6 of these are the PWM pins. A connection is made from each PWM pin to a resistor. The other side of the resistor is connected to the base of an NPN transistor. The resistor is there to regulate current. The transistor is there to provide our switching.

Now, look at one of the transistors. The base is connected to the Arduino PWM pin as described above. That means as the Arduino PWM pin switches on and off, the transistor will be switched on and off. The transistor is basically "inserted" between the header for the ELNs and GND. What this means is that when the transistor is off, the pins on the right side of the header will be floating (not connected to anything). In that state, there will be no current flowing on the circuit out to the ELNs, because there will be no ground. When the transistor switches on, it completes the circuit and electricity can flow, which means the ELNs will see 10v.

So, as the PWM signal from the Arduino switches on and off, it turns the transistor on and off. As the transistor turns on and off, it makes and breaks a ground connection for the ELN(s) connected to the header.

The "magic" is that the transistor is being switched by the Arduino's 5v signal, but we can have it switch anything we want - the voltage we use to turn it on and off are independent of what it happens to be switching, which we take advantage of here by letting it switch a 10v circuit, thus effectively translating the 5v PWM signal to 10v.

That's all in theory of course, I've never actually done this for this specific purpose. However, the general concept is extremely basic and fundamental to many electronics devices. Within the Arduino community, this approach is often used for doing things like turning a 12v DC relay on and off, for instance.
 
eln_shield.gif

I quoted this here so that we could look at it while reading your explanation. Thanks!

that is fantastic..
 
Last edited:
I've seen someone using mosfet to control the LED but he's using the buckpuck (only need 5v instead of 10v).

That's sometimes done on a buckpuck to "invert" the PWM signal from the Arduino. A buckpuck is ON at 0v and OFF at 5v (more or less) so it's backwards from conventional logic levels. Hence, some circuits using a microprocessor to dim a buckpuck use a MOSFET to flip-flop the signal. Of course you could just do the flipflop in software, too.

Another reason to use a transistor (driving a buckpuck or any other device) is for extra load capacity. If we assume an LED driver needs 10mA of current on it's DIM circuit (I'm making this up!), you'd only be able to connect 3 or 4 of them to an Arduino PWM pin before you exceeded the current limit (and blew the AVR on your Arduino). If you use a transistor with a higher max current, you can connect many more together without damage.

IIRC the transistors I used on my shield have a 100mA limit, and I've heard rumors that ELNs draw only a few mA each, so each "channel" on my shield should be able to control more of them than anyone would ever need.
 
Yes, there are a whole bunch of purpose-built "voltage converter" ICs that'll do this job. Most of them are basially a similar concept rolled into an IC. I didn't put much effort into looking at them because I wanted to give this route a try. One advantage of this route is that it's dirt cheap (the transistors were like 4 cents each).
 
Thank! I'm gonna try this w/e. I only need 10v for all caps rite? The LM2904 needs 12v-26v input and 10v output? I though we only have 5v input and need 10v out. Sorry for all the dump question!
 
Last edited:
you would need 2 .1uF caps, a 10uF cap, a 22uF cap and an LM2904 i THINK.

Yeah that's more or less correct. The values of the caps aren't really critical as long as they're in the vicinity. It depends on how well regulated your power supply is, how many ELNs you're driving, etc.

The voltage reg I'm using is an oddball part but there are lots that would work. For simple "I'm going to try it this weekend" experiments the easiest solution is probably an LM317 since you can get them anywhere and set them to whatever voltage you want.
 
DWZM,

Sorry, but your design is bothering my electronics brain cells.

In your design ( correct me if I'm wrong ), you are removing the +10V ground path when you turn off the PWM.

My brain hasnt come to terms with this yet, but my gut feeling is that this not a good idea.

Stu
 
We here in the UK are taking quite a keen interest in LED DIY projects along with help of arduino. There is complete code and user manual available for free to anyone who maybe interested.
User Manual
http://code.google.com/p/dangerduin...rusduinoUserManualv1.pdf&can=2&q=#makechanges
http://code.google.com/p/dangerduino/downloads/detail?name=Krusduino_r13.zip&can=2&q=#makechanges
The code can be modified to meet users needs and this above version also covers Meanwell (P) version drivers.
The thread itself on UR.... http://www.ultimatereef.net/forums/showthread.php?t=363432
Good luck.....
 
assuming your using 12v to power your arduino then this is much easier and doesn't require a different supply and what 30 cents in parts. it will give you 10v from the 12v power supply..let me know if i did something wrong
 

Attachments

  • schematic.gif
    schematic.gif
    6.3 KB · Views: 24
DWZM,

Sorry, but your design is bothering my electronics brain cells.

In your design ( correct me if I'm wrong ), you are removing the +10V ground path when you turn off the PWM.

My brain hasnt come to terms with this yet, but my gut feeling is that this not a good idea.

Stu

If your brain does come up with something, please tell me. :) I don't inherently see a problem - if the GND is broken, there will be no voltage or current in the circuit to the ELNs.

FWIW I've seen similar schematics for controlling relays or other "large" loads or loads with different voltage levels from a microcontroller. From the Arduino Playground, this is the "recommended" practice for a relay that needs a different voltage than 5v:

http://www.arduino.cc/playground/uploads/Main/relays.pdf

assuming your using 12v to power your arduino then this is much easier and doesn't require a different supply and what 30 cents in parts. it will give you 10v from the 12v power supply..let me know if i did something wrong

I don't see anything wrong with that either, but it's not THAT much simpler than putting a voltage regulator and a few caps on the board to generate 10v, and using the regulator probably guarantees good stable output over a wider range of conditions.
 
I think what stu is talking about is if there is a short to ground someplace after the transistor, then the circut will be live no matter what the state of the output pin. shorts to ground are common, but with the voltages and currents we are using it is not too bad but it is a risk that should be addressed.
 
DWZM,

Here is how I would do it.

In this picture, ignore the LED (short across it ) and connect the node between the resistor & the FET to the Meanwell Dim +. Hook the +V to +10V and it should work fine.

This way, when the FET is open (not conducting ) the voltage at that point is 10V.
When the FET is closed (conducting) hte voltage is 0V.

60772MOSFET.jpg


Stu
 
DWZM,

Here is how I would do it.

In this picture, ignore the LED (short across it ) and connect the node between the resistor & the FET to the Meanwell Dim +. Hook the +V to +10V and it should work fine.

This way, when the FET is open (not conducting ) the voltage at that point is 10V.
When the FET is closed (conducting) hte voltage is 0V.

60772MOSFET.jpg


Stu

Stu, maybe I'm missing something, but I'm not understanding the changes you're describing to that circuit. And I don't understand what's fundamentally wrong with mine, either. . .

But please don't take this as an argument, I'm really just not getting it. :D
 
In my circuit, the 10V ground to the Dim circuit is hooked up all the time and we are pulling the DIM+ up and down from ground.

In your circuit, the DIM+ is hooked to +10V all the time and you are disconnecting the ground circuit.

Both should work the same, just that mine is the one I typically see in these applications.

typically when you unhook things from ground, bad things happen but that is when a system uses multiple DC voltages.

With the Meanwell, your circuit should work fine since there is only one DC signal, but in general it is bad practice.

Stu
 
Back
Top