Go Down

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



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!



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).



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.  :smiley-cool: good luck with the journey...


@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?


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.

Thanks for all your help!


Apr 15, 2015, 11:47 am Last Edit: Apr 15, 2015, 11:48 am by dannable
Don't add your question to someone else's thread - that's called Thread Hijacking.

Post your code in [code][/code] tags so it formats correctly.

What error do you get?

All of this is in the post 'How to use this forum - please read.' at the top of the section.

Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

Go Up