Project
Project 1
Design and development of a smartwatch
Smartwatch:
Smartwatch is a wearable device that provides various functionalities beyond timekeeping. It is typically connected to a smartphone to provide notifications. They provide fitness tracking along with other features.

Specifications
The common specifications of smartwatch include
Operating system: smartwatches typically run on various operating systems like Wear OS by Google, watchOS by Apple or Samsung’s Tizen.
Factors involved while choosing operating system for smartwatch are-
· Compatibility with smartphone: ensure that the smartwatch is compatible with smartphone’s operating system iOS or Android.
· Desired features: fitness tracking, notifications, app support, voice assistant integration and battery life.
· Design and hardware: build quality, display and other hardware features available for operating system.
· Budget: consider the price of mass production and manufacturing costs.
Considering the above factors, I would choose Android-compatible Google wear OS.
Processor: it determines the performance like responsiveness and multitasking capabilities.
Design metrics for determining processor are-
· Requirements: the intended use of the device, form factor, display resolution, connectivity options, and battery life.
· Performance: although smartwatch processors are not as powerful as computer processors, they should be capable enough to handle OS, apps, notifications and tracking.
· Power efficiency: processor is chosen in a way to balance the performance and power efficiency.
· Size and form factor: smartwatches have a limited space for components, so a compact processor is preferred. System-on-chip that can integrate multiple components helps with space.
· Compatibility: choosing the components that are designed to work together and ensuring the compatibility between the processor and other components like display, sensors, memory and connectivity modules.
· Development tools and support: the availability of development tools, software libraries, and support resources for the chosen processor.
General processors that are used for smartwatches are Qualcomm snapdragon wear platform, mediatek MT2523 series, Samsung exynos wear platform, Nordic semiconductor nRF52 series and ST microelectronics STM32WB series and ESP32.
Processor selection
ESP32 is preferred because of it’s following features-
· Sensor compatibility: the required physiological parameters for the design are ECG, pulse oximetry, heart rate and blood pressure
· Hardware integration: connecting the sensor to the appropriate interfaces involves using connector or soldering.
· Performance: it has multi-core CPUs and dedicated GPUs to handle the tasks efficiently.
· Power efficiency: this processor incorporates power-saving features and optimizations to minimize energy consumption while maintaining performance.
· Sensors and features: it supports wide range of sensors which makes it an apt choice for our design
· Development ecosystem: the comprehensive development ecosystem offers software development kits, tools and resources for developers and facilitates the development of customized applications.
Memory: Sufficient RAM will ensure smooth operation while storage is for storing apps, data and media files.
Display: there are various display options available like OLED which offers vibrant colors, high contrast ratios; LCD offers good visibility, color accuracy but consumes more power and E-paper that offers excellent visibility in sunlight besides low power consumption.
Factors playing an important role in choosing the display are
· Size and resolution: it is decided based on form factor and design goals of smartwatch. A balance between readability and battery life is important.
· Power consumption: a balance between visual quality and power consumption is to be achieved.
· As we desire low-consumption displays, we opt for OLED display in our design.
Connectivity: Smartwatches need Bluetooth for pairing with smartphones and Wi-Fi for internet connectivity.
Fast charging and power efficiency: these processors are designed to support fast charging technologies. Thus, they are ideal for maximizing the battery life and ensuring long-lasting performance.
Sensors: As the desired smartwatch is designed to display ECG, heart rate, blood pressure and oxygen saturation, it should have the related sensors. It also can have accelerometers, GPS, gyroscopes, navigation.
Physiological sensors
1. Single-lead ECG signal: MAX30003 from Maxim integrated is an ECG single-channel integrated biopotential ECG sensor.
2. Heart rate: a photoplethysmography sensor namely optical heart rate sensor by Philips can be used.
3. Blood pressure: MAX30100 from Maxim integrated is a pulse oximeter and heart rate sensor. It primarily provides blood oxygen saturation levels and also provides an indirect way of measuring blood pressure.
4. Blood oxygen saturation: MAX30100 from Maxim integrated is a pulse oximeter and heart rate sensor.
Functional block schematic of smartwatch

