Hi everyone,
can you please tell me how to make this schema as safe as possible?
What I mean is that I want to know if I should connect a diode, resistor or an voltage regulator somewhere here? I've read about a resistor between the transistor base and Arduino, but don't know if its only for getting apropriate voltage on the base or if its responsible for something different.
When Arduino is connected with my PC, and I turn the power on (the transformer at the right side of the schema), I hear that Windows "new USB device" sound and Arduino restarts... Do you know what I mean?
Assuming the collector/emitter are connected correctly(polarity wise) there should be a resistor(~1k) from the arduino the base (the middle one, I'm assuming), and the ground from the arduino to the ground on the battery(I think that's the thing in the top right). You also need a diode in reverse in parallel with the motor(in other words, the diode is across the motor's leads and when the motor is on, current will not flow through it)
OK guys, here is the diagram in which I included your suggestions. Please check it.
Do I need to put a capacitor in paralel with the diode to prevent from noise?
Also, what do you think about using an optocoupler between Arduino and transistor base?
war_spigot, how do you know that the value of the resistor should be 1k?
~~That seems to be good unless I'm missing something. ~~
Edit: yes, the Arduino GND should go to the emitter(so it's on the same row as the battery GND)
Rubid: war_spigot, how do you know that the value of the resistor should be 1k?
I have a lot of 1k resistors, so I always use those. It limits current to the base, but you need enough current through the base to allow current from collector to emitter. The current needed would be based on the current that will be drawn and the current gain of the transistor. If you're putting it in a project you might want to use the most optimal resistor, but just to test something, it doesn't really matter(others may say differently, but that's just my opinion.)
I don't think it's right. What is the polarity of the wires from the power supply? If the yellow wire is + and the black wire is GND, you seem to bypass the transistor, assuming that the PSU's GDN is connected to Arduino's GND as it should be. How do you power the Arduino? Do you use the same PSU?
Yes, as pekkaa says, your Arduino ground and your power supply ground should be connected. Move the black wire that goes to the Arduino ground to the other outside leg of the transistor, so that the power supply ground and Arduino ground are wired together.
Also, are you sure you have the transistor wired correctly? What transistor is it?
Now it seems right Btw, have you check from the transistor's data sheet how much current it can handle? If the motor draws 10W@9V, it means a little over 1A. 1A is the maximum for many common transistors, such as BC 639.
You've scared me peakkaa!
I checked that before I bought this components... My mistake is of course on the schema, because this is a 0,5W DC motor - not a 10W DC motor So it draws a little over 0,05A, not 1A So my transistor is appropriate. Uff...
If we are already talking about transistors - how can I know what is the best (safe &efficient) base current for a transistor? In the datasheet I have only collector current in the "Absolute maxiumum ratings" table. There is nothing about the typical base current.
AWOL, I will check it personally tomorrow, when I will be able to access the lab
My friends says that its a 0,5W motor so I trust him. Its also hard to calculate the current, because on the power supply, there is a small potentiometer and the maximum voltage is 9V, but usually we are using about 5-6V.
The transistors maxiumum collector current is 100mA, so when voltage equals 5V we can use a max 0,5 W motor. As I said - I will check it personally - if the motor power is greater I will replace the transistor.
But maybe you're right - even if it is a 0,5W motor I can't use a transistor with maximum collector current equal my current. I will search for another one.
If we are already talking about transistors - how can I know what is the best (safe &efficient) base current for a transistor? In the datasheet I have only collector current in the "Absolute maxiumum ratings" table. There is nothing about the typical base current.
The current gain of a transistor is called the beta. You should see a minimum beta listed on the spec sheet, and there might be a curve showing beta over a range of operating conditions. Typical beta is about 100.
You want to saturate the transistor... you don't want to turn it partially-on, or you can overheat it. That means if your motor needs 50mA* (max), the base of a transistor with a beta of 100 would need 1/2mA minimum. It's best to pump a little extra current into the base to make sure it's saturated. Once the transistor is fully-on (saturated), the current is limited by the load and increasing base current does not increase CE current.
if you don't have the beta for the transistor, design for a beta between 20 & 50, and you should be OK.
Double check that. Again, if you don't allow for enough current, the transistor won't saturate and it may overheat.