Getting an Opticoupler to work.

Thread Starter

MB107

Joined Jul 24, 2016
345
That seems strange because I'm trying to figure out why you were reading 13.6 volts on the fan wire when we reversed the collector and emitter connections on the opto back in post #31. That voltage had to come from somewhere.
I have no idea why 13.6 gets back to the opti but not back to the Arduino when I feed it directly.
 

sghioto

Joined Dec 31, 2017
5,391
Try this: Set the PWM at around 50%. Wire the opto as in the schematic below. Remove the yellow LED to get more current through the opto.
1640014896657.png
 

Thread Starter

MB107

Joined Jul 24, 2016
345
Try this: Set the PWM at around 50%. Wire the opto as in the schematic below. Remove the yellow LED to get more current through the opto.
View attachment 255624
I did this back in post 14. I just reported it as a flat line. I just repeated it and it's not exactly a flat line but you need to really expand the view to 200mv to see its not flat. in any case its 13.6V to 13.9V.
 

Attachments

sghioto

Joined Dec 31, 2017
5,391
The breadboard setup doesn't look correct as per my schematic. Pin3 emitter should be ground and Pin4 collector to the fan control wire which I assume is the green-blue wire. No connection to 5 volts.
 

Thread Starter

MB107

Joined Jul 24, 2016
345
The breadboard setup doesn't look correct as per my schematic. Pin3 emitter should be ground and Pin4 collector to the fan control wire which I assume is the green-blue wire. No connection to 5 volts.
Good eye. And it works. It works backwards but I can take care of that. Only issue I have is the voltage is high 1.32 to 13.6V. I have proven that the fan work from 0 to 5V or 0 to 15V. But I'm not sure it will last at 15V.

I also found that it works with the 470K resister but it doesn't work with the 220 and LED in series. What is up with that I thought the opticoupler input side had nothing to do with the output side. I'm liking your relay idea.
 

Attachments

Last edited:

sghioto

Joined Dec 31, 2017
5,391
The 13.6v is not an issue as you are just reading the voltage back through the Fan control to the power supply.
You can replace the opto with a simple 2 transistor inverter that will correct the "backward" operation and provide more current to drive the Fan control.
1640038761736.png
 

sghioto

Joined Dec 31, 2017
5,391
also found that it works with the 470 resister but it doesn't work with the 220 and LED in series.
Not enough current through the infrared LED inside the opto. If you replace the 470 with the 220 ohm as in my schematic the collector should be closer to zero on the low side of the PWM.
 

Thread Starter

MB107

Joined Jul 24, 2016
345
The 13.6v is not an issue as you are just reading the voltage back through the Fan control to the power supply.
You can replace the opto with a simple 2 transistor inverter that will correct the "backward" operation and provide more current to drive the Fan control.
View attachment 255683
I tried several circuits with transistors and mosfets and I got them to work but all of them jacked with the signal. I belive I have everything to build this circuite so I will try this one tonight. I have a 5V signal that I just want to turn on and off like it was controlled with a mechanical relay. But all the circuits I have tried change the voltage completely. Some of the circuits work and some don't but for the ones that work if they are out of spec I cant be sure they are doing damage.

Thank You
 

Thread Starter

MB107

Joined Jul 24, 2016
345
Not enough current through the infrared LED inside the opto. If you replace the 470 with the 220 ohm as in my schematic the collector should be closer to zero on the low side of the PWM.
I find that very disappointing in that obviously its activating the other side of the opti with lower current as seen by the changes in output voltage, but perfomance apears to the related to the input side. The 220 resister helps by bringing down the low side voltage from 1.32V to 0.5V. No effect at on the upper voltage.
 

sghioto

Joined Dec 31, 2017
5,391
The 220 resister helps by bringing down the low side voltage from 1.32V to 0.5V. No effect at on the upper voltage.
That's about what I would expect on the low side. It should have no effect on the high side as you noticed and as I said before should not be an issue.
The Fan control works by pulling that lead to ground in a pulsed fashion.
I have a 5V signal that I just want to turn on and off like it was controlled with a mechanical relay.
Can you elaborate more? Is this something to do with the PWM signal?
 

Thread Starter

MB107

Joined Jul 24, 2016
345
That's about what I would expect on the low side. It should have no effect on the high side as you noticed and as I said before should not be an issue.
The Fan control works by pulling that lead to ground in a pulsed fashion.

Can you elaborate more? Is this something to do with the PWM signal?
Thats what I liked about the SS relay idea. To turn on and off the 5V using the PWM signal. I even tried doing it with a mechanical relay this morning but I only have 12V relays.
The 13.6v is not an issue as you are just reading the voltage back through the Fan control to the power supply.
You can replace the opto with a simple 2 transistor inverter that will correct the "backward" operation and provide more current to drive the Fan control.
View attachment 255683
Well Mr sghioto, I owe you an apology and everyone else on this forum that I may have confused. Aside from misreading circuit digrams, Im also misreading DMV. I believe the question was asked if I disconnect the fan and measure the voltage at the fan wire what is the voltage and I reported zero. It turns out it's 13.8V. Unfortunately I only discovered that when I was measure it with a scope and then discovered I had my DMV leads plugged in to the current sockets. This actually makes me feel a lot better about the opticoupler. When its off it's passing the fans normal 13.8V. When its on its pulling the fan voltage down to the 5V level of the source.

