Switching a 12vdc motor with a transistor

MikeML

Joined Oct 2, 2009
5,444
Yes #14 works. All i want is an on/off fan switch Ian so i'm not bothered about PWM. as i said though i could do with it coming on at a lower temperature so what resistors should i change? Something i've noticed also is that when i'm gently warming the sensor up with the soldering iron underneath, the motor will start slowly at first for a few seconds until it gets even warmer and then it suddenly starts fully, when the motor is running slowly the chip does get warm. it always switches off suddenly when cooling down.
As best as I can figure, with R2=R3=47K and R4=3.3K, it should switch on at R1=48.7K, and switch off at R1=53.6K, which should be enough hysteresis to prevent any chattering. Fitting a ln() function through your three points, I get R1=317534-73079*ln(C), where C is temperature in deg C. At C=40, R1=48K, so it should be turning on at ~40degC.

If it continues to turn on partially, it could be that the 12V is not well regulated? Try increasing R4 to 4.7K.
 

Thread Starter

Rich2

Joined Mar 3, 2014
254
Redone it with the modified diagram and it switches on and off cleanly. is there a way of adjusting the on/off set points? also the fan i want to use is an axial computer fan that takes aroung 400ma. could i use say a TIP31 transistor to increase the current delivery? or would i end up with the original problem?
 

Thread Starter

Rich2

Joined Mar 3, 2014
254
I put a PNP transistor in the output to switch a bigger motor and the same problem returns (it gets hot when off) ... so undetered I put a relay coil on the output and it just won't work with it. It works oppositely if I use ground but won't work between supply and output. the little test motor I'm using, the windings are 39ohms and the relay coil is 620ohms.
I'm thinking the 2 transistor method would be better then. Maybe.
 

Thread Starter

Rich2

Joined Mar 3, 2014
254
If I wire the motor and relay coil in parallel it works again, so it must need a low induction on the output to work, a resistor won't do it.
 

pwdixon

Joined Oct 11, 2012
488
I put a PNP transistor in the output to switch a bigger motor and the same problem returns (it gets hot when off) ... so undetered I put a relay coil on the output and it just won't work with it. It works oppositely if I use ground but won't work between supply and output. the little test motor I'm using, the windings are 39ohms and the relay coil is 620ohms.
I'm thinking the 2 transistor method would be better then. Maybe.
How did you connect the pnp transistor?
 

Thread Starter

Rich2

Joined Mar 3, 2014
254
The base on the output via a 1k resistor, motor between the collector and 12v and emitter to ground.
 

pwdixon

Joined Oct 11, 2012
488
The base on the output via a 1k resistor, motor between the collector and 12v and emitter to ground.
That sounds completely wrong, no wonder it didn't work. You needed the collector to the motor to ground and the emitter to 12V and drive the base through a resistor with either 12V (off) or 0V (on)
 

MikeML

Joined Oct 2, 2009
5,444
Lets deal with the correct way to connect a current booster PNP Power transistor between pin 3 of the 555 and the fan first:

264b.gif


Note that connected this way, the power dissipation in the transistor is determined only by VceSat, and the collector current, and is a manageable 120mW (see red trace), which the transistor can handle without being on a heatsink. It will get noticably warm. Note that the PNP used here must have a collector current rating better than 1/2A.

The base resistor has to be low enough so that the base current approaches Ic/10 = 40mA, which implies R5 should be about 10/0.04 = 250Ω. I made it double that, which is not ideal, but now the dissipation in R5 is <1/4W (see blue trace), hence is has to be rated for 1/2W. It will get quite hot to the touch, but not to worry.
 

MikeML

Joined Oct 2, 2009
5,444
... is there a way of adjusting the on/off set points? ...

Yes, but unfortunately, both R2 and R3 have to be changed at the same time. Refer to the schematic in post #29. Note that when R2 = R3 = 47KΩ, the actual Cutin is when R1 (sensor) decreases through 48.6K. The Cutout is when R1 increases through 53.6K.

