I would greatly appreciate any help. I believe I am understanding how the arduino output pins work incorrectly. I have written code that produces a high digital output to pin 3 for a couple of seconds and then it runs through a resistor and then back to ground. For some reason, no matter what the resistance of the resistor is, the resistance calculated via a multimeter is 50 Ohms, the voltage is 5 V(which I expected), and the current is 100mA. If I put a 10 kOhm resistor, the current still stays the same. Doesn't this violate Ohm's law? The circuit is simply going from digital output 3 to a resistor, to ground. The current through the resistor should be given via ohm's law. No? For some reason it isn't and I don't understand why. Any help would be very appreciated!
The issue is that the resistor isn't actually 50 Ohms, but the reading suggests that it is, which makes no sense to me. I understand that the voltage source has some load resistance, but couldn't we just calculate the equivalent resistance by adding them up. Thus, changing the resistance of the resistor should change the current passed. However, this isn't what is being shown.
STOP testing immediatly, you will destroy the UNO with the current meter connect that way.
< edit >
A current meter should be wired in series with the resistor, not in parallel. The way you have it connected, you could completely remove the resistor and still measure the same current. Essentially you are directly shorting pin 3 to ground, with only the internal resistance of the meter (which is very low) and the internal resistance of the output pin of the atmega328 limiting the current. If you are very, very lucky the atmega328 may still work, but I suspect pin 3 is damaged.
If you have a current meter connected between an output pin and ground, then it acts essentially as a short circuit, which can destroy the output pin, and even the processor.
The current is limited by the output impedance of the pin, until the pin electronics burn out.
The OP might get lucky, the cheep meters use a relative high resistor value in series with the load and measure the drop across that to determine current. I suggest the OP view a few basic electronics tutorials and maybe get a book or two on that as well.
How was it calculating a resistance of 50 Ohms and a current of 100 mA if it was a short circuit? Do some multimeters have an internal resistance and others will break my arduino?
In fact, the impedance of an ATmega328 output pin is around 40 Ohms, so your interpretation of the simulation result is not so far off. But I doubt any Arduino forum member knows what assumptions are built into a simulator.
However, if you set the output high on a real Arduino, and connect it to ground, that WILL burn out the pin.
Ohms law has not been violated. How are you measuring the resistance? If you are using an ohmmeter into the resistor and output of the UNO then you have to consider you have two items in parallel.
BTW your best not to draw more than a couple of milliamps from a digital output. The spec allows you more but its best to leave a lot of design margin.
A current metrr has a small resistor inside. Depending on the range you choose (or autorange), the retsitance may be small or larger.
The meter then measures the voltage over this resistor. That value is used to calculate the current through that resistor (which is equal to the current through your circuit).
Measuring current may quite easily damage your stuff or your meter (as it has near zero resistance, currents may get quite high).
In the high amp range, the resistor may be 0.1 ohm, in micro amp range, the resistance may be 1 kOhm or more. All depending on the quality of your meter.