title: How to connect a relay in such a way that both wall switch and relay are functional?
body: <p>I am trying my hands on home-automation using Arduino and a relay module. I'm trying to connect a light to the relay. The light is connected to the wall switch in the following manner:</p>
  
  <p><a href="https://i.stack.imgur.com/gXsPO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gXsPO.png" alt="Wall switch connection"></a></p>
  
  <p>Now I want to control the same light using my relay. To do so I have to remove the connection from the wall switch and connect it to the relay. But I want to make it work in such a way that the light can be controlled by both the wall switch and the relay module, so that if Arduino is offline I can use the wall switch to turn the light on or off.</p>
  
  <p>This is the kind of relay I'm using:</p>
  
  <p><a href="https://i.stack.imgur.com/t0KZK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t0KZK.jpg" alt="enter image description here"></a></p>
  
  <p>I am a complete beginner in this and don't know anything about circuits and connections, so it would be awesome if some of you guys can help. Thank you.</p>