Group assignment
Individual assignment
Musaed AlKout is the one who had the full process documented in detail; I will cover some highlights on my page.
01 | I used an MPU6050 GY-521, which is also part of my final project. I learned all the information I needed from Wokwi and started a virtual simulation, as I was away from the lab and wanted to utilize my time to start this assignment.
05| and I included
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>
Adafruit_MPU6050 mpu;
void setup(void) {
Serial.begin(115200);
// Define I2C pins for ESP32-C3 (SDA=8, SCL=9)
Wire.setPins(8, 9);
if (!mpu.begin()) {
Serial.println("Failed to find MPU6050 chip");
while (1) { delay(10); }
}
Serial.println("MPU6050 Found!");
// Set sensor ranges (optional)
mpu.setAccelerometerRange(MPU6050_RANGE_8_G);
mpu.setGyroRange(MPU6050_RANGE_500_DEG);
mpu.setFilterBandwidth(MPU6050_BAND_21_HZ);
delay(100);
}
void loop() {
sensors_event_t a, g, temp;
mpu.getEvent(&a, &g, &temp);
/* Print out the values */
Serial.print("Accel X: "); Serial.print(a.acceleration.x);
Serial.print(", Y: "); Serial.print(a.acceleration.y);
Serial.print(", Z: "); Serial.print(a.acceleration.z);
Serial.println(" m/s^2");
delay(500);
}
07| Then I opened my KiCad file in the schematic editor and added the GY-521 as a sensor and made the connections, following this workflow: Look for part → not available → search on SnapEDA → download symbol & footprint → open KiCad → import the library → add the new part → connected pins → mark other pins as "no connect" → run ERC
09| I tried to place it next to the microcontroller so that my full design fits on a 30mm copper tape, which I have access to cut for the circuit.
10| For better cutting results, I made the routes 2mm wide and made sure there was enough space between them to avoid short circuits
11| From KiCad, I plotted the PCB as SVG → imported it to Adobe Illustrator → transformed it to shape → selected all shapes → created a union → exported as SVG → imported to Cutting Studio → cut the circuit on copper tape.
13| I added , which was used in the simulation in step 5
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>
Adafruit_MPU6050 mpu;
void setup(void) {
Serial.begin(115200);
// Define I2C pins for ESP32-C3 (SDA=8, SCL=9)
Wire.setPins(8, 9);
if (!mpu.begin()) {
Serial.println("Failed to find MPU6050 chip");
while (1) { delay(10); }
}
Serial.println("MPU6050 Found!");
// Set sensor ranges (optional)
mpu.setAccelerometerRange(MPU6050_RANGE_8_G);
mpu.setGyroRange(MPU6050_RANGE_500_DEG);
mpu.setFilterBandwidth(MPU6050_BAND_21_HZ);
delay(100);
}
void loop() {
sensors_event_t a, g, temp;
mpu.getEvent(&a, &g, &temp);
/* Print out the values */
Serial.print("Accel X: "); Serial.print(a.acceleration.x);
Serial.print(", Y: "); Serial.print(a.acceleration.y);
Serial.print(", Z: "); Serial.print(a.acceleration.z);
Serial.println(" m/s^2");
delay(500);
}
19| The readings of x, y, z axes as well as the acceleration of change. To make a better visual, I needed to plot these values on a chart
20| For that, I had to add a plotting command to my code, and I used Gemini to redefine the code to
// --- SERIAL PLOTTER FORMAT ---
// Format: "Label:Value,Label:Value,Label:Value"
Serial.print("AccelX:"); Serial.print(a.acceleration.x);
Serial.print(",");
Serial.print("AccelY:"); Serial.print(a.acceleration.y);
Serial.print(",");
Serial.print("AccelZ:"); Serial.print(a.acceleration.z);