Go Down

Topic: Very basic resistors question (Read 1 time) previous topic - next topic

retrolefty


I now understand that the resistor can be connected on the cathode pin or the anode pin.

If I am running a wire from the digital, or analog, output pin on the Arduino to the cathode wire of the LED I assume it is the digital, or analog, output pin on the Arduino which is sending the current to the LED. If I am using one of these output pins, rather than the 5V or 3.3V pins, how do I know how many volts are going to the circuit and therefore which resistor calculation to use?



For calculation purposes you can just assume a digital output pin set to HIGH will have the same voltage as the Vcc value powering the chip, so +5vdc for a 5 volt board and +3.3 volts for a 3.3 volt board.

Note your above:

Quote
If I am running a wire from the digital, or analog, output pin on the Arduino to the cathode wire of the LED I assume it is the digital, or analog, output pin on the Arduino which is sending the current to the LED.


Yes, however:

Normally one wires the led anode to the output pin and the cathode/resistor end to a ground pin so that a digitalWrite HIGH will turn on the led. If you wire the cathode to the output pin then the other end of the led/resistor must wire to the +5V pin and the led will only light if you set the digital output pin LOW.

Lefty

DerekErb

Thank you again for your detailed and helpful replies.

Quote
For calculation purposes you can just assume a digital output pin set to HIGH will have the same voltage as the Vcc value powering the chip, so +5vdc for a 5 volt board and +3.3 volts for a 3.3 volt board.


Is an Arduino Uno a 5 volt board or a 3.3 volt board?

Would all of this work the same if I go through an analog port instead of a digital port?

retrolefty


Thank you again for your detailed and helpful replies.

Quote
For calculation purposes you can just assume a digital output pin set to HIGH will have the same voltage as the Vcc value powering the chip, so +5vdc for a 5 volt board and +3.3 volts for a 3.3 volt board.


Is an Arduino Uno a 5 volt board or a 3.3 volt board?

It's a 5 volt board.

Would all of this work the same if I go through an analog port instead of a digital port?

If you mean pin instead of port, then yes the analog input pins can be used as digital input or output pins. You just have to set the pin mode and output value using the pin mode and digitalWrite commands.
Lefty




123Splat

Derek:   You might want to look up Thevinin and Kirchoff.

Good luck and have fun

Go Up