Getting an Opticoupler to work.

Thread Starter

MB107

Joined Jul 24, 2016
400
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% .
Are you sure about 1ma, I'm getting about 10. I=V/R then .095V/10 = 0.0095a = 9.5ma or with the 1 ohm .0098/1 = .0098a = 9.8ma. I can only run to about 50% on the bench but I can run slower. RMS voltage tends to go higher at lower speeds. With the 1 Ohm resistor and PWM in place at 50% 11.9mv at 20% ~13mv. It would just be 10 x that with the 10 ohm resistor.

Am I correct in assuming that at 50% duty cycle the RMS voltage would be 1/2 the peak voltage and at 25% the RMS voltage would be 1/4the the peak. In that case, at 50%, the current to the fan controller would be about 24ma, which seams like it would be fine, but at 25% the current would be ~ 52ma which would not be acceptable.
 

sghioto

Joined Dec 31, 2017
8,634
I miss read the value of the shunts so yes 10 ma is correct. Shouldn't be a problem for the Arduino. I would leave the circuit as is.
 

Thread Starter

MB107

Joined Jul 24, 2016
400
I have made a video illustrating the issues. Hope this will shed some light on this situation. I will try to get another one up with the emitter and collector revered to show how that works out.

 

Thread Starter

MB107

Joined Jul 24, 2016
400
I miss read the value of the shunts so yes 10 ma is correct. Shouldn't be a problem for the Arduino. I would leave the circuit as is.
A member on this forum very kindly guided me through using the scope and DVM to measure current. I have it now isolated to somewhere between 10 to 16 ma. While that will work there are other reasons to use the opticoupler. For one the Yourdrino RoboRed is just a development board. The real board will probably be a nano33 which requires an opticoupler just for the voltage change. There is also a 5V nano but outputs on both of them are limited to 15ma putting is close enough to consider opticoupler. And then there is the high noise and environmental consideration so I think an opticoupler is a good idea.
 

sghioto

Joined Dec 31, 2017
8,634
In the case of using the Nano or Robo I would recommend a CPC1002 optocoupler.
Another possible issue with the opto connected in series with the 5 volts is when the output from the PWM is low the the input to the fan control is open or floating. A pull down resistor or another option maybe required.
 
Last edited:

Thread Starter

MB107

Joined Jul 24, 2016
400
In the case of using the Nano or Robo I would recommend a CPC1002 optocoupler.
Another possible issue with the opto connected in series with the 5 volts is when the output from the PWM is low the the input to the fan control is open or floating. A pull down resistor or another option maybe required.
Thanks

Interesting that they call these solid state relays. After all thats all I'm really looking for. Mouser has them in stock unfortunately they apear to be only available in surface mount. Im going broke spending $10.00 in shipping to buy $2.00 worth of stuff from Mouser.

https://www.mouser.com/c/optoelectr...uplers/solid-state-relays-ssr/?series=CPC1002
 

sghioto

Joined Dec 31, 2017
8,634
Im going broke spending $10.00 in shipping to buy $2.00 worth of stuff from Mouser.
Digikey carries the same product with a First Class Mail option for 4.99 if that helps however I would hold off for now until we can figure out exactly how this Fan Control will react to a series installed opto.
 

Thread Starter

MB107

Joined Jul 24, 2016
400
Put the current meter in series with the fan control and 5volts.
OK so I did this three ways

1) in series with the 5V going to the whole setup with the PWM output feeding the fan directly. Output was 0.36ma. Fan runs fine in this condition.
2) in series with the 5V going to only to the opticoupler output side of the of the opticoupler (emitter). Fan will not run in this condition but output was measured at 3.7ma
3) in series with the PWM signal and the fan. Fan runs good in this condition and the output was 12ma.

All readings had the PWM signal set to 50% duty cycle. Also this is not a true RMS meter.

Not making much sense of this since the current going to the whole board and fan is only 0.36ma, measurement 1 and the current going just to the fan is 12ma, measurement 3. Seems like I am making power. I had to repeat the measurement 3 times just to make sure.

P1030353.JPG
P1030354.JPG
P1030355.JPG

P1030356.JPG

P1030357.JPG

P1030358.JPG
 

Thread Starter

MB107

Joined Jul 24, 2016
400
Digikey carries the same product with a First Class Mail option for 4.99 if that helps however I would hold off for now until we can figure out exactly how this Fan Control will react to a series installed opto.
don't I already have a series installed opto?
 

sghioto

Joined Dec 31, 2017
8,634
How do you have that hooked up? Is that yellow LED wired in series with the input side of the opto? How are you reading the voltage with the scope? The negative lead should be on ground and the plus lead on the wire going to the fan control. Is that how it is?
 

Thread Starter

MB107

Joined Jul 24, 2016
400
How do you have that hooked up? Is that yellow LED wired in series with the input side of the opto? How are you reading the voltage with the scope? The negative lead should be on ground and the plus lead on the wire going to the fan control. Is that how it is?
I just added pictures to the previous post. The yellow LED is wired in series with a 220Ω resistor from the cahode of the opti to ground. Reading voltage with a scope, and negative lead on ground with positive to fan control wire.
 

Thread Starter

MB107

Joined Jul 24, 2016
400
I'm not sure if I see that. Tell me what each wire is on the breadboard please.
Hope this helps

Blue wire from pin 9 of the RoboRed connected to the opti anode.
Opti cathode connected in series to LED with 220Ω resister to ground.
Black and red wires are RoboRed ground and +5V from pin cluster A0
White wire at center of pot is from S pin on A0 cluster.
P1030365.JPG

Opti collector connected to +5V
Opti emitter connected to fan and scope positive. Note there is a metal bridge under the positive lead of the scope connecting the yellow bar to the rail with the positive lead. It holds the fan wire to the board.
Scope ground connected to blue ground rail
P1030366.JPG


Opti collector connected to +5V
Opti emitter connected to fan and scope positive. Note there is a metal bridge under the positive lead of the scope connecting the yellow bar to the rail with the positive lead. It holds the fan wire to the board.
Scope ground connected to blue ground rail
P1030367.JPG
Orange wire connected to RoboRed +5V
Brown wire connected to RoboRed Ground
White red and black wires connected to A0 cluster
P1030368.JPG

Ground wire from RoboRed connected to ground rail on opti output side
P1030369.JPG
Blue wire on pin 9 PWM RoboRed
P1030370.JPG
 

sghioto

Joined Dec 31, 2017
8,634
I have a thought and see if you can confirm. I'm curious if there is any voltage on the wire from the fan control when it is not connected to anything.
 

sghioto

Joined Dec 31, 2017
8,634
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.
 
Top