Hi , I'm doing this soil moisture sensing project with a solenoid valve to automate the watering using an atmega32A microcontroller . I'm using external power pack to give 12 V to the solenoid valve and 5 V regulator to convert the 12 V and give to the microcontroller. I've attached the 12 V solenoid valve with a relay to the microcontroller. and I have added a LCD to display information.I have included 2 interrupts in the code which will display 2 messages in the LCD .
The relay switching and everything works fine with the 12 V supply until I attach the solenoid valve to the other side of the relay. and when the 12 V solenoid valve is connected those interrupt functions starts showing up in the LCD even when I'm not pressing the interrupt switches.and the circuit sometimes gets reset. and sometimes other characters starts showing up on the LCD.
if anyone can help I would be grateful !
The relay switching and everything works fine with the 12 V supply until I attach the solenoid valve to the other side of the relay. and when the 12 V solenoid valve is connected those interrupt functions starts showing up in the LCD even when I'm not pressing the interrupt switches.and the circuit sometimes gets reset. and sometimes other characters starts showing up on the LCD.
if anyone can help I would be grateful !