Loading
carjo3000

Servo Switch Plate Mount

by carjo3000 Dec 16, 2015
Download All Files

Thing Apps Enabled

Please Login to Comment

Good job but totally useless, costy and ugly lol

Totally not useless...it barely even costys 50cents if you print it yourself (unless you're too dumb to know how and have to buy it), and its not ugly either, i printed it with high quality print on a low-medium grade printer (Quidi X-One 2) and it looks great! Go be gloomy elsewhere, this is a cool project i was going to make myself until i saw some other genius made it already, thanks a lot carjo3000!

Useless? Maybe for you, not me. Costy? Maybe if you're ordering it, in which case everything is. I'm not. Ugly? Yeah I'll agree with that, but you can't do much better and still keep it this simple and not permanent.

hi i printed your 3D model and hooked it up to an arduino nano, when i ran your example code the servo kept spinning in one direction and only stopping for a bit

If anyone would like to use their phone to control this light switch using a Telegram bot and a Raspberry Pi, here is my Python code below. I am no expert at programming by any means, but the following did work for me. You may have to change the numbers in the 'p.ChangeDutyCycle(x)' if your servo differs from mine, but besides that, I think it should work for you.

More information about Telegram bots can be found here:
https://core.telegram.org/bots
https://core.telegram.org/bots/api

import RPi.GPIO as GPIO
import time
import telepot
from telepot.namedtuple import ReplyKeyboardMarkup, KeyboardButton

GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.OUT)
p = GPIO.PWM(7,50)
p.start(7)

def handle(msg):
chat_id = msg['chat']['id']
command = msg['text']

if command == '/on':
    p.ChangeDutyCycle(2.5)
    time.sleep(1)
    p.ChangeDutyCycle(7)
    time.sleep(1)
    p.ChangeDutyCycle(0)
    time.sleep(1)
elif command == '/off':
    p.ChangeDutyCycle(12.5)
    time.sleep(1)
    p.ChangeDutyCycle(7)
    time.sleep(1)
    p.ChangeDutyCycle(0)
    time.sleep(1)
elif command == '/keyboard':
    bot.sendMessage(chat_id, 'Here you go!',
                        reply_markup=ReplyKeyboardMarkup(
                            keyboard=[
                                [KeyboardButton(text="/on"), KeyboardButton(text="/off")]
                            ]
                        ))

bot = telepot.Bot('ENTER YOUR BOT AUTHENTICATION TOKEN HERE')
bot.message_loop(handle)

while 1:
time.sleep(10)

pls what kind of arduino are u using pls, because i need a cheape one, and thank u very much

Anyone that is having a problem with the SG90 servo moving the switch, the problem most likely isn't the servo, it's the code. If you're using the example code supplied with this thing, it moves the arm too slow to activate the switch. Below is the code I'm using.

