Day and Night Power Strip!: a Light Sensitive Power Outlet

Introduction: Day and Night Power Strip!: a Light Sensitive Power Outlet

The Day and Night Power Strip is a power outlet capable of switching its output depending on the light it receives on its surface. Its sensors are LDRs which are basically variable resistors that change resistance depending on the intensity of light it receives, the more intense the light, the lower the resistance.

It can be used outside or anywhere near a window where the light of the sun is visible to control its outputs. There is also a potentiometer to adjust its sensitivity to light. This is very useful if you are tired of turning on and off your stuff during the day!

This could turn your ordinary lamp into an automatic night lamp! Since one of its outlets turns off during the day but turns on at night. Also, the other outlet does the opposite so you could plug in things you want to be on only during the day. The great thing about this is its usefulness because you could plug anything you want to it since it acts just like a power strip but with automated controls!

I got this idea when thinking about the lights I am going to place on our small fish pond. I want it to automatically turn on at night but turn off during the day. I cannot find power strips that can do this so i have to make my own.

This build will take some of your time but it will be worth it. The only skill requirement here is soldering and some knowledge about electronics or at least some understanding about circuit schematics (I did not fully simply the schematic I made since I only made it on the spot while doing this instructable).

You have to be very careful and always check if the connections are properly connected! The first one that i made got fried because i accidentally shorted some wires while building it so i started again. Make sure you reduce the use of wires to make your life easier and reduce the risk of shorting anything inside. It took me a whole day to make it but that includes testing the circuit on a breadboard. But for you guys, this may take just a couple of hours.

Step 1: Prepare!

-The lists only considers the exact number of components used on the circuit as seen above. Be sure you have extra!
-Note that I used 4 LDRs which is still considerable to 1 LDR since they are in parallel and series. I did this so that they would work as if they are a larger LDR to make sure only the ambient light will activate the circuit as much as possible.
-The schematics are updated!
-If you are not very familiar with the components, you could google it to know more about it. The components used here are fairly common.


Power Supply
(If you dont want to make your own power supply, you can have those already made, those are the power supply of your switch hub etc. the black ones)
-AC Cord
-Transformer (7.5-0-7.5) I only used 7.5 to 0 to have a 9v output (thats 7.5 / 0.707)
-Bridge Rectifier (I bought the ready made one)
-4700uF Capacitor 16v or above!

Relay Driver
-x4 LDR (10mm) it doesn't necessarily need to be 10mm, just pick the size you want
-12V Relay, the relay i bought was rated 12V but it runs on 9V just fine
-10K Potentiometer (Used to adjust sensitivity to light)
-x2 NPN Transistors (I used 2N3904)
-x1 PNP Transistor (I used 2N3906)
-x4 1k Resistors (in the circuit i used 1k for all the resistors)
-x2 LED (This is used to indicate which outlet is on, I used blue)
-Universal PCB (At first I did not use any PCB and just connected the components directly. But the problem is the components may short inside the casing, I highly recommend you use a PCB)

Final Parts
-I used an HC981 enclosure (You could use a larger enclosure to make your build easier to make)
-Two power outlets
-#22 gauge wire, i used solid wires (blue) as a jumping wire on the PCB and stranded wires (orange) for the components that are not directly connected on the PCB.

Step 2: Short Explanation About the Circuit

Circuit Flow(Notify me if there is anything wrong!)

1.) Power Supply
The transformer, bridge rectifier and capacitor only acts as a DC supply to the circuit only! Not to the sockets. It supplies approximately 9V since the secondary of the transformer gives 7.5V RMS meaning you should divide 7.5V to 0.707 which gives us 10.6V - (2)(0.7) = 9.2V. The (2)(0.7) is caused by the voltage drop across the diodes in the rectifier bridge. The 4700uF is enough as our filter capacitor since the load does not exceed 200mA.

2.) Principles to Remember
NPN transistors turn on if the base to emitter junction has 0.7V Ideally(usually 0.6V in reality)

NPN transistors could also be turned on when its base is connected to a positive DC supply.
PNP transistors turn on when its base is shorted to the ground.

NPN transistors' loads should be on the collector.
PNP transistors' loads should be on the emitter.

The relay uses Faraday's Law to turn its switches. Applying current to its coils creates a magnetic field thus moving its switch.

3.)Controlling the Day LED and the Relay
Since NPN transistors turn on if the base to emitter junction has 0.7V, we could take advantage of the varying resistances of the LDR together with the potentiometer.

If you look at the LDR and potentiometer on Q1, they are much like in series since there is almost no current flowing on the base of the transistor. Since we could consider that they are in series, If one of them changes its resistance lets say the LDR, the voltage across the potentiometer will be different from before. And since the potentiometer lies across the junction between the base and emitter of Q1, the voltage across the potentiometer will also affect the transistor. So, if the voltage across the potentiometer reaches 0.7V, because of the changes on the resistance of the LDR as the ambient light changes, the transistor (Q1) will turn on.

After the Q1 turns on, the transistor will seem to be shorted to the ground since it acts as a switch in this configuration. Thus making the Day LED and the Relay seem to be connected to the ground therefore turning them on.

4.) Controlling the Night LED
For Q2, its base is connected to the collector of the transistor. If you imagine that Q1 is still off (not yet shorted to ground), the base of the Q2 will be connected to the 9V supply since it can flow on the relay but not through the transistor.

