I have a usb device powered from usb (5V).
I want my device to turn on/off another device running on 12V.
What is the proper way of doing it?
My idea on how to do this is:
are you going to use a mosfet of a transistor, especially in the transistor case you have to add a base resistor to limit the current?
the gnd can be connected , no problem with that.
What kind of load will you drive, how much current?
Yes, I was thinking about mosfet, of course will add all the necessary resistors.
My 12V dev is an electro-lock, 350mA.
I think I should also add protection diode in parallel, right?
@johny
I need way more current, but thanks anyway.
If you are using a mosfet the resistor is not too important (I assume a small mosfet) but you can still add a 10K resistor.
Yes you can add a diode across the lock.
1)So, generally this is a good way of switching 12V circuit, right?
2)Is bjt better than mosfet (or vice verca) for this purpose and why?
3)Is there any better way of achieving this, and why?
A mosfet is better, you will have a much lower voltage drop across the source-drain (compared to emitter-collector)
The gate needs some current to charge (can be very small since there is no fast rate switching) and then doesn't pull current any more while in the transistor case you need to provide a constant current to the base that should be at about 1/10 to 1/20 of the output current to set the transistor in saturation.
3) Is there any better way of achieving this, and why?
The only other way i can think of is with an optocoupler in which you will have a complete physical isolation between the two device, I don't think that you need it in this case
Alex
P.S I'm charging you three answers for that although they were asked in a single post :-D