N00B questions after reading Getting Started

Hi,

My Getting Started With Arduino book arrived yesterday, and I'm hoping my Arduino beginners kit will arrive today - I'm very excited!

However, after reading the book last night, I find I don't understand the electronics aspect - the programming I'm fine with. I have a few questions to pose regarding circuits in the book - I hope I'm not breaking forum etiquette by posing them all in one post, but here I go...

Page 43 Figure 4-6 The circuit shows a wire coming out of 5V and into a push button. There are then two wires coming out of the push button, one going directly to pin 7 and the other going to Ground via a 10K resistor.

Why two wires, and why the resistor? Why not just one wire to pin 7?

Page 58 Figure 5-4 The circuit shows a wire coming out of pin 9 (which I assume will provide power on a digitalWrite?) into an LED. There is then a wire coming out of the LED to Ground via a resistor.

Again, why the resistor? Previous examples show an LED connected to pin 13 and Gnd without a resistor - why does this one need a resistor? What purpose does it serve?

Page 71 Figure 5-7 The circuit shows a wire coming from 9V to the middle pin on a MOSFET transistor (the collector I assume?) via two routes - one via the motor on a fan, and the other via a resistor. There's then a wire from pin 9 to the transistor (base?) and a wire from the final pin (emitter?) to the Gnd.

I get the feeling the answers to the first two questions will answer this one for me: Why the two routes from 9V to the resistor?

In my limited knowledge of electronics, I understand a simple circuit: electricity flows from one terminal of a battery through a few components and back to the other terminal. I can't understand how the Arduino board provides 3V, 5V and 9V pins, yet they all go back to the same Gnd pin.

If I were to connect a 9v battery to a motor and to the collector and emitter of a transistor, would I be able to use a pin on the Arduino to switch the transistor on and off? What would I connect to Gnd?

Finally, can you recommend a good site for beginners electronics that I can read articles covering all these things?

Thanks, A VERY excited Arduino convert!

Why two wires, and why the resistor? Why not just one wire to pin 7?

A button is a switch, it switches a path for the electricity to flow through, so one wire to flow in and the other for it to flow out. You wouldn't have a radiator in a central heating system with only one pipe in to it would you? The resistor is to limit the flow of current without it you have a dead short and a lot of current flowing and things will not work.

MOSFET transistor (the collector I assume?)

No a Mosfet has a Gate, Drain and Source, a Transistor has an emitter Collector and Base. Sorry as I haven't got the book I can't answer the specific point without seeing a drawing of the circuit.

Again, why the resistor? Previous examples show an LED connected to pin 13 and Gnd without a resistor

All LEDs need a resistor to stop them drawing too much current and burning out, it just happens that Pin 13 has a resistor built into the board so you don't need to add one.

If I were to connect a 9v battery to a motor and to the collector and emitter of a transistor, would I be able to use a pin on the Arduino to switch the transistor on and off?

Yes please see http://www.thebox.myzen.co.uk/Tutorial/Power.html and http://www.thebox.myzen.co.uk/Workshop/Motors_1.html

an you recommend a good site for beginners electronics that I can read articles covering all these things?

Our very own playground:- http://www.arduino.cc/playground/Main/InterfacingWithHardware

Lady Ada's Arduino tutorials are really good.

They explain in details exactly the concepys you ask about.

Thanks guys, I feel like I'm starting the get the hang of this now. Clearly the resistor in my first question was a pull-down resistor.

While the concept of pull-down/up resistors is starting to become clear in my head, I'm still confused about how they work in the circuits. For example, take figure 5-6 in this tutorial:

http://www.ladyada.net/learn/arduino/lesson5.html

So when the switch is closed, the current flows from the 5V pin through the 10K resistor to the GND? Does that mean only a small amount of current flows through it because of the high resistor? Does any of the current flow to Pin2? Where does Pin2 go to? I was under the impression a current flows from a positive terminal to a negative terminal - does this mean Pin2 flows to Gnd?

When the switch is open the current flows from 5V to Pin2?