Project Overview
The primary objective was to replace manual effort with automation by using four TT motors controlled through two L298N H-bridges and an ESP8266 microcontroller. This setup supports control of the blinds via TCP commands using netcat, simplifying the process of adjusting blinds remotely. The project integrates custom-designed 3D printed mounts and adapters, offering a holistic view of electronic design, mechanical design, and programming.
Materials and Components
Key components used in the project include:
- 4 TT Motors: Compact and efficient for mechanical actuation.
- 2 L298N H-Bridges: Dual H-bridge motor drivers that facilitate control over two motors each.
- ESP8266: A low-cost WiFi-enabled microcontroller that serves as the networked brain of the system.
- 3D Printed Mounts and Adapters: Custom-designed parts used to mount the motors securely to the blinds and adapt them to the mechanism.
Hardware Assembly
3D Printing Custom Parts
The design process for the mounts and adapters involved creating CAD models to ensure proper fit with both the TT motors and the blinds’ mechanism. This required several design iterations:
- Design Phase: Using design software to draft parts that would securely hold the motors.
- Printing and Testing: Conducting multiple prints to test fit and functionality, followed by adjustments as needed. I used OnShape for that.
System Assembly
The hardware assembly process involved the following steps:
- Mounting the Motors: The 3D printed parts were used to attach the TT motors to the blinds. Ensuring proper alignment was critical for smooth operation.
- Connecting the H-Bridges: Two L298N boards were wired to control the four TT motors. Proper wiring ensured that each motor received correct signals and power.
- Integrating the ESP8266: The ESP8266 was connected to the H-bridges, providing network control capabilities.
Software Development
The ESP8266 was programmed using the Arduino IDE to handle TCP connections, process commands, and control the motor drivers accordingly. The code establishes a server on the ESP8266, listens for incoming TCP connections, and executes motor control commands based on received instructions.
Below is a simplified version of the code responsible for setting up the network:
#include <ESP8266WiFi.h>
WiFiServer server(3000);
void setup() {
Serial.begin(115200);
WiFi.begin("your_ssid", "your_password");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("Connected!");
server.begin();
Serial.println("Server started");
}
void loop() {
WiFiClient client = server.available();
if (client) {
while(client.connected() && !client.available()) delay(1);
String command = client.readStringUntil('\n');
Serial.println("Received command: " + command);
// Insert motor control logic based on the command here
}
}
Note: This excerpt simplifies the full program. The actual implementation contains logic for parsing different commands and controlling multiple motors.
Operation via Netcat
Commands are sent to the ESP8266 using netcat. For example, to open a specific blind, I might use:
echo "RUN M1F" | nc 192.168.4.59 3000
The command is transmitted over the network, interpreted by the ESP8266, and then acted upon to drive the motors via the H-bridges.
Current Limitations and Considerations
The current system design relies on a stable power supply and synchronized timing for motor operation. Over time, slight drifts in timing or power irregularities might affect accuracy. These challenges are recognized and serve as focal points for future refinement.
Moreover, the system could benefit from improved feedback mechanisms to ensure consistent performance even under varying conditions. Addressing these issues will be part of the ongoing development and fine-tuning process.
Demonstration Video
A demonstration video below showcases the system in action with two blinds. This visual walkthrough highlights how commands sent from a computer affect the motorized blinds, providing a clear understanding of the project’s functionality and setup.
Conclusion
This project exemplifies a hands-on application of combining mechanical design, electronics, and programming to solve a real-world problem. The automation of blinds via a networked microcontroller is both a practical and educational endeavor, illustrating the integration of various technological components in a cohesive system.
The documentation provided serves as a resource for others interested in similar projects, offering insights into component selection, system assembly, programming, and troubleshooting. Feedback and questions are welcome as the project evolves and further improvements are implemented. Email me at [email protected]