2

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?

Edit

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

Adam Lawrence
  • 32,921
  • 3
  • 58
  • 110
McSIME
  • 21
  • 1
  • 4
  • 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. – Vladimir Cravero Sep 08 '14 at 14:10
  • You don't actually need the transistor or the diode, both are integrated on the relay (this is the one, isn't it? http://proton.cz.avg.com/plan/31399/?detail=746216654982669497). You do need to connect the 5V ground to the Arduino ground. – avakar Sep 08 '14 at 14:14
  • 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 ? – McSIME Sep 08 '14 at 14:25
  • 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: http://electronics.stackexchange.com/a/101879/25328 – Tut Sep 08 '14 at 15:07
  • 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 ? – McSIME Sep 08 '14 at 15:14
  • No, the snubber is for the fan and the best location is in parallel with the fan. See the application information in the [Red Lion SNUB0000 datasheet](http://www.redlion-controls.com/Products/Groups/NoiseSuppression/SNUB/Docs/12027.pdf) – Tut Sep 08 '14 at 15:17

2 Answers2

6

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

Tut
  • 4,195
  • 1
  • 21
  • 38
  • 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 ?) – McSIME Sep 08 '14 at 18:10
  • 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](http://electronics.stackexchange.com/a/42142/25328). 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. – Tut Sep 08 '14 at 18:49
  • 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](http://stackoverflow.com/a/23106839) "optoisolate RX and TX"... What does it mean ? – McSIME Sep 11 '14 at 07:28
  • 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! – Tut Sep 11 '14 at 10:12
  • See also [|Solved|PIC16F628A Resetting after relay turned off](http://electronics.stackexchange.com/questions/101815/solved-pic16f628a-resetting-after-relay-turned-off/101879#101879) – Tut Sep 11 '14 at 10:29
  • I didn't received yet the snubbers, and I totally with your point of view. In the meantime, i'm dividing my circuit and make each part works separately and trying to get the most possible issues. 1) The arduino switches the relay ON/OFF normally without any RX data input 2) The arduino switches the relay ON/OFF normally when there is a data input, but needs a big delay between Serial.read() and digitalWrite() 3) The arduino sends TX data normally when it's the only work to do – McSIME Sep 11 '14 at 10:53
  • I'm pretty sure that the answer you shared is my issue – McSIME Sep 11 '14 at 10:54
1

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

enter image description here

Null
  • 7,448
  • 17
  • 36
  • 48