Hi all. I was watching a video Arduino Tutorial (LM35 Temp Sensor) - YouTube on Youtube. Basically the guy connects a temperature sensor to an Arduino and then connects an led, fan, and servo to a breadboard that will all react when the temperature gets above a certain point. He designed this to cool down his entertainment center when it got too hot. I'm not sure if he doesn't read posts or not but I have not heard back from him on a couple of questions I had concerning the video. Could someone please take a minute to watch the video and answer my questions. I would appreciate it very much. Here is my post:
Hello. Great video!! I learned a lot from this video. Sorry for a rather lengthy post... Just a couple of stupid questions (newbie here ;). What would happen if I didn't use the transistor for the fan? Would it cause a component to overheat and burn up or would the fan not work or would it just run slowly? What if you hooked up the led, fan, and servo just using the arduino 5v power? Would it burn up the board? I'm still trying to understand transistors and why they are used. Why do you hook up the 3.3v power if you're just using the 5v? Why did you plug the positive terminal of the fan to the digital pin? Was it just to show that the digital and analog pins can be used to supply 5v power? Could you have just connected the positive lead to the power rail of the breadboard? What would have been the difference? Thanks for taking the time to explain this to me. Have a great day!?
Draw a schematic by hand and take a photo of it and post it. It is not practical to ask people to watch a video. You watched it so you should be able to draw the schematic and ask your questions. We need circuit voltages and specs for the fan.
That guy bored me to tears after 3 minutes so I can't answer all the questions, but here goes on the use of the transistor. If you had switched the fan off and on directly on the fan's power wire from the Arduino, yes you're right: probably melt something. I don't know what the fan he used draws as current, but almost certainly more than the 40mA max (20 recommended) that an i/o pin can supply.
The transistor is the switch then, in a separate circuit providing external power to the fan: the Arduino i/o pin switches the transistor's so-called "base" pin. The base pin in turn, closes the circuit inside the transistor and allows current to flow between the "collector" (which is hooked up to the fan and ultimately to V+) and the "emitter" which goes to ground.
You can read about transistors here, and this shows an Arduino / transistor example.
So the fan and other components that draw more than 40mA could damage the Arduino because they are trying to draw more power than the Arduino can supply? I just assumed that the Arduino would only put out as much power as it could and nothing more. I guess I understand that the transistor is sort of similar to a relay in that it is a buffer from a low power circuit to a higher power circuit. At one point he connected the fan direct to a 9 volt battery but still went through the transistor.