Here is my circuit schematic : enter image description here

I need to power ON/OFF a 230VAC fan using a relay. The relay is powered by a 5V DC power supply. Digital pin on the Arduino board open or close the circuit in PNP as it is HIGH or LOW; If it's HIGH, the relay is switched ON, otherwise it is OFF. There is also a snubber diode to avoid current from relay induction.

The digital pin is controlled by RX message.

This is working very well when 230V AC is powered OFF, but when it'is ON the Arduino crashes, and gets unable to receive RX messages.

I think something is wrong in my circuit. Can you help me please?


Here is my new schematic : I've removed the transistor and the snubber diode The digital pin is directly linked to the command pin on the relay with 2.2k resistor and a simple led

enter image description here

RX/TX is still crashing, and the arduino seems to act very slowly

  • \$\begingroup\$ First of all you should connect together the 5VDC ground with the arduino ground. The 1N4007 diode is too slow to properly avoid overvoltages but that doesn't seem related to your problem. Can you better explain what do you mean by "crashes"? And I am quite sure you are using an NPN transistor, or your schematic is wrong, or your bjt is magic. \$\endgroup\$ – Vladimir Cravero Sep 8 '14 at 14:10
  • \$\begingroup\$ You don't actually need the transistor or the diode, both are integrated on the relay (this is the one, isn't it? proton.cz.avg.com/plan/31399/?detail=746216654982669497). You do need to connect the 5V ground to the Arduino ground. \$\endgroup\$ – avakar Sep 8 '14 at 14:14
  • \$\begingroup\$ You're right it's a NPN transistor, sorry I mean by "crashes" that i'm unable to communicate with the board, and RX/TX leds are always on As you told me avakar, I removed the transistor from my circuit (that's what I thought too, all is integrated) and put both ground together, but the same problem happened Should put a led between digital pin and relay ? \$\endgroup\$ – McSIME Sep 8 '14 at 14:25
  • \$\begingroup\$ As an experiment, try disconnecting the fan from the relay. You need a snubber there to suppress inductive spikes from the fan that can result in arcing across the relay contacts and can also result in resetting of nearby circuitry. See this answer to a similar problem: electronics.stackexchange.com/a/101879/25328 \$\endgroup\$ – Tut Sep 8 '14 at 15:07
  • \$\begingroup\$ When the fan is disconnected, the relay command fully works. Indeed I've the same problem, so I need to put the snubber between from "-" to "+" on the relay power circuit ? \$\endgroup\$ – McSIME Sep 8 '14 at 15:14

Since your problem goes away when the fan is disconnected, it sounds like your problem is due to the inductive spike caused from switching off the fan. If it were a DC circuit, the solution would be a flyback diode, however since this is an AC fan, you need a Snubber &/or a high-voltage clamp such as a bidirectional TVS diode (transient voltage suppressor) or an MOV (metal-oxide varistor). Besides causing "erratic operation", the inductive spike can also result in shorter life of your relay contacts.

You can make your own snubber or you can purchase one off-the-shelf such as Red Lion SNUB0000. Refer to the Red Lion SNUB0000 datasheet for application information. The best place to connect the snubber is in parallel with the fan.

The snubber alone will probably be sufficient, but if you provide a voltage clamp such as a bidirectional TVS diode or MOV, it must clamp at a voltage greater than the maximum peak voltage of your 230V line. Remember to account for the fact that your line voltage is un-regulated and may go higher, and 230V is RMS (not peak).

  • \$\begingroup\$ Thanks for your answer that is really usefull to me ! :) Unfortunately I don't have the components to do the RC snubber by myself... Do the capacity and resistor value or important for this circuit ? (Should 0.1µF and 100ohm be nice ?) \$\endgroup\$ – McSIME Sep 8 '14 at 18:10
  • \$\begingroup\$ Those components are likely to be fine, however you need to pay attention to capacitor voltage rating and power rating of the resistor. Have a look at this answer by Russell McMahon. For a fan (if not too large) probably a 1000V or higher capacitor (0.1µF. A one-watt resistor will likely be fine). A lower-wattage would probably be OK, but make sure it doesn't get hot. \$\endgroup\$ – Tut Sep 8 '14 at 18:49
  • \$\begingroup\$ I've made a test, and the problem disappears when I don't use Serial communication to command the relay board I've seen at this answer by Prabhat Singh "optoisolate RX and TX"... What does it mean ? \$\endgroup\$ – McSIME Sep 11 '14 at 7:28
  • \$\begingroup\$ Have you actually tried a snubber? When it comes to "erratic operation" due to inductive voltage spikes, many things can make the "erratic operation" cease without truly fixing the problem. Moving circuitry, changing ground connections, moving cables, etc. The best fix is to actually fix the problem. Anything else is just a "bandaid". If you don't fix it, you are likely to experience "erratic operation" here or in something else; and it is still likely to damage your relay contacts. I stand by my answer! \$\endgroup\$ – Tut Sep 11 '14 at 10:12
  • \$\begingroup\$ See also |Solved|PIC16F628A Resetting after relay turned off \$\endgroup\$ – Tut Sep 11 '14 at 10:29

You need to put the snubber from "-" to "+" on the relay coil. Problem will definitely be solved.

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.