The objective of this activity was to measure the power consumption of an electronic device. To calculate power, we used the following formula:
P = V x I
For this exercise, we measured and compared the power consumed by a stepper motor when it was powered on but stopped, and when it was moving. We used a GW INSTEK GPD-3303D power supply and implemented an Arduino UNO-based circuit.
We assembled the following circuit to control a stepper motor. The components used were:
The following image shows the implemented circuit:
Expanded view of the circuit connections with the laptop and the power supply:
#define dirPin 2
#define stepPin 3
#define stepsPerRevolution 200
void setup() {
pinMode(dirPin, OUTPUT);
pinMode(stepPin, OUTPUT);
}
void loop() {
digitalWrite(dirPin, HIGH);
for (int i = 0; i < stepsPerRevolution * 5; i++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(2000);
digitalWrite(stepPin, LOW);
delayMicroseconds(2000);
}
delay(5000);
}
The voltage was set to 12.0 V. The current was read directly from the power supply in each operating condition, and the power was calculated using P = V x I.
| State | Voltage (V) | Current (mA) | Power (W) |
|---|---|---|---|
| Motor stopped | 11.9 | 0.23 | 2.74 |
| Motor moving | 11.9 | 0.37 | 4.40 |