Protect the board from a connection error

Hello All,

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?

How can I protect my portable system?

many thanks

Everything is wrong! :frowning: 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 )

make a cable adapter. you should be able to get mating pairs from an old PC, or buy them.

or, switch the polarity of the signal.

it may sound harsh, but if you cannot tell red from blue, technology can only do so much.

btw, you should use a resistor for the opto.

Sorry for my silence but I had a fever.

I am working with arduino to control the speed of a motor of a fan (24V) with a pwm signal.

The problem is:

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..

Can You help me?

Or you could put a diode into the circuit that prevents current flow when you connect it backwards.

where connect the diode?

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.

ok a diode 1N4148 ?

Is correct?

test.png

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.

Grumpy_Mike:
because you have an opto isolator

Good catch!

cchechio Forget the diode. Sort out your circuit.

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."

Is there a way to isolate arduino from the fan ?

In this way I burn the resistor but not Arduino.

If you connect it as you've shown in your diagram, then it already is issolated.

Can I separate the groundof Arduino and the ground of Fan?

If yes , how?

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.