Circuit

I recently bought the arduino uno starter kit. The first project was to create an starship interface programmed so the green led will stay lit until the button is pressed and when pressed it will turn off and the two red led’s will blink. I understand the code but I do not understand the flow of electricity that makes it an full circuit. I was hoping someone would maybe be able to describe how the flow of electricity works in this circuit in attaches picture.

(Edit: Sorry I should have worded this better. I included the schematics pic for this project and I am just trying to understand the breadboard and how current flows through it when the project does have an power source. I have been using the usb for now. The project works I just don’t understand how the circuit is making an complete loop when it is powered on.)

Donaldblevins58:
I recently bought the arduino uno starter kit. The first project was to create an starship interface programmed so the green led will stay lit until the button is pressed and when pressed it will turn off and the two red led’s will blink. I understand the code but I do not understand the flow of electricity that makes it an full circuit. I was hoping someone would maybe be able to describe how the flow of electricity works in this circuit in attaches picture.

I was hoping the picture was a schematic of your wiring. But, it is not. So I haven't a clue as to how the "electrons", not electricity, are flowing in your picture.

Paul

I'm pretty sure there's no electricity flowing in that picture because there's nothing supplying any electricity to it.

Otherwise the best I can do is "The electricity goes down some of the wires, through some of the components and comes back along some other wires".

You really need a circuit diagram and it needs to show where the power is coming from.

Steve

Well, the Arduino is supplied with power either from the usb or the power jack. If from the power jack, the external voltage is regulated down to 5V by a regulator chip. Either way, 5V is available from the 5V pin on the Uno, or from any output pin set to OUTPUT & HIGH. When any of the LEDs is lit, current flows from the Arduino output pin, through the led and series resistor, then back to the Arduino's GND pin, which connects to the ground side of the power supply. There's your circuit.

Outside of the battery (or power supply) "conventional current"* flows from positive to negative or from higher-voltage to lower-voltage. (Conventional current flows the opposite direction inside the battery or power supply.) direction. So when you have a [u]complete circuit[/u], current flows in a circle.

Sometimes we can think of current-flow as water-flow in a pipe, and voltage as water pressure. Resistance is like a small water pipe. High resistance reduces current flow.

The big difference is, if we cut a pipe we get no resistance and water flows-out freely all over the place. If we cut a wire we have infinite resistance (an open or incomplete circuit) and the electrical-current stops.

Also, nothing bad happens with no water resistance (except maybe a flood :smiley: ) but with no electrical resistance we have a short circuit and stuff can burn-up.

If you wire-up an LED and resistor as shown in the [u]Blink LED Example[/u], the current comes out of the power supply's positive terminal and into the Arduino. When the I/O pin goes high, current flows out of the Arduino, through the resistor and the LED, and back to the power supply through ground, making a complete circuit.

When the I/O pin goes low there is no voltage (no "pressure") and no current flows.

The Arduino I/O pins can either "source" or "sink" current. In the above example the Arduino is sourcing current.

If we reverse the LED and connect the resistor and LED between the I/O pin and +5V the LED will light-up when the I/0 pin goes low. Current flows from the power supply through the resistor and LED, and into the I/0 pin to ground.

  • Conventional current is a concept. Electrons actually flow the opposite direction. If you take an electronics class current (conventional current) flows from positive to negative or from higher to lower, like water flowing downhill. If you take a science class current (electrons) flows from negative to positive.

Here's that photo for all to see:

And, using "conventional current", when an Arduino output goes HIGH, the current flows out of the Arduino output, through the LED, through the resistor and then through the breadboard rail [labeled as "-"], through the black wire to the Arduino Gnd pin [assuming that is truly where that black wire is connected -- I can't tell for sure from the photo and I'm too lazy, right now, to dig out one of my Arduino Uno's].

When one of the Arduino outputs, on one of those LED circuits, goes LOW, there is no [appreciable] current flowing. Why? Because, when the Arduino output is LOW, it is a around the same voltage as the rest of the circuit. No voltage difference, no current.

There is a formula called Ohm's Law that mathematically tells the story:

** **E = IR** **

What this says is, the Voltage across the circuit "
** **E** **
" is equal to the Current "
** **I** **
" flowing through the circuit, times the total Resistance of the circuit "
** **R** **
". So, from this you can see that if
** **E** **
is 0, then
** **I** **
will always be zero, no matter what
** **R** **
is.

When the Arduino output, on one of those LED circuits, goes HIGH, it's at around 5V, and the other end of the circuit is connected to Gnd, then current will flow, because the voltage at Gnd is zero and the voltage across the circuit is 5V - 0V = 5V.

If an Arduino output goes LOW on one of those LED circuits, then it's at around 0V. And, because the other side of each of the LED circuits is at 0V, NO current flows, because the voltage across the circuit is 0V - 0V = 0V

The case of the Pushbutton is similar, but different in a distinguishing way. When the button is pressed, the current flows into the red wire, from the +5V supply, then through the switch, then through the 10k resistor to that "ground rail", where it flows to the black wire, which takes it back to the Arduino.

The LED circuits are being driven by the Arduino. The pushbutton, being an input device, drives the Arduino input.

Notice that nothing physically changes in the LED circuit, whereas, the Pushbutton electrically changes when it's pressed. Also, on the Arduino end, on the pushbutton circuit, it's an input, not an output [as stipulated by the code in the sketch that is loaded in the Arduino]. When the pushbutton is NOT being pressed, NO current flows -- why? Because the open pushbutton behaves like a really large resistance. And if you plug this into Ohm's Law, you can see why no current flows:

I = E/R = 5V/∞ = 0

Also, the 10k resistor holds the Arduino input to Gnd [or 0V]. To really see why, I would need to talk about voltage dividers -- and I'm running out of time!

When the pushbutton is pressed, it becomes a 0Ω resistor [or nearly 0Ω--i.e. for all intents and purposes, at least in this case, it is 0]. So, it basically, shorts the Arduino input to 5V. Current flows from the +5V rail, through the switch, through the resistor, to Gnd. Because the switch is, essentially, 0Ω, all of the 5V is across the 10k resistor, thus by ohm's law:

I = E/R = 5V/10k = 0.5mA or 500µA

So, the current flowing through the 10k resistor [and through the closed switch], is 500µA.

The Arduino output gets that current from the 5V power supply. Which power supply depends on how the Arduino is being powered [e.g. from a USB connector, from a WallWart plugged into the power jack, etc. -- in your photo, there doesn't appear to be anything powering the Arduino]

Let me [us] know if that doesn't answer the question.