Mechatronics Exercises

Workspace Navigation

Remotely Operated Motorized Curtains

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Current progress:
    1. Main electronic components
      1. Nema 17 Stepper motor
      2. DRV8825 stepper motor driver
      3. Arduino RP2040 micro controller with Wifi and bluetooth
      4. Hall sensor: TLE4935L DIGITAL HALL SENSOR BIPOLAR LATCH 
    2. Code with working motor and button to operate the motor

      Code Block
      languagecpp
      themeEclipse
      titleImplemented Code Block
      linenumberstrue
      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);

      
        }

      
      } 


    3.  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

    4. Picture 5. Motor assembly mounted on wall and installed on curtain( cyan cylinder with small portion of curtain shown)

...