PWM ‘ground switching’ ? [SOLVED]

PWM signal from Arduino Nano to automotive fan.

Mercedes Fan has built in MOSFET and just needs PWM from me but it’s not working.

I have confirmed with scope that I am sending PWM with prescribed 100hz frequency and duty cycles. But when it gets ignition signal on the other wire, it soft starts and ramps up to full blast no matter what PWM I’m sending which is what it is supposed to do in the failsafe mode without a PWM signal. It’s blind to the PWM signal.

Signal I tried sending is 0v to 5v and I’ve also tried 0v to 3.3v by sending 5v signal through a divider.

Clicking around, I have picked up a couple clues that make me think I need to send only the ground signal. ‘Ground switched PWM’ and ‘low side signal’ popped up a few times. Does this mean to send 0v ground during ‘on duty cycle’ and just a floating pin during ‘off duty cycle’?

I’d like to try but not sure how?

Other suggestions?

It may refer to “open drain”. But most likely you need a higher voltage level to control a fan’s MOSFET

What does the original pwm signal look like? Get the scope on that.

alesam:
It may refer to "open drain". But most likely you need a higher voltage level to control a fan's MOSFET

I don't think it's direct to the MOSFET. It's stand alone unit to convert PWM logic on it's own. Converts 10% duty cycle signal to 0% output. Must have it's own chip?

But you put me on the scent and I have more info. I have found several instances that this requires an 'open collector'. Seems Arduino can't easily do that with chip register settings, a transistor is necessary. Open collector connects to fan unit, emitter to ground.

PaulRB:
What does the original pwm signal look like? Get the scope on that.

If I had an AMG S65 Mercedes I'd do that..... :slight_smile: but from what I have read, since it is 'open collector' the scope would read a continuous 0v with potential to see tiny low level noise blips at the switch signals.

So I'm learning about differences between NPN, PNP, etc...

Seems I need to connect my PWM pin out from Arduino to base pin of NPN and when PWM out is 5v, the fan pin will ground, and when PWM is 0v, fan pin will float?

  • Do I need a resistor between arduino PWM out pin and base pin of NPN?

  • Do I need a 'flyback diode'? Capacitor for noise or protection?

Thanks, Scott

I created that NPN circuit on the breadboard. PWM pin output from Arduino through a 10k resistor to base of NPN 2N2222A, emitter to ground, and collector to fan unit.

Confirmed it is switching okay and signal is as expected. Without having the collector connected to fan unit, the scope picks up nothing, not even low level noise at the open collector, but as a test for signal on the scope, I put a pull up resistor on collector to 5v arduino and it is sending the ground signal as expected and seen w 0v-5v square wave on bench.

But no dice on the fan. It still goes into fail safe mode like it can't see the signal.

I put the scope on the signal line while connected to the fan unit and when powered into fail safe mode. The 'open collector' signal is getting pulled up to 12v at the fan unit and switching down to 0v as expected at proper duty cycle and frequency without much or any noise visible on the scope. It's a good square wave 0v - 12v when connected to fan unit.

Grrr. Is it possible I'm out of spec with how much current it wants to pull through the transistor for the trigger? FWIW The OEM wire is 22 awg for both the PWM signal and the power (ignition) signal.

Search the forum for PWM fan control, it has been discussed many times already. I guess that a much higher PWM frequency may be required for such devices.

Post a link to something describing the circuit in the fan, or a specification of the input signal, perhaps a schematic for example.

Alternatively, buy or borrow that model of Mercedes and use the scope on that. Reverse engineering a device without a schematic is hard. Reverse engineering a part of a device, without the rest of the device to test it in, is even harder.

PaulRB:
Post a link to something describing the circuit in the fan, or a specification of the input signal, perhaps a schematic for example.

Alternatively, buy or borrow that model of Mercedes and use the scope on that. Reverse engineering a device without a schematic is hard. Reverse engineering a part of a device, without the rest of the device to test it in, is even harder.

