Servo Motor Controlled Wireless Light Switch

diy wireless light switch

Table of Contents

  • Part 1
    What is a servo motor?
    Types of servo motors
    Required voltage and power supply
  • Part 2
    Servo control with Arduino program
    What can be done with a servo motor?
  • Part 3
    Servo-controlled light switch
    Remote operation of the light switch


diy wireless light switch

Today we’re revisiting the topics of motors again. We’ve covered the basics of various types of motors in series previously, such as a 2 wheeled robot using stepper motors and RC car using DC and servo motors. This time we’ll cover the basic use of a servo motor, which we haven’t done before and design an easy DIY servo-controlled light switch so you can wirelessly turn on/off the light whenever wherever you want!

Note: the auto light switch we are about to make only works for a buttoned light switch system.

Today’s Electronic Recipe

Section 1:


Section 2:

1. What is a servo motor?

diy wireless light switch

Figure 1. Servo motor

A servo motor is a type of motor that works by rotating a shaft connected to the engine throttle. Due to its ability of accurate rotation angle and speed control, servo motors are used in various applications, such as automated manufacturing, robotics and personal IoT projects.

Servo motor – wikipedia

A servomotor is a rotary actuator or linear actuator that allows for precise control of angular or linear position, velocity and acceleration. It consists of a suitable motor coupled to a sensor for position feedback. […] A servomotor is a closed-loop servomechanism that uses position feedback to control its motion and final position.


Servo motor has an encoder to detect rotation angle and using coded signals, an output shaft can be positioned to a specific angle. We can examine the differences between different types of motors:

  • Motor: It rotates when electric power is applied.
  • Servo motor: It rotates in the range of 0 degrees to N degrees in response to a signal.
  • Stepper motor: It rotates in discrete step angles and can be controlled with or without a signal.
  • Brushless DC motor: It rotates continuously when fixed DC voltages is applied, and thus gives stable control of rotational speed.

It’s important you choose the right motor(s) according to their specific applications.

diy wireless light switch

Figure 2. Various types of motors. Left to right, brushless motor, stepper motor, servo motor, and DC motor.

2. Types of servo motors

So, which servo motor should you purchase? Consider the following specificities when buying a servo motor:

  • Torque: a rotational force to move the motor; the larger the numerical value, the stronger the force (unit: kgf·cm, etc.)
  • Angle of rotation: rotate/position the motor to a specific angle
  • Operating speed: rotational speed
  • Operating voltage: voltage required for operation

2.1 Calculation of Torque

The most important thing you should understand, when using servo motors, is the amount of torque you need. The torque of a servo motor is indicated in units of kgf·cm or kg. As a method of calculating the torque, in the case of kgf · cm, it means that it can lift an object of N [kg] at a radius of 1 [cm]. For instance, if you want to lift a 5 kg product, and if the handle attached to the axis of the servo motor is 2 cm, a torque of 5 kgf × 2 cm = 10 kgf·cm or more is required.

diy wireless light switch

Figure 3. Method of calculating torque

3. Required voltage and power supply

When moving a servo motor with Arduino, as with other motors, it is almost impossible to draw voltage or current from Arduino. In this case, you can take the external power supply and transmit angle control signals only from Arduino to control the servo motor.

For example, Arduino UNO R3, which is frequently used in this series, has I/O pins (digital/analog pins) that draw approximately 20mA from each individual pin (with possibility of damage if 40 mA+). Even though the operating voltage of the servo motor is 5V, since the power supply from the digital/analog pin is insufficient in electric current, the servo motor and Arduino can be damaged. So be careful when you supply power from I/O pins!

The absolute maximum rated current value (the current value which can not be drawn anymore) is 200 mA on the 5V or 3.3V pin, so it’s possible to use a small servo motor.

As an example, in the case of a servo motor with an operating voltage of 9 V, it’s necessary to supply power to the servo motor separately from Arduino as shown in the circuit diagram below.

diy wireless light switch

Figure 4. Arduino and servo motor (separate power supply)

Also, when the servo motor’s operating voltage is small (i.e. 5V) and you want to share the power supply with Arduino, you can pull the current from 5V with the circuit below.

diy wireless light switch

Figure 5. Arduino and servo motor (shared power supply)