Wireless Motion Controlled Side Show Clicker
💞 Vibrating Structure Gyroscopes
We spun heart-to-heart, dancing to the tunes of our forever-long story.
Fundamentally, vibrating structure gyroscopes are a type of Micro-Electrical-Mechanical-Systems (MEMS). MEMS serve an especially unique role in that at their small size, surface area becomes much more dominant than volume. Hence, electrostatic forces, surface tension, Van der Waals forces, viscous drag, and elastic forces become much stronger than gravity.
Accelerometers function by detecting changes in capacitance. They are generally composed of fixed plates of capacitance, alongside a moving mass held in place my springs. As the object moves, the moving mass changes position, altering the electric field. This could then be used to determine the direction and magnitude of the movement.
Gyroscopes, function similarly, but instead utilizes Coriolis force. More information about gyroscopes can be found here.
Hardware Components
An Overview of the Components
- MPU-9250 9-axes Gyroscope
- ESP32 Microchip
- 9V Battery
The MPU-9250 9-axes gyroscope is capable of detecting:
- acceleration in three directions - x, y, and z
- angular Acceleration in three directions: raw, pitch, and yaw
- magnetic field via its magnetometer
The ESP32 microchip was chosen for its bluetooth functions, which is essential for remote control.
The 9V battery was used to power this system.
Circuit Design & Routing
Since the entire system is essentially a Inte-Integrated Circuit (I2C), we connected the input of the gyroscope to PIN 21 as SDA (Serial Data) and PIN 22 as SCL (Serial Clock). SDA and SCL provide all the necessary information to know the directional data provided by the gyroscope that is accompanied by a time stamp.
Overview of Code
The bleMouse package was used to control the mouse on the connected laptop.
The main logic of the motion detection is quite self-explanatory.
void loop() {
if (!bleMouse.isConnected()) return;
mySensor.accelUpdate();
mySensor.gyroUpdate();
Serial.print(String(millis()) + " "+ "-->"+" ");
float aX = mySensor.accelX();
float aY = mySensor.accelY();
float aZ = mySensor.accelZ();
float gZ = mySensor.gyroZ();
Serial.print(String(aX)+" ");
Serial.print(String(aY)+" ");
Serial.print(String(aZ)+" ");
Serial.print(String(gZ) + "");
//Serial.print(String(gZ)+" ");
if (abs(aX) > 0.4 || abs(aY) > 0.4) {
int Cx = constrain(aX * 15, -10, 10);
int Cy = constrain(-aY * 15, -10, 10);
bleMouse.move(Cx, Cy);
delay(20);
}
if (aZ < -1.5) {
bleMouse.press(MOUSE_LEFT);
delay(100);
bleMouse.release(MOUSE_LEFT);
}
if (gZ > 100) {
bleMouse.press(MOUSE_RIGHT);
delay(100);
bleMouse.release(MOUSE_RIGHT);
}
Serial.println("\n");
}
Additional Information
This project was developed for the Nanotechnology course at the Engineering Summer Academy at Penn summer program that I took during the summer of 2025.
More pictures and information will be added to this page as I slowly organize them.
Disclaimer
This device was developed for educational purposes as part of the Engineering Summer Academy at Penn (summer 2025). Both methods are experimental and have known limitations.
The code and explanations are provided "as-is" without any warranty. Users are solely responsible for validating results for their specific applications. The author(s) are not liable for any errors, inaccuracies, or damages arising from the use of this software.
For critical research applications, please independently verify all measurements and consult established methodologies in the field.