Week 9. Input Devices¶
Group Assignment¶
This week, during the group assignment, we worked with various input devices like the MAX30102 Pulse Oximeter and Heart Rate Sensor (Datasheet). We learned how to set up and use the sensor to measure heart rate and oxygen levels. I found it interesting how the sensor uses light to detect blood flow and oxygen in the body. We also worked with other sensors, like the IR distance sensor and ultrasonic sensor, and learned how to integrate them with microcontrollers like Arduino. It was a valuable experience that helped me understand how to gather real-time data using different sensors.
Individual Assignment¶
Over the past few weeks, I have been making a stand to measure the efficiency of the propeller for my submarine. This week, I decided to integrate a load cell with the HX711 amplifier to get accurate thrust data. The main goal is to determine the thrust force generated by the propeller and use this data to choose the best option for my project.
This stand is an aquarium with guide rods, where a structure with a propeller is placed. When the propeller generates thrust, it slides along the rods, allowing me to measure the applied force.
To measure the thrust, I decided to use a load cell with the HX711 amplifier. Here is the datasheet.
What is Load Cell and how it works?¶
A load cell measures force by converting mechanical deformation into an electrical signal. In the image, force bends the metal beam, causing tension on the top (R2, R4) and compression on the bottom (R1, R3). Strain gauges placed in these zones change resistance when stretched or compressed. These changes are read through a Wheatstone bridge circuit, producing a voltage proportional to the applied force.
I designed a mount in Fusion 360 to fix the sensor to the aquarium body so that the end of the sensor touches the moving part of the stand mechanism.
Calibrating Load Sensor¶
To use this sensor, I installed the DFRobot HX711 library.
For calibration, I used the code from the examples section. First, I weighed a pre-known part on precise scales, then placed it on the sensor to get the value needed to calculate the scale factor.
To convert grams to newtons, I used a simple formula. First, I took the value in grams from the load cell. Then I multiplied it by 9.8, which is the acceleration due to gravity. After that, I divided the result by 1000 to convert grams to kilograms. This gave me the force in newtons.
#include "HX711.h"
HX711 scale;
void setup() {
Serial.begin(9600);
scale.begin(8, 9);
scale.set_scale(-1000);
scale.tare();
Serial.println("Thrust (g) | Thrust (N)");
}
void loop() {
float g = scale.get_units(10);
Serial.print(g, 1);
Serial.print(" g\t| ");
Serial.print(g * 0.00980665, 4);
Serial.println(" N");
delay(200);
}
After obtaining the correct scale factor value, I wrote the code that displayed the values in the Serial Monitor in both grams and newtons. This allowed me to see the force generated by the propeller in real time.
#include "HX711.h"
HX711 scale;
void setup() {
Serial.begin(9600);
scale.begin(8, 9);
scale.set_scale(-1000);
scale.tare();
Serial.println("Thrust (g) | Thrust (N)");
}
void loop() {
float g = scale.get_units(10);
Serial.print(g, 1);
Serial.print(" g\t| ");
Serial.print(g * 0.00980665, 4);
Serial.println(" N");
delay(200);
}
Assembling¶
After successful calibration, I attached the sensor to the stand to measure the propeller’s thrust during operation. The main control board was my own with ATtiny1614 microcontroller, which I had made on last week.
Then, I filled the aquarium with water and conducted the first test. And it Worked!!!
As seen, the thrust is only 2.2 newtons, which is not normal for me. However, I needed to do this in order to later modify the propeller design and achieve better efficiency and results!!
Conclusion¶
In the process of working on this project, I learned how to integrate force sensors with microcontrollers, as well as how to work with load cells and calibrate them using the HX711. I learned how to properly calibrate the sensor using known weights to calculate the scale factor, and also how to use the data to display force in real time. As a result, I was able to create an accurate stand to measure the thrust of the submarine’s propeller, which will allow me to optimize the choice of propeller for more efficient operation in the future.