Introduction: Futuristic Green SmartSwitch
We use light switches everyday. However, little do we realize how much energy is wasted when a light switch is unnecessarily left on. Rarely in some companies, you would see a PIR motion sensor switch that can turn on the light when someone enters a room and automatically turn off the light when the room is idle. However, the most significant thing I have noticed is that it is 2015 and we are still using dull light switches which are plastic toggle or rocker switches made from 19th century. So the goal here is very simple: Why not make a futuristic portable light switch that is installation free and environmentally friendly?
As a college student, I do not have the best appliances or lamps. Often, I find myself struggling to toggle a lamp or appliance. In the end, I just hate the switch because it is plainly hard to toggle. Also, there have been a few times where I simply left my apartment forgetting to turn off my lamp, fan, or even soldering iron. But as a hobbyist, inventor, and programmer at heart, I did my best to make a clean DIY solution for us all to save energy (and our appliances) while making it more convenient to turn things on or off.
Before you read on, it is important to understand a few things:
1. My intention of making this Instructable is not to infringe anyone's idea, patent, or product. I am simply sharing a project that I made on my free time and hope that my designs will someday help people.
2. Please understand that there may be slight flaws or better way to do things. Although I always welcome your comments or suggestions, I would prefer if we can keep any criticism to a minimum. If done right, the product conforms to standard wiring, is relatively safe assuming the enclose is closed, and fully functional.
3. As a disclaimer, if you have never done any electrical work and do not have proper experience in soldering and basic electronics, I would advise you to get on Google and learn these things or take a few classes about basic electronics and systems control. This Instructable utilizes high voltage, therefore you are advised to use caution when working with such equipment. *I shall take no liability of any damages or injury that may occur due to this project*
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Parts and Resources
For this project, you will need the following resources:
- 3D Printed custom enclosure (Provided by Dominick Lee)
- 40A Solid State Relay
- Arduino Nano
- 1 Mega Ohm resistor
- USB outlet charger
- 1ft extension cable
- Soldering iron and rosin core solder
- 22 AWG wire (or equivalent)
- Copper Conductive Adhesive
- Double Sided Tape
- Electrical Tape
- Wire Strippers (makes life easier)
- Masking Tape
- Hot glue gun
Step 2: Front Cover
Go ahead and 3D print the provided files for the enclosure. There should be two pieces for the enclosure: the box and cover. Once your print job is finished, apply a thin piece of copper conductive adhesive that draw a connection from the front to the back of the cover. Then place a larger piece of copper adhesive over the front side of the cover. Insert the LED (single or RGB color, your choice) through the front cover and apply hot glue to secure it properly.
Step 3: Prepare the Plugs
Cut the cable
To connect the switch to an AC outlet, we need to prepare male and female connectors. The most convenient way of doing this would be to snip a short extension cable. Cut the extension cable in half and carefully strip the all the wires on both ends.
Test both ends
Grab your multimeter or DMM and set it to test for continuity. Check that the wires of corresponding color show continuity. If any connection in your cable does not match, do not proceed until you find a working connection.
Also, as a word of common sense, NEVER plug any part of this cable into the wall until you have completely finished building the circuit and checked your wiring. Doing so can result in injury or fatal results.
Step 4: Wiring the Circuit
Preparing the AC cables
1. First, we need to connect the power source by taking the wires from the male AC plug. Identify all three wires (white is the hot wire, black is the neutral wire, green is the ground wire). Start by inserting both the male and female AC cables through the box. Strip and lightly tin all the wires with solder.
2. Hot glue the cables to the wall of the box to make sure they do not fall out. For your safety, make sure the AC cables are securely hot glued to the box.
3. Connect BOTH neutral (typically black) wires together and solder them.
4. Connect wires to both ends of the USB outlet charger with copper adhesive and secure them tightly with electrical tape. Solder the respective ends of those wires to the corresponding AC input wires (hot and neutral). Wrap all connections in electrical tape.
5. Connect BOTH ground (typically green) wires together, solder them, and wrap tightly with electrical tape.
6. Now, the ONLY free connections that have not been taped should be the two hot (white) wires from the two AC cables. Connect both those wires to the load (high voltage) side of the relay. Polarity of that does not matter.
7. Wrap any remaining AC cables with electrical tape. Use double sided adhesive to mount the relay inside the enclosure.
The overall project schematic has been provided for your convenience.
Step 5: Power for the Arduino
We used a USB outlet charger for a particular reason: USB chargers are everywhere and they regulate the perfect amount of voltage for powering the Arduino. The Arduino accepts an input voltage of 5v from USB, so to power the Arduino for this project, we will tap into the USB connector of the charger. Of course, you are definitely welcome to use your own 120v AC to 5v DC step-down circuit.
Because I wanted to keep the size of the enclosure small, I have directly applied to thin sheets of copper tape to a piece of plastic and inserted it to the USB port of the charger. Observe polarity of the USB pinout. Connect the ground terminal to the Arduino's ground terminal and the 5v terminal to the Arduino's 5v terminal.
Step 6: Let's Get Digital
Finish off by connecting the rest of the components to the Arduino.
Connecting the LED
Solder wires to the anode and cathode of the LED. Connect the respective terminals to Digital pin 12 and GND on the Arduino. Check the polarity.
Connecting the Touch Sensor
Grab your 1 Mega Ohm resistor and solder it to Digital pins 5 and 6. The polarity does not matter. Grab a small piece of wire and tape one end to the copper conductive adhesive on the front cover and solder the other end to the Arduino's Digital pin 6.
Check your connections and wrap any power wires with electrical tape.
Step 7: Compile Code and Finish
Open the Arduino code provided for you and plug in your Arduino. Ensure that your project is NOT connected to the AC outlet yet. Go to the Arduino IDE and click Tools > Serial Port and make sure the correct COM port is selected. Also, make sure that you selected the correct Arduino board.
Take a look at the code. Feel free to modify the time variable to any length you want. The lower the interval, the quicker the relay automatically shuts off. Shorter intervals are recommended if you plan to use the SmartSwitch for your soldering iron or hot glue gun. Longer intervals are recommended if you plan to use the SmartSwitch for a reading lamp, LED strip, fan, 3D printer, or anything that should stay on for an extended period.
The possibilities for this project are endless! You can hook up the SmartSwitch to almost anything you want! (though I wouldn't recommend anything like a hair dryer, heater, etc.)
I hope you have all enjoyed this Instructable and will find it useful for your daily appliance needs! Please vote for me in the Instructables competition if you liked this project. Thanks!