Arduino Uno Output Pin Current Limit

If it is 200ma for total max current pin output is it still possible for me to control a keypad shield and 4 channel relay if:

Keypad 16x2 LCD shield (sainsmart): 6 pins x 30mA = 180mA
4 channel relay shield (Sainsmart): 2 pins (for relay load 1 & 2) x 30 =60mA

Total: 240mA

So right now I am over the 200mA output pin limit, is there a way to do this with the Uno or do i need a MEGA?

The relay will be powered by a seperate 5V 1A supply and the uno will be powered by a 9V 1A wall adapter.

Thank you

EDIT:
Relay: http://www.sainsmart.com/4-channel-5v-relay-module-for-pic-arm-avr-dsp-arduino-msp430-ttl-logic.html

LCDKeypadShield: http://www.sainsmart.com/sainsmart-1602-lcd-keypad-shield-for-arduino-duemilanove-uno-mega2560-mega1280.html

Neither the LCD keypad shield nor the relay board will consume anywhere near that current. Certainly, the relay shield mist be powered from a separate 5V 1A supply for the relays themselves, but the control pin currents are minimal.

Mind you, one could be more precise if you actually provided the links to these devices.


How do you imagine plugging both these shields onto a UNO?

This illustrates the practical impracticality of “shields”.

No, it's 200mA max per VCC pin, and 40mA ABSOLUTE MAX per IO pin, with per-port limits as described in the datasheet.
You need a couple of transistors, one to sink relay coil current, and one to control LCD power if that's what you're after.
Or power them both from the 5V pin on the power header if you have 7.5V into the barrel jack.

Can also use a Screw Shield to allow connections to the relays while having the LCD mounted on the UNO:

http://www.crossroadsfencing.com/BobuinoRev17/

Sorry, just added the links to the relay&shield. Can’t I just connect an Uno pin to the relay directly? I just need a dc motor to be on or off or is a transistor necessary? The LCD shield uses the Uno’s VCC pin

OK, well now, with a little further research, I note that the relay module is not a "shield", so that is not so much of a problem.

The current consumption of the LCD/ keypad shield is less than 30 mA. Hopefully what you have is the later version with the catastrophic fault corrected.

Each relay has a coil resistance of 70 Ohms, so we will estimate current consumption as 70 mA. You must supply the relay board with a separate supply as unless you are powering it from USB (or a 5V 1A fully regulated supply via the 5 V pin), the UNO regulator cannot supply the 280 mA for four relays. You must supply the 5 V to the relay board via the "JD-VCC" and "GND" pins with the link to VCC removed. VCC on the board connects to your Arduino 5 V and the inputs to appropriate pins (not used by the shield) and you do not connect "GND" on the relay board to the Arduino.

Each relay control pin will draw 15 mA, so four of them is not a problem. You pull them LOW to actuate each relay and you must write them HIGH in your "setup()" before you set pinMode to OUTPUT.

I think you're confusing "supply current" with "IO pin Current."
The relay module already includes drivers for the relays (opto-isolators, so they work like an LED, and they already have the relevant current limiting resistors.) So it will draw about 20mA on the IO pins (but also needs a power connection for the "other side" of the isolators. But that's NOT connected to an IO pin.)
The LCD has a CMOS controller and will draw negligible current from the IO pins (but also requires power.)

6 pins x 30mA = 180mA

Oh, you also seem to misunderstand - just because a pin is connected to something does NOT means that the pin needs to provide 30mA - it depends on how much current the "thing" needs. In the case of most 'electronics', it will use much less than 30mA. LEDs are the most common thing "near" the limit, "high current
devices like motors or relays almost always need additional electronics in between the pins and the device. In the case of a marketed "module", that electronics should already be part of the module...

Look at it this way. You have light bulbs in your house; they are rated e.g. 60W (and therefor use 0.5A (120V) or 0.25A (230V)). They do not use the full 16A of the fuse (for this simple example each light bulb has it's own fuse in the distribution board).

The light bulb is a pin of the LCD module; the fuse is the output pin of the Arduino.

Paul__B:
OK, well now, with a little further research, I note that the relay module is not a "shield", so that is not so much of a problem.

The current consumption of the LCD/ keypad shield is less than 30 mA. Hopefully what you have is the later version with the catastrophic fault corrected.

Each relay has a coil resistance of 70 Ohms, so we will estimate current consumption as 70 mA. You must supply the relay board with a separate supply as unless you are powering it from USB (or a 5V 1A fully regulated supply via the 5 V pin), the UNO regulator cannot supply the 280 mA for four relays. You must supply the 5 V to the relay board via the "JD-VCC" and "GND" pins with the link to VCC removed. VCC on the board connects to your Arduino 5 V and the inputs to appropriate pins (not used by the shield) and you do not connect "GND" on the relay board to the Arduino.

Each relay control pin will draw 15 mA, so four of them is not a problem. You pull them LOW to actuate each relay and you must write them HIGH in your "setup()" before you set pinMode to OUTPUT.

First, thank you to everyone that has responded. Shouldn't the uno and relay board share a common ground? Also, what do you mean the "link to the VCC removed"...do you mean just dont use that as the voltage pin and use the VCC JD?

WakaDArc:
Shouldn't the UNO and relay board share a common ground?

Absolutely not.

The operative term here is "opto-isolated". The very purpose of this is to facilitate a supply to the relays themselves having no connection to the Arduino.

Now of course if you have been reading thoroughly in the other forums here (as you obviously should), you would have noted my explanation of the conditions under which you can use the same correctly rated power supply to power the relays as well as the Arduino.

WakaDArc:
Also, what do you mean the "link to the VCC removed"...do you mean just don't use that as the voltage pin and use the VCC JD?


I mean that on your relay board, there is a link fitted between the "JD-VCC" and "VCC" pins which must always be removed. "JD-VCC" connects to your relay power supply - whatever that is - and "VCC" connects to the Arduino +5 V in order for it to activate the opto-coupler. At that point, the two supplies are isolated.

There needs to be a return path for the current that flows through the optocoupler.

In the below picture, the left block resembles an output pin of the Arduino micro and the right hand block resembles (part of) the relay board.

If the output of the Arduino is LOW, Q1 conducts (and Q2 blocks). Current flows from the 5V supply on the relay board (that’s the same 5V that is used by the Arduino) through R3, the optocoupler and Q1 to ground of the 5V supply.

Out of interest:
If the output of the Arduino is HIGH, Q1 blocks (and Q2 conducts); because Q1 blocks, there is no way for the current to flow from 5V to ground and the transistor in the optocoupler will not conduct.

408861.0_1.png

The below picture represents a different scenario where the right board is e.g. a LED driver board and uses 12V.

If you do not connect the GND of both boards in this case, it will not work because there is no way for the current to flow from the 5V supply on the Arduino back to the ground of the 5V supply. In this case, when the output of the Arduino is high, (Q2 conducts, Q1 blocks) current will flow from the 5V supply through Q2, resistor R3 and the base of Q3, the emitter of Q3 to ground of the 5V supply (if both grounds are connected).

408861.0_2.png

Note:
Transistors were picked ‘randomly’ to show the principle !!