I have the following circuit:
The relay will basically be controlled by the Arduino (using pin 3), based on a value it's getting (from a NRF24L01 module). However, I also want the relay to be controllable via a button.
Problem:
Controlling the relay with the button is working fine WITHOUT the load (a 3-way motorized valve) being connected. When the load is connected, the button gets randomly pressed WHILE the valve is moving.
Based on this observation, I guess the 3-way motorized valve interferes with the button. Sadly, I cant figure out how to solve this error. I've spend several hours, with no success. Some things I've tried:
- add flyback diodes around valve
- attach the button in different ways
- tried placing resistors
- seperate the relay circuit from the rest, as it should ideally be (I was not succesfull doing this, because the transistor must be connected to the common ground? + the Arduino has the same power source as the 3-way valve..)
Another solution is (I think obviously) to seperate the relay circuit from the rest. But I can't figure out how to split the 12V power supply into two seperate power sources.
My temporary solution...
Since the button only gets randomly pressed WHILE the valve is moving, I've written my code to ignore the button during valve movement. I consider this as a temporary solution. I want to understand what exactly is going on and how to solve it.
Is the motorized valve interfering? How to solve this problem?