0

I am currently developing some basic led board using Arduino Uno R3. Basically, the LEDs are connected in parallel so that 5V DC supply can light up about 3 LED. Each LED has its resistor and its connected to 3 Arduino digital pin where I ground it by using digitalWrite(pins, LOW). Each ground on the schematic is the Arduino digitalWrite(LOW). My question is where should the negative of the 5V should be connected?

Also, if I wanted to measure the voltage of the LED, where should I connect my probe so that analogRead() can read the voltage?

Thanks and sorry if my explanation is not correct since it's my first time using this site.

schematic

simulate this circuit – Schematic created using CircuitLab

1 Answer 1

1

The Arduino common, normally referred to as ground, although it is usually only accidentally grounded through external connection. In general ALL connections should have a common "ground".

You can not measure voltage across the LED given the circuit you have listed. (You could read the voltage at both ends and subtract.)

If you swap the LED and resistor you can get an approximation of the LED voltage (actually LED + Arduino pin) from the junction of LED and resistor.

4
  • Thank you. What if I have a dual power supply 5V and 12V, lets say D3 needs 12V to work, and the others need 5V to work, should both the power supply's negative port be connected to Arduino GND as well? Commented Jan 21, 2017 at 11:44
  • @Jason Your comment is imprecise. All electrical circuits need some reference connection. If it is a "dual power supply" it presumable has a common. If you have 2 independent power supplies they both need a reference connection - this is conventionally 0V, but any reference is acceptable. If you really intend using 12V, you should rethink your circuit, and NOT connect directly to the Arduino. I really don't see why you would want 1, let alone 2, external supplies to switch a few LEDS. The Arduino can only switch 40mA max (20mA recommended) without extra circuitry.
    – Milliways
    Commented Jan 21, 2017 at 12:38
  • @Milliways, the “it is usually only accidentally grounded through external connection” part seems false. Commented Jan 21, 2017 at 20:33
  • @jwpat7 If you power with most switch-mode power supplies (such as the plug packs used as phone chargers) which are double insulated, the Arduino will be floating WRT ground, unless you connect to a grounded device.
    – Milliways
    Commented Jan 21, 2017 at 23:13

Your Answer

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

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