Ohms law :: designing my own circuit?

Hey guys and gals,

I am new to Arduino. I know that when designing my circuits I need to keep Ohms law in mind to make sure that I am not trying to get the Arduino to sink too much electricity and to make sure that I am not sending to much electricity though my components. My question is; lets say I have two components running from two separate pins (lets say 13 & 12) do I do my calculations with each pin using the full 5V or would it be 5V/x where x == number of pins in use.

Or am I completly off about this generally works? I can't find any tutorials on this topic.

Thanks!

You do the calculations for each pin separately. But the entire collection of hardware that you connect to 5V has to stay within the maximum 5V current limit of the Arduino. There is also a maximum current for the sum total of all the pin current, 200mA if I recall correctly... no individual pin should draw more than 20mA.

Thank you for the quick reply. So I do each one independently and all components must stay within the 5v, got it.

One other related question do I need to add all of the "left over" electricity together from all the pins to sink it or is it still as long as each individual pin isn't sending back more then the board can sink I am ok?

zeroradius:
Thank you for the quick reply. So I do each one independently and all components must stay within the 5v, got it.

One other related question do I need to add all of the "left over" electricity together from all the pins to sink it or is it still as long as each individual pin isn't sending back more then the board can sink I am ok?

Sorry, I don't understand your question. I've never heard of left over electricity before. Does it sell for half price?

zeroradius:
I know that when designing my circuits I need to keep Ohms law in mind

You need to keep Ohm's law AND Kirchhoff's laws in mind. This completely answers your question. If it doesn't, ask questions about Kirchhoff's laws.

Stefflus:
Voltage is potential.

Resistance is futile. :slight_smile:

One other related question do I need to add all of the "left over" electricity together from all the pins to sink it or is it still as long as each individual pin isn't sending back more then the board can sink I am ok?

That gave me a chuckle on this dreary day. Remember that question, and in a few months ask yourself the same question. If you have a laugh, congrats, you are getting to understand it.

There is no "left over" electricity, or if you were referring to Voltage, there is again none left over. The components you use have a voltage specification, and it is your job to ensure the supply falls within those parameters. There are some components you might use as a beginner that won't, and you must add additional components to deal with it. Led's are the big one, with required voltages of only 1.5V to 3.5V (forward voltage or Vf). Resistors are placed in series and sized in accordance with the total voltage (in your case 5V) and then to limit the current (If-or forward current). This must also be checked against the limitations of the supply, which in your case is 5V and "X" mA. I put "X" because the specs for the arduino call out 40mA max, but it is normally kept down to 20mA or so. If you only want 10mA through the led, great, it is UNDER the max current, but the pin supplies 5V regardless of how much current it is sourcing, provided it is under the max current.

For now, you would be good to just concentrate on current usage. Yes, make sure the voltage is the right for the component you are using, but current is what gets newcomers in trouble. The limits on the supply-whether it is a wallwort, battery, arduino I/O pin, arduino 5V regulator- they all have a max current. Stay BELOW this limit, I like to stay 50-75% of that limit. Just add up all the current each device uses to get the current required of the supply. If you have 5 led's set at 20mA each, that is 100mA, or .1Amp.

This is what is considered CV, or constant voltage supplies. The current is variable and will match the requirements of the circuit EXACTLY. If you had a 5V 10A supply, and using the led example above used a ammeter to measure the current, you would only read 140ish mA (arduino uses some too), not the 10A the supply says. Throw in another 5 led's and that reading would only be 250mA. Hook up 1000 leds, and then something odd will happen. The current will be maxed out at 10ish amps, but the voltage will have dropped to something much less than 5V. The led's probably wouldn't light up and the supply would probably start getting hot and stinking. That is because those 1000 leds are trying to sink 20A, but the supply cannot supply that much. The supply sees this as a short circuit, so max current flows and voltage drops. This is what you want to avoid.

There are also CC, or constant current supplies. They are used a lot for high power leds (learn why later). The CC supply will have a constant current and the voltage will actually vary to match the need, just like the CV supply varied the current.

tinman13kup:
Just add up all the current each device uses to get the current required of the supply. If you have 5 led’s set at 20mA each, that is 100mA, or .1Amp.

Also keep in mind that the Arduino chip itself has maximum electrical ratings (datasheet chapter 32). One of these is 200ma through Vcc/gnd. So, if you added five more LEDs at 20ma that’s 200ma total that the Arduino must provide. Even though the power supply may be capable of five hundred amps, the Atmel processor will be operating at or slightly above its limits with all the LEDs on. The smoke may very well be released at this point.

tinman13kup:
Hook up 1000 leds, and then something odd will happen. The current will be maxed out at 10ish amps, but the voltage will have dropped to something much less than 5V.

DO NOT TRY THIS AT HOME! RESULTS MAY VARY!

Depending on the failure mode of the power supply, an overload could have a range of different results, including but not limited to:

  • Limiting current to the maximum value, and dropping voltage appropriately.
  • Folding back current to a low value (with an appropriately low voltage) until the supply is reset.
  • Breaking.
  • Breaking and CATCHING FIRE.

dougp:
Also keep in mind that the Arduino chip itself has maximum electrical ratings (datasheet chapter 32). One of these is 200ma through Vcc/gnd. So, if you added five more LEDs at 20ma that’s 200ma total that the Arduino must provide. Even though the power supply may be capable of five hundred amps, the Atmel processor will be operating at or slightly above its limits with all the LEDs on. The smoke may very well be released at this point.

IIRC it’s 200mA per Vcc/Gnd pin - so on the SMD version with 2 Vcc (and 3 Gnd) pins, you can do 400mA total. But not