0
\$\begingroup\$

I have a circuit that connects an IR led to my Arduino. The positive leg goes to +5v and the negative goes (via a resistor) to a digital pin. However, I have since seen some pictures of IR circuits that also connect the LED to ground. Do I need to do that, and if so, how do I do it? (So far, I've built 2 of these circuits and nothing has happened in the month since.)

enter image description here

\$\endgroup\$
5
  • 1
    \$\begingroup\$ This website has a schematic function. You may also copy paste an image directly into your post. \$\endgroup\$
    – DKNguyen
    Jan 16, 2021 at 22:23
  • 1
    \$\begingroup\$ Why don't you draw a schematic and show us? But it seems like the LED is correctly driven by the IO pin. \$\endgroup\$
    – Justme
    Jan 16, 2021 at 22:25
  • \$\begingroup\$ Sorry, I don't really know how to draw schematics. \$\endgroup\$
    – ma1234
    Jan 16, 2021 at 22:40
  • \$\begingroup\$ I am going to go out on a limb here. I THINK I understand the question even without a schematic but it is hard to be sure. What you did is fine. If it is working then don't worry about it. Basically when your IO pin is set up as an output and driven low, it becomes the ground for your IR LED. When it it is drive high or is not configured as an output, then your IR LED is off. That is all fine. \$\endgroup\$
    – user57037
    Jan 16, 2021 at 23:08
  • \$\begingroup\$ The circuit looks like the left schematic in the accepted answer. \$\endgroup\$
    – ma1234
    Jan 16, 2021 at 23:31

1 Answer 1

1
\$\begingroup\$

You can have the GPIO drive low to light the LED OR drive high to light the LED, depending on how you connect the LED.

Some I/O technologies can drive a low with more current, so connecting the LED to VCC (+5V) was preferred. This is generally not the case for modern technologies, the low and high current are usually about the same. Some older designers still have habits from the old days and tend to connect LEDs to VCC.

If you need a transistor driver, a low side switch is often easier to make. For a low side switch, the LED is connected to VCC.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
3
  • \$\begingroup\$ So my circuit is fine? \$\endgroup\$
    – ma1234
    Jan 16, 2021 at 22:38
  • 1
    \$\begingroup\$ If your circuit looks like the left side, then yes. Output a "0" to turn the LED on. \$\endgroup\$
    – Mattman944
    Jan 16, 2021 at 22:44
  • \$\begingroup\$ Thanks. And would the resistor value be the same if I wanted to build the one on the right? (Right now, my circuit, the left schematic, uses 220 ohm) \$\endgroup\$
    – ma1234
    Jan 16, 2021 at 23:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.