Switching with a MOSFET - Page 1
Forum section: electronics / beginners

author: rexxar
author_rank: Frequent Contributor
timestamp: June 28, 2013, 09:33:45 pm
content: I've got a noobie problem here. Basically what I want to do is install a fan in my entertainment center that will automatically turn on when I turn on my PS3. As I see it, I've got a few options in doing this; I could just plug a PC fan into a USB port, but it'll run rather slowly, and not push much air. I thought about connecting the coil on a relay straight to USB, and using that to switch a 12V wall wart, but I'm not sure how well that would work. My last thought is to use some MOSFETs or similar to switch the wall wart. I was thinking I could just put an optocoupler on the 5V from the USB, and using that to drive some FET or other.I've no idea how to go about this, could someone point me in the right direction?

author: Paul Price
author_rank: Super Contributor
timestamp: June 28, 2013, 10:26:02 pm
content: Solution (1)Take an x-box usb port and connect it to a 5V relay coil with a small diode (1N4148) cathode of diode to +5V USB, anode of 1N4184 diode to ground and both leads of the diode across the relay coil. Connect a discarded 12-volt wall wort through the relay contacts to power the fan.Solution(2)Take the +5V wire from a x-box USB port and apply it to the gate of N-chan power MOSFET, connect a 10k resistor gate to ground to keep the MOSFET turned off when the XBox is unplugged. Take a 12v wall wort and connect the - lead to the common USB ground. Connect the +lead of the wallwort to the + wire of the fan, Ground the source of the MOSFET to the USB ground. Connect the - wire of the fan to the Drain terminal of the MOSFET.Solution(3) substitute a 1Amp medium power NPN transistor to replace the n-channel MOSFET. Connect the +5V of the USB port to the base of the transistor with a 1K resistor in series with the base. Ground the emitter of the NPN transistor to the common ground of the 12V wall wart and the USB. Connect the -lead of the fan to the collector of the NPN transistor, As before, connect the +lead of the fan to the +12V output of the wall wart.Solution(4) use a TI boost convertor IC to convert the 5V power from the USB +5 wire from the X-box to +12V to directly drive the fan. Some, but not all, PC power supply fans require just .125 amp at 12V and this equates to a current draw from the USB port at 5V which might be within the power limits of the X-Box USB port for powering a device operation. See attached.(schematic upon request)Solution(5) hack into your X-box and find a 12V power supply point and bring it out to supply the cooling 12V fan. If your X-Box has a DVD/CDROM drive, it has a 12V supply powering it, so easy to locate this power point.

author: cthree
author_rank: Frequent Contributor
timestamp: June 28, 2013, 11:04:08 pm
content: Your configuration would be more useful if it was temperature variable but if you just want a simple on/off then use the 5V from USB of the PS3 to drive the gate of an N-channel MOSFET connected to the low-side of the fan which would be driven from a separate 9-12V wall wart supply. Pull the gate to ground with a resistor to make sure the fan shuts off when the PS3 does.As an alternative, Use the 5V to drive a 555 timer configured for PWM driving the gate of the mosfet and use a pot to adjust the speed. It will be impossible to control the speed (and noise) of the fan with voltage alone.As a third option, us a thermistor instead of a pot to variably change the speed of the fan with temperature assuming the device is in the same space you are ventilating.

author: rexxar
author_rank: Frequent Contributor
timestamp: June 29, 2013, 01:08:18 am
content: For some reason, when I hooked up the USB directly to the transistor, the fan would twitch, and the USB port on my computer would die (a reboot fixed it). Works fine when I use a USB wall adapter, so there must be some sort of noise going back up the USB cable or something? The only 12V wall wart I had to hand was an extraordinarily crappy no-name brand. I'm rather paranoid about this console, so I'd like to use an optoisolator. How should I set that up?

author: cthree
author_rank: Frequent Contributor
timestamp: June 29, 2013, 01:13:42 am
content: What FET are you using? You may be drawing too much current from the USB but without any specifics it's hard speculate.

author: rexxar
author_rank: Frequent Contributor
timestamp: June 29, 2013, 01:25:50 am
content: Quote from: cthree on June 29, 2013, 01:13:42 amAn NPN transistor was the first thing I found in my parts box, so I went with that. I'm using a Toshiba d235.

author: cthree
author_rank: Frequent Contributor
timestamp: June 29, 2013, 01:54:04 am
content: This one?http://datasheet.octopart.com/2SD2352-Toshiba-datasheet-10902625.pdfVbe is Max 1V

author: Unknown
author_rank: Unknown
timestamp: June 29, 2013, 02:58:29 am
content: My first thought was to just use a relay attached to the power cord, maybe through an inductor. When enough current is flowing, it energizes the relay, and the fan goes. Seems like it would be an extremely simple circuit.

author: rexxar
author_rank: Frequent Contributor
timestamp: June 30, 2013, 10:49:37 pm
content: I really wanted to use an optoisolator, just out of sheer paranoia, as this isn't my console. I certainly don't want 12V going up the USB ports. Attached is a schematic of what I've done. My parts choice was basically whatever was at the top of my junk bin. This setup seems to work quite well, I'm happy with it, and it keeps the PS3 from overheating.