I am working with arduino to control the speed of a motor of a fan (24V).
This fan have three wire, red, black and blue.
The blue wire accept a pwm signal to control the speed of the fan and I want isolate fan from arduino using the optocoupler 4n26.
the schematic of my project is in attachment.
Question:
This board is a portable system to control the fan.
Sometimes I make mistakes when I connect the wires of pwm, for example if I connect the red wire (24V) to the blue wire of PWM fan, it burns the resistance R. How can I prevent this from happening when I connect Red Wire (24V) with pwm wire?
Everything is wrong! I think you've got the opto-isolator backwards, depending on what you're tryning to do. The LED-side of the opti-isolator is the input. I assume the blue wire is the speed sensor-output? In that case, the blue wire doesn't connect to the red wire.
The LED inside the opto-isolator needs a resistor, just like any LED.
You need a transistor or MOSFET to power the fan. You can't power the fan from the "little" phototransistor in the opto-isolator (or directly from the Arduino).
Look-up some examples of how to PWM a fan without the speed sensor before worrying about speed-feedback.
@DVDdoug
I suspect you've misunderstood what the OP has. I suspect he's got a brushless ESC such as this! (sorry for the fritzingesque image, it was the first I found with google )
Cut the red wire of the fan and connect a diode across the gap. Then if you connect the fan back to front, no current will flow. Everything will be safe.
if I reverse the fan power, this places a tension of 24 Volts on the wire of control that burns arduino and the resistor R.
If that is true then you have not got it wired up correctly.
The ground on the arduino side in this case should not be connected to the ground on your motor supply because you have an opto isolator. Therefore it will be imposable to damage the arduino because it is isolated. You will damage the arduino because there is no resistor in line with the opto isolator's LED but that will happen anyway.
cchechio:
for example if I connect the red wire (24V) to the blue wire of PWM fan, it burns the resistance R. How can I prevent this from happening when I connect Red Wire (24V) with pwm wire?
I am afraid there really is only one answer to that.
The standard way this is accomplished in commercial products is keyed connectors that prevent the connector from being plugged in backwards. The wires from the connector cable are soldered to their respective locations and the cable connectors can only be plugged in one way.
The term they use to describe this design approach is called "IDIOT PROOF."
cchechio:
Can I separate the groundof Arduino and the ground of Fan?
If yes , how?
By not connecting them together?
There is a bit of a miss match here, you are missing telling us something. Maybe if you posted a picture of your wiring we could spot what you are getting confused about.