Introduction: Control Your Room Lights Using Your Computer

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

Picture of 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

Picture of 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

Picture of 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.

Comments

KohK3 (author)2017-07-20

Hi,

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

VinitV (author)2017-07-13

Hi

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

ShailzaP (author)VinitV2017-07-16

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

About This Instructable

1,168views

36favorites

License:

More by ShailzaP:Control LED Strip Intensity Using Mouse Scroll Button || Install LED Strip at the Back of Your MONITORControl Your Room Lights Using Your ComputerCharge your cellphone from 9V battery
Add instructable to: