Tuesday, June 18, 2024

Build Your Own Simple Smartwatch

The aim of this project is to create an affordable and programmable smartwatch capable of tracking health data, providing real-time information, and enabling customization according to users’ preferences. Leveraging the compact size and onboard sensors of the Indus board, along with additional components such as the GC9A0 display, MAX30100 SpO2 sensor, heart rate sensor, and temperature sensor, we can design a feature-rich smartwatch that meets these requirements.

Components:

  • Indus Board: The Indus board serves as the core component of the smartwatch, offering a compact form factor and a variety of onboard sensors and GPIOs essential for building a versatile device.
  • GC9A0 Display: The GC9A0 display provides a crisp and clear interface for users to interact with the smartwatch. Its high resolution and vibrant colors enhance the user experience, making it suitable for displaying health data, notifications, and other information.
  • MAX30100 SpO2 Sensor: This sensor measures blood oxygen saturation levels (SpO2) and heart rate, enabling the smartwatch to monitor users’ health in real-time. Accurate SpO2 readings are crucial for detecting potential health issues and ensuring users’ well-being.
  • Heart Rate Sensor: Alongside the MAX30100 SpO2 sensor, the heart rate sensor further enhances health tracking capabilities, providing continuous heart rate monitoring during various activities and at rest.
  • Temperature Sensor: The temperature sensor adds another dimension to health monitoring, allowing the smartwatch to track users’ body temperature and detect changes that may indicate illness or exertion.
  • WiFi Chip: Integrated with the Indus board, the WiFi chip enables connectivity, data synchronization, and the creation of a mesh network for collective health monitoring. It also facilitates over-the-air programming and customization of the smartwatch’s functions and features.

Functionality:

  • Health Tracking: The smartwatch can monitor vital signs such as heart rate, blood oxygen levels, and body temperature, providing users with insights into their overall health and well-being.
  • Real-time Information: Users can access real-time data including time, date, weather updates, notifications, and activity tracking through the intuitive interface displayed on the GC9A0 screen.
  • Customization: With programmable capabilities, users can customize the smartwatch’s UI, functions, and features according to their preferences and needs. They can also develop and install custom apps to extend functionality.
  • Mesh Networking: The WiFi chip enables the creation of a mesh network, allowing multiple smartwatches to communicate and share health data. This collective data can be analyzed to identify trends, patterns, and potential health risks within a community or group.

Coding:

First we need to prepare code for the smartwatch so our smartwatch is able to take data show them and do functions as we want. Here we are using Arduino for coding so download the Arduino latest IDE and then. Arduino IDE do not have an ESPboard to program so go to ESP website and then follow the instruction and install the ESP board to Arduino IDE. Now we have various libraries to interface the LCD sensors and for getting time from the network so open the library manager and install the following library

NTP client, MAX30100, Arduino GFX.

After installing the library we can cod first we need to interface the round LCD display for that we use Arduino GFX library so include that in the code, Next, we use the NTP client to get time from the wifi network so include that as well in the code now we need to interface the MAX30100 heart sensor so include that library as well. After including the library we need to do the setup in cod for the hardware SPI bus pins and board type we are using so here we are using theindusboard where any pins can snfigired as spi and have esp32cs2 chip on it so we set the board as esp32s2 and then we need to set SPI pins for here we have used 21,1,2,3,4,5, pins on Indus baord for SPI connection with LCD display we need to set the display of our display driver GC9A01 so we sat the same.

Now need to set the WiFi SSID and password for the NTP server so our watch connects to WiFi of our phone or home wifi and then fetches the time from NTP client-server. Next, we create the setup function where we initialise the I2C communication with the MAX30100 sensor the SPI communication with the LCD display, and the NTP server for the clock

- Advertisement -

Now need to set the WiFi SSID and password for the NTP server so our watch connects to WiFi of our phone or home wifi and then fetches the time from NTP client-server. Next, we create the setup function where we initialise the I2C communication with the MAX30100 sensor the SPI communication with the LCD display, and the NTP server for the clock

Download Source Code

Creating GUI for watch:

Now we create a loop function where we update eth sensors and time data in real time.

Then we create an interface and look for our smartwatch to display the health data, date, and time data in real-time here you ca code and make any style of GUI of your choice. I have used the circular mark with 2 hands for a minute and an hour with a circular arc that decreases with every second showing the seconds of time and then I have used an arc and circle with text to display the SPO2 value and used a round rectangle for displaying the heartbeat data and used text to display the current day month and other time-related data and after that we update the text and data in realtime.

- Advertisement -

Connection

Now connect the MAX30100 sensor to Indusboard as following

Max30100Indusboard
VCC3V
GNDGND
SCL9
SDA8
DisplayIndusboard
TFT MOSI21
TFT_SCLK1
TFT_CS2
TFT_DC3
TFT_RST4
TFT_BL5
VCC5V
BL3V
GNDGND

Testing

Now power the watch and you can see the details on watch

SHARE YOUR THOUGHTS & COMMENTS

Unique DIY Projects

Electronics News

Truly Innovative Tech

MOst Popular Videos

Electronics Components

Calculators