Because the switching points of the 555 are at 2/3*Vcc and 1/3*Vcc, with a 12V supply, they would be 8V and 4V, respectively. R1, R2, (R3+R4) form a two-tap voltage divider. Suppose R1 = R2 = R3 (R4=zero, for the moment). That would cause the 555 to switch with no hysteresis at a R1 value such that it is equal to R2 and R3. So, to a first approximation, if you want the thing to switch when R1(sensor) = 100K, then R2 and R3 would also have to be 100K.

To introduce the required hysteresis, add R4 back in and make it about 5% to 8% of R3; done! Note that that will move the CutIn up a bit, but move the Cutout up more, creating the hysteresis.
 
Last edited:

Thread Starter

Rich2

Joined Mar 3, 2014
254
No thinking about it it would need to be in parallel. Anyway IT WORKS! I've used a BC327 and two 220ohm 2w resistors in series on the base. I'll get the proper values and a TIP32 transistor.
 

MikeML

Joined Oct 2, 2009
5,444
Series or Parallel? Depends on if you want the existing circuit to trip at lower or higher temperatures. I'll let you work it out...
 

Thread Starter

Rich2

Joined Mar 3, 2014
254
A 1M ohm trimmer pot in parallel with the sensor seems to work a treat. I've tested it with an ice cube and the range lowers great.. until I got water all over it ha ha. I'm going to rebuild it on veroboard when the new parts come and put it in a small box with the sensor sticking out. We're going to Spain in our motorhome (RV if you're American ) next month and the fan will be coming with us to keep the condenser cool on the absorption refrigerator. Thanks again especially Mike you're a star :)
 

ian field

Joined Oct 27, 2012
6,536

Thread Starter

Rich2

Joined Mar 3, 2014
254
I've been trying the circuit for a couple of hours with various resistors and then a variable resistor in parallel with the sensor to get the cut in temperature down and it's no good, the differential becomes very big and once it's cut in it won't cut out again until the temperature has dropped to something like 20c. Also after a lot of trial and error I've found that the 555 chip itself must be out of calibration as I've swapped it for another and now I measure the cut in temperature at 42c (with the first chip it was sometimes over 50c) and the cut out at 35.
Is it possible to change the resistors in the circuit to give a lower cut in and cut out temperature? Say 5c lower? I don't mind buying some (my TIP32c transistor came in the post today and is working ok)
Thanks, Rich
 

MikeML

Joined Oct 2, 2009
5,444
... The sensor reads:
240k at 3c
90k at 20c
30k at 55c (in my tea this morning )

I want the fan to come on at about 30c....
Ok. Here is a ln() function fitted through those three points. If I solve the function at 30C, I get R= 317534-73079*ln(30) = 68977 or 69KΩ.

R1.gif

I would make R2 = R3 = 68KΩ, and then add R4 somewhere between 2.2K and 4.7K (standard 1% or 5% values).

Plugging those values back into the simulation shows the trip points moved to 69.6KΩ and 74.6KΩ.

If this doesn't work, you will have to measure the actual resistance of the sensor at the temperature you want it to trip!

Refer back to post #31. Just throwing in random resistors is not going to be useful.
 
Last edited:

Thread Starter

Rich2

Joined Mar 3, 2014
254
I've redone it with the 68k resistors and it switches on at 31 and off about 30, but it wasn't switching cleanly with the motor running slowly in between. So I tried a pair of 47k resistors and it's now switching on at 37 and off at 36 which is near enough. I can always move the sensor about to fine tune it. It's switching cleanly now too. Thanks Mike
 

MikeML

Joined Oct 2, 2009
5,444
With the 555, the motor coming on part way can only happen if the 555 is toggling between its two states; on or off, so you are effectively generating PWM, where the output transistor is switching on/off rapidly.

You have two choices: ignore it because it isn't hurting anything, or leave R2 and R3 alone (because they are not responsible), and increase R4 to widen the difference between the switching points.

As to why this is happening, since the motor is an inductive load, I wonder if the inductive kick when the motor turns off is perturbing the Schmitt Trigger? Try putting a rectifier diode (1n400x), anode to GND and cathode to the collector of the PNP Q1. You could also try putting a 100nF capacitor from pin 5 to GND.
 
Last edited:
Top