Arduino Nano(better)/Arduino Uno
5v 2 channel relay module
IR receiver VS1838B LED
IR remote control (can be your TV remote control)
1x Blank Wall Socket
3x Electric Socket Outlet
3'' x 12'' switch white box
3 Phase Wire
Mini Breadboard
3-Pin Plug
Jumper Wires
Download the IR Library from the library manager to your Arduino IDE software .
Search the Library shown in the diagram.
Put in the code given here ============>
(You will need to replace the code at each case with the Decimal number that you obtained from the button you pressed from your remote. For example, if you want Button 1 to turn ON your socket, you will need to replace the code "16753245/or the opposite of it, i guess..!" with the one obtained from your remote control in your serial monitor)
Connect the VCC pin of the IR receiver to pin A4 of the Arduino Nano.
Connect GND Pin to pin A3 of the Arduino Nano.
Connect Signal pin to pin A2 of Arduino Nano.
(You also can refer to this schematics for simpler understanding.)
Connect IN1 Pin to D7 of the Arduino Nano.
Connect IN2 Pin to D6 of the Arduino Nano.
Connect the VCC to 5V of the Arduino Nano and GND to GND of the Arduino Nano as usual.
Connect live wire of the 3-pin plug cable to the 2nd terminal of the 1st relay. (the socket of the 3-pin plug will be used as the power supply for the arduino .)
Use another copper wire to connect the 2nd terminal of the 1st relay to the 2nd terminal of the 2nd relay.
Connect the 3rd terminal of 1st relay to the live wire of Socket 1,S1.
Connect the 3rd terminal of 2nd relay to the live wire of Socket 2,S2.
Arrange the copper wire neatly so that it wont look messy or complicated.
Make a hole at one point of the socket casing so that it would allow the cable for Arduino Nano easily to be connected to the computer for coding.
Test your socket first to ensure that there will be no error that might happen before screwing everything up.
Then, Screw everything up, arrange it nicely and you're good to go.
please leave a review here.