Ideation/Brainstorming:
When brainstorming ideas for MGP4, we pondered the exciting possibilities of utilizing
Inertial Measurement Units (IMUs). To see more of our brainstorming process, you can view
it under "MGP3: Intermediate Prototype" section of the blog. Basically, our research led
us into real-world applications used by IMUs. For example, we found out that drones employ
IMUs to relay contextual information about the drone's relative position and movement back
to its remote controller. This technology facilitates precise and responsive control,
enhancing the user's experience. Since this is a Human-Computer Interaction (HCI) course,
we were also keen on approaching this project from a unique angle that would redefine the
way we interact with technology.
While exploring YouTube, we came across a video featuring the Xbox team at Microsoft discussing
the development of the adaptive controller. This innovative controller was specifically designed
to accommodate individuals with disabilities, with the goal of providing a more inclusive gaming
experience.
One particularly insightful statement from a team member responsible for creating the
adaptive controller caught my attention. They asserted that "a disability is defined as a
mismatch in human interaction." This perspective challenges the conventional understanding
of disabilities, suggesting that many are not inherent flaws or limitations of the
individual but rather arise from a lack of support and accommodation in their environment.
In essence, this viewpoint shifts the focus from the individual's impairment to the societal
and environmental barriers that prevent them from fully participating in various activities,
including gaming. By embracing this perspective, the Xbox team emphasized the importance of
creating inclusive products and environments that empower individuals with disabilities to
engage more fully in the activities they enjoy.
This approach to understanding and addressing disabilities highlights the need for more inclusive
design practices across various industries, not just gaming. It showcases the potential for
technology to break down barriers and create opportunities for people of all abilities to participate
equally in society. Our team wanted to implement this ideology in our project. Of course, we
had to think about the practicality of designing such a device.
A compelling question arises: why is it important to make such accommodations in something
as seemingly trivial as video games? Beyond the simple premise that everyone deserves the chance
to experience these enjoyable activities, there is a deeper significance. The genesis of the
Adaptive Controller can be traced back to veterans who utilized video games as a form of prescribed
therapy. Veterans account for a disproportionate number of suicides, and a psychological study
demonstrated that veterans prescribed video games exhibited better signs of recovery from severe
depression.
We wanted this device to not just be used for video games, but for any device that
utilizes user inputs. People with disabilities deserve to have as much flexibility in
their hobbies as everyone else. That is how we decided on a glove, which uses the tilt of
one's hand as input.
Finalized Idea #1:
So we decided, on making a glove, with the Arduino Nano attached and using its internal
IMU. We made a program that determines how far up, down, left, and right the user's glove
tilts. We also added LEDs on all four sides of the Nano to indicate where the user is
tilting. The following video is a demonstration of the glove we made:
Our idea was to use another microcontroller, an ESP32, to wirelessly communicate with the
Arduino Nano. Since the ESP32 has two cores on its processor, we planned to use one of its
core to communicate with the Arduino and receive input while the other core controlled the
device we were wirelessly sending inputs to. The ESP32 would receive four inputs of the
four directions the glove would tilt. The following is a video showcasing the inputs the
ESP32 would receive:
We successfully sent the inputs to the ESP32. The following is a video of the ESP32
outputting the inputs it read:
The following is the code we used for this project.
#include <Arduino_LSM6DS3.h>
#include <Wire.h>
float x, y, z;
int degreesX_f = 0;
int degreesX_b = 0;
int degreesY_r = 0;
int degreesY_l = 0;
int threshold = 23;
const int LED_PIN[] = {17, 2, 9, 4};
void setup() {
for(int i = 0; i < 4; i++){
pinMode(LED_PIN[i], OUTPUT);
}
Wire.begin();
Serial.begin(9600);
while (!Serial);
Serial.println("Started");
if (!IMU.begin()) {
Serial.println("Failed to initialize IMU!");
while (1);
}
Serial.print("Accelerometer sample rate = ");
Serial.print(IMU.accelerationSampleRate());
Serial.println("Hz");
}
void loop() {
if (IMU.accelerationAvailable()) {
IMU.readAcceleration(x, y, z);
}
if (x > 0.1) {
digitalWrite(4, 0);
x = 100 * x;
degreesX_f = map(x, 0, 97, 0, 90);
Serial.print("Tilting forward ");
Serial.print(degreesX_f);
Serial.println(" degrees");
if (degreesX_f > threshold) digitalWrite(2, 1);
else digitalWrite(2, 0);
} else digitalWrite(2, 0);
delay(50);
if (x < -0.1) {
digitalWrite(2, 0);
x = 100 * x;
degreesX_b = map(x, 0, -100, 0, 90);
Serial.print("Tilting backward ");
Serial.print(degreesX_b);
Serial.println(" degrees");
if (degreesX_b > threshold) digitalWrite(4, 1);
else digitalWrite(4, 0);
} else digitalWrite(4, 0);
delay(50);
if (y > 0.1) {
digitalWrite(17, 0);
y = 100 * y;
degreesY_l = map(y, 0, 97, 0, 90);
Serial.print("Tilting left ");
Serial.print(degreesY_l);
Serial.println(" degrees");
if (degreesY_l > threshold) digitalWrite(9, 1);
else digitalWrite(9, 0);
} else digitalWrite(9,0);
delay(50);
if (y < -0.1) {
digitalWrite(9, 0);
y = 100 * y;
degreesY_r = map(y, 0, -100, 0, 90);
Serial.print("Tilting right ");
Serial.print(degreesY_r);
Serial.println(" degrees");
if (degreesY_r > threshold) digitalWrite(17, 1);
else digitalWrite(17, 0);
} else digitalWrite(17,0);
byte sendData[8];
sendData[0] = (degreesX_f >> 8) & 0xFF; // High byte of degreesX_f
sendData[1] = degreesX_f & 0xFF; // Low byte of degreesX_f
sendData[2] = (degreesX_b >> 8) & 0xFF; // High byte of degreesX_b
sendData[3] = degreesX_b & 0xFF; // Low byte of degreesX_b
sendData[4] = (degreesY_r >> 8) & 0xFF; // High byte of degreesY_r
sendData[5] = degreesY_r & 0xFF; // Low byte of degreesY_r
sendData[6] = (degreesY_l >> 8) & 0xFF; // High byte of degreesY_l
sendData[7] = degreesY_l & 0xFF; // Low byte of degreesY_l
// Send data over I2C
Wire.beginTransmission(8); // Address of the ESP32
Wire.write(sendData, 8); // Send the data array
Wire.endTransmission(); // Stop transmitting
delay(1000);
}
Code Breakdown:
If you look at the code, we use the Arduino's bultin library to read in it's IMU values.
We then map those readings to display the tilt as a measure between 0 and 90 degrees.
Afterwards, we display each of those values if they are actively being tilted more than
the threshold we set, which is 23 degrees. Then, the respective led is lit up. If an LED
is lit up, then it's opposite LED will not be. This way, there wouldn't be any confusion
on the tilt of the hands. However, its perpendicular LED could still be lit up, allowing
the user to see if it's tilted above the threshold in both directions, the X and Y axis
values.
We then use the Wire.h library to communicate with the ESP32 microcontroller. We send an
array of 8 bytes, where all four inputs are divided into two bytes of data. The ESP32
reads this data and then converts it into an array of four ints. A for loop is used to
combine two bytes of data into one, then inputs the recovered data into the array.
Afterwards, each element of the array is assigned to it's respective integers. That is how
the ESP32 receives the data, which can be used for many applications.
We thought about different cases we could use this for. We could use it as an interactive
video game controller, but that idea has already been done, which was also the main
inspiration for this project. We wanted to make something new, not just recreate something
already made. That is when we decided to use the glove as a controller for a drone.
Finalized Idea #2:
So we're going to make an IMU controller for an fpv drone. Why an fpv drone?
The first challenge we anticipated was formalizing the IMU data to be read as valid input.
It's difficult to determine the exact input format required, but what if we built a drone
ourselves? Drones are expensive, and FPV drones are even more so. How about we build our
own drone?
Building our own drone presents several advantages. We were inclined to use the ESP32, as
it features a dual-core processor and can create a WiFi access point. By utilizing the
ESP32, we can use it to act as the drone's controller and provide a point of connection
for the Arduino with the built-in IMU to connect wirelessly.
Additionally, the extra layer of complexity beyond just getting imu readings also made
this a more interesting project.
How to build a drone:
To build the drone we have to address a few important aspects.
- - What electrical parts do we need
- - We also need to implement some signal based communication channel between the remote
controller and the drones onboard controller.
- - We need some sort of housing for the drones electronic components.
Addressing Electronics Parts
So drones have 7 important parts, the remote controller, the drone's onboard controller,
the motor, the propellor, an Electronic Speed Controller, a power source, and a frame. We
have two parts covered, the two controllers. We find a project from another individual who
is working towards building an esp32 drone and he lists a few parts for us an 8.5x20mm
Motor 3-5V brushed motor and propellor combo, a CAD file for the frame, and a P-channel
MOSFET transistor for making his own ESC.
Addressing communication channel
As I said earlier we wanted to use Wifi. The esp32, has a way to creat a wifi access
point, this lets up basically create this private network where connected devices can
communicate with each other. Since the Arduino and ESP32 can both use the WiFi.h library
this implementation is fairly simple.
Addressing Housing
While the online resource provided a CAD file, the built in housing meant to fit the motor
didn't fit, so we had to design our own frame.
What went wrong?
In Short, the SMD Transistor was not an apt alternative for an actual Electronic Speed
Controller. There is also a reason the motor was cheap. The transistor ended up being too
small to actually try and write an electronic speed controller with, even though the GPIO
pins on the esp32 actually have a way of sending varying voltages, which would've allowed
us to manipulate the current to the motor. Because the transistor was too small, it was
just almost impossible for unexperienced to work with using just tweezers and a soldering
iron.
What did we learn?
Our journey in building an IMU drone controller provided us with valuable learning
experiences and insights. Firstly, we gained a deeper understanding of the intricate
components and technologies involved in drone construction, including the role of IMUs in
flight stabilization and control.
Additionally, we learned the importance of thorough planning and research in project development.
Identifying suitable electronic parts, establishing communication channels between controllers,
and designing a suitable housing demanded meticulous attention to detail and problem-solving
skills.
Furthermore, our project underscored the significance of experimentation and iteration in the
prototyping process. Despite encountering challenges such as incompatible components and design
limitations, each setback served as an opportunity for learning and refinement.
Importantly, our experience highlighted the value of interdisciplinary collaboration and knowledge-sharing.
By drawing upon resources and insights from diverse sources, including online communities and
existing projects, we were able to navigate challenges more effectively and enrich our understanding.
Ultimately, our venture into building an IMU drone controller not only expanded our technical
competencies but also cultivated essential skills in teamwork, problem-solving, and adaptability.
These lessons will undoubtedly inform and enhance our future endeavors in the realm of technology
and innovation.