I am trying to turn on and off a lamp I have at home using a relay controlled by my Raspberry Pi. Here are the exact parts I will be using:
My lamp:
My relays:
Potential outlets I would be using (mains):
OR:
With all the equipment being listed, my procedure would be:
Peel off the lamp cable and connect the lamp's power supply to the relay so whenever the Pi closes the circuit, the lamp is powered on.
I am aware that there are risks implied when tampering with the "mains" voltage. With that being said, I would like to ask the following questions:
Will it be dangerous to do this with the hardware listed above? Please know that I would place the relay on a surface that does not conduct electricity (potentially wood), and the though of touching any hardware (not even the PI) while the lamp is connected WOULD NOT EVEN POP IN MY HEAD.
I am aware that the relay may fail since I've read in some forums that this is supposedly a 5V relay (maybe not?). If it were to fail, would it be dangerous? As in, would my whole house be in a blackout or something like that? Any advice for that?
3.If you were to consider this safe, would it make a difference if I cut/tamper with the wire before or after the manual switch my lamp has? (please refer to the switch image above).
How would I be able to identify which wire is positive and which negative if I cut open my lamp's cable?
Would it make a difference to connect the lamp to the black extension cord (please refer to the picture above) rather than directly to the mains outlet?
I am still debating whether to give this a try or not due to security reasons. I am aware of how dangerous tampering with house-level voltage (especially current) is, therefore I need your help to better analyze the situation.
Thank you so much for your help!
QUICK EDIT:
FYI, I currently live in America, therefore I am assuming my mains V supply is 120V...