Controlling LEDs on-off state via Arduino

I got a VMA100 Uno clone, I bought a Velleman 501 kit at that was inside. As you can see on the pic, in this improvised circuit I have a switch that controls the LED. What I'd like to do is to make Arduino control the LED instead, so for example; I turn the switch on and it powers up the LED, and maybe introduce a second switch in the circuit that triggers Arduino control on the LED, making it flash or whatever. What are my first steps here, shopping list items? Mosfet or something? Disclaimer I'm an ultra newbie.

The first step is to obtain a data sheet for the LED. Always get the documentation for all the components first.

When you have the data sheet, post a link to it here so we can see it, too. Then we can make intelligent recommendations for other parts.

You can use a relay, which is an electrically-operated, electrically-isolated switch. If you wire the relay in series with the existing switch you create an "and" condition where the light comes-on when both the switch and relay are on. If you wire them in parallel you get an "or" condition where either one (or both) can turn in on.

The Arduino itself can't put-out enough current to power a relay coil but you can get a "relay board" with a built-in driver circuit.

...To me, that looks like a car headlight LED, but I see an AC power cord. Just make sure the relay contacts are rated to handle the voltage & current. And as always, BE CAREFUL with power line voltages.

Thanks @DVDdoug for clarification! Yeah those are car LEDs but I'm testing this Arduino idea at home first, so just trying to figure out what and how to do basically, it's my starter project.

The LED is a pretty standard Chinese car led, CSP 1860 chip, 25W, 80 CRI, power factor 0.9 6000K unit.

So the first thing on the buy list is the relay board for this Uno.

I am reading up on the similar projects and I'm reading about "slowness" of relays and how transistors are better or more elegant way to switch on-off functions?

lemilitza:
I am reading up on the similar projects and I'm reading about "slowness" of relays and how transistors are better or more elegant way to switch on-off functions?

It depends upon what you’re switching, how fast and how often it has to switch. Relays are capable of switching a broader array of loads than any other type of switching device. Yes, they have limitations but so does every other switching device you can name.

In general, there is a tremendous amount of urban legend nonsense posted on the web by people who couldn’t find their butt cheeks with their own hands. The Internet is full of crap and down right dangerous stuff, especially when it comes to things that use household AC voltage.

It is quite easy to kill yourself when mucking about with 120 and 240 volts AC. Some of what you see and read has been done by people that haven’t killed themselves, yet. Some are charter members of a future Darwin Award, they just don’t know it.

So you need to switch 12V, 5A? Pretty easy for N-channel MOSFET.
Find one with Low Rds, Logic Level Gate drive.

For example, I made up this board with 8 of AOD424 (or a very similar part). On resistance with the Gate driven at 4.5V is really low, just 0.0036 ohm (3.6mOhm), so it is not going to heat up with 5A of current (P=I^2 X R = 55.0036 = .009W).
https://www.digikey.com/en/products/detail/alpha-omega-semiconductor-inc/AOD424/3152449

I set it up so, depending on the components installed: the gates can be driven from an Arduino directly: the gates can be driven from a shift register; the gates can be driven by a 74ACT241 which will take as low as 2V for a High input, so it can be a buffer for 3.3V devices.

Here it is with a 74HC595 shift register controlling the gates, driving 12V LED strips. Not much of a load, just showing that it works as planned with some stuff I had on hand.

Thank you for the reply, I try to learn as much as I can from these pieces of knowledge people give me in replies on topics like this :smiley:

May I ask you to help me out by "explaining" the action in the circuit, I think that my levels of (non)experience and over-thinking keep me from actually understanding the process.

So in a scenario where we put Arduino in the middle of the circuit between the bench PSU and this LED bulb, how does Arduino control the state of the light - if I want to control it with Arduino IDE? What tells Arduino if the bulb is on, what happens when IDE control "goes out" to the board, if we would slow motion the process x1000000 :smiley:

At first you need to explain what you want to happen, when you flick the switch.
And another thing: when working with micro controllers it is often more elegant to use buttons as switches.
You may ask why?
Here is the reason: you can reset them with the code...
If you got a phisical switch you have to set it back manualy.
if you have a virtual switch (butten press to turn it on, another button press to turn it of) you can reset it any time you want with out having to do it manualy.

I personaly use switches only, when it is reqired for esthetics, or for verry specific reasons.

And now to your learning prozess:
You should start with the basics and put some code together on your own.
When you have done this you can post the code here any time, if you got any questions and we will help you.

I'm testing my idea in Tinkercad and it pretty much shows what my intent is, two leds here, top led and bottom led, bottom is turned on when there's power so no need to do anything, I'd like to control the top led - the push button in the circuit should trigger the arduino sketch that should run for once when that button is pushed.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.