Connecting multiple sensors to an Arduino.

Hi everyone,

I am working on a project in which I need to run 2-3 sensors and relay blocks based on arduino code.
I see from the leonardo spec that:
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA

However I do not see any currents specs for the 5V pin.

I want to know 3 things:

  1. I need to run two sensor whose spec call them out as using 13mA each for a total of 26mA
    based on the numbers I see that I can safely connect both of them to the Arduino 3.3V pin? At some point I may also want to connect the 3.3V to the AREF pin.

  2. Does the same logic apply to any component you may want to connect to the ardunio board? If not can someone please help me?

3.Lastly, what is the best way to connect to two wires to the same pin (see question 1)

However I do not see any currents specs for the 5V pin

That is because it depends on a lot of things.
If it is USB or externally powered?
a) USB has a maximum current of 500mA
b) External power depends on the voltage of the external power because of the heat the regulator can get.

based on the numbers I see that I can safely connect both of them to the Arduino 3.3V pin

Yes

Does the same logic apply to any component you may want to connect to the ardunio board?

Yes

what is the best way to connect to two wires to the same pin

Put in a row of header pins and solder the wires to the pin

That is because it depends on a lot of things.
If it is USB or externally powered?
a) USB has a maximum current of 500mA
b) External power depends on the voltage of the external power because of the heat the regulator can get.

This probably explains why the sensors behave differently when connect to a computer UBS versus a walwart transformers (5v 1000mA) ?

How can I know / calculate how much current the aduino 5V pin can support at the different voltages.
I want to try to use the AREF pin from the 3.3V on the arduino to make things more stable.

Ideally I want to power the board from a 9V source. But how do you test and program for 9V operation, if when connected to the USB you are powering the board from 5V and then your sensors are probably getting a little less that the full 5V.

How can I know / calculate how much current the aduino 5V pin can support at the different voltages.

It is a matter of power dissipation in the regulator
See:-
http://www.thebox.myzen.co.uk/Tutorial/Power.html
and
http://www.thebox.myzen.co.uk/Tutorial/Power_Examples.html

But how do you test and program for 9V operation,

There is nothing to change in a program if you are using a 9V supply or the USB supply.

if when connected to the USB you are powering the board from 5V and then your sensors are probably getting a little less that the full 5V.

If the output from your sensors are dependent on the supply voltage ( most sensors are not ) then using the standard AREF that is the +5V supply will automatically compensate.

thanks , your post has given me some clarity.

Grumpy_Mike:

How can I know / calculate how much current the aduino 5V pin can support at the different voltages.

It is a matter of power dissipation in the regulator
See:-
http://www.thebox.myzen.co.uk/Tutorial/Power.html
and
http://www.thebox.myzen.co.uk/Tutorial/Power_Examples.html

But how do you test and program for 9V operation,

There is nothing to change in a program if you are using a 9V supply or the USB supply.

if when connected to the USB you are powering the board from 5V and then your sensors are probably getting a little less that the full 5V.

If the output from your sensors are dependent on the supply voltage ( most sensors are not ) then using the standard AREF that is the +5V supply will automatically compensate.

Mike going back to how much current the 5v pin can supply, I would need to know the specs of the regulator used on my board (Leonardo).

And basically if I am powering the device from a 9v source, the regulator needs to drop 4v..
but besides that, although I read your links I am not sure how to figure out how much current I am supplying.

I found this:

although I read your links I am not sure how to figure out how much current I am supplying.

That is for you to decide given the other information.
Up to the limit of the regulator - 1A in this case you can supply current. But as well as the regulators built in limitations on current you also need to consider the heat dissipation. At 1A with a 4V drop you are trying to get that tiny chip to dissipate 1 * 4 = 4 Watts. If you let it do that then it will get too hot.

You have two choices:-

  1. Fit a heat sink
  2. Limit the current that you let yourself draw from the regulator.

If using the latter you have to decide how hot you want to let it run. The cooler things run the longer is the life of a part. This depends on what environmental temperature you want to run the whole system at.

Grumpy_Mike:

although I read your links I am not sure how to figure out how much current I am supplying.

That is for you to decide given the other information.
Up to the limit of the regulator - 1A in this case you can supply current. But as well as the regulators built in limitations on current you also need to consider the heat dissipation. At 1A with a 4V drop you are trying to get that tiny chip to dissipate 1 * 4 = 4 Watts. If you let it do that then it will get too hot.

You have two choices:-

  1. Fit a heat sink
  2. Limit the current that you let yourself draw from the regulator.

If using the latter you have to decide how hot you want to let it run. The cooler things run the longer is the life of a part. This depends on what environmental temperature you want to run the whole system at.

okay I understand how it works and I also saw where the 1A came from.
now what you are saying is this scenario is that I can choose any amp amount up to 1A. So my 9v 650mA power supply will give the arduino 650mA and 4v * .65A = 2.6W.

regardless of this, in reality, I will never be able to supply the arduino more the 700mA or so because of its internal thermal cut off component. (from what I read on these forums) correct?

I was doing some more testing last night and I noticed that if I have an analog voltage (3v) going into analog pin A1 , the same valuve appears on A0 and A2, unless I connect a specific sensor.

reading the reference here I read that is normal when nothing is connected. Is there a way to turn-off those pins so that they read 0v ? some sort of pull down? - is it even worth it?

Thanks

is it even worth it?

No.

Thank you very much, :slight_smile:

What happens if two sensors are programmed to trigger the same output pin?
and the condition happens to be true for both instances?

IF (sensorvalueA <5 || sensorvalueB <5);
digitalWrite (pin10, HIGH);

Is there any chance of damaging the arduino?, or does the board know that if pin10 is already HIGH, wee lets keep HIGH a little longer if the another condition is true ?

Is there any chance of damaging the arduino?,

No.

If a pin is high already setting it high just doesn't do anything.

That is what I thought / was hoping for. I am really liking this Arduino stuff. Thank you for your help.