Brief introduction and looking for assistance designing PWM for automotive blower motor

Thread Starter

Spook50

Joined Jul 16, 2020
9
Hello folks. Brand new to the forum. I have an AA in Electronics Engineering from ITT Tech in 2015 and even though I don't work in engineering I've been recently getting back into a few projects I've put on the back burner due to life catching up to me for the last several years.

I have been working on ways to update and modernize some of the electrical in late 80s & early 90s era Toyota trucks. Currently I'm trying to find a way to better control the speed of the cabin blower motor using a PWM that can support 30A capacity and would eliminate the current limiting resistor (which in the OEM design is used to control the fans speed) but still allow for use of the factory switch to control the PWM for the five desired settings (off, 25%, 50%, 75% and 100%). Its been several years since I finished my electronics engineering course, and given I didn't go beyond an AA, more advanced circuit design is still very much a challenge. I also could not (still can't) write code to save my life, so unless I can develop a PWM that can be built without having to manually program a controller, I fear I may be out of luck. I'm hoping someone can steer me in the right direction or provide some guidance to help me get started on figuring out a design that could be made to work.

Any assistance would be greatly appreciated!
 

Papabravo

Joined Feb 24, 2006
21,159
Hello folks. Brand new to the forum. I have an AA in Electronics Engineering from ITT Tech in 2015 and even though I don't work in engineering I've been recently getting back into a few projects I've put on the back burner due to life catching up to me for the last several years.

I have been working on ways to update and modernize some of the electrical in late 80s & early 90s era Toyota trucks. Currently I'm trying to find a way to better control the speed of the cabin blower motor using a PWM that can support 30A capacity and would eliminate the current limiting resistor (which in the OEM design is used to control the fans speed) but still allow for use of the factory switch to control the PWM for the five desired settings (off, 25%, 50%, 75% and 100%). Its been several years since I finished my electronics engineering course, and given I didn't go beyond an AA, more advanced circuit design is still very much a challenge. I also could not (still can't) write code to save my life, so unless I can develop a PWM that can be built without having to manually program a controller, I fear I may be out of luck. I'm hoping someone can steer me in the right direction or provide some guidance to help me get started on figuring out a design that could be made to work.

Any assistance would be greatly appreciated!
There are a couple of steps:
  1. You need to familiarize yourself with oscillator circuits, particularly the triangle wave or sawtooth oscillator.
  2. You need to learn about comparator circuits, Schmitt Triggers, and how to set the thresholds.
  3. Then you can combine these things to do a hardware PWM control
There may be alternative strategies, but that is where I would start. Actually, that is not true, since I spent most of my career writing software and firmware, I'd do it a bit differently.
 

Thread Starter

Spook50

Joined Jul 16, 2020
9
There are a couple of steps:
  1. You need to familiarize yourself with oscillator circuits, particularly the triangle wave or sawtooth oscillator.
  2. You need to learn about comparator circuits, Schmitt Triggers, and how to set the thresholds.
  3. Then you can combine these things to do a hardware PWM control
There may be alternative strategies, but that is where I would start. Actually, that is not true, since I spent most of my career writing software and firmware, I'd do it a bit differently.
Thanks for the response. I faintly remember covering oscillator circuits before, so I'll be sure to read up on them and see if there's anything that rings any bells for me to use as a jump-off point to better familiarize myself with them. Same with comparator circuits (but I seem to remember picking up the details of those fairly well when I was in school). The factory 5-position switch uses a 5 terminal connection and a combination of continuity between certain terminals to send current through the OEM resistor. One of the terminals on the switch is for an ignition switched +12V lead, but I'm wondering if I would be better suited having the PWM detect which combinations of terminals have continuity between them (which is the way I'm leaning for the sake of better creating a close to "plug & play" solution for integrating the factory switch) to dictate which duty cycle is output by the PWM, or which terminal combination on the PWM would be receiving +12V from its connection to the switch.
 

KeithWalker

Joined Jul 10, 2017
3,063
This circuit is good for 30 amps. The potentiometer VR1 could be replaced with a four 2.7K resistors in series tapped for connection to the speed selector switch:
Motor Speed Controller.jpgRegards,
Keith
 
Last edited:

crutschow

Joined Mar 14, 2008
34,285
still allow for use of the factory switch to control the PWM for the five desired settings (off, 25%, 50%, 75% and 100%).
How does that switch work?
Is it a simple rotary switch with a common connection to one of four outputs with the Off position open?
 

Thread Starter

Spook50

Joined Jul 16, 2020
9
How does that switch work?
Is it a simple rotary switch with a common connection to one of four outputs with the Off position open?
I believe that's the case, which makes me hope I can have the PWM set up with a way to detect which of four teminals gets continuity with the common terminal to dictate what duty cycle to output to the motor. I haven't had a chance to sit down and verify its function with my multimeter or the factory service manual's wiring diagram yet though. Been juggling my kids with packing the salmon I caught earlier this week lol

@KeithWalker that looks pretty close to what I'm hoping I can make work to control my blower motor. Once I verify the function of my OEM control switch I can find out if that'll work. Hopefully it will because it looks much simpler than what I was hoping I'd end up having to do!
 

crutschow

Joined Mar 14, 2008
34,285
Below is the LTspice simulation of Keith's circuit, with some minor modifications to function with your switch (as how we think it works).
I only had a 3-position switch with no off position, so I used that for the sim but, of course, yours will be 5-position.
To simulate the OFF position, S1 was added in series with the switch

The three switch positions give a 25% duty-cycle (bottom red trace), 75% duty-cycle (yellow trace) and (near) 100% duty-cycle (blue trace).
(For the five-position switch you would add another 5k resistor to give duty-cycles of 25%, 50%, 75%, and 100%.
(These values may need to be tweaked to get the desired motor speeds in the real circuit).

As you can see the output goes low (OFF) after the switch (top red trace) opens.

Note the connection of the timing C2 timing capacitor in parallel with R2 connected to the 12V.
This insures that the pin 2 will remain high and not trigger the 555 output to go high when the switch is off.

The shown switch position is for (near) 100% duty-cycle.

The output must be connected to a MOSFET to drive the motor, as Keith's circuit shows.

1595052476128.png
 

Thread Starter

Spook50

Joined Jul 16, 2020
9
Below is the LTspice simulation of Keith's circuit, with some minor modifications to function with your switch (as how we think it works).
I only had a 3-position switch with no off position, so I used that for the sim but, of course, yours will be 5-position.
To simulate the OFF position, S1 was added in series with the switch

The three switch positions give a 25% duty-cycle (bottom red trace), 75% duty-cycle (yellow trace) and (near) 100% duty-cycle (blue trace).
(For the five-position switch you would add another 5k resistor to give duty-cycles of 25%, 50%, 75%, and 100%.
(These values may need to be tweaked to get the desired motor speeds in the real circuit).

As you can see the output goes low (OFF) after the switch (top red trace) opens.

Note the connection of the timing C2 timing capacitor in parallel with R2 connected to the 12V.
This insures that the pin 2 will remain high and not trigger the 555 output to go high when the switch is off.

The shown switch position is for (near) 100% duty-cycle.

The output must be connected to a MOSFET to drive the motor, as Keith's circuit shows.

View attachment 212395
Okay cool, that I can begin to understand (beginning to realize just how much I've brain dumped in the last few years). I haven't dealt with FETs of any kind since school though, so I'll have to read up on them again for using in an application like this.

As it turns out, the switch operates much differently from what I assumed it would (late 80's Toyota design. Aggravating stuff). The wiring diagram didn't tell me anything about this particular switch's function, so I had to use my multimeter to figure it out. I attached a pic of the switch's connector and labeled the pins for the sake of illustration. When off there is no continuity between any terminals. 25% there is continuity between terminals 5 and 1; 50% between 5, 1, 4; 75% between 5, 1, 3; and 100% between 5, 1, 2. I suspect this could complicate the control end of the PWM more than originally expected.

Blower Switch Pinout.jpg

I'm really wishing now I had been able to continue on to get my BA. As it is now I've retained just enough knowledge to get myself into trouble lol
 

LesJones

Joined Jan 8, 2017
4,174
I think using a small microcontroller such as a PIC12F1840 would be the simplest hardware solution. Pin 5 on your switch connector could be the 12 volt + input. Pin 1 could control the power to the circuit which would by default give 25% output with pins 2, 3, 4 open. Pins 4,3,2 could control the input to three I/O pins on the microcontroller to select 50%, 75% and 100% duty cycle. This (And many other) microcontrollers have built in PWM hardware so an output on the microcontroller could drive the gate of a logic level power mosfet to do the actual switching.

Les.
 
Last edited:

LesJones

Joined Jan 8, 2017
4,174
Hi cruts, It may not be too messy using your circuit from post #9 and adding a quad bilateral switch (CD4066) to select duty cycle setting resistors. I have not worked out the detail. The control switch terminals 4,3,2 could each drive one of the bilateral switches to increase the duty cycle from the 25% preset value to 50%, 75%, 100%. This would not be as simple and low cost as the microcontroller solution.

Les.
 

Thread Starter

Spook50

Joined Jul 16, 2020
9
I think using a small microcontroller such as a PIC12F1840 would be the simplest hardware solution. Pin 5 on your switch connector could be the 12 volt + input. Pin 1 could control the power to the circuit which would by default give 25% output with pins 2, 3, 4 open. Pins 4,3,2 could control the input to three I/O pins on the microcontroller to select 50%, 75% and 100% duty cycle. This (And many other) microcontrollers have built in PWM hardware so an output on the microcontroller could drive the gate of a logic level power mosfet to do the actual switching.

Les.
It seems like that would be the cleanest way to make it work. I was up late last night studying up again on using MOSFETs in conjunction with a PWM to control a 30A capacity DC circuit. A friend of mine suggested just controlling a pair of MOSFETs with an Arduino (I think he was bagging on my skill level, but didn't realize how accurate he was lol), but given this is something I'd like to make kits out of if I can finalize a good reliable design (rather than a one-off that only I would use) I'd rather have a design that I can order bulk components for and build it in my shop.

The way you explained using the PIC12F1840 sounds like it would be the most effective way to integrate the OEM switch (while also retaining the safety kill circuit for the A/C compressor that keeps it from switching on unless the fan motor is running). I'll read up on it and see how well I can grasp its operation and use.

I think the CD4066 switch with a 555 would probably be easier for me to figure out, but as you pointed out, the final result wouldn't be as simple or cost effective as the microcontroller. I'd rather spend the time and resources to figure out the PIC12F1840 and test & finalize designs based on that, for the sake of a simpler circuit and smaller number of components.
 
Last edited:

LesJones

Joined Jan 8, 2017
4,174
It could be done with an Arduino but it is very much overkill. The PIC12F1840 (Or the PIC12F683 that peterdeco uses.) are 8 pin devices. You would also need a 5 volt regulator (Say a 7805) and a few resistors and capacitors and the mosfet. It is possible that peterdeco may share the source code for his unit to get you started. The nearest code I have written is for a PIC16F786 (And also a version for a PIC18F2431) but is much more complex than the simple code you would require. It is for a closed loop PID motor speed controller to drive the X axis table feed on my milling machine. You can have a copy of this but there is so much code to do the calculations for the PID algorithms and serial communications to allow tuning the PID loop that you may find it difficult to extract the small amount of code for the PWM. If you can wait until winter (In the UK) then I can probably write some code to do what you want.
Les.
 
Top