Remote control a Relay with Arduino and a Laser

This guide allows you to control any electronic device with a Laser using an Arduino, a light dependent resistor, and a relay module. This will work for any device that can be plugged directly into the wall outlet. All Links to buy parts are in this guide.


– LDR (Light Dependent Resistor): Dealextreme
– Relay Module
– A laser for testing.

Arduino Wiring

First, connect your Relay Module to an arduino :

The relay module has the following connectors, these connections should be the same for any Arduino Relay Module :

The relays can be closed by applying a “high” to any of the Channel pins.

Now we also need the LDR to receive our laser beam:

Arduino wiring diagram ldr

for the Analog In, I will be using pin 4 but you can use any Analog Input you want.

Wiring Relay

A relay is just an electrical switch, a relay would be connected the same way you would add a switch to a electric device.


A Relay usually has 3 connectors :

C Usually, the wire that comes from your power supply
NO Normal Open : Device is OFF when sending a 0 (low)
NC Normal Closed : Device is ON when sending a 0 (low)

Wiring a light bulb :

– From your wall socket, go to the C on your relay.
– Then from the NO connector go to your Light bulb
– From the light bulb, go back to your wall socket:


Arduino Code

Program following code in your Arduino, change the relay pin to your wiring setup.

int value=0;
int led=13;
int relay=8;

void setup()

void loop()
   value = analogRead(light);
   if(value == 950){


Leave a Reply

Leave a Reply

Notify of