As a rower I need to wake up at 5:30 am every morning. Especially here at MIT, with all the super late night study sessions and P-set grinds, I often find myself not sleeping much and struggling to wake up every morning. Hence why I am motivated to design something to help me out with that.
The design is to make a device to open my blinds in the morning and play a little wake up tune. It will either sync to my alarm on my phone, detect sunlight, or view the first event on my Google calender. The complexity of the project will highly depend on how the weeks go for me and what I am able to learn. Theres lots of room for iteration and creativity.....
The components will consist of a sort of gear to bind to the chain of the blinds, a motor to control the opening and closing, likely a ESP32 for wifi connection, a light sensor to detect daylight, and a speaker to play a little song.
(I will add images of my CAD design soon)
The vinyl cutter would be cool to add some decals to the final product. I don't really see myself using the laser cutter, but potentially to cut a casing for the components.
This is going to be huge for the project. I struggled a lot with some issues on the simulation software when it came to the ESP32 and wifi connection, but hopefully with the real thing it won't cause as much trouble. I'll need to program the system to control the motor and communicate with input devices (whatever I decide those to be).
This will also be quite integral. I will likely need to make the custom gears on the 3D printer. I could also utilize the 3D scanner to scan the chain and make it a little easier to CAD (something I am not really sure how to do exactly).
This device will require a PCB which I will use the skills from this week to design.
Same as electronics design week.
While super fun, I don't see this week contributing to my final project very much.
This week for my options in input devices, I found that a phototransistor would be most appropriate for my final project. In the case that I decide to go in the light detection route to activate the opening of the blinds, this week's project taught me how to set up and code that sensor.
This week for my options in ouput devices, I found that a servo motor would be most appropriate for my final project. When I want to move the blinds a servo motor would be good. This week allowed me to get to know the device and see how well it could work for my project
This week I didn't really do anything that I hadnt already before. I kinda just made something fun unrelated to my final project so no much to report here. If anything it helped hone in some skills on the CNC and on Fusion that could potentially help later on.
This week for me was probably the most important yet. I made a PCB that I will also use for my final project and I coded it up to allow me to interface with a stepper motor via bluetooth.
This week was also extremely important. I decided to also make a user interface ona website to control the motor. Now I have the code and the interface I need to control the blinds on my final project (or at least a base to spiral develop).
This week for just for fun.
Now it’s time to dive into the actual project. Having spent previous weeks learning the necessary skills, I assumed tackling the more challenging parts would be relatively straightforward. I was quite wrong. After 30+ hours debugging PCBs, creating four iterations of the same board, and soldering the DRV8428 driver nine separate times (which, might I add, is no easy task), I finally achieved a working solution. Here’s the story of how it all unfolded...
The first step was pulling out my board from the past two weeks along with a stepper motor. Below are some images of my schematic, board layout, milling process, and the soldering of key components. The primary components included the DRV8428 stepper driver and the Xiao ESP32-C3 microcontroller. My design was inspired by a model on the HTMAA site.
I encountered a significant number of issues with the board: components snapping off during transit, dull milling bits producing messy traces that caused shorts, and moments of frustration leading to errors. Ultimately, I ended up creating four boards in total. Here’s a tribute to some of the fallen soldiers.
Once I had a board working, I wrote some basic Arduino code to control the stepper motor. From there, I built on my user interface code from “Interface and Application Programming” week, utilizing the ESP32-C3's WiFi capabilities to create buttons for controlling the blinds' direction. Wiring the motor proved to be a recurring challenge, but my trusty multimeter saved the day more than once. I should also mention that electronics and coding are not my strong suit, and I faced plenty of struggles along the way. As Anthony said at one point, “I have no idea how this ever worked or why it’s broken again now.” After countless late nights, migraines, and questions, I finally had a reliable system up and running two weeks in.
Another critical aspect of the project was designing the pulley. I borrowed some measurement tools from EDS (with permission!) and measured my chain at home. I turned to the internet for CAD help and, using OpenSCAD (a new tool for me), adapted an existing model to fit my measurements. Once I had the correct design, I imported it into Fusion 360 to tweak the attachment points. I then exported the STL and printed it on the Bambu printer, which quickly became my favorite. I iterated through a few prints with slight size adjustments to ensure the pulley fit perfectly.
With the pulley complete, the next step in my spiral development process was creating a clean, functional casing to match the room. Thanks to this class, I’ve become much more comfortable with Fusion 360. I designed a case, motor mount, and a removable lid for easy access to components. Printing these parts on the Bambu was seamless and incredibly satisfying.
Assembly and testing came next. I carefully fit all the components into the casing and plugged everything in to see it in action. The most challenging part of this step was attaching the pulley to the motor shaft. I used an aluminum coupling part (thanks to a friend) with a set screw to secure the printed pulley in place.
Finally, here’s the moment of truth: a video of me controlling the blinds with my phone!
Files:
Download STEP PullyCode:
#include <WiFi.h> #define EN 2 // Enable pin from your schematic #define DIR 3 // DIR pin from your schematic #define STEP 4 // STEP pin from your schematic #define M1 5 // M1 pin from your schematic #define M0 6 // M0 pin from your schematic WiFiServer server(80); // Set up the web server on port 80 //void moveMotor(bool forward, int steps) { // digitalWrite(DIR, forward ? LOW : HIGH); // for (int i = 0; i < steps; i++) { // digitalWrite(STEP, HIGH); // delayMicroseconds(20); // digitalWrite(STEP, LOW); // delayMicroseconds(200); // } //} void moveMotor(int steps, bool direction) { // Set the direction digitalWrite(DIR, direction); // Loop to generate the required number of steps for (int i = 0; i < steps; i++) { digitalWrite(STEP, HIGH); delayMicroseconds(20); // Adjust speed by changing delay digitalWrite(STEP, LOW); delayMicroseconds(200); } } void setup() { pinMode(M0,OUTPUT); pinMode(M1,OUTPUT); pinMode(STEP,OUTPUT); pinMode(DIR,OUTPUT); pinMode(EN,OUTPUT); digitalWrite(EN,HIGH); digitalWrite(STEP,LOW); digitalWrite(M0, HIGH); digitalWrite(M1, HIGH); digitalWrite(DIR, LOW); // Start the ESP32 in AP mode WiFi.softAP("ESP32_AP", "12345678"); Serial.begin(115200); // Print the IP address of the ESP32 Serial.println("AP Mode Started"); Serial.println("IP Address: "); Serial.println(WiFi.softAPIP()); // Start the web server server.begin(); } void loop() { // Check for incoming client connections WiFiClient client = server.available(); if (client) { String request = client.readStringUntil('\r'); Serial.println(request); client.flush(); // Handle forward command Serial.println("test"); Serial.println(request.indexOf("/forward")); Serial.println(request.indexOf("/backward")); if (request.indexOf("/forward") != -1) { //moveMotor(100,true); // Move forward 100 steps for (int i = 0; i < 10000; i++) { digitalWrite(DIR,HIGH); digitalWrite(STEP, HIGH); delayMicroseconds(20); digitalWrite(STEP, LOW); delayMicroseconds(2000); } } // Handle backward command if (request.indexOf("/backward") != -1) { //moveMotor(100,false); // Move backward 100 steps for (int i = 0; i < 10000; i++) { digitalWrite(DIR,LOW); digitalWrite(STEP, HIGH); delayMicroseconds(20); digitalWrite(STEP, LOW); delayMicroseconds(2000); } } // Send an HTML response client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println(); client.println("<h1>Blind Control</h1>"); client.println("<button onclick="fetch('/forward')">Down</button>"); client.println("<button onclick="fetch('/backward')">Up</button>"); } // digitalWrite(STEP, HIGH); // delayMicroseconds(20); // digitalWrite(STEP, LOW); // delayMicroseconds(200); }