Since Q2's Base is connected to the 9V, Q2 will turn on thus shorting the base of Q3 (PNP) to the ground to turn on the Night LED. If however, Q1 turns on, the base of Q2 would be considered to be shorted to the ground even if it can flow through both the relay (400 ohms) and transistor since the flow through the transistor has a smaller resistance. Electricity tends to choose a path where there is lower electrical resistance.

Step 3: Creating the Circuit

This involves soldering the components on the PCB

The circuitry
I used a Universal PCB to put together the components in place. Make sure you give extra spaces between the components to make your soldering easier.

I used solid wires as jumping wires on the circuit because its more stable than stranded.

As you can see in the picture I have attached the relay upside down so that the AC wires will be easily connected. I just glued the relay to the PCB.

I have connected the components that will not be directly attached on the PCB using the #22 gauge stranded wire (orange) this is because stranded wires are more bendable than solid wires.

Step 4: Connecting the Parts to the Enclosure

Cutting the openings
I have cut out openings on the enclosure for the parts to pop out. You could use a small wheel saw and a drill to cut the openings but if you don't have one like me, i just heated a knife on a stove until it heats up to cut the enclosure and an old soldering iron to cut a hole through the enclosure. It doesn't look that great but it works!

Glue them in place
I just glued the transformer in place on the enclosure, the potentiometer, the LDRs and the LEDs are under the PCB. I just glued everything in place except for the potentiometer since it already has a nut. Make sure you do not use glue gun too much since it doesn't go where you want it sometimes. I only used super glue on LEDs.

For the AC, I used the stranded wires as seen on the picture. Always be sure to solder the connections properly.

To check for the connections, you could use any method you want. I just used a 9V battery, resistor, LED and some wires. There are two wires, one is connected to the LED and one is connected to the battery. If the two wires short, the LED will light up. Be sure the connections on the relay reach to output of the outlet!

Step 5: Testing!

As seen on the pictures, we could simulate the darkness of night just by covering the sensors

Since I dont have the lights for our fishpond yet, I just used our filter as a test! As seen in the picture the filter is connected to the DAY outlet, meaning it will turn on when the ambient light is bright.

I have also tested the other outlet and it works, it only turns on when it is dark.

Step 6: WE'RE DONE!

This could be useful for many applications. This could convert an ordinary lamp to a nightlight! This will turn on and off stuff for you automatically. I plan to connect our filter to the daylight socket so that it would not run for 24 hours. I will also connect led strips to the Night socket so that it would only turn on at night to illuminate our fish pond. Its up to you where you would use, there are so many possible uses!

Since we are done, I'm just going to upload a bunch of pictures and some notes about the one i made of the and its up to you to make your own version of it. Mine does not look very professional but hey it works!

So I hope you enjoyed my instructable, dont forget to vote and thanks for reading!

If there are any questions please leave a comment and I would gladly reply!

Supercharged Contest

Participated in the
Supercharged Contest

Make It Glow Contest

Participated in the
Make It Glow Contest

Workshop Contest

Participated in the
Workshop Contest

Manly Crafts Contest

Participated in the
Manly Crafts Contest

Be the First to Share


    • Pocket-Sized Speed Challenge

      Pocket-Sized Speed Challenge
    • Audio Challenge 2020

      Audio Challenge 2020
    • Maps Challenge

      Maps Challenge

    9 Discussions


    6 years ago on Introduction

    Nice project, but one photocell should be more than enough to drive the relay. Put one photocell from the base of Q1 to ground and a 100K resistor from positive supply and Q1 should turn on. You may need a bigger resistance.


    Reply 6 years ago on Introduction

    Thanks that would work too but opposite with what i did. Using that circuit, the relay will only turn on when its dark (high resistance). Also the 4 photocells that i used is arranged in such a way that they are still equivalent to 1 photocell.


    Reply 6 years ago on Introduction

    The way you have it set up, Q1 works all day running the relay and LED and when it finally stops Q2 and Q3 run the other LED. Did you find that Q2 could not run the LED by itself? You shouldn't need to use 2 transistors just to run an LED while one transistor runs an LED and relay.


    Reply 6 years ago on Introduction

    Wow didn't notice that at all. Q2 was completely unnecessary since I could just connect the base of Q3 directly to Q1. Thanks for that sir hope I could improved my circuit earlier


    Reply 6 years ago on Introduction

    No, Q1 would pull Q3 base low so it would work when Q1 works. Try Q2 although it may not have enough supply voltage to run the LED well. Maybe you could put the PNP base on the photocells too. You have enough of them.


    Reply 6 years ago on Introduction

    Yes i understand now. my comment earlier is incorrect i said q2 instead of q3. q3(pnp) is the one that is unnecessary since q2(npn) alone could be used as the inverter

    Good Instructable ,but the schematics could be a bit more readable. Is there a reason you used 4 LDRs instead of just 1?


    Reply 6 years ago on Introduction

    The reason I used multiple LDRs is to make it work like a larger LDR. This is to make sure that only the ambient light will be considered by the sensors as much as possible.
    The reason i used 4 LDRs is to have them in parallel and series so that their resistance will still be equal to one LDR since I only used one while testing the circuit.
    Thank you sir I will update the schematics and add more notes on my instructable soon.