Today, we are going to make an ‘all-in-one’ measurement device/instrument, which consists of a digital inclinometer, compass and protractor. It also includes a health monitoring system that can provide data about temperature, oxygen levels and heartbeat.
All these features come in a very small form factor for ease of use and portability.
For inclinometer and smart protractor, we are going to use a tiny mpu6050 sensor. It can also be used to collect temperature-related information. For health monitoring, a MAX30100 sensor is used. It’s red and IR lights along with photosensors can determine heartbeat and oxygen levels.
So, let’s start our project by collecting the following components.
Bill Of Materials
Assuming that you already have the Arduino IDE installed in your computer and connected to the internet as well, go to the sketch menu and click on the library manager. A window having a list of different libraries shows up. Now search the following libraries and install them one by one. (Refer fig 2).
- Arduino MPU6050
Firstly, we will include the required libraries in the code. (Refer fig 3)
Secondly, we will create a setup function to initialize the I2C-based sensors and OLED display .(Refer fig 4)
Thirdly, we will create a loop function that will convert x,y,z axes readings of the accelerometer into angle of rotation. By writing a set of code, this result can be displayed on an OLED screen. The readings from the MAX30100 sensor can also be displayed on the OLED screen. (Refer fig 5)
Lastly, we will write a code that will create a rectangular frame and a small circle within that. The y-axis of the circle is mapped with the angle at y-axis of mpu6050 reading. This will allow the circle to move according to the angle of inclination. (Refer fig 6)
Now our code is ready, which you can download and upload to Arduino.
After uploading the code, make the following connections. (Refer fig 7)
|Arduino Pro Micro||MPU6050,Max30100,SSD1306|
|SCL(Pin 2 )||SCL|
Connect the +ve terminal of the 3.3V – 5V battery to the VCC pin and -ve to the GND pin.
To measure the inclination of any surface or to determine whether it is perfectly flat or not, place the measuring device on that surface. If x = 0 and y=0 readings are obtained, then the surface is flat.
If the surface is inclined, the circle moves accordingly and displays the angle of inclination. At the same time, the device displays the surrounding temperature.
In order to get a reading of your health, put your finger on the MAX sensor and wait a few seconds. After calculating the readings from the sensor, the device will now show your heartbeat in BPS and oxygen level in percentage.