2x Arduino: One as a power supply, One actioning 4 relays

Hello guys!
I have a problem with a project. First, let me tell you how the project works.
(Also, i apologize in advance for my English!)

The project:
I'm using an Arduino MEGA 2560 (to communicate with a APP i made) and an Arduino UNO (as a power supply).
The project have 2 main roles:

1. My APP (made in VB.net) takes the system volume, then maps the value from 0 to 11. Then, the APP sends this values to Arduino through an SerialPort. When the Arduino receives the values, it turns ON or OFF some LEDs (according to the values). Just like a VU Meter.

2. My APP also has a Voice Control function. I used Microsoft's Voice SDK to listen for voice commands like "turn all lights on", "turn the lights off in my room" and so on. When the APP receive a command like that, it sends over to the Arduino another value ("R1_ON", "R1_OFF", etc.). After Arduino receives that, it turns ON / OFF one of my 4 relays (each one being turned on/off by a different command). Obviously, the relays turn the lights on/off in different rooms.

The problem:
When the 'VU Meter function' is active, the rest of the LEDs (see the picture) are fading.
I don't think that is good for the Arduino to supply power for all this consumers: there are 11 LEDs for the VU Meter, 4 relays, 4 green LEDs that lights up when the relays are ON, and 4 red LEDs that lights up when the relays are OFF. I'm afraid that the Arduino board will get to hot.
So, i tried to supply power for the relays from another Arduino board (UNO). But it didn't work.
I connected the INT1 and INT2 pins to my Arduino MEGA. Then, i connected the GND and VCC pins to Arduino UNO's GND and 5V pins.
But the relays won't turn on.
What can i do?

Here is a photo and a short video of my project, so you can understand what i am saying...
http://s3.amazonaws.com/3AgL3-DJ-Soft/3AgL3+DJ+Soft/Arduino+APP.mp4

I don't think that is good for the Arduino to supply power for all this consumers:

