he guys .. i connecting my arduino to 5v power supply to the wall(220v), and there is relay connected to the arduino , every time i connecting to the wall same electronic device , like for example tv or xbox , the relay the arduino get electric disturb, and the relay gate opening ..... how can i prevent this to happen..
Can you post your circuit schematic ? does the Arduino reset when you plug something else in ?
arduino digital pin 3 -> relay arduino ground -> relay arduino 5v -> relay
arduino miniusb connector to -> 5v power supply -> ac 220v
hope i'st helps ..
There is any electric component that can prevent unstable voltage get to the arduino /relay ? maybe capacitor or resistor ??
That's not a circuit diagram, that's a description, and almost certainly incomplete. I'm expecting sensors that normally tell the Arduino to open the gate.
How is the wiring? (type, length, etc) What sensor do you use? Which exact relay? (link to data sheet)
the relay is : 5V 1-Channel Optocoupler Relay Module for Arduino H/L Level Triger
the circuit is match more complicated, its with 2 mini arduino raspberry pi web server and php server . many sensors and relays and all trigger by c programming code . so i simplified it.
the only problem is when high valuate device is plug into the wall , the 5v power supply gets unstable voltage and trigger the relay .
How about adding a fair size capacitor (1000uF) on the 5v rail ? have you tried that.
no . but it's sound like what i'm looking for ... i'm not fully understand the use for capacitor in this case . how dose capacitor preventing the unstable pulses ?
Most likely the problem is in the part you left out, which is why we need complete schematics (and not just a description, that doesn't cut it).
Is it the relay power supply that's the problem, or is it the Arduino that receives a false signal and based on that switches the relay, or is it the Arduino that resets and that way switches the relay? All are possibilities, and may require different solutions.
Based on the information given, that's all I can say about it.
Deva_Rishi: How about adding a fair size capacitor (1000uF) on the 5v rail ? have you tried that.
what is the volt of the 1000uf capacitor i need?
For the 5V rail: >5V.
Safe would be 10V or higher (tantalum or aluminium).
wvmarle: For the 5V rail: >5V. Safe would be 10V or higher (tantalum or aluminium).
thank you ..