Go Down

### Topic: Project 2 - Spaceship Interface - Digital Input (Read 2245 times)previous topic - next topic

##### Nov 27, 2014, 09:26 am
Hi,

I am a total newbie to arduino and electronics in general. Please pardon my ignorance.

I am little confused about the the digital input 2 in the project 2. In the attached circuit below. As per my understanding, when the switch is closed the current flows from the +5v terminal to the Digital input 2 and sets the Digital input 2 to HIGH. But in this case, since there is no resistor between the +5v supply and the digital input 2 wouldn't it cause a short circuit and damage the micro controller?  I read earlier that there must always be a load on the circuit between the two terminals to avoid damage.

Sorry again for this basic question. Really appreciate all your help!

#### Lokh

#1
##### Nov 27, 2014, 11:05 am
Hi,

I'm also a total beginner so my explaination may be wrong .

As I understand it, there is a short circuit only if there is nothing between the +5v supply and the ground.
Here, the Digital input 2 is not the ground. It should be considered as an electrical component like the LED in the first project (current goes in input 2, and gets out via output 3 to 5).

Regards,

#### plustwo

#2
##### Nov 27, 2014, 11:58 am
the pull-down resistor connects the pin to ground when the switch is open. so, it reads LOW when there is no voltage coming from the switch. check page 35 note 2. just simply put.  good luck with the journey...

#3
##### Nov 27, 2014, 11:14 pm
@Lokh,  Thanks for the reply.  "current goes in input 2, and gets out via output 3 to 5" -- By this, do you mean that all the pins are connected internally?  If so, what would happen if the output of the pins 3,4 and 5 are set to LOW in the Arduino program? How will the current flow to the ground in that case?

I hope I am not confusing you.

@plustwo, My question is regarding the case where the switch is closed and not when it's open.  My question is: How is the circuit from +5v to digital pin 2 complete when the switch is closed? what happens to the current that flows through digital pin 2? how does it reach ground?

#4
##### Dec 01, 2014, 05:24 am
I think I understand the flaw in my concepts now.

When the switch is closed, the current doesn't flow from pin 2 to anywhere. All the circuit is doing is measuring the voltage at pin 2. The circuit is complete only through the path: Voltage source -> Switch -> Resistor ->Ground.  Pin 2 doesn't form a parallel circuit.

#5