void switch_on(){
Serial.println("Lights On");
myservo.write(100); // tell servo to go to position in variable 'pos'
delay(200); // waits 15ms for the servo to reach the position
for(pos = 100; pos>=60; pos-=1) // goes from 100 degrees to 60 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}

void switch_off(){
Serial.println("Lights off");
myservo.write(15); // tell servo to go to position in variable 'pos'
delay(200);
{
for(pos = 15; pos < 60; pos += 1) // goes from 20 degrees to 60 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}

}

In doing this, you really don't need to sweep the servo on and off, so you can just send it the position it needs to go to. Then there's a delay of 200ms to give it time to get there before it returns back to the center position.

Video of it in action with an inductive switch.
https://www.youtube.com/watch?v=B72mnBc7xAI

Hope this helps everyone.

If you have the kind of light switch with the big button that can snap two ways:
https://www.thingiverse.com/thing:22936

Quick LIght Timer

This is awesome! The fit around the servo and servo arm is really perfect (sliced in Cura & printed on a Monoprice Maker Select 3D Printer v2). Great Work!

Can you please tell what unit measurements are? In, Cm or mm? Thank you.

This was designed in mm.

Thanks for the great design! I used it with 2 hc-05 modules and 2 ATtiny85 chips to control it with a remote control so I don't need to get out of bed to turn off/on the lights!
Video: https://www.youtube.com/watch?v=QmDzJaZzIgI
Instructions: https://www.instructables.com/id/Remote-Control-Bluetooth-Light-Switch/

Awesome design! What software did you use to create this model? Would you mind posting the design files?

Thanks! I designed this in Solidworks. If you have access to Solidworks, I can definitely add it.

just printed one out and put it all together but the screws for the wall mount are not long enough to screw in with the added thikness of the printed parts :/

I had the same issue, but I got a 10 pack of longer white wall plate screws at my local hardware store for 99 cents.

I'm a total noob at arduino and have no clue on how to wire this project. I have all of the 3d printed parts and I've put in the servo but I'm stuck at the wiring. It would be great if you could send me some pics of how you wired it (If at all possible). Great project btw.

Thanks for printing my project! The servo has 3 wires. They are usually brown, red, and orange/yellow. On the arduino, connect the brown wire to ground, the red wire to 5V, and the orange/yellow wire to Pin 9. Let me know how it turns out.

I'd like to purchase three of these. I don't have a 3D printer. Is it possible to buy these from this site or creator?

Unfortunately, I am not setup to sell printed parts. But, depending on where you live you may have a makerspace or a library you can get it printed. You can also check out 3dhubs.com or a similar online printing service. Basically, you search for a printing hub in your area, send them the .stl file, they print it, and they mail it to you. Price varies on part size, material, etc...

Hey, could you show me the link to the servo you bought? I also used an SG90 from Amazon (TowerPro brand) and it's so weak it wouldn't move the switch at all. Also, how did you power your servo?

I bought these from amazon. They aren't the best, a couple died after a few weeks. I powered mine directly from the arduino and it worked fine for my light switches. But you might want to try using something like a motor shield to supply external power. The arduino alone may not provide enough current to adequately power the servo.

Hey carjo3000, thank you for the reply. i already tried that, but I think my light switch is just harder to flip than some others. I am thinking about redesigning it to fit a bigger servo, but I don't have experience in designing 3d models (oh and also no hardware background lol). Do you have recommendation on stronger servo/how to redesign the plate to fit said bigger servo?

Thanks for the design! Had to work out a friction issue with the lower screw, but works great now!

Awesome, glad it worked out!

awesome design, unfortunately the server was too weak to turn off the light completely

Thanks! It depends on the servo and the light switch. If you switch is old and takes some force to turn off then the servo might not be enough. Also, you might have issues if you are powering the servo directly from the arduino. You may need an external power source, or use something like a motor shield.

Comments deleted.

Thanks for this design. i thought i would share my addition to the author's code that triggers this from a photo resistor and a arduino nano. it also only operates the servo when there is a change of state in lighting which reduce unnecessary cycling of the servo.

/* photo resistor controlled servo

Connect the photoresistor one leg to pin 0, and pin to +5V
Connect a resistor (around 10k is a good value, higher
values gives higher readings) from pin 0 to GND. (see appendix of arduino notebook page 37 for schematics).


       PhotoR     10K-100K

+5 o---/\/\/--.--/\/\/---o GND
|
Pin 0 o-----------


*/

include

Servo myservo; // create servo object to control a servo
int pos = 0; // variable to store the servo position
int oldpos =0;// variable to store old POS
int lightPin = 0; //define a pin for Photo resistor

void setup()
{
myservo.attach(9); // attaches the servo to pin 9 of arduino
//Serial.begin(9600); //Begin serial communcation
}

void loop()
{
//Serial.println(analogRead(lightPin));
oldpos = pos;
if(analogRead(lightPin)>200){
pos = 25;
}
else{
pos = 105;
}
if(pos != oldpos){
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay (150);
myservo.write(60); //center servo to prevent straining
delay(1000); //change to suit conditions
}}

Thanks, I'm really glad you liked my design! I like your new code, I'll have to give it a try

Building two of these as I post. No good with Arduino. Want to add a ON - Off switch so as to run two wall switches. Was thinking a DPDT switch just cannot get it to control a servo. Any suggestions? Thank You

Awesome, glad you like my design! As far as operating the servos with an ON/OFF switch it is much easier to do using an arduino or some other microcontroller. Servos operate through PWM so you wouldn't be able to control one with a switch alone. But, setting one up with arduino is not too difficult. I found this instructable that might help you:
http://www.instructables.com/id/Servo-Controlled-by-Pushbuttons/
It uses tact switches to control the servos and the instructions are well detailed. You would need to play around with the part of the code that lists the angle of the servos. I also have an example arduino code in the thing files that you can easily setup. It should guide you in the right direction. Good luck on your project!

Thank You tried the Visuino, not a big fan of it. Found another program on Arduino that did the trick.

I LOVE THIS. I remixed it and "welded" a Wemos D1 Mini Case onto it to use with Home Assistant. Dude! (or Dudette!) this thing is elegant, and everything fits perfectly! Words cannot express how great this plate/arm is. Also if you're looking into Home Automation (even just a bit) look into Home Assistant for the raspberry pi as a controller with some ESP8266 based boards like the D1 Mini to activate the switch. I started down the rabbit hole and now everything is wifi controlled haha.

Thanks! I'm really glad you liked my design. I've been meaning to try out the Wemos board. Another person had used one with my switch plate and seemed to have great success with it. I just might have to try it with raspberry pi now...

Hey,

Thanks a lot for sharing this! I had to design a new faceplate because switches are a different layout in Ireland (and my switch was incredibly stiff!) but it did give me a lot of inspiration. I was able to use the servo arm though and it fit perfectly!

Thanks again

Thats awesome! I'm glad you were able to make it work for you. I guess I should have mentioned that this was for a US light switch... If you get the chance I would love to see some pictures of it.

Hey, I added it it as a remix there. I'm using it with my wemos d1 mini to create a Telegram bot to control my Immersion (water heater) My switch was really stiff so I needed to get some law of the lever going so I used an extender and changed the direction of the servo.

http://www.thingiverse.com/thing:1666986

Servo Switch for Immersion Bot

This looks really great! I'm glad you were able to use my servo arm design. I really like the idea of using wifi to control the switch, I might try out your code later

This looks awesome, I was just thinking about designing something for this exact function. Do you use it at home?

Thanks! I designed this because I wanted a timer for my porch light when I went on vacation. I just used two time intervals on the arduino code and increased it to several hours instead of seconds. It worked out great. Eventually I want to connect it to a raspberry pi and control my lights remotely

Thanks! Glad you like it.