Remotely Operated Motorized Curtains
...
- Current progress:
- Main electronic components
- Nema 17 Stepper motor
- DRV8825 stepper motor driver
- Arduino RP2040 micro controller with Wifi and bluetooth
- Hall sensor: TLE4935L DIGITAL HALL SENSOR BIPOLAR LATCH
Code with working motor and button to operate the motor
Code Block language cpp theme Eclipse title Implemented Code Block linenumbers true int stepPin = 2;
int dirPin = 3;
int enPin = 4;
int upButton = 5;
int downButton = 6;
int stepDelay = 2000;
int RevolutionSteps = 200;
bool buttonState_up;
bool buttonState_down;
void setup() {
pinMode(stepPin, OUTPUT);
pinMode(dirPin, OUTPUT);
pinMode(enPin, OUTPUT);
pinMode(upButton, INPUT);
pinMode(downButton, INPUT);
}
void loop(){
buttonState_up = digitalRead(upButton);
if(buttonState_up == HIGH){
roll_up();
}
buttonState_down = digitalRead(downButton);
if(buttonState_down == HIGH){
roll_down();
}
}
void roll_up(){
digitalWrite(enPin, LOW);
digitalWrite(dirPin, HIGH);
for(int i = 0; i < RevolutionSteps; i++){
digitalWrite(stepPin, HIGH);
delayMicroseconds(stepDelay);
digitalWrite(stepPin, LOW);
delayMicroseconds(stepDelay);
}
}
void roll_down(){
digitalWrite(enPin, LOW);
digitalWrite(dirPin, LOW);
for(int i = 0; i < RevolutionSteps; i++){
digitalWrite(stepPin, HIGH);
delayMicroseconds(stepDelay);
digitalWrite(stepPin, LOW);
delayMicroseconds(stepDelay);
}
}
- Current design of the system
Picture 1. Overall view of the motor housing
Picture 2. Preliminary main dimensions of the housing
Picture 3. Nema 17 motor with 5.1:1 Planetary gear box and fasteners
Picture 4. Main electronic components of the motor
- Picture 5. Motor assembly mounted on wall and installed on curtain( cyan cylinder with small portion of curtain shown)
- Main electronic components
...