I built a compact Arduino based control system that fits beneath a standard light switch. It uses a 16×2 LCD, an IR receiver, a sound sensor, and a servo motor. The IR remote lets the user choose between two servo actions, and any detected sound triggers the servo to perform the chosen action.
The goal was to create a small device that installs cleanly under an existing switch plate, provides clear LCD feedback, responds quickly to IR and sound inputs, and reliably moves the servo to complete the selected task.
The main challenge was fitting the IR receiver, sound sensor, LCD, and servo in a very small space while keeping the system reliable. The limited room behind the switch plate made wiring, mounting, and cable routing difficult, and each component needed to work smoothly with the others. Another challenge was designing a servo-driven arm that could turn the light on and off within a 45 degree range of rotation while maintaining enough torque and consistent alignment.
Details
Mechanical Design: Servo Rotation and Arm Geometry
To make the servo flip the light switch correctly, I designed a small 3D-printed arm that attaches to the servo horn. I measured how far the light switch moves, then converted that distance into the angles the servo needed. A few quick prototype arms helped find the right length so the servo could toggle the switch without over rotating. After finalizing the geometry, I programmed specific angle values so the servo hit the correct positions every time.
Embedded Logic: Input Handling and Mode Control
The Arduino handled all the inputs and system states. The IR remote used two main buttons: one for turning the light on and one for turning it off. Every time a button was pressed, the Arduino moved the servo and updated the LCD to show “ON” or “OFF.”
The sound sensor followed the same pattern. If sound mode was enabled, any detected sound triggered the same on or off action and updated the display. The remote could also turn the sound sensor mode on or off, and the Arduino stored this as a state variable. When sound mode was off, sound input was ignored.
All logic ran in a simple loop with basic debouncing and timing checks, which helped prevent false triggers and kept the servo, sensor inputs, and LCD consistent.
Housing and Component Layout
The 3D-printed housing was designed to stay compact and organized. The Arduino fit into a dedicated slot that held it securely, preventing any movement during operation. The rest of the components were arranged to keep wiring clean and to keep the servo aligned with the light switch.