@Ira_T treat the opto isolator as a transistor not a relay. Think of the input (the 12v side) as the base of the transistor. When you light the led inside the opto isolator, its a bit like applying power to the base of the transistor, and current begins to flow between the collector and emitter (or vice versa depending on opto isoltator used). You dont need to worry about current flow throught the input pin of the arduino (it will be negligible) but you will need to add say a 10k resistor in series.
@Ira_T , I hesitated to write this last post as I really do not intend to upset you or anybody else however, you had a support question that we try hard to help you with and you keep writing irrelevant and/or inaccurate explanations for a simple electrical behaviour following these attempts to help you.
1st) You write… As far as having a voltage with no current, you must have both according to Ohm’s law… That is false. Voltage is often described as ‘potential’ and it is possible to have this potential without ANY current. Ohm’s law does not imply you MUST have current AND voltage it only describes the relationship between voltage, current and resistance. Voltage with infinite resistance = 0 current.
2nd) You write… But in reality, to have a usable voltage, you must have some flow of electrons (the current)… That is mostly false. My battery example is the simplest proof of that. Again consider the 9V (or any other) battery just sitting there, will you not admit that the voltage is still 9V and that there is actually NO current at all even if you do not actively measure that voltage !? I will give you a small point for the ‘useable voltage’ part. A modern voltmeter has a high impedance input, typically about 10 Megohms, and MUST have that amount of current flowing to actually measure the voltage in the circuit. This is very similar to the high impedance within the digital input issue that you have here. That 0.5 microamps IS necessary for the input to detect logic states but let’s be honest here, that current is insignificant and not worth arguing about unless you do want to have 10,000 Arduino digital inputs on a single output !!!
3rd) You write… Having a high pressure water line requires there to be water, so with no available current , you get no potential voltage difference… that is false. Just consider an empty water pipe under high pressure and totally empty of water. Water pipes and copper wires comparisons are shaky at best but if you want to compare them you would have to match ‘pressure’ with ‘voltage’ and easily enough water current with electrical current. A pressurized water pipe , with water in it but with valves closed, will maintain it’s pressure inside but there is no current, just standing water under pressure and nowhere to go. Now quickly open the valve (that’s like low resistance for water) and there goes your water flow…
4th) You write… Theoretically, figuring an air gap of 2 cm between the outlet holes, and a surface area of maybe 2 cm, the current flowing across an outlet at your house would be 7.76E-15 Amps, but essentially it’s zero… Ok, that is true. Air electrical resistance is extremely high and varies with humidity etc… I think you are in the correct order of magnitude with 7.76E-15 Amps but… what is your point here !? that there is always some infinitesimal current if there is voltage !? Nobody takes these numbers into account in simple circuit designs !!
My best regards, JP