hello
i am using a jd-vcc rely with a custom atmega328p board that i made(pcb) the board is fine i tried it without the relay it worked perfectly but when relay is connected every time i send it a LOW signal it resets my atmega328p the relay is connected to a different 12v power supply to power on a valve i read everywhere but it didn't help
Welcome to the forum
Please post your code and a schematic of your project
As well as adding a schematic, add a link to the relay (or relay module).
i dont have a schematic for my project th board is https://www.ebay.com/itm/125124157117
Is the jumper JD-VCC in place? That then powers the relay coil from the same power supply as the arduino. If you remove the jumper do you still get the reset problem? Clearly then, the relay will not be powered but then it will be clearer where the problem is.
Is the valve operated by 12 volts DC ? If so, you can try reversing a diode across its coil.
it a 12 volt dc valve and the jumper is in place i will try without it
it does not reset the system now what
Put the jumper back but disconnect the 12 volt supply to the valve to see if the reset problem shows itself.
nope it does not
Then it looks like the electrical noise from the operation of the 12 volt valve is causing the problem. Have you a diode which you can put across the valve coil (or even the relay contacts). You reverse this diode so it functions as a flyback diode.
Incidentally, what are pins 11 and 13 connected to ? Are these both connected to the relay board ?
no pin 11 is connected to reset pi (atmega328p pin 1)
it works!
thank you very much
The recommended way of forcing a reset is to use the watch dog timer reset feature.
Anyway, it seems it all works now.