Inspiration

We have a world of voice-enabled smart devices around us, assisting us in mundane and not-so-mundane daily tasks. However, smart lights still remain a hassle to use, often requiring rewiring of the switch, re-installation, taking apart existing systems, and so on 😕 .

Instead, in this project, we envision and develop a portable, low-cost, generalized smart switch which can be easily set up as an extension on any common existing switch system 😋. Think temporary hostels, semester-time dorm rooms, and overnight hotels - one Switch-It-Up device can unlock the wonders 😍 of voice-assisted light toggling within seconds.

Hardware

Parts

  1. ESP32 Board
  2. TFT Display
  3. Microphone
  4. 2 buttons
  5. Linear Motor / Actuator
  6. Powerboard
  7. Rectangular Wooden Frame (2" x 1")
  8. Breadboard and Jumper Wires

Wiring

The following is a schematic of how the different hardware components will be wired together in the final device. Wiring

Button Workings

We have two buttons on the device - primarily used as manual on/off buttons, but with software expansion, can be used for a combination of things (including brightness toggle if the switch allows for it), flickering lights, etc.

Here is an FSM denoting this working.

Button Press FSM

Pressing button A currently prints "ON" on the TFT display and pressing button B currently prints "OFF" on the TFT display. Once we have the motor parts, we can simply link the button presses to moving the motor in addition to printing on the TFT display. In the future, when we wish to extend the system to various brightness levels or mode toggling, we can utilize the long press option, which we have already developed and tested.

Speech/Microphone

We use a microphone module to capture the voice commands of the user. The microphone module has 3.3 V across its ends and provides a 12 bit resolution, thus having 3.3/2^12 voltage per increment. The measurements are taken at the frequency of 8 kHz.

However, even after these optimizations, our microcontroller could handle a voice input of length 5 seconds. To improve that further, we make use of MuLaw that relies on the fact that human hearing tends to respond linearly to logarithmic changes in intensity. Finally, we use Google speech API to find the transcript associated with the captured analog signal.

Arm

The arm toggles the electric switch state on/off with a short stroke (~ 0.5 inches) to the frame, which in turn is obtained from a linear voice coil actuator. The magnitude of this force (per unit length) F=Il x B, is proportional to the current I (the permanent magnet flux density field B is fixed) in the and the direction of the displacement depends on the polarity of the input current. Thus, the electric switch can be toggled by changing the potential difference across the actuator. Actuator-Frame mechanism

We choose a moving coil DC linear mini-actuator (~5.0 oz) which can deliver a force of 3.6 N (0.8 lbs) at 100% duty, sufficient to flip an everyday electric switch (plus the wooden frame). Such a device is low power and small in dimensions (~1.2" in diameter and 1.1" in length), making our device lightweight and portable ✌️.

Switch-It-Up parses the audio user input and flips the relavant switches accordingly. The code below implements this functionality. We display the Switch states on the TFT screen for we do not have an actuator in our inventory right now, but below we also have the code in place for the actuator to work out-of-the-box once we obtain one and wire it up according to the schematic.

The full code can be found on our GitHub repository here and a more detailed explanation can be found here 😊 .

Built With

Share this project:

Updates