Skip to content

9. Input

Gyro Scope

I decided to test out a gyro scope sensor for my input week as I was originally planning to try and use a gyroscope for my final project before I realized that I wanted to use joystick as my Input.

Overview

The idea was to use a gyroscope to monitor the orientation of the drone’s center mass and make corrections based on the calculations. I decided to try and find this data using the HiLetgo GY-521 MPU6050 3 Axis Gyroscope or just the MPU-6060 for short.

Group Work

Cooper Cumbus and I worked on the group site

Process

a. First I did research on how other people use this with ESPs and Arduinos to get a value in the serial monitor based on the devices’s current location.

b. I did this by first powering its VCC and GND ports to my ESP 32’s ground and power This Website helped me a lot with the pinouts.

c. Next I connected GPIO5 to SDA and GPIO4 to SCL: SCL(Serial Clock) and the SDA (Serial Data). I did this so I could accurately receive data from the gyroscope in the correct order that the movement happened. Click here for the code.

d. The data was received in the serial monitor where I could see it in real time.

PCB

After confirming the breadboard setup worked, I moved on to designing a custom PCB for this input. I used KiCad to create a simple board design. Unfortunately, I couldn’t find a footprint for the MPU6050, so I made a custom one. I found a 4x1 pin header footprint for the sensor and used the Xiao ESP32-C3 footprint for the microcontroller. I connected: - GPIO5 to SDA
- GPIO4 to SCL
- 3V3 to VCC
- GND to GND Here are my design files

One issue I found I had accidentally set the trace width too small at 0.2mm, which I forgot to change before milling. Despite the tiny traces, I decided to keep going and carefully solder the components. Luckily soldering worked, and I was still able to receive sensor data through the Serial Monitor using the custom board.

Reflection

This week I learned the value of input sensors and how they can be very useful tools in design projects as they are completely automated on their own and need no human input. I also learned how to do effective and useful research on a new part that I did not understand how to use. I had no idea how to use the MPU 6050 but after finding the developers websites and some other tutorial’s I was ready to design and create my own version of the project. ChatGPT was also an invaluable tool in helping me write and debug the code to receive data. Overall, this experience helped me grow more confident in working with input devices and designing functional PCBs.


Last update: June 3, 2025