Fab Academy 2024

@ Fab Lab Rwanda, Kigali

Output Devices:

Our Group work focused on Measuring Power Consumption of a Mini Stepper Motor

In this assignment, our group measured the power consumption of an output device. We used our custom board and a mini stepper motor programmed to move in steps forward and backward. Using a multimeter, we measured the current and voltage to calculate the power consumption.

Steps followed;

  1. Setup the Circuit:
    • We connected the mini stepper motor to our custom board.
    • The board was programmed to move the stepper motor in steps forward and backward.
  2. Programming the board:
    • The motor was controlled using a simple Arduino sketch that moved the motor back and forth.
  3. Measuring Voltage and Current:
    • A multimeter was used to measure the voltage across the motor.
    • The current flowing through the motor was also measured using the multimeter.

Install the libray

To upload the code to run min stepper motor, we had to first install the libray for ESP32 in arduino IDE that works with XIAO ESP32C3.

Code Used

#include <ESP32Servo.h> Servo myservo; // create servo object to control a servo #define SERVO_PIN 9 // Servo control pin void setup() { myservo.attach(SERVO_PIN); // attach the servo to the specified pin Serial.begin(9600); } void loop() { for (int pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } for (int pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } }

Click Here to Download the Code

Videos Demonstration

Voltage measurement

To measure the voltage, positive wire of multimeter is put on servo pin and negative to the ground.

Current Measurement

Set your multimeter to measure DC current. Connect the multimeter in series with the power wire of the servo motor:


  1. Connect the red probe of the multimeter to the power source which is the 5V pin of the board.

  2. Connect the black probe of the multimeter to the power wire (VCC) of the servo motor.

  3. Ensure the ground (GND) connection of the servo motor remains connected to the ground of the Arduino.

Varying current is due to the servo motor's rotation and the load it experiences during operation. Here are some additional details and steps to ensure accurate measurement and understanding:

Observations

  • Calculating Power Consumption:
    • Power consumption was calculated using the formula: ( P = V x I)
    • Where ( P ) is the power in watts, ( V ) is the voltage in volts, and ( I ) is the current in amperes.
  • Voltage Measurement:
    The voltage across the motor was measured to be 5.05V.

    Current Measurement:
    The current flowing through the motor was measured to be varrying between 39.8mA to 170.8mA, as it presses with some force on the table. average is arround 135mA or 0.135A

    Power Consumption Calculation:
    ( P = V x I )
    ( P = 5.05V x 0.135A = 0.682W )

    Measuring the power consumption of the mini stepper motor provided insights into its electrical characteristics. Understanding power consumption is crucial for optimizing the efficiency and performance of electronic devices.

    Instructor

    Contacts

    • Map
    • +250 781 187 555