Introduction: Remote Control Light Switch
I'm a mechanical engineering student at Utah State University in Logan Utah. It's awesome, except for one thing. I sleep on the top bunk of a bunk bed, and the light switch is by the door all the way across the room. If I'm lounging in my bed, the last thing I want to do is jump out of bed, walk across the room and back, and then climb back up on my bed just to turn the lights on or off. That's why I've spent the last couple weeks designing and building a machine that lets me switch the lights on and off with a remote control from anywhere in the room! (Wait, I'm wondering if I actually saved myself any effort with this...)
The remote control light switch mounts over your current light switch in place of the panel that usually covers it. It uses a servo motor controlled mechanism to turn the light switch on and off. A pair of radio transceivers, one in the mechanism and one in a remote, allows you to control the light. It also has a button on the front that switches it as well, if you happen to be nearby.
This is my first draft of this design and I'm mostly using parts I have on hand, so there is clearly lots of room for improvement or other neat features. In this Instructable, I'll go through the process I used to design this and make it. I'll provide the CAD files and code that I've got, but you are more then welcome to modify it or make your own.
Let's get started!
Metal lathe (if you have one)
3D printer filament
Servo motor with servo horn
Another Arduino (for the controller)
Two RF24 transceivers
M3 screws and hex nuts (or similar size).
6-32 screws and hex nuts (or similar size).
1/8 in diameter round steel rod - two 4.5in lengths
Brass round bar (used to make small bushings, however not strictly necessary)
Step 1: Model the Switch
The first step is to model the light switch you have in a CAD program. I chose to use Fusion 360. I measured and drew the switch and the panel behind it, and used joints to fit it together. I used a rotational joint to allow the switch to rotate up and down, like in real life. This is very handy for testing the fits of the other parts.
Step 2: The Carriage
My design uses a sliding "carriage" to bump the light switch up and down. It slides on two 1/8in steel round bars and has a rectangular hole in the center that the switch goes through.
I added some small brass bushings that I made on a lathe so that it slides more smoothly. They have a 1/8in inner diameter, 3/16in outer diameter, and are 1/4in long and are press fit into holes in the carriage. It's probably a bit overkill, but I wanted to give it a try. They aren't critical, so you can probably get by without. You'll just need to modify the carriage design by shrinking the holes so that it can slide easily on the rods. Loose enough that it moves freely, but tight enough to keep it from wiggling or pivoting.
Step 3: Rack and Pinion
Next, we need a way to move the carriage up and down. I chose a rack and pinion with a servo motor to drive it. I used a gear generator plugin in Fusion 360 to design the rack and then attached it onto the carriage. Then, I made a matching pinion gear with a flange that fits over the servo horn. I added these to the assembly and positioned them so that they meshed nicely.
Step 4: Mounting and Enclosure
Next up is to make mounting geometry for the servo and the Arduino and a nice enclosure for everything to fit into. I positioned the Arduino and the servo where I wanted them, then used the edit in place tool to edit the panel design within the assembly. I projected all the mounting holes and features and extruded them to fit. For the lid that covers all the electronics, I decided to try to make some little dovetails on the plate that it can slide onto. With the right tolerances or a bit of filing, it fits together very nicely.
Now that its all designed, its time to print! Feel free to modify my designs to fit your switch or hardware. Make it even cooler if you can.
Step 5: Wiring
For wireless control, I used a RF-24 radio transceiver. I had a few lying around and they're not to hard to use. Make sure to connect the power pin of the RF module to the 3.3 volt pin on the Arduino. If you connect it wrong, you might fry it!
The servo connects to the 5v, ground, and a digital pin of the Arduino.
The pushbutton connects to the ground and another digital pin. Often if you want to wire a simple button like this, you need to connect a resistor into the circuit, however, if we connect this one to ground and a digital pin and set the pin mode to INPUT_PULLUP, we can get by without. Handy!
Wire up the RF-24, the servo, and the button as described in the schematic above.
Step 6: Assembly
Now that we've got all the pieces, its time to put it together. If you made bushings, press them into the holes in the carriage. Slide the rods through the holes in the panel and the carriage.
Make sure to align the rack and pinion in such a way that when the carriage is right in the middle of the sliders, the servo has rotated half of its travel, so it's able to move the carriage both upward and downward.
Securely bolt on the servo and the Arduino and attach the pushbutton to the lid. Make sure all the wires are in the right place and slide on the enclosure.
Step 7: Programming
The programming for this is pretty simple. You'll need to download the RF-24 library to run it. Find the 'RF24 by TMRh20' library with the Arduino IDE library manager. You can also find more information at its GitHub page: https://github.com/nRF24/RF24
The code for the controller simply reads whether a button has been clicked or not. If it has, it sends a '1' to the light switch device.
The light switch device will check if its radio has received anything or if the button on the front has been pressed. If it has, it rotates the servo either forward or backward to switch the lights on or off. And that's about it!
You may need to adjust the distance the servo motor rotates to fit your light switch. Simply change the values of the upPosition and downPosition variables in the code until it moves the proper amount.
I've added more details in the comments of the code, so if you want the nitty gritty details, its all in there.
Step 8: The Controller
The controller is pretty simple. It has a pushbutton and an RF module. Were this a finished product, I probably would have made a nice enclosure for it, but for now, it's stuck together on a breadboard.
I used an Arduino Mega with a breadboard shield because its what I had on hand. Any Arduino should work.
I've attached a schematic of the wiring above and the code below.
Step 9: Installation
To install, loosen the two screws that hold on the cover and remove it. Using those same two screws, attach the new automatic light switch cover to the switch. Make sure that the switch goes through the slot in the carriage.
Be careful not to touch any wires or anything inside. Electricity can be very dangerous.
To operate, plug both the switch and the controller. It may take a few seconds for the RF modules to boot up, but when they do, you should be able to operate your lights wirelessly with the push of a button. How convenient!
Step 10: Improvements
I'm very pleased with how this turned out so far. I've wanted to make a remote control light switch like this for quite some time. This project was a great learning experience for me as well. I figured out a lot of things I'd do differently were I to make one again.
For example, right now, the light switcher is powered through the Arduino's USB port, Unfortunately, however, there isn't a wall outlet I can plug it into within a 10 foot radius of the thing. Oops. Maybe I'll add a battery pack.
Also, I think that the remote control could be replaced with something a bit more user friendly. I used the RF-24 modules because I had them on hand and I knew how to operate them, but there are definitely better options. I think that using a phone app to control it over Bluetooth would be pretty handy.
One could also use a different mechanism to flip the switch. Some sort of mechanism with a cool gear train or clever linkage or some neat design to fit the décor of your room might be a nice touch. The possibilities are endless.
I hope you enjoyed this Instructable. I definitely enjoyed making it.
If you have any ideas on how to improve this device or how to make this Instructable more clear and easy to follow, please let me know!
First Prize in the
3D Printed Student Design Challenge