I ran this circuite with the transistors it is working from 0.1V to 13.6V and does not work backwards. Still that high voltage of 13.6V, but from the results of the above paragraph maybe not.
 

Thread Starter

MB107

Joined Jul 24, 2016
345
You should be good using that circuit. Don't worry about that 13.6v, that reading is normal.
Thats working and I can probably do a few tweaks on it to get it better. I will try to get some performance data up tonight. But it does look like Im going to 12V on the output.

OK been a long day of research. and recouping of what I found. First thing is this is apparently a 12V fan and not a 5V fan. In interpreting the Mercedes Benz manuals you need to understand that they are written for MB technicians and they wont get into the nitty gritty required to design and aftermarket system, in fact they hide that detail on purpose. What they publish is the detail required to troubleshoot the system by a technician following there procedures and using there proprietary diagnostic equipment that really gives the technician no idea what he or she is actually measuring. In any case in the 203 they give a required voltage to the fan control of >3VDC and no other detail. Well I guess that means 440V is OK? If I take a look at a later vehicle that uses the same fan, the series 220 I found a little more detail.

From the 203 manual
image
image761×45 4.27 KB


From the 220 manual
image
image1495×114 18.4 KB


Note on the left side of each picture the term 4.39. That means connector #4 pin 39 of the N3/10 module. Both vehicles use these fans and N3/10 modules. They are each different but I believe they are operating the same. So using the later 220 data max at 20% duty cycle = 2 to 4 volts DC about the same as you would get with a DC voltmeter measuring a 20% PWM signal on 13.8V and likewise 12.5V is ~90% of 13.8V. So I'm a believer. And consequently the statement of >3V in the operational mode makes a little more sense.

So where am I at now. The desire is to replicate the signal of the Mercedes Benz main engine computer, previously referenced as the N3/10 module. And of course I don't have an N3/10 module and getting the true output specs on it from pin 4-39 is going to be difficult. If my wife had a friend with a Mercedes, I could have her invite her over for tea and coffee while put a scope on her car. But I don't see that happening.
So now there are three concepts.


  1. Driving the fan directly with the Arduino at 5V PWM. I think I can rule this out based on the 12V discussion.
  2. Driving with the opticoupler with emitter to ground. This works well but still would like to work on the final output signal.
  3. Driving with the opticoupler with emitter to 5V. This doesn't work at the moment but knowing what I know now, I believe this is still possible.
And then there becomes the power issue. Do I feed raw automotive power which can vary greatly through the opticoupler or try to filter it some way. And if I used something like an L7812 to regulate power what happens if the automotive voltage drops below 12. I really would like to filter to get 13.8V.
 

sghioto

Joined Dec 31, 2017
5,391
MB107 I believe you are over analyzing the fan speed control. From everything I have seen the speed is simply controlled by grounding that lead. The longer the lead is grounded the faster the fan runs. Correct me if I'm wrong but from your research if the fan lead is simply grounded continuously the fan will not operate, meaning it requires a PWM signal within limits.
IMHO using the 2 transistor inverter has solved the problem of isolating the Arduino and reducing its current draw to less then a ma.
 

Thread Starter

MB107

Joined Jul 24, 2016
345
MB107 I believe you are over analyzing the fan speed control. From everything I have seen the speed is simply controlled by grounding that lead. The longer the lead is grounded the faster the fan runs. Correct me if I'm wrong but from your research if the fan lead is simply grounded continuously the fan will not operate, meaning it requires a PWM signal within limits.
IMHO using the 2 transistor inverter has solved the problem of isolating the Arduino and reducing its current draw to less then a ma.
I would say the longer the lead is grounded the slower it goes. Speed seems to run high when the width of the high signal is wide. At least that is the way it works when powered directly from the Arduino. When the 5V portion of the curve is wide it runs fast. But I concur it could be just switching that 13V signal to ground.

I did just tried grounding it and it does not turn. The PWM control actually only works from 10% to 90% where 10% = motor stopped. Mercedes only runs the motor a desecrate levels. The motor will actually run at 16% to 100%, but MB only feeds it 10, 20, 30, 40, 50, 60, 70, 80, 90. The use 10% to stop it. At 0% it will fault and run at 100% but be powered by the other small wire shown in my original post #1. The double line black and white wire.

You like the 2 transistor circuit for this over the opti? Can I run that Q1 transistor at 5V or possibly 3.3V with Q2 at automotive 12V power unregulated?
 

sghioto

Joined Dec 31, 2017
5,391
The opto requires more current to operate efficiently. The transistors can handle more current and much less load on the Arduino.
 

Thread Starter

MB107

Joined Jul 24, 2016
345
Thanks I appreciate all your help I get to try it out in a few days.
Actually I just realized I already did try it out with 12V. The fan control being the 12V. And if I go with the Nano33. I just replace the +5V at the red square with +3.3.
1640181417891.png
 
Top