Using common ground correctly

Hi,

yes, I know, there are many topics on common ground. Couldn't find a proper answer though to my particular problem which is kind of a more general one. Say I have a circuit like this:

1

now, if U0 is bigger than 5V - say 8V for example - I would think that I need to plug a resistor into the signal line. However, that's where my problem lies. Which one? For that it would be useful to know what kind of resistance is on the Arduino input side. I know from documentation that a digital I/O pin can provide 40mA max which would correspond to 125 Ohms. Also that there are pull-up resistors. But here it is an input signal which I guess "delivers" the current from the power source U0. For instance, I have a flow meter which I measure (without Arduino) 30 Ohms at 0.005V if there is a signal and a high resistance (not measurable) at 8V (=U0) if there is none. I suppose in that particular case (because of the high resistance) no additional resistor on the signal line is necessary. However, if the resistance would be (for whatever reason) something like 40 Ohms at 8V that would be about 200mA on the I/O pin of the Arduino. So I would need to plug a 160 Ohms resistor into the signal line to limit the current to 40mA, right? Or will the I/O pin of the Arduino adapt to the high current and increase its resistance automatically? And if so, to what value (say for the UNO for example)? Plus, can I ignore the voltage between the negative terminal of the device and the signal cable as long as the resistance of the device limits the current to 40mA or rather the power to 0.2W (e.g. 5V x 40mA = 8V x 25mA)?

1 Like

Under what circumstances would there be an external voltage between D1 and GND as depicted in your drawing ?

1 Like

Hint, schematics are from top down left to right.

flow meter example I mentioned. I think, as I can't look inside it unless I destroy it.

could you be more specific by what you mean?

I'm having a hard time reading that jumble of a "paragraph"...

A sensor doesn't normally go in parallel with the power supply and an Arduino input. Or is that battery just to indicate a voltage from the sensor?

Usually, not just a resistor. Here are some protection circuits to protect against over-voltage and/or negative voltages. (You can increase the current limiting resistor to 1K or more.)

But in fact, the ATmega chip (regular Arduino Uno, etc.) has "small" protection diodes for static-discharge protection. I believe they are rated for 1mA. In some cases, you can just use a 10K series resistor, and when you go above Vcc the diode "turns on" and "clamps" the voltage.

The resistor has virtually no effect below Vcc because the Arduino inputs have nearly infinite input resistance, so no current flows and no voltage is "dropped" across the resistor.

Like I said, when configured as inputs, the pins have virtually infinite resistance. That's assuming the pull-ups are not enabled, and assuming you haven't gone negative or exceeded Vcc. If the chip is not powered (Vcc = 0) the protection diodes will start to conduct above about 0.5V.

The input isn't actually a resistor so it doesn't necessarily pull-up or pull-down and unconnected inputs can "float" and read unreliably high or low, or analog inputs can float to anything... Unconnected-floating inputs are "undefined".

The output impedance isn't 125 Ohms but that's minimum allowed load resistance.

2 Likes
  • Sorry but your request is too confusing.

  • Please just tell us what you are wanting to do without any preconceived ideas of what you think needs to be done.

1 Like

A sensor doesn't normally go in parallel with the power supply and an Arduino input. Or is that battery just to indicate a voltage from the sensor?

