LED Spotlights

I am a beginner trying to make a control approximately 6 channels for dimmable parallel LED spotlights that I will make myself using a 12 volt DC power source. Any thoughts on where to start so I don't have to reinvent the wheel. I aim to make a Halloween display with changing "Mood lighting" scenes. Not necessarily with music as I plan to use ambient type audio with mixed in audio effects. Any help would be greatly appreciated. Thank you. ~Goneferal

I would start of by looking at some DC Solid state relays (not the AC type). This will allow you to apply a PWM signal to them to dim the LEDs. You can do it slightly cheaper with FETs but an SSR is much easier to wire up.

Hi,

Take a look at "Arduino Power" here: http://arduino-info.wikispaces.com/ArduinoPower

Near the end of that you'll see a 12V light being controlled and dimmed...

DISCLAIMER: I mentioned stuff from my own Shop... (It'll be about 10 days until I have a new shipment of those 4-channel FET power controller boards.)

OK, I’m getting to where I want to be. I’m using Vixen software with this code I cannibalized. I want to figure out how to apply a soft PWM to the on-off digital pins but I have a lead here. http://www.hauntforum.com/showthread.php?p=555973&posted=1#post555973. Any thoughts?

/*
The purpose of this code is to allow the Arduino to use the
generic serial output of vixen lights to control 12 channels of LEDs.
Author: Matthew Strange Changed by Jeanne Pepalis
Originally Created: 14 October 2010, Revised 7/18/11

*/

// Output
int Chan1 = 2; // LED, connected to digital pin 2
int Chan2 = 3; // LED, connected to digital pin 3
int Chan3 = 4; // LED, connected to digital pin 4
int Chan4 = 5; // LED, connected to digital pin 5
int Chan5 = 6; // LED, connected to digital pin 6
int Chan6 = 7; // LED, connected to digital pin 7
int Chan7 = 8; // LED, connected to digital pin 8
int Chan8 = 9; // LED, connected to digital pin 9
int Chan9 = 10; // LED, connected to digital pin 10
int Chan10 = 11; // LED, connected to digital pin 11
int Chan11 = 12; //LED, connected to digital pin 12
int Chan12 = 13; // LED, connected to digital pin 13

int i = 0; // Loop counter
int incomingByte[12]; // array to store the 12 values from the serial port

//setup the pins/ inputs & outputs
void setup()
{
Serial.begin(9600); // set up Serial at 9600 bps

pinMode(Chan1, OUTPUT); // sets the pins as output
pinMode(Chan2, OUTPUT);
pinMode(Chan3, OUTPUT);
pinMode(Chan4, OUTPUT);
pinMode(Chan5, OUTPUT);
pinMode(Chan6, OUTPUT);
pinMode(Chan7, OUTPUT);
pinMode(Chan8, OUTPUT);
pinMode(Chan9, OUTPUT);
pinMode(Chan10, OUTPUT);
pinMode(Chan11, OUTPUT);
pinMode(Chan12, OUTPUT);
}

void loop()
{ // 14 channels are coming in to the Arduino
if (Serial.available() >= 14) {
// read the oldest byte in the serial buffer:
for (int i=0; i<14; i++) {
// read each byte
incomingByte = Serial.read();

  • }*

  • analogWrite(Chan1, incomingByte[0]); // Write current values to LED pins*

  • analogWrite(Chan2, incomingByte[1]); // Write current values to LED pins*

  • analogWrite(Chan3, incomingByte[2]); // Write current values to LED pins*

  • analogWrite(Chan4, incomingByte[3]); // Write current values to LED pins*

  • analogWrite(Chan5, incomingByte[4]); // Write current values to LED pins*

  • analogWrite(Chan6, incomingByte[5]); // Write current values to LED pins*

  • analogWrite(Chan7, incomingByte[6]); // Write current values to LED pins*

  • analogWrite(Chan8, incomingByte[7]); // Write current values to LED pins*

  • analogWrite(Chan9, incomingByte[8]); // Write current values to LED pins*

  • analogWrite(Chan10, incomingByte[9]); // Write current values to LED pins*

  • analogWrite(Chan11, incomingByte[10]); // Write current values to LED pins*

  • analogWrite(Chan12, incomingByte[11]); // Write current values to LED pins*

  • }}*

Any thoughts?

Yes. You should learn how to post code properly.

Writing readable code, { and } on their own line, would help, too.

PaulS:

Any thoughts?

Yes. You should learn how to post code properly.

Writing readable code, { and } on their own line, would help, too.

Moderator: Personal insult removed. I'm brand new to this. I tried to post it properly, but for some reason the forum upload didn't work last night. I've gotten too many crappy replies from snobs who obviously don't care to foster a positive environment for learning. I worked a long time on that getting it to work. Moderator: Personal insult removed.

Moderator: If you have an issue with another forum member, please take it to PM, or ask a moderator. If you go back to your post with the listing, click on "modify", highlight the code, then click on the "#" icon on the editor's toolbar, then click save, you will find your code placed in a code box. If, in the IDE, you type ctrl-T, your code will be automatically formatted. AWOL

I can't quite make out the values of the resistors, but are you aware that there is a per-device maximum current for the AVR? With that number of LEDs, it seems likely that you may be exceeding that limit.

If you go back to your second post with the listing, click on "modify", highlight the code, then click on the "#" icon on the editor's toolbar, then click save, you will find your code placed in a code box. If, in the IDE, you type ctrl-T, your code will be automatically formatted.