Andrew Sudyk

Smart Window

A motorized smart window system that provides precise position control, automated operation, and built-in safety features through custom electronics and a purpose-built enclosure.

  • 24 V DC linear actuator
  • 24 in stroke (before limit switch)
  • 35 lbs rated load
  • 0.8 in/sec rated speed (no load)
  • <45 dB rated noise level
  • Integrated position-feedback potentiometer
Position Control

A linear potentiometer provides continuous position feedback from the actuator, allowing the microcontroller to determine the window's position throughout its travel and move it to a commanded position.

  • Potentiometer voltage is measured using the microcontroller's ADC and mapped to a 0–100% window position.
  • Position feedback enables intermediate setpoints rather than simple fully-open and fully-closed control.
  • A median filter reduces measurement noise and provides a more stable position reading.
Safety

An ACS712 current sensor monitors motor current for abnormal increases associated with an obstruction. When the configured threshold is exceeded, the controller stops and reverses the actuator.

  • A 5A sensor was selected to match the expected current range, providing greater measurement sensitivity than the next 20 A variant.
  • Current sampled at 20 Hz by the microcontroller
  • 5-sample median filter produces a filtered value at 4 Hz
  • Obstruction thresholds can be adjusted through the Home Assistant UI

End-stop protection: A hardware limit switch prevents the mechanism from driving beyond its mechanical travel by directly interrupting motor current, independent of software control. A 40 V Schottky diode provides a reverse-current path, allowing the motor to move away from the triggered end stop while preventing further travel in the unsafe direction.

Quick release: In the event of a power outage or actuator failure, the clevis pin can be removed to disconnect the actuator and allow the window to be operated manually.

Electronics & Enclosure

Enclosure: The electronics housing mounts vertically along the wall and provides dedicated connections for the 24 V power input and actuator output, with an easy-access snap-on lid.

  • Enclosure printed in PETG for heat resistance
  • Heat-set threaded inserts for secure PCB mounting
  • Additional motor holes for future expansion
Automation

The window is exposed to Home Assistant as a controllable device, allowing its entities to be incorporated into larger home automations.

  • If CO₂ exceeds 1000 ppm, open the window to 20%
  • If the portable AC turns on, close the window
  • If outdoor temperature falls below 0 °C, disable the window
  • At 9 PM, reduce speed to 50%; at 9 AM, increase it to 80%

Fail-safe automation: Automations are permitted to disable the H-bridge enable signal, but never to re-enable it. After a critical condition disables the system, actuator operation can only be restored manually by the user, preventing an automation from unintentionally restarting the window.

Adaptive speed control: Motor speed is controlled through PWM, allowing the window’s movement speed to be adjusted dynamically. During nighttime operation, the system automatically reduces the motor speed for quieter, less disruptive movement.

Results

This system is used reliably every day. Future improvements for a second-generation design include developing a custom PCB for cleaner wiring and easier troubleshooting, as well as upgrading from Hall-effect current sensing to a shunt-based current-sensing IC, such as the INA228.