1. Using transistors to turn things on and off (first LEDs, then motors).
-Transistors help with switching power to devices that require more power or current than what the arduino can safely supply. We are working with a PN2222 transistor.
In the examples below, we are using the transistor to either flash the LED bulb on and off; or fade gradually between 0 and full brightness.
The simple LED blink example that's preloaded into the Arduino IDE works with the transistor; to add the fading component, we simply use a PWM pin to modulate the LEDs invisible blinking at different rates to create different brightnesses.
The same circuit and code as the blinking LED can be used, except for the fact that different values of resistors are used because the two plugins require different levels of voltage.
2. Using relays to control motors
A relay uses electricity to mechanically move a switch so that of two circuits can be connected by it, one will always be on and the other off; or vice versa. When talking about relays, the number of "throws" refers to the possible number of outcomes caused by the relay. An "on or off" possibility would be single throw; more complex possibilities like differing modes is double throw. "Poles" refer to the number of electric paths that can be switched simultaneously.
This is a circuit I made with the relay that came in our kit; I was able to get the relay clicking, which indicated that its switch function was working. However, because it wasn't fitting in the breadboard properly, which caused issues with ground connection, I couldn't get it to control the motor.