That would be ideal if I could molest someones S class for 10 minutes. Just not sure how to set that up. Maybe I'll find an MBZ mechanic in a forum that might share the info. But I've pored over the interned and these forums. Tons of clues I've picked up, but here's an intro to the fan:

This is the fan.

This guy posted some technical stuff. I've scrubbed the internet and have not run into a circuit diagram of the fan unit I'm sending the signal to.

My level of certainty is nearly 100% of the following:

  • 100Hz frequency
  • 10% off, 15%-90% variable

I'm not as confident with the circuit required to feed the PWM or potential current. I know it's not easy to get this to work, but figuring out the open collector and seeing it pulled up to 12v on the fan side was a big step forward today. Just back to the drawing board after it did not behave as expected.

Thx

I have confirmed with scope that I am sending PWM with prescribed 100hz frequency and duty cycles.

My level of certainty is nearly 100% of the following:

  • 100Hz frequency
  • 10% off, 15%-90% variable

The second link you posted shows a 95ms period, or about 10.5 Hz. Why are you certain about the 100Hz control frequency?

Confused 100Hz and 100ms?

cattledog:
The second link you posted shows a 95ms period, or about 10.5 Hz. Why are you certain about the 100Hz control frequency?

Ah, GREAT catch. And THANK YOU for clicking through and taking a look. I did not pickup on that. Although the info from that page does not give me a bundle of confidence. But that sure is interesting and I'll give it a try.

I have read others experience is that Mercedes fan is not particular about frequency 50Hz to 200Hz, but it is very particular about the 10%-90% bounds otherwise it fail safes. I did try different frequencies and dc's, but I did not go down to 10.5Hz which seems WAY to slow but I'll give it a try if I can set the chip timer registers that slow, or I'll try millis() routine to get that slow.

nearly certain (nearly was the key word lol) because others running similar fans from Merceds and other OEMs are all at 100hz. I remember reading, but I can't find now, at one point, auto OEMs were mandated to create PWM fans for emissions purposes and their frequency required for OBD protocols were 100hz. But they were all manufacturing brushed fans which require a much faster (20Khz) high current signals. So they put logic between the ECU 100hz that stepped up the pulsed power frequency to the fan motor. That's one of the reasons that there are separate fan controllers from ECU (other than required heat dissipation from switching high current, but would not require a chip). It's possible this particular controller gets fed a totally different frequency and dc and that's what I'm trying to discover.

I'll also try an open collector TIP transistor, as I just clicked through an instance of someone that required that, even while feeding a logic level fan interface like I am. Not sure why it would require the extra current though.

THANKS for the feedback. I'm in Captain Ahab mode on this. I chose this fan because it remarkable was a perfect drop in to my truck, and I mean perfect fit...

SHAZAM !!!

It works at 95ms cycles, 10.53Hz

My confidence and appreciation (and dare I say love) for that guy that shared the PWM wave is now at 100% lol.

THANK YOU to those that helped and took a look at this with me. Big big win to get this fan to work, and I will be happy to share anything I learn for anyone else looking for help.

Also a lesson in details and hubris. When I saw his 95ms wave, my brain did get confused and went to Hz assuming same frequency as other Mercedes fans. I lost confidence in that information because I could make heads or tails of his comment about the matching frequency at 3v p to p. Still not sure what that means.

This fan is SO smooth and powerful. The soft start is so gentle on the power system in the car.

Thanks again.

Scott

At last I can reply this topic. :slight_smile: I'm very insterested in your project. It looks like it's something like I want to do.

I own a Jeep Grand cherokee '06 with mercedes 3.0 CRD diesel engine. With a lot of time and searching I have to say the AC is very bad designed. When you are at idle, condenser pressure goes crazy high and radiator Fan didn't speeds up so condenser temperature not goes down lowering the performance of cooling a lot.

My idea was simple, taking AC pressure sensor value ( I think it is resistive ) process the value and send a pwm value to fan.

I'l apreciate much if you could share your research.

Thanks!!

Is the pressure sensor working properly?