Fan control with TMP36

Ok, here's what I'm thinking of setting up next. It's basically a fan control, that uses a TMP36 (says TMP66, that's a typo) to sense when temperature is above a certain range. I use a KN2222 transistor to switch the fan on and off, using one of the digital outputs on the Arduino Uno board. There's a 220 - 250 ohm resistor on the Arduino output to limit the current to the allowed 40 mA.

First thing I'd like to verify, the fan runs at 220 mA, 12VDC. So on the breadboard I have a 12VDC input. The Arduino would run off 5VDC power on the USB port. And I'm guessing what I have to do to get them to work together correctly is to tie the GND pin from the Arduino to the 12VDC GND on the breadboard. Correct?

At 220 mA, the KN2222 needs 22 mA to switch according to the datasheet, so I shouldn't need to use something bigger like a TO120.

The rest is just output from the KN2222 to the fan, and a diode and capacitor for protection across the fan terminals. I've got some 1000 uF caps around and a couple of 1N4001 around, I was thinking of using those. Probably overkill, but they're doing nothing in the drawer anyway.

I might add PWM later for the fan speed and maybe a couple LEDs to show fan status (off - low - high), off more output pins on the board. But I haven't really thought it through much.

So, any comments on the design? Any components or connections you see I might have trouble with? I might have messed up BCE connections in the drawing, that would be corrected when breadboarding.

Playing around with my fan control idea, still working on the switching circuit before I hook it up to the Arduino. Here's a model I was working on:

12VDC supply runs the fan, 9 VDC controls the transistor switch. 9V is simply because I had one of those around. Could just as well be 3V or 5V in the case of the Arduino pin. The rest of the stuff at the fan is simply protection circuitry. Both 9VDC and 12VDC are tied into the same ground line on the breadboard.

50 ohm is once again, what I had around (2x100 ohm in parallel). At 9V current is around 190mA (too much for switching, but I'm just testing for now), for arduino I'll take it up to 150 ohm or so to limit the current to under 40 mA.

So here's the part I'm stuck at. I build it, and turn it on. The fan runs at moderate speed. I measure the voltage at the emitter, I'm seeing about 9 volts. Vce is 3 volts. Vbe is 0.7 volts. I can't get the output voltage higher (and fan speed faster). Except... if I feed the base from the 12 VDC line, there I get Vce down to around 0.7V and full speed on the fan.

So does that mean that when I connect the arduino I'm going to get an even slower speed on the fan? Or is there something I can modify to solve the problem? The 2 power source thing is mainly since I plan to run the fan off a supply, and the arduino off USB, so there's going to be 2 supplies. Connecting them both to 12VDC is pretty much out, since the fan is in one place and the arduino in another.

Here's the datasheet for the transistor: http://www.datasheetcatalog.org/datasheet/kec/KN2222_A.pdf Also tried with this other transistor, same results: http://www.datasheetcatalog.org/datasheet/kec/TIP41C.pdf

Why don't you connect the load (i.e. your motor) on the "collector" side, so the emitter is connected directly to ground.

And for that matter, might as well use a "logic level" Mosfet. You can connect the "gate" of the mosfet (via small 100R) directly to Arduino output pin (or other cmos output pin).

Then you can connect the Mosfet's (Drain/Source) to your 12Volts (or whatever) voltage source to power your load, and the Gate is turned on/off by your logic circuit (with it's own 5V supply voltage).

Put the NPN transistor on the other side of the motor with the arrow pointing to Gnd.

What's the 20uF cap for?

There's at least 2 problems here. First, the 2N2222 cannot really supply so much current realistically. Better to use a MOSFET for this ckt.

Secondly, you have the 2N2222 hooked up as an emitter follower, which means the highest voltage you can get on the motor is (9V - 0.7V) = 8.3V, and not 12V. Much better to use an inverter ckt instead, eg

http://www.picotech.com/applications/pwm_drivers/#chap8 http://www.electronics-tutorials.ws/transistor/tran_7.html

That got it! Changing "sides" took it to full speed. Thanks for the idea :D

The capacitor is a shot in the dark, mostly. I'm thinking it might help to eat up any electrical noise the fan might generate, as well as keep the system going during spikes or stalls. Not sure if it's really necessary or if the diode simply takes care of it all.

As for the KN2222 current limitation, I upgraded to a TIP41C I had in the junk box. That one's got a 6A Icmax, so it shouldn't complain. I'd never thought of working with MOSFETs, mainly since the application is so simple (just on/off). I'll be sure to check out those links and see what they can do!

Use a 0.1uf if you're worried about it.

The diode is for flyback protection.

The mosfet is voltage driven, while a transistor is a current driven device. For this purpose, a "LOGIC LEVEL" mosfet is really more appropriate (to be driven by the arduino's output).

Yeah, the diode really only does anything when the motor is switched off, and has no effect when motor is running. It quenches the reverse inductive spike, which can be huge, more than 100V.

Rather than putting a large cap across the motor, it's normal to put it at the Vcc terminal, along with a bypass cap. Some people will use a bypass cap [small value, 0.01-0.1 uF] across the motor terminals.

Topics merged. It's more helpful to stick with one basic question in one thread.

  • moderator