Go Down

Topic: Project 2: Pull-down resistor's job to ensure LOW reading w/ switch n/ pressed? (Read 818 times) previous topic - next topic

Hi,

When building the circuit for Project 2, I am a bit unsure why the 10k Ohm pull-down resistor is needed. At first, the resistor did no sense at all to me: The resistor would only be connecting the switch to the ground when someone press the switch.

But after reading some of the pages I found, here in the forum and elsewhere, my understanding is that the pull-down resistor's job is to make sure that the digitalRead on pin 2 doesn't fluctuates when the button is not pressed, to empty that part of the circuit of any electrons left or induced from other parts. Am I right?

It's been a long time since I learnt electronics in school...

Thanks,
Anders


Thank you for this question and the confirmation of the answer. 

I am also trying to understand this. 

So to clarify, and extract a little more information, I have two main questions:

Question One

Pin 2 is a digital input. 

It gets its power from the 5V rail when the button is pressed which routes the voltage to it. 

The 10k resistor connects to the ground rail AFTER the wire that goes to pin 2 (the input). 

So would it be correct to say that the resistor is there to accommodate for any 'left over' electrons existing after the button has been pushed?  Is this a common requirement?  Is there a rule of thumb regarding when this arrangement is required?  I would have assumed the electrons would just be 'cleared' when the circuit was open ie when the button wasn't being pushed. 

Question Two

Pins 3, 4, 5 are digital output's.

They get their power directly from the pins which is delivered to the anode of the LED's. 

A resistor is then placed between the cathode of the LED and the ground rail. 

In the previous starter kit project, the resistors came before the LED, I am guessing to prevent the LED receiving too much electricity. 

In this project, why do the resistors come after the LED?  What part of the circuit are they protecting? 

Thank You. 


ejhart

I'm new to this as well, so I can't guarantee this answer to your first question is correct, though my understanding is that the resistor is there to ensure that the digital in wire (pin 2) reads LOW when the button is NOT pushed. Otherwise, if the resistor were not there, the reading could be erratic and you could get varying high and low voltages. I don't really know the physics behind why that is, so I can't really elaborate, but that's my understanding.

Pins 3, 4, 5 are digital output's.

They get their power directly from the pins which is delivered to the anode of the LED's. 

A resistor is then placed between the cathode of the LED and the ground rail. 

In the previous starter kit project, the resistors came before the LED, I am guessing to prevent the LED receiving too much electricity. 

In this project, why do the resistors come after the LED?  What part of the circuit are they protecting? 

Thank You. 
As for this second question, here is a good answer (I was wondering the same thing you were about resistor placement for this project). http://electronics.stackexchange.com/questions/13746/why-does-a-resistor-need-to-be-on-the-anode-of-an-led

The misconception is that the flow of electrons is like water filing an empty tube a tube or something, but in the link I provided, the answer below the "best" answer has a good explanation of this misconception (which I also had). Here is another link that helps explain this which he links to: http://amasci.com/miscon/eleca.html#electron

So basically it doesn't matter if the resistor is before or after the LED, the resistor increases resistance throughout the circuit (not just at that specific point).

Hope this helps!

Thank you very much for this clear and concise answer and for the related links.  It is really good information to know.  Thank You. 

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy