Skip to content

10. Output Devices

Hero Shot !

Group Assignment

For more details, visit our lab site:
Tech Works – Output Devices

My Contribution:
I created a Tinkercad simulation to demonstrate how to measure voltage and current (amperage) for two different motors.

Learning Outcomes:

  • Gained an understanding of how different motors behave under the same voltage by comparing their current draw and power consumption.
  • Learned how to calculate power usage using the formula P = V × I, enabling evaluation of energy efficiency between output devices.
  • Developed skills in using Tinkercad to simulate motor circuits for validation before physical implementation.
  • Practiced proper wiring techniques for DC motors with a 12V power supply, ensuring safe and accurate measurements.

Fixing the Board

I re-cut the last week’s board due to issues with the traces. I adjusted the trace thickness to 0.4 mm instead of 2.5 mm, and I also used sandpaper to clean them after the cutting process.

Previous board:

New boad:

I encountered an issue while cutting the board’s outline. By mistake, I changed the CNC tool’s X and Y zero positions, which caused a trace at the upper-right edge to get separated. I later fixed this by using a very tiny wire to reconnect the two cut traces.


XIAO RP2040 with Servo Motor

Wiring

To control a servo motor using the XIAO RP2040, connect the signal pin of the servo motor to one of the PWM-capable pins on the XIAO RP2040. In my setup, the signal pin is connected to pin P0.

Programming

Below you can find the code I used to program the XIAO RP2040 to control the servo.

#include "Servo.h"

Servo myservo;

#define servoPin 0

void setup() {
  myservo.attach(servoPin);
}

void loop() {

  // Sweep from 0 to 180 degrees:
  for (int angle = 0; angle <= 180; angle += 1) {
    myservo.write(angle);
    delay(15);
  }

  // And back from 180 to 0 degrees:
  for (int angle = 180; angle >= 0; angle -= 1) {
    myservo.write(angle);
    delay(15);
  }
  delay(1000);
}

Files