Correct.
Use an external power supply (with ground (0 Volts) tied to the Arduino's GND).

LarryD:
Use an external power supply (with ground (0 Volts) tied to the Arduino's GND).

Wow! :astonished: Can i do that? :smiley: It will be awesome!
So i tie the Arduino's GND to the other Power Supply's GND. Then i use the Arduino pins for (+) right? XD
And then when i send a "HIGH" through a pin it wont overcharge the Arduino?

The Arduino is powered by the USB cable.

Ok. I got that.
Thanks for the scheme!
So, i can use an external (5V) power supply only for those parts that works with separate power source (like relays, temperature sensors, sonar sensors, etc.), right? I don't think that i can use an external power supply for a LED that is being controlled by an Arduino pin.

I don't think that i can use an external power supply for a LED that is being controlled by an Arduino pin.

You can, see the 3 examples below schematic below.

LarryD:
You can, see the 3 examples below schematic below.

Ok. I understand now. Thanks a lot!
Any advice on what External Power Supply is best for Arduino?
Like some 220V AC to 5V DC converter? If so, how many mA? XD

Probably a 1 to 3 amp 5 volt power supply would suffice.

Later on you may want to look at other voltage power supplies i.e. 6V, 9V, 12V, 24V etc.

Here are some 5 volt units, make sure to get a universal input voltage 100-220VAC if you have 220VAC in your area:

http://www.robotshop.com/ca/5vdc-3a-wall-adapter-power-supply.html
http://www.robotshop.com/ca/adafruit-switching-power-supply-276.html

Remember to:
Draw a circuit diagram of your layout.
Always make your circuit connections with your power supplies un-powered.
Observe proper voltage and polarities on your components.
Double check your wiring before you turn on the power.
You need a common ground between your Arduino and your other circuits (unless you are using optical or relay O/Ps).

If in doubt, ask for help.

Ok. Thanks for all the help!

Just a few more things:

  1. What resistors do i need to use for the LEDs? Maybe 300-400 Ohm?
  2. Why use a power supply with 1-2A when the Arduino works with 400mA? Or this will supply power only for the relays and won't affect the board?
  3. What software did you use for the schematics? :smiley:
  4. You've helped me a lot! You're awesome. :wink:
  5. Can i come back in a few days and post a reply in this topic with my final schematics? :slight_smile:
  1. What resistors do i need to use for the LEDs? Maybe 300-400 Ohm?

For a 5 volt supply and a 2 volt 20ma led 5v - 2v = 3v across the resistor 3v/.02a = 150 ohms use 180 or 220 which are standard values.

  1. Why use a power supply with 1-2A when the Arduino works with 400mA? Or this will supply power only for the relays and won't affect the board?

Your components will draw the current they need based on their resistance. 1-2 amps is a good start as it allows for expansion later. Picking a 5 volt 20 Amp supply could cause major problems if you short something.

  1. What software did you use for the schematics?

I use a program called WinQCAD (schematic/PCB software) not available any more, I believe EAGLE (I think there is a free version available) and Fritzing are good choices also Kicad.
Others may want to suggest something.
Also, search the forums here for schematic or PCB software.

https://www.sparkfun.com/tutorials/109

  1. Can i come back in a few days and post a reply in this topic with my final schematics?

Sure
Good luck.
Learning is fun if you understand what you are learning.

Her are some Web sites to review:

http://arduino-info.wikispaces.com/
http://learn.adafruit.com/category/learn-arduino
http://forum.arduino.cc/index.php?topic=173843.0

http://www.youtube.com/playlist?p=A567CE235D39FA84
http://garagelab.com/page/beginner-tutorials

LarryD:
Her are some Web sites to review:

Awesome! I have to start learning now. :slight_smile:

I'm back! :slight_smile:
So, i made a scheme that i think will help me in my problem.
Once again, the problem was that i didn't have a constant 5V current on the Arduino's 5V pin because of the LEDs and Relays.

I hope this scheme will help.
I'm waiting for your replies...

With that many LEDs you have to drive them with external drivers and use an external power supply.
example: ULN2803 (8 drivers in one I.C.).
Relays must have snubbing diodes across their coils to prevent Arduino damage.
Relay should be driven with drivers also, ULN2803 will do this.

http://www.ti.com/lit/ds/symlink/uln2803a.pdf

Good for you for learning Fritzing.

LarryD:
With that many LEDs you have to drive them with external drivers and use an external power supply.
example: ULN2803 (8 drivers in one I.C.).
Relays must have snubbing diodes across their coils to prevent Arduino damage.
Relay should be driven with drivers also, ULN2803 will do this.

I think i know what are you saying.
I searched google for some examples and I have an idea...
I have to start all over again with the scheme.
I will come back though (thanks for your patience)!

LarryD:
Good for you for learning Fritzing.

Its actually very easy to use. Is good for me. Thanks!

Oh. One lase thing before i go and buy all the parts and make the scheme...
I saw this picture (the one from attachments) on the web an i have this question:
Do i have to connect pins 1 to 8 from ULN2803 only to PWM pins on Arduino? Or it will work the same with any other digital pins?
Because even if i use the MEGA, i only have 12 PWM pins. :~

uln2803 ex.PNG

Do i have to connect pins 1 to 8 from ULN2803 only to PWM pins on Arduino? Or it will work the same with any other digital pins?
Because even if i use the MEGA, i only have 12 PWM pins.

Unused pins on the ULN2803 can be left floating.
The 2803 can be used on any Arduino O/P not just PWM.

By some extra 2803s for future projects.

LarryD:
Unused pins on the ULN2803 can be left floating.
The 2803 can be used on any Arduino O/P not just PWM.

Ok. Awesome!
And i don't need to use any resistors between Arduino's Digital pins and pins 1 to 8 from ULN2803, right?
Only between ULN2803's output pins and the LEDs.

Buy some extra 2803s for future projects.

That's my plan... :slight_smile:

And i don't need to use any resistors between Arduino's Digital pins and pins 1 to 8 from ULN2803, right?
Only between ULN2803's output pins and the LEDs.

Resistors between Arduino and 2803 are not needed, they are already exist in the 2803.
LEDs need the resistors.