Controlling 24v LED bars with Arduino Mega 2560?

Im quasi-new to this sort of thing, and i'm doing my best to learn things, so please bare with me. :wink:

I've recently jumped onto a project called iAqua, and it has many things going on, most of which I understand by now, but there is one thing that im hung up on; PWM LED lighting.

This is the shield I will be using on an arduino mega 2560 r3;

At the top-center there is a pin-out for PWM control, but I can't figure out how to wire it. The Arduino board certainly cant provide power directly because the LED strip pulls 24V 3A, so it will have to draw from an external source.

Would one of these work in conjunction with the arduinos output?

You can drive a ‘Logic Level MOSFET’ with the output.

Use circuit C1.

M3 and D3 would be removed and you then connect your LED pin to the MOSFET drain.
Also, R28 would not be needed (replace it with a piece of wire) as you have a 220R on your shield already.

Aha, thanks for the help!

I'm not the best at deciphering diagrams yet, but here goes;

So if i'm reading it right, on each channel;
From arduino pin there is a 220 ohm resistor which leads to the gate on a mosfet and also to a grounded 10k ohm resistor. The mosfet source is grounded, and the mosfet drain connects to the LEDstrips R/G/B/W cathode pin. The LEDstrips shared anode pin goes straight to powersource which is +24VDC.

Did I get that correct?

I'm also still curious if this device can do it as well, as it is easier and more compact than having to make something myself.

Very close!

The transistors in your diagram are shown as BJT PNP transistors.

You need a ‘logic level’ N channel MOSFET as seen on the LHS.

Of course each LED on your strip must have a current limiting resistor. :wink:

Sorry, I should have clarified, the virtual breadboard software im using is a little hokey and doesn't have mosfet objects for some reason, so I grabbed the nearest thing.

Could you tell if this device would work?
It would be easier and smaller and probably cheaper than making something myself. :wink:

This might work, inexpensive enough to try one.

I would not hesitate to try one but to be 100% safe, a schematic of the device would be nice to see. :slight_smile:

Edit:
On 2nd thought, looks like this module might need a common cathode strip.

Looks like you need ‘male’ machine pins to plug into the module.

OR

You should get the version that has wires.

W B R G wires would probably be switched outputs, i.e. switched +24v.

These would go to the LED anodes, therefore you need a strip the has common cathodes as there is a black (probably GND) wire which should connect to all the cathodes.

Please confirm if your strip is common cathode or common anode.

Edit:
It say "Connecting Mode: Common anode (or common cathode)"

I cannot verify what this means in their context.

They do not say if it is compatible with 5V logic (Arduino).

You might want to stick with designing an interface as per your actual hardware.

I've checked the LED strip, it says

+24v
R
G
B
W

So it has a common anode.

Went scouring for info and found this lonely diagram, not even sure if it pertains to this device. :')

This video partially answers the question. He is using arduino to control a single channel LED amplifier.

Meanwhile I also found a video explaining how to connect it to the arduino with conventional components;

He doesn't seem to bother with the 10k ohm resistor for some reason.

So it has a common anode.

If that’s true, I cannot guarantee that module will work.

Need a schematic of the module as I do not understand how it can be used with both CC and CA.

For ‘Common Anode’, you better use circuit C1 as pointed out previously.

He is using a BJT TIP120 transistor in the video.

You might be able to get away with using a TIP120 but a 'logic level' mosfet is recommended as it has a low on resistance.

An IRL540 would work as mentioned previously.

A MOSFET needs the 10k resistor.

Edit:
BTW, A WS2802B LED strip would be much better.
Doesn’t need the MOSFET drivers and has 65,000 different colours.

It would probably be a pain in the behind to alter the code, so I would rather not change the LED type.

I drafted something to slap on an experiment board, should still be reasonably compact;

The blue things are supposed to represent the mosfets,
the horizontal block terminal is supposed to be a barrel jack socket,
my drafting software didn't have those.

Parts list;
4 x Resistor 220Ω 1W 5% Axial Metalfilm
4 x Resistor 10kΩ 1W 5% Axial Metalfilm
4 x Mosfet IRL540NPBF 140W
5 x Screwblock Terminal 2 poles
1 x Powerjack Barrel socket
1 x Experimenting PCB

Does that all look alright?

Its about 4 times as expensive and 4 times as large as that ebay amplifier, but better safe than sorry I suppose.

EDIT :
I got a reply from one of the eBay vendors about the question if input can be 5v while output is 24v, they said yes. So now im conflicted a bit. :') I guess I could risk it for a biscuit and order an ebay amplifier, to hook up to a cheap 24v PSU I have laying around, and see what pins it comes out of. I assume it should technically only go out to the common anode pin, and only on the output side.

Not sure how that module can handle both CA and CC.

It looks like they are giving you W B R G Bk wires (5) to go to your LED strip.

I don’t see that there is any ordering option other than wires vs connectors.

If Bk is GND, this means CC display is needed.

Since your shield appears to have 220R resistors for each of the PWM pins, you will not need them on your interface board.

Black is common anode, at least according to LED strip standards.
The colors never really correspond to the strips, I guess its just how ribbon cable is colored.

I've ordered one and I shall do some experimenting when I get it.
First ill just stick 24v on the power leads to see where it comes out of.
Then ill just run a cheap LED controller on 5v on the input and a bit of 24v strip on the output.
If that works, it should mean its good to go for the arduino as well, right?

When you get your testing done, report back with your findings.

Sokonomi:
Black is common anode, at least according to LED strip standards.

That is somewhat confusing, but of course if you use red, green and blue wires for the colours, you tend to use black for the common. It should actually be white for the positive, given a choice. :roll_eyes: