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

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.

Done!
I hope this scheme is the one... :smiley:
I'm waiting for your advice. :slight_smile:

Arduino - VUM + Relays [SchemaFinala].jpg

You have GND going to the Anodes of the LEDS, you want +5V to the Anodes.
Your 2803 to the relays should be turned 180' EDIT: PINS 1,2,3,4,5,6,7,8 are the inputs to the 2803 9 is GND and 10 connects to +V

LarryD:
You have GND going to the Anodes of the LEDS, you want +5V to the Anodes.

I know that. I will put the LEDs the right way on the board. In Fritzing i don't have the option to mirror the LED. Only Turn them around...

LarryD:
Your 2803 to the relays should be turned 180'

Yeah. I can see that now. Thanks! I'm changing it now...

But, the rest of the circuit is ok? I can go on and install all the parts according to the scheme? :smiley:

You are showing the Black wire (GND) of the external power supply going to the LEDs, you should have the Red wire (+5V) going to them.

+5V(red wire)----LEDs----Resistors----2803 o/p----2803 pin 9----GND