Jump to content

Powering and controlling LED's with an arduino.

werto165

I want some case light LED's , (don't judge please). I was just wondering if I could use molex power, I think it needs 5V and the LED's probably would need 12V I just wondering if I can just get a bread board and stick this on: http://www.banggood.com/DIP28-ATmega328PPU-MCU-IC-Chip-With-Arduino-UNO-Bootloader-p-932159.html?currency=GBP&createTmp=1&utm_source=google&utm_medium=shopping&utm_content=saul&utm_campaign=Electronic-xie-uk&gclid=Cj0KEQiArJe1BRDe_uz1uu-QjvYBEiQACUj6opvMeawK6Xk5t8D_3Mp9bT5HcHrENODUYr_QEeJbr8oaAhPp8P8HAQ 

and use something like a buck converter for the voltage to drop it down, or is there a better way of doing this? 

 

any help would be appreciated. 

CPU: Intel 3570 GPUs: Nvidia GTX 660Ti Case: Fractal design Define R4  Storage: 1TB WD Caviar Black & 240GB Hyper X 3k SSD Sound: Custom One Pros Keyboard: Ducky Shine 4 Mouse: Logitech G500

 

Link to comment
Share on other sites

Link to post
Share on other sites

yes you could, also MOLEX has both 5V and 12V connections, also you can do 7V:

psplug.gif

 

also what kind of controlling are we talking about? RGB or Brightness dimming?

both can be done but brightness controll is easier obviously

the benefits would be that you can get diodes for cheap buying bulk

CPU: Intel i7 5820K @ 4.20 GHz | MotherboardMSI X99S SLI PLUS | RAM: Corsair LPX 16GB DDR4 @ 2666MHz | GPU: Sapphire R9 Fury (x2 CrossFire)
Storage: Samsung 950Pro 512GB // OCZ Vector150 240GB // Seagate 1TB | PSU: Seasonic 1050 Snow Silent | Case: NZXT H440 | Cooling: Nepton 240M
FireStrike // Extreme // Ultra // 8K // 16K

 

Link to comment
Share on other sites

Link to post
Share on other sites

Same questions as DXMember.

 

You'd use something like an Arduino if you were to do PWM brightness/color control, but what is often much easier is voltage based dimming.

 

The Atmel chip would also require supporting hardware (oscillating crystal, a few capacitors, etc.).

Link to comment
Share on other sites

Link to post
Share on other sites

Could you post the link to the LEDs you intend to use? If you are using several single LEDs they probably work on lower voltages (e.g. 1.8-3.3V), however if you are using LED strip you have options from 5V and 12V (the most common ones).

 

Since you mentioned Arduino, I'm guessing you want to burn the Arduino boot loader on that ATmega328. You will also need a crystal oscillator, few caps and some other components to make the Arduino work (assuming you have a way of programming that Chip via ICSP or another Arduino).

 

You will also need Transistor or MOSFET to turn the LEDs on/off and a few resistors.

 

If you already have a way to program the chip, maybe you could write your own code (or find someone who already did it) and use that instead of Arduino, IF you want to go hard core. :)

Or you could order RGB controller from eBay and RGB LED strip + AC Adapter and be done with the electronics part of the build. First option definitely has more customization options and makes you proud since you've done it all by yourself, but it requires more sweat and tears. :)

Link to comment
Share on other sites

Link to post
Share on other sites

Could you post the link to the LEDs you intend to use? If you are using several single LEDs they probably work on lower voltages (e.g. 1.8-3.3V), however if you are using LED strip you have options from 5V and 12V (the most common ones).

 

Since you mentioned Arduino, I'm guessing you want to burn the Arduino boot loader on that ATmega328. You will also need a crystal oscillator, few caps and some other components to make the Arduino work (assuming you have a way of programming that Chip via ICSP or another Arduino).

 

You will also need Transistor or MOSFET to turn the LEDs on/off and a few resistors.

 

If you already have a way to program the chip, maybe you could write your own code (or find someone who already did it) and use that instead of Arduino, IF you want to go hard core. :)

Or you could order RGB controller from eBay and RGB LED strip + AC Adapter and be done with the electronics part of the build. First option definitely has more customization options and makes you proud since you've done it all by yourself, but it requires more sweat and tears. :)

Probably something off hobbyking, I haven't really decided yet(most likely RGB), I have another arduino, I saw that the chip was being used by itself a while ago just couldn't remember which parts I needed. I'm just doing this to get myself more familiar with electronics as I start electrical engineering this semester. Hopefully this doesn't ruin my PSU it shouldn't but you never know I could wire it incorrectly and have a fire on my hands... I guess I could just use a 9V battery, or I could run a USB cable from the back of my pc inside the case and have a cheap arduino chinese clone or something along those lines. with that chip that I listed is there not some way that I can get similar pin outs to something like the arduino uno or would I just need another one entirely. 

CPU: Intel 3570 GPUs: Nvidia GTX 660Ti Case: Fractal design Define R4  Storage: 1TB WD Caviar Black & 240GB Hyper X 3k SSD Sound: Custom One Pros Keyboard: Ducky Shine 4 Mouse: Logitech G500

 

Link to comment
Share on other sites

Link to post
Share on other sites

Probably something off hobbyking, I haven't really decided yet(most likely RGB), I have another arduino, I saw that the chip was being used by itself a while ago just couldn't remember which parts I needed. I'm just doing this to get myself more familiar with electronics as I start electrical engineering this semester. Hopefully this doesn't ruin my PSU it shouldn't but you never know I could wire it incorrectly and have a fire on my hands... I guess I could just use a 9V battery, or I could run a USB cable from the back of my pc inside the case and have a cheap arduino chinese clone or something along those lines. with that chip that I listed is there not some way that I can get similar pin outs to something like the arduino uno or would I just need another one entirely. 

to control RGB on a LED you would need just four pins

to control brightness of a single color you need only two pins

to control both brightness and RGB you need the same four pins

 

for a single color LED you would use one power and one ground

for an RGB LED you would use one common ground and three independent powers for R, G and B repectively.

 

with that you can control both a single LED or a strip of LED where all of them will act excatly the same.

 

So if your micro controller has at least four pin-outs that you can control, then you can do any color at any brightness and make some cool pulse or breathe effects as well as rainbow

CPU: Intel i7 5820K @ 4.20 GHz | MotherboardMSI X99S SLI PLUS | RAM: Corsair LPX 16GB DDR4 @ 2666MHz | GPU: Sapphire R9 Fury (x2 CrossFire)
Storage: Samsung 950Pro 512GB // OCZ Vector150 240GB // Seagate 1TB | PSU: Seasonic 1050 Snow Silent | Case: NZXT H440 | Cooling: Nepton 240M
FireStrike // Extreme // Ultra // 8K // 16K

 

Link to comment
Share on other sites

Link to post
Share on other sites

You have RGB single LEDs and RGB strips. Most common RGB strips or single color LED strips are configured to work off 12V. I asked if you want to use LED strip or several single LEDs because there is a difference in working voltage.

 

To make Arduino you could use ATmega328, ATmega8, ATtiny8 or any other compatible chip. However if you already have Arduino on PCB, maybe it is easier to use that one, or order Arduino Nano from eBay because of it's small form factor it will be easier to fit (hide) inside your case.

 

You will also need 3 transistors or MOSFETs plus few resistors to provide enough current to the LEDs. You can solder them on some perforated circuit board and the wire with the LEDs or gheto solder them in air, isolate with electrical tape or heat-shrink (which I don't recommend unless it's last resort or you are sure you know what you're doing).

 

If you have a decent power supply, it already has over-current protection, short current protection, thermal shutdown and etc. which most of the cheap wall-wart AC-to-DC adapters don't have or have very poor/cheap implementation.

 

So drawing power from MOLEX connector shouldn't be an issue. Just make sure you are connecting everything properly and watch out for shorts and check and re-check your polarity. :) If you want to be sure, add few fuses (preferably poly-fuse aka re-settable fuse) and some diodes to protect you circuit and your PSU against reverse polarity. You don't have to worry about polarity of LEDs since they are already LEDiode so they are "protected from reverse polarity".

 

As for the chip, when programmed with Arduino bootloader it becomes Arduino. The pinout of ATmega328 <=> Arduino is shown on this diagram. So after programming the Arduino on that chip, Atmel's ATmega328 Port B pin B2 becomes Digital pin D10 in Arduino and etc. Keep in mind that you need several other components (capacitors, resistors, crystal, preferably USB-to-Serial converter and etc) to make that chip into a functional Arduino. Or you can order Arduino Nano from eBay for $1-2 and just use few transistors/MOSFETs + few resistors.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×