Control Your Room Lights Using Your Computer

1,677

38

5

In this Instructable, i have made a system by which one can control your room lights or fan using your PC or mac.

To explain it better, i will categorise the complete intructable into two parts

1) Hardware section (includes arduino, relay and a power supply)

2) Software section (designing GUI using Processing software)

Step 1: Parts Needed

Below is the list of parts needed to build this instructable

1) Arduino (nano) or any other Arduino

2) Relay module

3) 12V Power supply

4) Breadboard

5) Connecting Wires

Step 2: Connections

This was time to connect all the parts.

The 12V power supply was used to power up the relay module.

To trigger the relay module, you can connect any digital pin of arduino to the input pin of relay module.

I have used pin 13 of arduino to trigger the relay.

As the arduino is powered up from usb port of your system, so don't forget to common the Ground of arduino to Ground of power supply.

For testing the load a 220V bulb was connected to relay module.

By this time the connection was complete.

Step 3: Software Section

There are 2 parts in software section.

1) Arduino's code

2) GUI using Processing software.

Both codes are attached for reference.

The arduino coding is quite simple, arduino is reading serial data from USB and turn on or off the relay module accordingly.

The processing IDE is also very similar to arduino IDE. Arduino library was imported in processing and a rectangle was drawn using rect function, whenever mouse is pressed in that rectangular area, a serial data is sent to arduino, which in result turn ON or OFF the relay.

Step 4: Testing the Project

This was time to test the project, and the result was quite good, it worked like a charm.

As it can be seen from the images that when mouse is clicked the bulb is turning ON and when again it is clicked the bulb is turned off.

For more details, you can refer to video link attached in the intro section.

Share

    Recommendations

    • Make it Glow Contest 2018

      Make it Glow Contest 2018
    • Plastics Contest

      Plastics Contest
    • Optics Contest

      Optics Contest

    5 Discussions

    0
    None
    hishamkumbra

    Question 6 months ago

    How can I add more lights?

    0
    None
    hishamkumbra

    6 months ago

    How can I add more light?

    0
    None
    KohK3

    1 year ago

    Hi,

    How can I contact you? I have some question I want to consult you on.

    0
    None
    VinitV

    1 year ago

    Hi

    Can we control it from mobile as well ????

    1 reply
    0
    None
    ShailzaPVinitV

    Reply 1 year ago

    Yes, we can, but for that you will be needing either wifi module or bluetooth module.