Project 02 (Spaceship Interface)

I'm making my first steps in the world of electronics, so I'm quite a beginner and still don't understand many of the basic concepts.

I was watching the circuit of project 2 and I don't understand what's the purpose of the 10K resistor. What would have happened if the resistor wasn't there?
Could I have also placed the resistor "before" the button, i.e. between the 5v power source and the button?

Thanks,
Eli.

I haven't seen the project circuit, but you said it was connected to a button, so it's probably a pull-down resistor.

Hi cepa, thanks for you reply.

No need to see the circuit. Let's say I have this: 5v -> button -> 10K resistor -> ground.

As I mentioned in my post, I'm a beginner and I'm not familiar with the term pull-down/pull-up.
So I've googled it, and from what I understand if we didn't have this pull-down resistor, then the current will be "floating" and not stable. We use this resistor only to stable the current?
Could I cause a short circuit if there was no resistor at all?

Thanks,
Eli.

Your diagram is missing where the connection to the Arduino is.

Your current diagram only shows a button "shorting" the 5V to Ground through the 10K resistor. So yes you will create a short circuit if you ommit the 10K resistor and press the button.

Excuse my rudeness to continue another man's post from 2012, but it would be great to know a little bit more than just the explanations given in the projects book. ;D

This is the schematic for the project:


The Arduino's 5V is connected to a push button which has a 10k resistor afterwards and

  • a connection to the Arduino's digital pin 2 (as an input in order to check if your push button is pressed or not)
  • a connection to the Arduino's ground

Then 3 LEDs (2 red, one green) are connected to the Arduino's digital pins 3-5 (as outputs to supply the LEDs with voltage).
Each of the LEDs has a 220 ohm resistor in series which is then connected to the Arduino's ground.

Now my questions (and respective assumptions):

  • Why do we need the 10k Ohm resistor as a pull-down resistor after the push button and what would happen if we left it out?

  • Why is it necessary to define the digital pins 3-5 as inputs? wouldn't it also be possible to just use the Arduino's 5V to supply the LEDs with current? (Maybe to be able to make them blink individually?)

  • The LEDs and the resistors are in series. Why don't we need to put the resistors before the LEDs and why apparently does the sequence in a series circuit not matter?

  • I'd like to find out what the smallest resistor value would be for this circuit. How can I calculate the resistors needed value with the formula R = U / I? (U must be between 1,6V and 2,2 V for a red LED, correct me if I am wrong, but what is the value for I?

  • I would also like to know the same for the pull-down resistor: what would be the lowest value for this resistor and how can I calculate it? R = U/I : U should be 5Vs but how can I find out I?

  • What's the lowest voltage that can come out of the digital inputs and what is the highest (5V?). Is it possible to tell the Arduino a fixed value coming out of the digital inputs?

Thank you very much in advance for helping me! :slight_smile:

Caveat: I don't have the kit, or the book.

  • Why do we need the 10k Ohm resistor as a pull-down resistor after the push button and what would happen if we left it out?

If you left out the resistor and with the switch open, the input to the processor would float, which means that sometimes it might read as HIGH and others as LOW.
The pull-down ensures it reads LOW when the switch is open.
A cheaper option is to invert the switch logic, and use the processor's free built-in pullup resistors, which ensure the input reads HIGH when the switch is open.

  • Why is it necessary to define the digital pins 3-5 as inputs?

I don't have the code, but I'd expect them to be outputs.

wouldn't it also be possible to just use the Arduino's 5V to supply the LEDs with current? (Maybe to be able to make them blink individually?)

The 5V is on all the time, so the LEDs would be too.

The LEDs and the resistors are in series. Why don't we need to put the resistors before the LEDs and why apparently does the sequence in a series circuit not matter?

It doesn't matter here where you put the components, the important thing is that they are in series.

I'd like to find out what the smallest resistor value would be for this circuit. How can I calculate the resistors needed value with the formula R = U / I? (U must be between 1,6V and 2,2 V for a red LED, correct me if I am wrong, but what is the value for I?

Until you're happy that you're not going to damege either your LED or your microcontroller, it's safest that you don't experiment.
However, subtract the forward votage of the LED from the supply voltage, and divide by the maximum forward current for the LED, making sure that his value is nowhere near the absolute maximum 40mA for a single I/O pin.

I would also like to know the same for the pull-down resistor: what would be the lowest value for this resistor and how can I calculate it? R = U/I : U should be 5Vs but how can I find out I?

A pullup or pulldown wouldn't normally be less than about 5kohms.