DIY Fan Controller

Discussion on Turbo electronics including Boost Controller, Turbo Timers, WideBands, etc
Post Reply
basic
Dont Question My Nissan Knowledge
Posts: 663
Joined: Mon Jul 27, 2009 11:03 pm
Location: Eastern Iowa.

DIY Fan Controller

Post by basic »

Not sure if anyone has done this before - or anything like it - so I thought I would post here and get some input as well as post my findings when I get them

Here's the background - need an electric fan solution for my KA swapped S12. DIF doesn't make controllers anymore, and I want to be able to switch high/low or dual fans. So here's my idea(s). (I have a ver 1.0 and 2.0 already planned).

Using an arduino, I'm going to read the signal from the stock ECU temp sensor. This will then take that voltage (somewhere between 0 and 5V) and compare against a value set either a) by the code or b) by a potentimeter that you can adjust to change the kick in temp.

After this happens (ie it's above whatever temp you want the fans to kick on) it will send a signal out to a circuit to turn on a relay to turn the fan on. There would be a 2nd temp set that could be for the 2nd fan and/or fast speed. Additionally - I plan to add an override switch that if on, will turn both fans on.

The nice thing about this is the total cost should around $20 to $25 (~4 for each relay, ~8 for the arduino nano, and maybe $3 in electronics and maybe a few bucks for an electronic enclosure). This cost is of course in addition to the cost of the electric fans.

The 2.0 version will incorporate true variable speed fans by using a SSR and using the arduino to output a pulse width single to the SSR depending upon temperature. This would also have a bypass switch for always on operation.

Total cost for 2.0 would likely be closer to $60, depending upon the SSR used.

I'm going to do version 1 first to see if it's even possible, and then maybe work on version 2.

I'm new to arduino, so it may take a bit to get everything correct, and my code may be ugly and inefficient, but I will post here my progress and code when it's all finished.

Now I just wish the guys at the local salvage yard would call me back about that Taurus fan I called them about.
'87 200SX Hatch - complete with KA24DE swap.
'91 240SX hatch complete with super rare sunroof insert and bag.
chubbza5 wrote:Well hey, truck engine + truck turbo, why not!
cmj
240sx Wannabe
Posts: 129
Joined: Fri Jun 27, 2008 3:12 am

Re: DIY Fan Controller

Post by cmj »

FYI the coolant signal isn't a voltage but a resistance. You will need to create a voltage divider with another resistor and use THAT voltage with the arduino. Might I suggest an arduino pro mini.

Let me know if you need any help!
cmj
240sx Wannabe
Posts: 129
Joined: Fri Jun 27, 2008 3:12 am

Re: DIY Fan Controller

Post by cmj »

Also remember to drive your relay with a transistor. The arduino can't safely handle the coil current to activate the relay.
foreverdeath
Learners Permit
Posts: 15
Joined: Thu Dec 27, 2012 12:20 pm

Re: DIY Fan Controller

Post by foreverdeath »

cmj wrote:FYI the coolant signal isn't a voltage but a resistance. You will need to create a voltage divider with another resistor and use THAT voltage with the arduino. Might I suggest an arduino pro mini.

Let me know if you need any help!
absoultly wrong ECT sensor is a thermresistor and varies resistance with temp. it is feed 5v and the ECT sensor drops the voltage based on coolant temp and returns a signal back to the ecu.

i have done a simlar project with my old EF civic using a Ardunio Uno. ive looked into doing that same for the my 240 but the data protocalls use different methdos and i haven't had the time for it. nissans consult sends a list of rom addresses or "desired values" to the ecu and the ecu spits back data. honda was a much more simple one by one tx/rx protocall, also i didnt require the extra circuitery. but i ended up with my Uno making it: display all rom data live on a 20x4 rgb lcd, max/min values, f1 style shift lights, read a wideband (amount other sensors), RT whp/wtq (never got the math to work, some weird error),another guy with a simiral honda project but wasnt as refined even made his into a boost controller. i tired to get it datalog onto an sd card but it keep running out of ram needed to upgraded to a mega.
Image
Image
your project would be a great simple start if you wanted to make an easier task to make a fan controller. just have the arduino tap the ECT sensor into a Analog pin. then have it active one pin to a relay at said voltage and another at a another voltage. but if you'd like keep your project the way it is id be gald to help. alread have the resreach done just need to adapt the data retrival part of my code.
cmj
240sx Wannabe
Posts: 129
Joined: Fri Jun 27, 2008 3:12 am

Re: DIY Fan Controller

Post by cmj »

I was referencing the one wire temp sensor for the gauge. Didn't even consider the ecu sensor.
erich
Knows Some Stuff About 240's!
Posts: 418
Joined: Fri Mar 11, 2005 1:42 pm
Location: New Westminster, BC
Contact:

Re: DIY Fan Controller

Post by erich »

Are you on a tuned KA DE ECU and stock wiring harness?
If you are, why not use the internal fan controller and stock relay?
I wrote a program a long time ago for setting the fan turn on and off temp in a ROM tune. I'vr been running dual 12" fans on the stock wiring for seven years or so with no problems.
Here's a link to the program: http://www3.telus.net/kreen/fantemp.exe
basic
Dont Question My Nissan Knowledge
Posts: 663
Joined: Mon Jul 27, 2009 11:03 pm
Location: Eastern Iowa.

Re: DIY Fan Controller

Post by basic »

Thank you all for the input and replies. I'll take the advise into consideration.

An update on ver 2.0 - DC Only SSR with enough current capacity are prohibitively expensive. Researching now to look at using a MOSFET or possibly a switched voltage regulator.


Other concerns addressed -

I plan on using an arduino nano - the idea here is that because the the voltage regulator on the nano is good to 20V - you could use it with the 14V output of the car while it's running without having to use a voltage regulator to power the nano - it has it built in. The pro-mini is limited to an input voltage of 12V.

The idea was to simply tap into the ECU temp sensor, not the single wire. Like foreverdeath said, it's a thermistor that decreases in resistance as temp is increased (if you want to see a sample of the expected resistances check page 160 of section EC of an S13 FSM). The data acquisition will hopefully be as simple as reading a voltage from the CTS via an analog pin (the blue/orange wire pin 19 on the DOHC s13 ecu is the CTS line).

I was planning on switching the relays using a 2n2222 transistor and of course a 1N4007 diode across the coil to keep from frying stuff with bounceback current like shown in this schematic ->
Image

I think foreverdeath pretty much has hit it on the nose on what I would like to do - only change is that I would like to use adjustable potentiometers to adjust the comparision - basically run them through a voltage divider via the 5V out and analog pins on the arduino - compare this voltage value to the current read from the CTS. Have two of them so at one voltage the low speed will kick on, and at another voltage the high speed will kick on. The only addition in the 1.0 is the addition of the switch to turn them manually on. I figure I can run this off the 5V line as well, because any time the switch is on (ie - the Digital input it's hooked to is HIGH) the voltage dividers hooked up to the pots aren't needed.

as a version 1.1 I would maybe like to display temp on a simple numerical display. My temp gauge doesn't currently work in the S12 - I'm still trying to figure out why - so this would be a good substitute.


The idea of this project was to be a simple start making something useful. I'm a mechanical engineer, not an electrical, but stuff like this is interesting to me. This will be my first real project with arduino, and hopefully I can help other people out with it.

Foreverdeath - I had given thought to trying to use the consult interface like you had mentioned, but didn't for a few reasons - one - I don't yet have the know-how to tackle a project of that magnitude, and two - i wasn't entirely sure how It worked. Maybe that will be a later project - I already have an idea of using a consult connector similar to the one I have already that is a consult to serial adapter ( this is the one I purchased - http://www.amazon.com/Nissan-Consult-Di ... roduct_top ) and then sending/receiving serial data from that using the arduino. That is a ways down the road though.



erich - i'm currently running a stock ecu on a KA24de swapped 200sx. If I were running a tuned ecu, I would definitely do it your way - it seems the easiest and cheapest (no extra stuff to buy). But - I would like this to be a more "universal" solution - conceivably anyone with a thermistor CTS read by the ECU could use this in their car for an electric fan setup. There would need to be changes made to the voltage comparison circuit, but still pretty easy and cheap.
'87 200SX Hatch - complete with KA24DE swap.
'91 240SX hatch complete with super rare sunroof insert and bag.
chubbza5 wrote:Well hey, truck engine + truck turbo, why not!
foreverdeath
Learners Permit
Posts: 15
Joined: Thu Dec 27, 2012 12:20 pm

Re: DIY Fan Controller

Post by foreverdeath »

mosfets would work (chrsyler town&country i know uses them) or a transitor and relay would better, less current going threw your setup i know altima fans draw upto 60amps. id dont really understand your POT idea tho. also most arduino boards the regulator will handle upto 20v like my uno would but i chose it run it out the 5v pin in that data loogin header on the ecu (be carefull tho, once fired a fuse and was confsed for a few days). as erich said you could reprogram a tuned ecu as thats in my future plans, but also a 93-94 altima manual ecu works which has a built in dual fan controler the pinout is only slightly different.

about the consult heres some of the info i have grabbed so far.

http://www.plmsdevelopments.com/images_ ... ssue_6.pdf
http://www.plmsdevelopments.com/images_ ... f_rev4.pdf
http://forum.arduino.cc/index.php?topic=54277.0
and as far as the coding goes its been before but its incomplete in resigter ardesses which i fixed once but i cant find it but it maybe on my linux partition. if you want do a bigger projects later id start out with an UNO as its only a like more $ and has capabilitys do everything you want and more.
basic
Dont Question My Nissan Knowledge
Posts: 663
Joined: Mon Jul 27, 2009 11:03 pm
Location: Eastern Iowa.

Re: DIY Fan Controller

Post by basic »

I'll be sure to bookmark those pages for the consult stuff if/when I get to that project.

The reason for not using a transistor/relay combo for the version 2.0 (variable speed) is that it would wear the relay out pretty quickly for variable speed (think PWM through a mechanical relay) - not only do I not know if it could switch fast enough, but it would switch so many cycles it would wear out. Given a life cycle of 10^6 cycles and the relay switching on/off 10 times a second, the life cycle would be less than 30 hours. This doesn't take into account effect of hot switching on the life expectancy of a relay.

For version 1 I will be using a mechanical relay switched via a transistor.

To better explain my idea of using pots to make the switching points adjustable, the idea is this:

Read the stock CTS sensor, get a voltage.
Read voltage of voltage divider that uses POT1 to change the output voltage1.
Read voltage of 2nd voltage divider that uses POT2 to change output voltage2.
Compare CTS sensor voltage to the voltage you get from POT1, if CTS>POT1 - set the fan to low.
If CTS>POT2 - set fan to high.

This if of course assuming that POT2 voltage > POT1 voltage.

Doing it this way would allow you to adjust the low speed on and high speed on temperature points. Hopefully this explains it a little better. I'm planning on working on some of the coding this weekend, I'll post it up so you can maybe get a better idea.


I didn't know that about the voltage regs on the uno and others - I just went by the data sheets on the arduino homepage and the input voltage requirements. Oh well.

I have an Uno already - I'm planning on using it to test the code and stuff, make sure all it working. Then I'll just take the sketch, send it to the nano, and put it in a box with a perf board and some relays. Advantage there is the nano is pretty cheap an dit's about 1/3 the size of my Uno Rev 3
'87 200SX Hatch - complete with KA24DE swap.
'91 240SX hatch complete with super rare sunroof insert and bag.
chubbza5 wrote:Well hey, truck engine + truck turbo, why not!
foreverdeath
Learners Permit
Posts: 15
Joined: Thu Dec 27, 2012 12:20 pm

Re: DIY Fan Controller

Post by foreverdeath »

ah now that you mention PWM a mosfet would make sense but itll have to be a pretty powreful one altima fans run 30 amps on low (1/2 of the armetture is powered) and nearly 60amps on high. i thought you were using altima fans so suggested the relays ill be doing them next week on my s13. your voltage divider idea is pretty simple now that you put it that way it makes sense.
basic
Dont Question My Nissan Knowledge
Posts: 663
Joined: Mon Jul 27, 2009 11:03 pm
Location: Eastern Iowa.

Re: DIY Fan Controller

Post by basic »

I'll be running a taurus fan in my setup. From what I've read, they draw about 40A on full blast. I'll find out early next week.

As for the mosfet - It would be have to be oversized for the expected load. I was thinking of using something like a 350A 40V mosfet for the switching. It would have to have it's own heatsink/fan, but i've got some old motherboards to pull a small HSF off of. That's in the future though.
'87 200SX Hatch - complete with KA24DE swap.
'91 240SX hatch complete with super rare sunroof insert and bag.
chubbza5 wrote:Well hey, truck engine + truck turbo, why not!
basic
Dont Question My Nissan Knowledge
Posts: 663
Joined: Mon Jul 27, 2009 11:03 pm
Location: Eastern Iowa.

Re: DIY Fan Controller

Post by basic »

well, work has been busy, so I haven't had a chance to work on this as much as I would like. I have a working version for the code, and the circuit is pretty much done - only using LEDs instead of the transistor switch. I just got in my transistors and diodes from china, so it's like 90% done in the prototyping phase.

I was just going to use perfboard or a DIY PCB, but I may actually pay to have this professionally made. There's a few services online that can do this, and I think that the professionally printed pcb may hold up better in actual use.

Anyway - here's the code as it stands now. Currently I have all three analog inputs setup via voltage dividers for testing. Actual use will see the a1 input (analog pin 5) hooked to the ECU pin for the CTS. I will probably have to adjust the values of a2 and a3 in the code by adding some value to them. Alternatively, I could tune this using the voltage dividers that are hooked up to a2 and a3, but I think it would be easier just to add some number to the values in the code.

If anyone has any suggestions or knows a better way to do this, please let me know.


int fan1 = 4;
int fan2 = 5;


void setup()
{
pinMode(fan1, OUTPUT);
pinMode(fan2, OUTPUT);
}

void loop()
{
// read the analog input1
float a1 = analogRead(5);
// read the analog input2
float a2 = analogRead(6);
// read the analog input3
float a3 = analogRead(7);

//compare a1 to a2, if a1>a2 - fan1 turns on, otherwise, it doesn't.
if(a1>a2)
{
digitalWrite(fan1, HIGH);
}
else
{
digitalWrite(fan1, LOW);
}
//compare a1 to a3, if a1>a3 - fan1 and fan2 turn on.
if(a1>a3)
{
digitalWrite(fan1, HIGH);
digitalWrite(fan2, HIGH);
}
else
{
digitalWrite(fan2, LOW);
}


delay(2000);
}
'87 200SX Hatch - complete with KA24DE swap.
'91 240SX hatch complete with super rare sunroof insert and bag.
chubbza5 wrote:Well hey, truck engine + truck turbo, why not!
basic
Dont Question My Nissan Knowledge
Posts: 663
Joined: Mon Jul 27, 2009 11:03 pm
Location: Eastern Iowa.

Re: DIY Fan Controller

Post by basic »

SO, I finished a schematic of the circuit so far. It includes the transistor switched relays, the override switch, and the voltage dividers for the input adjustment. I've not actually tested this- really just looking for input on the circuit to see if there are any suggestions anyone would make.

here's the schematic. NOTE - Pins may not match the code above. Also the code above does not impliment the override switch (i'll have to add a while loop for that)

Image
Last edited by basic on Wed Apr 30, 2014 4:55 pm, edited 1 time in total.
'87 200SX Hatch - complete with KA24DE swap.
'91 240SX hatch complete with super rare sunroof insert and bag.
chubbza5 wrote:Well hey, truck engine + truck turbo, why not!
foreverdeath
Learners Permit
Posts: 15
Joined: Thu Dec 27, 2012 12:20 pm

Re: DIY Fan Controller

Post by foreverdeath »

code looks good but i don't see any PWM action. that's just a dual fan circuit with temp A low temp B high with a 2 second loop. The tarus fan is a dual speed fan. this is how most manufactors run there fans up intill lately (to make fans quiter) so relays for this will be fine. i see 2 ways to do an override switch ether in code(will required a interupt for instant use or may have to wait up to 2 seconds) or just send 5v threw the switch to pin 4,5. i decided to ditch this for electric fans nismotronic will allow my s13 ka ecu to drive altima fans just like on an altima with some relays.
basic
Dont Question My Nissan Knowledge
Posts: 663
Joined: Mon Jul 27, 2009 11:03 pm
Location: Eastern Iowa.

Re: DIY Fan Controller

Post by basic »

Yea. This is just version 1.0 of the controller. My plan for the 2.0 is to get the PWM to work, but that's a larger undertaking.

For adding the switch, all I did was add a while loop that sets fan1 and fan2 to high while the switch is on...something like this -

while (digitalRead(2) == HIGH)
{
digitalWrite(fan1)=HIGH;
digitalWrite(fan2)=HIGH;
}


Seems to work ok on the prototype I have set up. I'm STILL waiting for the taurus fan, BUT i have run this on car voltage using a voltage divider to emulate the input from the CTS, and it works fine.


I'm still playing around with how to impliment the PWM the best in version 2.0.
'87 200SX Hatch - complete with KA24DE swap.
'91 240SX hatch complete with super rare sunroof insert and bag.
chubbza5 wrote:Well hey, truck engine + truck turbo, why not!
Post Reply