Go Down

Topic: 2x Arduino: One as a power supply, One actioning 4 relays (Read 13596 times) previous topic - next topic

3AgL3_DeeJay

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
3AgL3 DJ Soft
We Make IT Happen

larryd

Quote
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).
No technical PMs.
The last thing you did is where you should start looking.

3AgL3_DeeJay


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


Wow!  :smiley-eek: Can i do that?  :D 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?
3AgL3 DJ Soft
We Make IT Happen

larryd

The Arduino is powered by the USB cable.
No technical PMs.
The last thing you did is where you should start looking.

3AgL3_DeeJay

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.
3AgL3 DJ Soft
We Make IT Happen

larryd

Quote
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.
No technical PMs.
The last thing you did is where you should start looking.

3AgL3_DeeJay


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
3AgL3 DJ Soft
We Make IT Happen

larryd

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.adafruit.com/products/276
http://www.robotshop.com/ca/5vdc-3a-wall-adapter-power-supply.html
http://www.robotshop.com/ca/adafruit-switching-power-supply-276.html
No technical PMs.
The last thing you did is where you should start looking.

larryd

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.
No technical PMs.
The last thing you did is where you should start looking.

3AgL3_DeeJay

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? :D
4. You've helped me a lot! You're awesome.  ;)
5. Can i come back in a few days and post a reply in this topic with my final schematics? :)
3AgL3 DJ Soft
We Make IT Happen

larryd

Quote
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.
Quote
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?

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.
Quote
3. 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.
http://fritzing.org/download/
http://www.instructables.com/id/Choosing-PCB-Layout-Software/
https://www.sparkfun.com/tutorials/109
Quote
5. 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.
No technical PMs.
The last thing you did is where you should start looking.

larryd

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://tronixstuff.wordpress.com/tutorials/
http://www.hacktronics.com/Table/Tutorials/
http://electronicsclub.info/index.htm
http://electronicsclub.info/transistorcircuits.htm
http://www.buildcircuit.com/how-to-use-a-relay/
http://www.youtube.com/playlist?p=A567CE235D39FA84
http://garagelab.com/page/beginner-tutorials
http://arduino.cc/en/Tutorial/HomePage
http://www.pighixxx.com/abc-arduino-basic-connections/
No technical PMs.
The last thing you did is where you should start looking.

3AgL3_DeeJay

3AgL3 DJ Soft
We Make IT Happen

3AgL3_DeeJay

I'm back! :)
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...
3AgL3 DJ Soft
We Make IT Happen

larryd

#14
Jul 26, 2013, 04:37 am Last Edit: Jul 26, 2013, 04:59 am by LarryD Reason: 1
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.adafruit.com/products/970
http://www.ti.com/lit/ds/symlink/uln2803a.pdf

Good for you for learning Fritzing.
No technical PMs.
The last thing you did is where you should start looking.

Go Up