Processor: ESP32 is chosen as it is economical, offers wide features and is easily programmable with integrated development environment like Aurdino.
Power management circuit: it contains all power-related circuits along with battery charger and buck-boost converter.
Touch inputs/switches: ESP32 has 10 touch inputs that can be used as physical buttons for the user inputs.
ESP32-Processor features
Processor: It has a main 32-bit microprocessor and dual-core processor
Frequency: the clock frequency is up to 240 MHz
Ultra-low power co-processor: it allows ADC conversions and computation.
Wireless connectivity:
· Wi-Fi: 802.11b/g/n/e/i @ 24 GHz up to 150 Mbits/sec
· Bletooth: v4.2 bluetooth low energy
Memory:
· Internal memory: ROM: 448KB for booting and core functions
· SRAM: 520KB for data and instruction.
· RTC fast SRAM: 8KB for data storage and main CPU during RTC boot from deep-sleep mode
· RTC slow SRAM: 8KB for co-processor accessing during deep-sleep mode
· EFuse: 1KB-of this, 256 bits are for system use while the remaining 768 are reserved for customer applications.
· Embedded flash: flash connected internally is of three types-0 MB, 2MB and 4MB
· External flash & SRAM: it supports up to four 16MB external QSPI flashes and SRAM with hardware encryption to protect developer’s programs and data.
o The encryption is based on AES.
Peripheral inputs/outputs: peripheral interface with Direct memory access includes capacitive touch, ADCs, DACs, I2C, UART, CAN 2.0, SPI and more.
Security:
· IEEE 802.11 standard security features all supported including WFA, WPA
· Secure boot
· Flash encryption
· 1024-bit OTP
· Cryptographic hardware acceleration: AES, SHA-2, random number generation

Circuit diagram to interface display with ESP32

Programming the embedded core and flow diagram for ESP32-based smartwatch
C/C++: the primary programming languages for ESP32 embedded development are C and C++. Arduino IDE uses C/C++ for both firmware and applications.
Flow diagram:
Initialization: firstly, ESP32 peripherals like GPIO pins, sensors, display and communication interfaces are initialized.
Main loop: here the core functionality is implemented.
· Sensor data is continuously read to monitor the user activity and health metrics.
· Sensor data is processed to detect the fitness activities and calculate the parameters.
· Update display with relevant information
· Handle user input from buttons, touchscreens or other input devices to navigate menus, interact with apps and control device functions.
· Communicate with external devices or services via Wi-Fi, Bluetooth for data synchronization, notifications and remote control.
Interrupt handlers: implements interrupt handlers to handle asynchronous events like button press, sensor interrupts or communication interrupts.
Power management: implement power management techniques to optimize energy consumption and extend the battery life such as sleep modes, low-power operation and dynamic voltage scaling.
Error handling: these mechanisms detect and handle runtime errors, exceptions, or abnormal conditions.
Peripheral control: it controls external peripherals and actuators.
Task scheduling: it is used to manage concurrent tasks and ensure timely execution of critical operations.
Shutdown: Clean the resources and perform any necessary shutdown procedures before powering off the device
Update and maintenance: mechanisms for firmware updates and maintenance to ensure the smartwatch remains up-to-date with latest features, bug fixes and security patches.
Algorithms for smartwatch
Heart rate monitoring:
1. Peak detection algorithm: it detects peaks in the heart rate signal obtained from the heart rate sensor.
2. Heart rate variability: it calculates RR intervals, time-domain measures to assess the activity.
Blood oxygen saturation monitoring:
1. Photoplethysmography analysis: it analyses the absorption of light by oxygenated and deoxygenated hemoglobin in blood vessels.
ECG monitoring
1. R-wave calculation: it is used to detect R wave in ECG signal
2. Arrhythmia detection: analyses the QRS complex to detect atrial fibrillation, ventricular tachycardia or heart block
Blood pressure monitoring:
1. Photoplethysmography analysis: the amplitude, morphology and timing characteristics are used to estimate blood pressure directly.
Concept of Operations (CONOPS) or user manual
Hardware components:
· Processor: ESP32
· Sensors: heart-rate, blood oxygen saturation, blood pressure, and ECG
· Display: OLED
· Battery: rechargeable battery
· Connectivity: Bluetooth, Wi-Fi
Software functionalities:
· Operating system: Google Wear OS
· Applications: fitness tracking, notifications, time, weather, navigation and more
· Health monitoring: health and fitness features include heart rate monitoring, all above-mentioned features.
· Notifications: it can display notifications from paired smartphones, calls, messages etc
User interactions:
· Touchscreen: for navigating menus, selecting options and interacting with applications.
· Buttons: physical buttons for common actions such as power on/off, home, back and app shortcuts.
Operation modes:
· Active mode: fully operational, displaying information and responding to user inputs.
· Standby mode: it conserves power by dimming the display and reducing background activities while providing essential functions like notifications and timekeeping
· Sleep mode: during the periods of inactivity, it enters low-power sleep mode to conserve battery life.