Upgrading a Window Cleaning Robot From IR Remote to Wi-Fi
by dudeden in Circuits > Arduino
42 Views, 1 Favorites, 0 Comments
Upgrading a Window Cleaning Robot From IR Remote to Wi-Fi
Upgrading a Window Cleaning Robot From IR Remote to Wi-Fi
Supplies
Hardware components
Espressif Wemos D1 Mini - 1pc
Resistor 1k ohm - 1pc
Resistor 22.1k ohm - 1pc
Optocoupler, Transistor Output PC817 - 1pc
1N4007/1N4148 – High Voltage, High Current Rated Diode- 4 pcs. or MB10S/DB107, - 1pc
General Purpose Transistor NPN 2N2222, 2N3904, BC547 - 1
Hook Up Wire Kit, 22 AWG
Disassembly
I bought a window-cleaning robot during a sale on a popular Ukrainian marketplace. It works well and does its job, but there was one drawback — the infrared (IR) remote control.
When the robot is operating indoors, it responds to commands reasonably well, although it still needs to remain within direct line of sight of the remote. However, when the robot is cleaning the outside of a window, getting a command through can become quite challenging. Sometimes I had to stand right next to the glass and repeatedly press buttons before the robot would respond.
That led me to the idea of upgrading the robot with either Wi-Fi or Zigbee connectivity.
The Zigbee option was quickly ruled out due to the lack of readily available integration modules and my limited experience with DIY Zigbee devices.
Wi-Fi, on the other hand, seemed like a perfect fit. I happened to have an unused WeMos D1 mini lying around from a project that never got started.
After disassembling the robot, I found a single main control board inside. A quick search online revealed that this PCB is used in a wide range of Chinese window-cleaning robots, with most models differing only in their external design and branding.
Test
The next step was identifying the infrared receiver. The receiver pins were labeled +, –, and O (Output). By connecting the O (OUT) pin to the D5 pin of the WeMos D1 mini and tying the grounds of both the robot and the WeMos together, I was able to use the standard IR Receive example sketch to capture the raw codes generated by every button on the original remote control.
Once all button codes had been captured, it became possible to emulate remote control button presses directly. Using a 2N2222, 2N3904, or BC547 transistor together with a 1 kΩ resistor connected to the output of the IR receiver, the WeMos could inject the captured commands directly into the robot’s control circuitry.
This effectively turned the WeMos into a virtual remote control.
While examining the main board, I also discovered a service connector labeled 3.3V and GND. Power is present on this connector as soon as the robot is plugged into the mains, making it an ideal power source for the WeMos D1 mini, which can operate directly from 3.3V.
Prototype
However, all initial testing was performed with the WeMos powered via USB.
The wiring for IR command emulation was as follows:
WeMos D1 mini D2 → 1 kΩ resistor → 2N2222 base2N2222 emitter → WeMos D1 mini GND2N2222 collector → robot IR receiver OUT pin
To verify the concept, I wrote a simple test sketch that allowed previously captured commands to be transmitted through the Serial Port.
It worked! The robot responded perfectly to the transmitted commands.
The next step was to enhance the firmware by adding an access point for initial Wi-Fi configuration, MQTT support for Home Assistant integration, and OTA firmware updates through a web interface.
Once the testing phase was complete, the WeMos was connected directly to the robot’s service connector:
WeMos 3.3V → Robot 3.3VWeMos GND → Robot GND
The WeMos board, along with the transistor circuit, was then installed inside the robot’s housing.
After powering up the robot, a Wi-Fi access point became available. By connecting to it, I was able to enter my Wi-Fi credentials and, if required, the MQTT server settings. After clicking "Save", the robot rebooted automatically.
Once restarted, the device obtained an IP address from the router. By opening this address in a web browser, for example 192.168.0.2, a web-based control interface became available. The interface included buttons corresponding to the remote-control commands that had previously been captured.
The robot responded correctly to every command issued through the web interface. In my particular model, it is not enough to simply plug the robot into a power outlet. The power button must also be held for a few seconds to start the vacuum motor and allow the robot to attach itself securely to the glass.
At this point, the project already provided a fully functional web interface and seamless Home Assistant integration through MQTT.
Everything was working great. The robot could now be controlled from anywhere within Wi-Fi coverage. However, a new challenge emerged: how could I determine whether the robot was still cleaning or had already finished its job?
For example, I usually clean each window twice. The first pass is performed with cleaning solution applied to the glass, while the second pass is used to remove any remaining residue without applying additional cleaner. Because of this workflow, knowing the robot’s current operating status became important.
After studying its behavior, I concluded that monitoring the brush motors would be the most reliable solution. If the brushes are spinning, the robot is actively cleaning. If they stop, the cleaning cycle has most likely finished.
The robot does include a buzzer that beeps when cleaning is complete. However, the buzzer also sounds during manual operation, which could easily lead to false detections.
For that reason, I decided to monitor the brush motor activity instead. An inexpensive PC817 optocoupler turned out to be the perfect solution.
The challenge was that the brush motors periodically reverse direction. Depending on the movement, the motor terminals may see either +24 V or -24 V. Therefore, the signal first needed to be converted into a constant polarity before it could be safely detected by the WeMos.
Finished Product
To achieve this, a bridge rectifier was used. A small MB10S, DB107, or KBP bridge rectifier can be used, or it can be assembled from four individual 1N4148 or 1N4007 diodes.
The final circuit was connected as follows:
Bridge rectifier "+" output → 22 kΩ resistor → PC817 Pin 1Bridge rectifier "−" output → PC817 Pin 2
PC817 Pin 4 → WeMos D1 mini D5PC817 Pin 3 → WeMos D1 mini GND
The two AC inputs of the bridge rectifier are connected directly to the brush motor terminals.
For the 24 V version of the robot, a 22 kΩ resistor provides a safe current level for the optocoupler's internal LED while still ensuring reliable detection.
The firmware uses the following configuration:
The status detection logic is straightforward:
Brush motor running → D5 = LOWBrush motor stopped → D5 = HIGH
After updating the firmware, the robot's operating status could be monitored in real time without having to be physically present near the device.
The robot's current operating status is displayed in the web interface, and thanks to MQTT, the same information is also published to Home Assistant. This makes it possible to receive notifications when a cleaning cycle has finished and to build various automations around the robot's operation.
As a result, a window-cleaning robot that previously required constant supervision became significantly more autonomous. I no longer have to run to the window every time to check whether the cleaning cycle has finished or to start a second cleaning pass.
P.S. Full functionality of the original IR remote control has been preserved.
Note: This article was translated into English with the help of an AI assistant.