the circle is meant to be the whole device (including - for example - a sensor, so certainly there are some resistors and/ or other components inside but again, can't look inside unless destroying it)

But in fact, the ATmega chip (regular Arduino Uno, etc.) has "small" protection diodes for static-discharge protection. I believe they are rated for 1mA. In some cases, you can just use a 10K series resistor, and when you go above Vcc the diode "turns on" and "clamps" the voltage.

I was thinking about diodes inside the Arduino as a protection against external "over-voltage", for example from that power supply in my drawing. But 1mA is really small, guess that won't give much protection. The reason why I'm digging into that problem is that I've seen websites where there they say that the voltage of the external power supply (that is necessary to power some device) doesn't matter when using common ground. I have (almost) no idea of the interior of the Arduino (to be honest, too complicated for me, at least as long as I don't take a loooong course), so I've been trying to imagine equivalent circuit diagrams for it (like in the drawing, the Arduino seen as a 5V "power source" that somehow measures voltage differences.

Like I said, when configured as inputs, the pins have virtually infinite resistance. That's assuming the pull-ups are not enabled, and assuming you haven't gone negative or exceeded Vcc.

and what happens in that case? I think you mean if you connect (like in the example) 8V to GND and D1 you get -3V negative voltage on the Arduino pins. As for the pull-ups, I always thought that they increase the resistance of the pins but if you say they are normally infinite, pull-up rather means decreasing their resistance, right? I think I measured the voltage across a digital pin and GND at 1.9 MOhms and 400 kOhms (while turned on), it was a bit strange. It was either one of those values and not always the same.

without any preconceived ideas of what you think needs to be done

when your are working with devices (Arduino, sensor devices etc) which you don't have complete knowledge about that's what you - I - do: preconceive or rather assume how they work and hope that asking questions will confirm the assumption or clear things up.

Lots of volunteers here ready to help you with your project.

  • It is best, when starting out with a new project, to say:
    I have this hardware . . .
    I have this skill set . . .
    I would like to do this . . . and have this . . . happen.

Inputs come from the top and left, outputs are right and down. Positive is up ground is down. Does that help? Ground is also generally used as the reference point for voltage etc.

I rather like to come to the point if possible

yeah, those conventions. sometimes you don't want to or rather can't afford the time to spend hours to please everyone's taste. not saying that they are not important but I think in this case it suffices to make a rough sketch as it's simple and general - nothing specific, and not a particular project. Just trying to understand things.

Then you have accomplished what you wanted. Nothing specific given and and no specific answers returned.

2 Likes

not true. DVDdoug gave some useful insights into what I'm trying to understand.

  • Good luck.

same to you

8V on input pin will kill the input pin.
Use a voltage divider.
2 10 kOhm resistors in series over voltage source.
Connect D1 halfway.
If voltage source is unregulated, you might need more to protect your D1 pin.
All at your own risk, as you did not give sufficient information...
You seem to have sufficient time to write a lot of words, while lacking time to organize your drawing. Or answer relevant questions. That is a bad habbit. Because of that, some of the best helpers already left this thread. Just saying...

8V on input pin will kill the input pin.

okay, that statement is totally different from what I've come across before (on those websites) and to me sounds much more reasonable. However: if a weak "power source" can only provide 25mA at 8V (corresponding to 0.2W at the input) would a resistor still be necessary because the maximum a pin could bear was 0.2W?

Use a voltage divider.
2 10 kOhm resistors in series over voltage source.

right, but why? as I understand it, to devide the voltage there has to be another resistance "inside" the Arduino. Say for example 8V external power source, 20k Ohm as you say there would be - if the internal resistance of the power source was negligable - a current of 0.4mA coming from it. Now if the resistance over the Arduino pin was 125 Ohms the voltage (subtracted from its own 5V or 1.5V (?)) over its pins would be 0.05V. If its resistance would be something like 2 MOhms though (which I measured by connecting one of its pins to GND) the voltage would be 7.92V but the power only about 0.03 mW.

so, it is not the power on the pins that kills them but the voltage if I understand you correctly?

Connect D1 halfway.

why is that? wouldn't it suffice to connect D1 directly to the positive terminal of the power source and the 20kOhms on its negative (or vice versa with the 20kOhms on the positive line)?

You seem to have sufficient time to write a lot of words, while lacking time to organize your drawing. Or answer relevant questions. That is a bad habbit. Because of that, some of the best helpers already left this thread. Just saying...

nah, that's not the way it is. Believe it or not, I've tried to make a better drawing with straight lines etc but after 30 min of using Windows Paint gave up... takes much too long. And learning some new (to me) software that I first need to look for certainly consumes even more time - which at the moment - I really don't have. The other option would have been to draw it by hand and scan it which is also quite unnecessary here I guess. By contrast I can write fast and so it only takes me a couple of minutes.

I realize though that my drawing was dispensible anyway. The question(s) would have stayed the same more or less but I could have boiled it down to:

"what exactly happens at the I/O pins of the Arduino if I connect them to more than 5V and why? what kind of resistors are involved, calculations for substantiation would be great"

but please bear in mind that if you don't have sufficient knowledge of the Arduino (like me) that the questions are probably not always precise and need further "discussion".

and what are those relevant questions you say I haven't answered? I believe the questions asked to me I have already answered initially.

They get damaged, that is all I ever needed to know. I am not an electronics expert, so I follow the advice of people who are. Expert advice says use a voltage divider, so that is what I do. As a result, I have never damaged an IO pin.

Perhaps if I knew more (maybe Kirchhoff's Laws?) I could sometimes get away with one less component, but that is not a worthwhile saving.

AFAIU, damage is basically caused by heating, and heating is proportional to current flow. Current is proportional to voltage.