Good morning, i'm building a machine and came across the necessit of using a incremental encoder because of a belth, i used the arduino uno to program, in a determined moment the arduino turn on a relay to open a compressed air valve, but sometimes the arduino restart, i think it's because the relay, so i add 2 power supplies, one for the arduino e one for the relay, to isolate both i'm using a transistor IRF3205 and in the relay coil i added a capacitor 104 and a diode 1N4733A, but even with that the arduino is restarting, what should i do?
If you disconnect your arduino from the circuit, then run your code, does your code run without restarting the arduino?
If the arduino continues to reset without being connected to the circuit, copy and paste your code in this thread. Be sure to format the code and click the < CODE > button and paste the code where it says type or paste your code here
Maybe your circuit is pulling the arduino into "brownout" (is the digital pin sourcing more than it safely should) - verify your circuit is connected correctly and works as intended before reconnecting it to your arduino.
[edit]
I think the ground (or power) path of the relay coil should be interrupted by the IRF3205, which is controlled by the arduino. Your drawing looks like the coils are always connected to power, and the IRF3205 is trying to switch ground on the COM. This is the LUZ-5-R drawing
.
Translation - the schematic is a fiction. Please take a pen and paper, draw it as it really is, and post a photo of that. Include absolutely everything, power supplies too.
Sorry about the long time to a response, but i'm powering through the usb port. I changed the schematic a little, just to change the relay module to just the relay.
The red and black wires from the arduino are the VCC and GND from the encoder, the brown and white are the D2 and D3 from the encoder.
The white wire coming from the right of the image is from the other power supplie of 5V.
Now this is the output without the air valve being connected to the relay, it works fine.