Getting an Opticoupler to work.

Thread Starter

MB107

Joined Jul 24, 2016
290
I am building a fan controller for a PWM fan for a Mercedes Benz. The fan is a 600W fan controlled by a the engines main computers. For the moment I am using a Yourdrino RoboRed which is similare to an Arduino Uno except it has a hight power 2000ma power pin on it. I have successfully got this fan to run perfectly using the PWM signals directly applied to the fan. The fan requires a 10Hz 0 to 5V PWM signal and the output has driven it directly with no further conditioning required. However I am concerned about the power being pulled directly from the PWM output pins. All my testing thus far has only been for a few minutes at most so I would like to take power from the Yourdruino's 2000ma 5V pin. I have tried several circuits with transistors and mosfets and have been successful getting them to work but all seem to have the same problem and I am not sure it it will cause a relaibility issue if this thing were to run daily for sometimes extended trips of 5 to 10 hr or so.

In any case today I tried a new device called a PC817 Opticoupler. The results appear to be the same in that the signal is shifting. Presented below is a wiring diagram of what I have tried.

1) If I remove the opticoupler and and just reconnect the two blue wires together the fan works perfect and reading the voltage with a scope in the blue wire to ground gives me a very desirable 0 to 5V PWM signal.

2) With the opticoupler installed but the blue wire to the fan control module disconnected I once again get the desired 0 - 5V PWM signal between pin4, the collector and ground.

3) once the blue wire to the fan control module is connected to the pin 4 colector of the opticoupler, the fan will not work and the voltage readings between pin 4 and ground shift to 7.28 to 13.6. So I am getting a shift of ~ 7.28V. And the 13.6V is about the same as the large power going into the power side of the motor controller and the voltage feeding the RoboRed.

I prefer the opticoupler idea in that it separates the circuits but no mater what I use stuff is moving around. Does anyone know how I can beat that signal back into place.

1639864845572.png
 

sghioto

Joined Dec 31, 2017
3,058
I prefer the opticoupler idea in that it separates the circuits
Not really if they share the same ground connection. I would leave the circuit alone if it's working as you say.
However I am concerned about the power being pulled directly from the PWM output pins
What is the current draw on the PWM output of the Arduino? The max current a PWM can supply is appx 40ma. If the current draw on the fan control is less then 30ma I don't see a problem.
 
Last edited:

sghioto

Joined Dec 31, 2017
3,058
Normally the Emitter is on ground.
I think if the TS moves the collector to 5 volts and the emitter to the fan control it will work if the fan control doesn't draw too much current.
However that leaves the fan control open when the output from the PWM is zero.
 

Thread Starter

MB107

Joined Jul 24, 2016
290
Not really if they share the same ground connection. I would leave the circuit alone if it's working as you say.

What is the current draw on the PWM output of the Arduino? The max current a PWM can supply is appx 40ma. If the current draw on the fan control is less then 30ma I don't see a problem.
I'm having difficulty measuring it. I have a thread on that currently. If you have any ideas please respond to this thread. My best guess is its 24ma at the moment.

https://forum.allaboutcircuits.com/threads/measuring-current-in-a-pwm-signal.183772/
 

Thread Starter

MB107

Joined Jul 24, 2016
290
Not really if they share the same ground connection. I would leave the circuit alone if it's working as you say.
That's a good question. In my little test they share the same ground's. In the installed real configuration Ground for the fan control module will be at the front of the car near the radiator on the vehicle chassis. Ground for the Arduino will be in the divers area under the dash, again on the chassis but far away. Is that considered a shared ground. Also for the real configuration I'm considering a nano3.3V Arduino which does not have a 5V output. Im also considering 1 or possibly two separate 5V voltage regulators. 1 for the nano and 1 for the 5V going to the PWM signal. That's down the road a little.
 

Thread Starter

MB107

Joined Jul 24, 2016
290
Put the current meter in series with the fan control and 5volts.
I have tried a 1Ohm shunt resistor in series with the PWM signal at 50% it reads ~ 12mv RMS. with a 50% PWM signal I belive that means 24mv peak which should be = to 24ma peak. My cheep clamp meter is useless down at those numbers.
 

Thread Starter

MB107

Joined Jul 24, 2016
290
Emitter on +5V? That does not look right. What does the input to the fan module look like.
Normally the Emitter is on ground.
As far as voltage it should be 0 to 5V PWM and it is without the opticoupler or with the opticoupler not connected to the fan control. With the fan control connected to the opticoupler its about 7 to 13V. Are you saying I just might have the put the collector to +5V and the Emitter to the fan controller.

Switching can only be done on the positive side of the fan controller because the ground is internal to the motor and comes out with the large 6ga ground cable.
 

sghioto

Joined Dec 31, 2017
3,058
Forget the pwm, use the 10 ohm shunt in series with the fan control and 5 volts and read the voltage across the shunt with the DVM not the clamp meter.
 

Thread Starter

MB107

Joined Jul 24, 2016
290
As far as voltage it should be 0 to 5V PWM and it is without the opticoupler or with the opticoupler not connected to the fan control. With the fan control connected to the opticoupler its about 7 to 13V. Are you saying I just might have the put the collector to +5V and the Emitter to the fan controller.

Switching can only be done on the positive side of the fan controller because the ground is internal to the motor and comes out with the large 6ga ground cable.
I just tried switching them and got a flat line.
 

Thread Starter

MB107

Joined Jul 24, 2016
290
Forget the pwm, use the 10 ohm shunt in series with the fan control and 5 volts and read the voltage across the shunt with the DVM not the clamp meter.
I got 95mV with the 10Ohm and about 9.8mv with the 1Ohm. In both conditions the fan would not run. Effectively that is a 100% duty cycle signal which is out of range.
 

sghioto

Joined Dec 31, 2017
3,058
That's only about 1 ma which might be normal.. Using the scope and the 10 ohm shunt in series with the pwm output read the peak voltage across the shunt with the fan running at 90% .
 
Last edited:
Top