Output-Devices week 10

Description of group assignment

    Group Assignment

  • Measure the power consumption of an output device.

  • Document your work on the group work page and reflect on your individual page what you learned.

Group Assignment

For this week’s group assignment, we measured the power consumption of an output device.

Through Our group documentation includes full details on our shared experimentation with multiple output devices.

INDIVIDUAL ASSIGNMENT

by this Week 10 of the Fab Academy, I continued by output devices that make a given display or output from comands. I was targeting to work on driving stepper motor

Components I Used

  • stepper motor 28BYJ-48
  • Seeed Studio Xiao microcontroller
  • Stepper motor driver ULN2003
components

step of Wiring and Setup

The stepper motor has five pins: IN1, IN2, IN3, IN4, VCC, (DIGITAL output). I connected them to the Xiao board as follows:

  • VCC → 5V on Xiao
  • GND → GND on Xiao
  • IN1 → D1 on Xiao
  • IN2 → D2 on Xiao
  • IN3 → D3 on Xiao
  • IN4 → D4 on Xiao

Arduino Code

After wiring, I wrote codes to control the motor. Below is the code I uploaded using Arduino IDE to drive the stepper motor:


              #include 
                  int in1 = D1 ;
                  int in2 = D2 ;
                  int in3 = D3 ;
                  int in4 = D4 ;
                  
                  Stepper s(2048, in1, in3, in2, in4);
                  
                  void setup() {
                    // put your setup code here, to run once:
                  
                  }
                  
                  void loop() {
                    // put your main code here, to run repeatedly:
                  s.setSpeed(10);
                  s.step(2048);
                  delay(1000);
                  s.setSpeed(10);
                  s.step(-2048);
                  delay(1000);
                  
                  }
            
            
codes image

Testing and Results

when I uploaded the codes to my xiao microcontroller, stepperwas moving forward and backwrad 360 degrees as commanded from the codes above

outcomes I got from this week

This week helped me understand how to deal with output devices comanded from microcontrollers and also how to connect diferent output devices on microcontroller. codes that controlls stepper motor in both directions

Here is the original code

You can download the Arduino code used for this experiment below:

codes to drive stepper motor