COMPLETELY NEW user of Arduino/electronics/etc

I have some questions about Arduino before I purchase one, but first here is some background:

I am a volunteer firefighter and I am looking to build my own strobe/light bar. What I would like to do is hard wire everything to my car and have a toggle switch to turn the system on/off. I also would like to program multiple patterns that I can cycle through by pressing a momentary switch (i.e. I turn the system on and the 1st or last used pattern starts. I press the momentary switch and the next pattern starts, press again: next pattern, so on and so forth)

  1. Is it possible to program multiple flash patterns?
  2. If so, could I cycle through them with a momentary push-button switch?
  3. Can the Arduino be power solely from USB or would I need an outlet adapter (for when I'm programming), eventually I will hardwire it.
  4. Can the Arduino be hardwired easily (I'm pretty sure the answer to this is yes)?

I plan on purchasing an Arduino Uno R3 and "Programming Arduino Getting Started with Sketches" by Simon Monk from Amazon.com
I also have some questions about wiring/LEDs/resistors/etc. Could anyone help me with that?

Thanks!
Brian

  1. Is it possible to program multiple flash patterns?

Yes. The only limitation will be that your code has to fit within the microprocessor's flash memory, which shouldn't be a problem unless you want thousands of patterns.

  1. If so, could I cycle through them with a momentary push-button switch?

Yes. There are also other options you may want to consider, like using a rheostat or other multi-position switch.

  1. Can the Arduino be power solely from USB or would I need an outlet adapter (for when I'm programming), eventually I will hardwire it.

Arduino boards like the Uno, Leonardo, and Mega can be powered from USB. The only potential issue is that the maxium current supplied will be 500 mA (0.5 A), and while that's plenty for just the board you'll need to power the lights seperately.

  1. Can the Arduino be hardwired easily (I'm pretty sure the answer to this is yes)?

Of course, though you'd probably want to get a board without pre-installed female headers if you want to solder wires directly to the board. Alternatively, you can either buy or make wires with male headers and just add a few spots of hot glue to keep them in.

Thanks Far-seeker!

Far-seeker:

  1. Is it possible to program multiple flash patterns?

Yes. The only limitation will be that your code has to fit within the microprocessor's flash memory, which shouldn't be a problem unless you want thousands of patterns.

No haha, not that many, just a few that I like. However, I know once I get comfortable with the program I'm going to want to make more and more intricate patterns. What is the memory?

Far-seeker:

  1. If so, could I cycle through them with a momentary push-button switch?

Yes. There are also other options you may want to consider, like using a rheostat or other multi-position switch.

What is a rheostat?

Far-seeker:

  1. Can the Arduino be power solely from USB or would I need an outlet adapter (for when I'm programming), eventually I will hardwire it.

Arduino boards like the Uno, Leonardo, and Mega can be powered from USB. The only potential issue is that the maxium current supplied will be 500 mA (0.5 A), and while that's plenty for just the board you'll need to power the lights seperately.

At this stage in my learning, 500 mA means nothing to me (milliamps I presume?). I'm guessing that this would not be sufficient to run anywhere from 50 to 250 blue LEDs.

Far-seeker:

  1. Can the Arduino be hardwired easily (I'm pretty sure the answer to this is yes)?

Of course, though you'd probably want to get a board without pre-installed female headers if you want to solder wires directly to the board. Alternatively, you can either buy or make wires with male headers and just add a few spots of hot glue to keep them in.

From the pictures I've looked at, it appears there are multiple choices for a power source, is this correct? Also, even though I plan on hardwiring the unit, I would like to be able to easily remove it in case I want to reprogram or if I have problems. There is a female port for an outlet adapter which I'd hope would be fairly secure. Would it be possible to buy this adapter and splice it to my 12V car battery? Or just buy the male end and wire it?
Do you know of any boards without pre-installed headers? Or any suggestions of a better board for what I plan on doing?

Thanks again for your help! As I said, I'm completely ignorant when it comes to anything like this. I plan on using this project as a learning experience which I'll hopefully get something useful out of.

240sxy:
What is the memory?

http://lmgtfy.com/?q=arduino+flash+memory

What is a rheostat?

http://lmgtfy.com/?q=rheostat

240sxy:
What is a rheostat?

A rheostat is type of a variable resistor. If you are familiar with wall mounted "Dimmer Switches" that control room lighting, those are usually rheostats. Used with an Uno on an analog input pin it could be used to control the rate LEDs flash.

A rotary encoder looks similar to rheostat, but is a digital switch rather than an analog one. Connected to a digital I/O pin could be used to select from a large list of the different patterns you were planning on using.

At this stage in my learning, 500 mA means nothing to me (milliamps I presume?). I'm guessing that this would not be sufficient to run anywhere from 50 to 250 blue LEDs.

Yes on both counts. The symbol for milli-amperes is "mA", and 1 mA = 0.001 A. Also, standard 5 mm LEDs have a current rating of ~20 mA each, and you'll probably want to use brighter and therefore higher current LEDs. Furthermore, you'll need between 100 mA to 150 mA to run the UNO board (this can be reduced some but in your application it won't be necessary). I'll let you do the math on how few LEDs you can power from a 500 mA source.

Additionally, you could choose RGB LEDs instead of blue LEDs. RGB LEDs actually combine three different color LEDs (red, green, and blue) that are blended together to create almost any visible color. These types of LEDs can easily be controlled by Arduinos. However, you might to make your first project more complex than necessary.

From the pictures I've looked at, it appears there are multiple choices for a power source, is this correct? Also, even though I plan on hardwiring the unit, I would like to be able to easily remove it in case I want to reprogram or if I have problems. There is a female port for an outlet adapter which I'd hope would be fairly secure. Would it be possible to buy this adapter and splice it to my 12V car battery? Or just buy the male end and wire it?

As you stated, there are many options. 12VDC is the upper end of the Uno's voltage regulator, so it is possible to power it from a car battery. If you wire directly from the board, you'll want to connect the positive wire to the VIN pin and the negative to one of GND pins. You could also use the barrel jack, there are wires you can buy with the proper plugs on one end and unterminated on the other. Also you could just get a plug for your car outlet, so you don't have to splice into your car's existing wiring.

Do you know of any boards without pre-installed headers? Or any suggestions of a better board for what I plan on doing?

Some distributors sell versions of Arduino boards without headers, but many like the Arduino Pro are not a good choice someone new to microprocessors. So on second thought, a stock Uno is probably the best for you at this time.

Thanks again for your help! As I said, I'm completely ignorant when it comes to anything like this. I plan on using this project as a learning experience which I'll hopefully get something useful out of.

You earlier mentioned your plans to buy an Uno and the "Programming Arduino Getting Started with Sketches" book. That's a good idea, but you might also want to consider the various "Arduino starter" kits available, like those listed below, instead of just an Uno. It will let you experiment with the Uno's capabilities beyond what you'll use in this project.

I'm back with more questions. I received my Arduino in the mail and I've been playing around with it successfully so far with some LEDs. I just ordered jumper wires (definitely should have done that from the start), a momentary push button, and I'm in the process of getting a toggle switch. On to my questions.

  1. As far as I know, batteries are DC and wall outlets are AC. My presumption is that the barrel jack on an Uno accepts AC, but I want to power it from a 12V car battery. Would I need something to convert from AC to DC or is that not how that works?

  2. Will I need to step down the power at all from 12V or can an Uno handle that? Would I do that with a resistor?

3)Would something like this work?

Or this?
http://www.dpcav.com/xcart/Auto-Accessory-Power-Cord-with-2.1mm-Barrel-Plug.html
Since phones are able to be charged from wall outlets and cars, do the car chargers already contain whatever components are necessary for this? This way I could just break one open and directly wire the positive and negative straight to the battery.

  1. Since I'll be powering the LEDs NOT through the Arduino, would I also need to step down the power for the LEDs?

  2. I'm also a little confused as to how this would all be wired since the Arduino and LEDs will be powered separately. These are my thoughts as to how this would work:
    a. positive/ground from car to 2.1mm barrel jack on arduino
    b. toggle switch (to turn everything on/off) connected in middle the power cable from step a. (I'm assuming this requires no coding
    c. positive/ground from car to LEDs
    d. outputs from Arduino to middle of positive cable from LEDs (with some sort of relay or switch or something, otherwise wouldn't they just constantly receive power from the battery and stay on?)
    -This is the step I'm most confused about, wouldn't something have to go to the ground on the Arduino?
    e. momentary switch (for cycling through patterns) connected to pin (as INPUT) and ground on Arduino

  1. The barrel jack on the Arduino accepts DC. If you were using a plug in adaptor from the wall, the adaptor converts the AC to DC. DO NOT plug AC into the Arduino barrel jack.
  2. You can feed the Arduino with 12V from a battery.
  3. Both of those will work for the Arduino. The phone chargers that plug into the wall convert the AC to DC, and the car charger is already getting DC from the car electrical system.
  4. & 5) Here is a great tutorial about LED's: Arduino Tutorial - A detailed introduction on how to use LEDs

I use a Universal Remote to change LED sequences. Beats a switch any day, however a switch is a good start.

As far as memory goes, you won't run out.

I connect a 9V DC 1A charger to my UNO.

So I read through the ladyada tutorial and it was really helpful, but alas, I have more questions.

What I plan on doing is having 12 sets of multiple LEDs (anywhere from 5 to 40 per set). Each set will be linked to a different output pin on my Arduino. For round numbers say I have LEDs that have a forward voltage of 3V. Would this mean I would be limited to 4 LEDs per positive cable run from a 12V car battery? I feel like I'm missing something here

Since kd7eir handled the first three questions, I concentrate on your last two...

240sxy:
4) Since I'll be powering the LEDs NOT through the Arduino, would I also need to step down the power for the LEDs?

I highly recommend that you read through LadyAda's LED tutorial. However, here's a quick explanation...

No you don't need to step down the power if you have a decently designed circuit. There is a voltage decrease across an LED (usually 1.5 to 3.0 VDC depending upon the specific type), somewhat like that across a resistor (the causes are rather different but the results are the same).
An example of how to configure your LEDs for a group of them wired in series has a total voltage drop close to, but less than, 12 VDC (you'll need a current limiting resistor so that will use the remaining voltage). Since voltage drops in series add together, you can think of each group as one resistive element (like a single resistor) with a fixed current draw at 12V. Then you'll wire multiple groups in parallel to form an array of LEDs. The voltage drops and currents through each group is (approximately) the same, but the maximum total current drawn by the LED array will proportional to the number of LED groups you have wired in parallel. Although this isn't the only way to do it, there are ways to control each LED individually, but they involve slightly more complicated circuitry.

240sxy:
5) I'm also a little confused as to how this would all be wired since the Arduino and LEDs will be powered separately. These are my thoughts as to how this would work:

What the Arduino will do is control one or more logic elements (could be individual transistors or something more complex) that will act like switchs on the 12VDC powering the array of LEDs. The circuit design details will depend on how exactly you layout your array of LEDs. For example a releatively simple layout would be to have have a rectangular array where each of the above series group of LEDs are in a vertical strip. That way you could have a transistor for each series group and the Arduino connect to the transistors to control whether or not any particular vertical strip in the array is off or on.

Edit:

240sxy:
So I read through the ladyada tutorial and it was really helpful, but alas, I have more questions.

What I plan on doing is having 12 sets of multiple LEDs (anywhere from 5 to 40 per set). Each set will be linked to a different output pin on my Arduino. For round numbers say I have LEDs that have a forward voltage of 3V. Would this mean I would be limited to 4 LEDs per positive cable run from a 12V car battery? I feel like I'm missing something here

See the example of parallel wiring above...

Arrch:

240sxy:
What is the memory?

http://lmgtfy.com/?q=arduino+flash+memory

What is a rheostat?

http://lmgtfy.com/?q=rheostat

So much sarcasm -_-

blair2000:
So much sarcasm -_-

Give a man a fish...

blair2000:
So much sarcasm -_-

Haha blair, I just chose to ignore this rather than potentially start a stereotypical forum flame war. And I know how to use google Arrch, but I find you can get much better and obviously more personal explanations in forums.

As for parallel wiring, I MAY have a grasp on it, but I'm fairly certain I don't. Please correct the following example.

Say I have one group of 20 LEDs that have a forward voltage of 3.2V each.
I solder each anode/cathode to the following respective anode/cathode effectively leaving one open end of each. (if this isn't clear imagine I bend every anode/cathode 90degrees in the middle so now the LED almost looks like a person with no arms sitting on the floor with legs straight out. The each "person" sits on another person's feet one leaving one person's feet exposed)
I connect the anode directly to a 12V car battery (with a transistor in the middle).
The voltage that the resistor would need to absorb would be: 12V - 3.2V = 8.8V
At 25mA the resistor would need to be: 8.8V / .025mA = 352ohm resistor
These numbers are based off of blue

I will also need to build housing for the LEDs. I would like this to be black, and possibly reflective behind the LEDs. Any suggestions of materials?

Thanks again to everybody for their help and advice. Once I get deeper in to this project I will undoubtedly have more questions.

Here I'm testing out this marque thing to see what it does
Here I'm testing to see if this can go faster
AAAAAHHHHHHHHHHH!!!!!!

Haha blair, I just chose to ignore this rather than potentially start a stereotypical forum flame war. And I know how to use google Arrch, but I find you can get much better and obviously more personal explanations in forums.

I wouldnt ignore it. This forum is full of extremely helpful people who will go out of their way to help you. But its disrespectful to ask questions that can be answered on the first link in google. It wastes everybody's time. Its always much better to say what you already did, what doesnt work, what you did to try to fix it. And links and pictures if possible. You did that father down when talking about reading the ladyada site and then had questions.
no offense, just giving you a heads up that many users here will have no problem telling you to think for yourself every once in a while. I get lazy and ask for spoon feeding sometimes to though :wink:

If you are familiar with wall mounted "Dimmer Switches" that control room lighting, those are usually rheostats

In most developed parts of the world, dimmer switches are no longer simple rheostats, but triacs.

AWOL:

If you are familiar with wall mounted "Dimmer Switches" that control room lighting, those are usually rheostats

In most developed parts of the world, dimmer switches are no longer simple rheostats, but triacs.

Fair enough, but the dimmer switches I tinkered with as a teen in the 1990s were definitely rheostats. As I recall, I got them at a surplus store, unused but who knows how old they were by then...

What do you guys think of this "LED series/parallel array wizard"?
http://led.linear1.org/led.wiz

Also, is my example correct? If I use the above calculator it does not seem that it is

Say I have one group of 20 LEDs that have a forward voltage of 3.2V each.
I solder each anode/cathode to the following respective anode/cathode effectively leaving one open end of each. (if this isn't clear imagine I bend every anode/cathode 90degrees in the middle so now the LED almost looks like a person with no arms sitting on the floor with legs straight out. The each "person" sits on another person's feet one leaving one person's feet exposed)
I connect the anode directly to a 12V car battery (with a transistor in the middle).
The voltage that the resistor would need to absorb would be: 12V - 3.2V = 8.8V
At 25mA the resistor would need to be: 8.8V / .025mA = 352ohm resistor
These numbers are based off of blue

It sounds like you're wiring them in series, so you're going to need 20x3.2volts=64 volts to get them to light.

Your idea would work theoretically but would require a very high input current. Alternatively, if you were to put them in series you would need a high input voltage, which might actually blow out the LEDs. What the array wizard does, as far as I understand it is make the best of both worlds. It powers small groups in series to make use of the voltage and the puts those groups in parallel to make use of the current. I plugged in 40 LEDs into the wizard at 3.2v forward voltage with a current draw of 100 mA and a 12v power supply and it looks like that many LEDs will draw around 2 amps. One suggestion I have is to buy a strand of g35 color effects lights which are easily hacked and pretty bright, not to mention RGB. If you want I have an Instructable, http://www.instructables.com/id/Extreme-Nightlight-Color-Organ/, that will help you get started programming these lights if that is the route that you wish to take. I would also be happy to help with any coding questions you might have regarding these lights.

I have used that LED wizard several times. You can reduce the total voltage that you need to feed to your circuit by wiring your LED's in a series/parallel arrangement.
Six series strings of 3 LED's + 1 series string of 2 LED's, OR 10 series strings of 2 LED's. Connect all the series strings together in parallel.

With this arrangement, you only need to supply 12 volts to the circuit, and about 250mA

Look at the LED wizard, it will show you what I am talking about.