Remote Control Light Switch

13,504

85

19

Introduction: Remote Control Light Switch

Hi everyone!

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!

Supplies

Tools:

Calipers

3D printer

Alan wrenches

Screwdriver

Metal lathe (if you have one)


Materials:

3D printer filament

Servo motor with servo horn

Jumper wires

Arduino Uno

Another Arduino (for the controller)

Two pushbuttons

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!

Happy making!

3D Printed Student Design Challenge

First Prize in the
3D Printed Student Design Challenge

Be the First to Share

    Recommendations

    • New Year, New Skill Student Design Challenge

      New Year, New Skill Student Design Challenge
    • Fix It Speed Challenge

      Fix It Speed Challenge
    • Raspberry Pi Contest

      Raspberry Pi Contest

    19 Comments

    0
    alexnovik
    alexnovik

    3 days ago

    Why don't you just use relay under toggle switch. Overengineered to my taste

    0
    khoskin
    khoskin

    Reply 8 hours ago

    my thoughts exactly :-D
    But I guess he had fun making it, which was possibly the point. Might have been banned from directly playing with the mains wiring.

    0
    khoskin
    khoskin

    8 hours ago

    It's very clever and I'm impressed with the effort put in.

    Although I have a back ground in electrical, electronic and computer engineering , with a reasonable mechanical knowledge, so probably stating the obvious I'd have just thrown a relay (maybe even a triac or solid state relay) and a microcontroller at the problem, and wired directly to the light circuit ! (I'd probably get something premade these days). Yes you need to know what you're doing with higher voltage electricity, it can be dangerous, but it's a lot easier.

    But yeah, where's the fun in that :-D

    0
    CreativeTinker
    CreativeTinker

    4 weeks ago

    Nice work Alan!
    I actually made something similar when I was a kid 50 years ago! The tools are so much better now. (And it was uphill in the snow both to and from school.)
    Pro hint: Bicycle spokes are great 2mm stainless shafts. 2mm eyelets fit perfectly for bushings.
    Challenge 1: Could you do this without a sliding element?
    Challenge 2: Could you do this and still have it be human opperable?

    0
    alanmerritt
    alanmerritt

    Reply 4 weeks ago

    Thanks for the comment!
    I'll have to see if I can get my hands on some bike spokes and give that a try!
    Before I started building it, I was thinking about how one could make it so that you can still move the switch by hand. I haven't quite figured it out yet, but I'm sure there is a way!

    0
    alexnovik
    alexnovik

    Reply 3 days ago

    Put control box under light switch and make control arm moving with the use of threaded rod (worm gear). Control arm then can be made flipable, just flip it towards you and toggle switch manually

    0
    CreativeTinker
    CreativeTinker

    Reply 4 weeks ago

    This is a great little project.
    Let me know if you need some hints or "design review".

    0
    remotecaptures
    remotecaptures

    Question 8 days ago on Introduction

    Awesome project! I don't see any limit switches. How do you make sure the carriage doesn't run to far either way and hit the top or bottom of the enclosure? Are you telling the servo to move just enough to hit the switch each time or did you design a mechanism that allows the servo to stop pushing the carriage before it hits the top or bottom but also allows you to move it back int he other direction? That would be neat!

    0
    icecats
    icecats

    14 days ago

    Wow, this is really cool! I have the same problem in my dorm room. Congrats on the contest win too! Trog Ebersips would be proud!

    0
    alanmerritt
    alanmerritt

    Reply 11 days ago

    Thanks! Hehe, I'm sure he would! ; ]

    0
    gravityisweak
    gravityisweak

    12 days ago

    I've got a suggestion for a minor change that would allow for manually controlling the light switch. The small cage you put around the switch handle itself is too small. If you modify that 3d printed part to simply go across your 2 sliders as a straight bar at the top and bottom and leave enough room for the switch to be in the on or off position the light can be in either the on or off position by hand. Then modify your programming so that when you hit the on or off switch remotely your slider moves up or down to turn the switch on or off then returns to a neutral position. Let me know if that was a clear enough description. Basically modify your diagonal braces on your sliding carriage so they go straight across to the other one instead of wrapping so tightly around the switch. This is an awesome instructable! People commenting that you can do it more cheaply or easily with other technology are totally missing the point!

    0
    corradini
    corradini

    13 days ago

    SOOoooooo....I have 2 comments, both probably variants of what've been said already, but: both meant to be constructive, and helpful for future Makers.
    (A) This is a really nice piece of engineering -- for what it's trying to be. I.e.: given that the decided-upon approach is to mechanically switch the existing light switch, and goes down that pathway, it does so very nicely. AND, may I point out, it also illustrates rather a number of very interesting techniques and solutions that people might find quite helpful and or simply entertaining (and it's well-documented, -illustrated, and -explained!) (I would quibble slightly with the choice to machine the bushings vs. using off-the-shelf components - that choice kind of pushed this approach a little bit too far into the "quirky one-off (and expensive/difficult!) solve" domain -- it's one thing to program an Arduino or print 3D parts these days; it's another to assume access to and expertise with a metal machine shop.)
    (B) It may or may not be the "best engineering 'solution'" to the problem itself: i.e., do we really want to Rube Goldberg a whole rack-and-pinion box with smart-board control simply to flip a switch, when we could -- well, not just put in a remote switch (that's ... "TOO simple", if you get my drift? and I think we're pretending an off-the-shelf solution doesn't already exist), but at least use something in-between, cheaper, and more-appropriate, like a relay, or servo? This just seems like massive engineering overkill - again with the Rube Goldberg - and (both time/effort and actual parts) expense.

    0
    schuylergrace
    schuylergrace

    14 days ago

    Nice project, but you know, you have power right there at the light switch? A simple regulator circuit, tapped into the 120vac feeding the switch and housed in your existing box, could feed whatever you needed to power. And although I like the mechanical part best (despite being an electrical engineer), you could also just fire a solid state switch with the Arduino and eliminate all the mechanical bits.

    0
    PicRic
    PicRic

    14 days ago on Introduction

    Great job but why when a Bluetooth light switch can be bought for less than $20?

    0
    ketch22
    ketch22

    16 days ago

    Very cool! Thanks for sharing this!

    0
    NirL
    NirL

    Tip 16 days ago

    nice job! maybe consider a ESP32 with a Bluetooth or a WiFi connection, and make some app to control it. That way you can have multiple switches and operate them all through your smartphone :) You should check out Blynk (I haven't used it for a while but it used to be free and super useful!)
    Other people also mentioned some cool ideas :)
    good luck in the future and I hope you keep on sharing here!

    0
    knightofday
    knightofday

    21 days ago

    Having a manual switching option of some sort (or pushbutton?) on the fixture itslef would be very cool.

    0
    Mark Liu
    Mark Liu

    4 weeks ago

    Very nice! What are the appropriate specifications for the items used? Do you have any cost-effective recommendations? Is this small servo motor fit?