Building an ESP8266 Smart Health Watch from Scratch

If you don’t want to miss my updates, remember to check the public account in the upper right corner and set it as a star, and send me a star.

Building an ESP8266 Smart Health Watch from Scratch
Building an ESP8266 Smart Health Watch from Scratch
There are many styles of smart watches on the market, with various functions, but it is not always possible to find one that meets all your needs. If you can’t find it, then make one! This is the advantage of hardware engineers. Below is the complete record of the production process, providing design ideas for smart watch enthusiasts.
Building an ESP8266 Smart Health Watch from Scratch
First, let’s take a look at what functions this homemade watch can achieve:

1) It will display the time via NTP (Network Time Protocol), so the time is very accurate.

2) A gyroscope monitors motion.

3) Tests the wearer’s BPM and displays a mini graph on the screen (although the function is implemented, it needs improvement).

4) Sends email to your friends through the internal program of the watch.

The hardware used in the smart health watch includes:

· ESP8266

· OLED display

· MPU6050

· Vibration motor

· 3.3V voltage regulator, 105mAh battery

· Pulse sensor – APDS9008

· Other auxiliary tools: Velcro, header pins, wires, soldering tools, etc.

Step 1: Connecting the OLED display and the main control circuit

Configure the hardware for the OLED display and ESP12E. This OLED display: 0.91 inches, I2C communication, 128*32, can display text and images. The communication method is I2C, with four pins, apart from VCC and GND, which are SCL (serial clock line) and SDA (serial data line), using these two lines to call the display.

Building an ESP8266 Smart Health Watch from Scratch

Connection of the OLED screen and the main control:

Building an ESP8266 Smart Health Watch from Scratch

And test in the Adafruit SSD1306 library in Arduino:

Building an ESP8266 Smart Health Watch from Scratch

Step 2: Pulse sensor and main control circuit

The pulse sensor used is an optical analog sensor based on 3.3V, with an output value between 0-3.3V (Note: Do not connect VCC to 5V, as it will cause incorrect readings). The NodeMCU board has a 10-bit analog pin that can read this voltage range and output data from 0-1023. Connect the signal pin of the pulse sensor to A0 of NodeMCU, connect VCC to 3.3V, and ground the sensor and main control.

Building an ESP8266 Smart Health Watch from Scratch

Building an ESP8266 Smart Health Watch from Scratch

Testing the pulse sensor:

Simply use the AnalogRead(A0) function for a simple analog read, and then use the serial.print() function to display it on the serial monitor.

void setup(){   Serial.begin(115200);   Serial.println(" Started!"); } void loop(){ Serial.println(analogRead(A0)); delay(10); }

Then open the serial window [Shortcut: Press Shift + Ctrl + L]. View the sensor’s analog data in graphical format. When a finger is placed on the sensor, the graph will change rhythmically with the heartbeat.

Building an ESP8266 Smart Health Watch from Scratch

Step 3: Connecting the MPU6050 gyroscope and NodeMCU

The gyroscope used is the MPU6050, which is a MEMS (Micro-Electro-Mechanical Systems) sensor with 6 degrees of freedom. This means it can measure the body’s acceleration in 3 axes and the body’s orientation in 3 axes. If you want to know why specifically use MPU 6050? That’s because IMUs are very popular and easy to find!

The IMU interface is also similar to what we saw before with the OLED display, also using the I2C communication protocol. Just connect the SDA and SCL pins of the MPU to D2 and D1 of NodeMCU, and connect VCC and GND to NodeMCU’s 3.3v and GND.

Building an ESP8266 Smart Health Watch from Scratch

Building an ESP8266 Smart Health Watch from Scratch

Testing the MPU6050:

Now use NodeMCU to test the MPU6050, using the Adafruit library Adafruit MPU6050.

Building an ESP8266 Smart Health Watch from Scratch

With this example file, we can visualize the changes in sensor data for different movements. Go to the XY, XZ, or YZ plane, and we will see the changes in acceleration data. To obtain direction (angular momentum) or gyroscope data, just twist the X, Y, or Z axes.

Step 4: Configuring WiFi

When powered on for the first time, the OLED screen does not display the time because NodeMCU is not connected to the network and cannot obtain the time. At this point, NodeMCU will create an access point named Enter Credentials, connect this access point with a computer. After connecting, the login page will pop up automatically, and enter the WiFi name and password to connect to the PC’s network. After saving, the device will automatically restart and perfectly display the current time, saving this setting in the flash memory of NodeMCU.

Step 5: Configuring the development environment

Install VScode and the platform.io extension, then restart VScode. At this point, there will be a new icon on the left side of the window, click the icon, then click to import the project folder (Fitness_Watch_Code).

To simplify and easily port to the Arduino IDE, install all libraries in the Arduino IDE.

· ESP-Core – by Ivan Grokhotkov

· TimeLib – by Paul Stoffregen

· EmailSender – by Xreef

· Adafruit 6050 – by Adafruit

· Wifi Manager – by Tzapu

· OLED – by ThingPulse

After opening the project in the VScode editor, open the platform.ini file, which is where platform.io recognizes libraries, sets serial communication speed, and determines the board model. Just change the path of the external libraries to the current existing Arduino library path.

lib_extra_dir: “Arduino library path”

After changing, click the checkmark button on the bottom tool of the VScode window to compile the code. There should be no errors (there may be warnings). After successful compilation, click the arrow button on the bottom tool of the VScode window to burn the code to NodeMCU. We don’t have to worry about which port NodeMCU is connected to on the PC; platform.io will automatically detect and upload the code without any problems.

All the codes mentioned above can be obtained by replying to “Darwin Says” on the WeChat public account: ESP8266 Watch. You can also refer to GitHub: https://github.com/Neutrino-1/Fitness_Watch

Step 6 Comprehensive Testing: Testing with a Breadboard

Building an ESP8266 Smart Health Watch from Scratch

Test the circuit described above on a breadboard, building the above circuit.

Building an ESP8266 Smart Health Watch from Scratch

After powering the NodeMCU, there is no problem displaying the time.

Next, test the pulse sensor, first press the button to switch to pulse measurement mode, at this time place the pulse sensor on a finger, and the pulse sensor will display the BPM on the display in graphical format.

Finally, test the MPU: When the device rests for a while, about 15 seconds, the display will turn off. At this time, just shake the breadboard, and the display will light up again.

Building an ESP8266 Smart Health Watch from Scratch

OK, so far, all hardware parts have been tested and everything is working! You can connect all components together for comprehensive testing.

Setting up the PCB model and wristband shape:

Building an ESP8266 Smart Health Watch from Scratch

Process of making the perfboard: The perfboard was cut into small pieces of 3.6cm*5cm and two slots were cut into the small board with a rotary tool to hold the wristband. Since the edges of the perfboard are too sharp, it was sanded with fine sandpaper.

Soldering process: First map the pins of Nodemcu and ESP12E, solder VCC and the enable pin from ESP12E. Then some insulation material is attached to the back of the 12E to prevent short circuits when later attached to the perfboard. After soldering the ESP-12E, an additional switch is soldered as a programming switch, and the ESP-12E will enter Flash mode at startup.

Building an ESP8266 Smart Health Watch from Scratch

Building an ESP8266 Smart Health Watch from Scratch

In addition to the functions tested on the breadboard, a new component will be added—a vibration motor. By adding haptic feedback, the interaction design is enhanced. It can be designed in the program to vibrate the wristband when a certain movement is detected (these can all be set by the user).

Building an ESP8266 Smart Health Watch from Scratch

Power circuit: Add a battery, stabilize it to 3.3V with a voltage regulator, and power the main control. Additionally, solder two header pins for future battery charging.

Building an ESP8266 Smart Health Watch from Scratch

Next, solder the gyroscope, pulse tester, and OLED display as shown in the figure.

Building an ESP8266 Smart Health Watch from Scratch

In addition, the ESP-12E is downloaded via the FTDI programmer through the serial port. Ensure that the programming button is pressed when downloading the program, so that the code can be compiled and burned.

Finally completed:

To make it work like a real watch, a Velcro nylon buckle was added, which will serve as the strap for the watch. To enhance comfort, a piece of removable foam with 3M tape was added to the back of the watch, and finally, the fitness watch installation is complete!

Building an ESP8266 Smart Health Watch from Scratch

Future Improvements:

· To improve the experience of the wristband, it can be made into a PCB board in the future.

· Add a charging indicator, downloader slot, etc.

· Even though the watch has so many functions, it still has not fully developed its potential. In future improvements, the WiFi function and motion detection function of the wristband can be developed to create a gesture control home automation system, or do you have any better suggestions?

Project source: instructables
Maker: Neutrino-1

Compiler: Wind Blowing Wheat Waves

END
Building an ESP8266 Smart Health Watch from Scratch
More Practical Project Recommendations:
STM32 IoT Smart Home Project
Project Sharing | Step-by-Step Face Recognition with MATLAB + Raspberry Pi
Raspberry Pi + Compute Stick 2 completes real-time face recognition project
Building a cloud computing platform for embedded development boards
STM32 achieves the simplest air mouse
Arduino Rubik’s Cube Robot
STM32 version of “AI Soul Painter”
Making an STM32 electronic photo album
STM32 + DDS homemade signal generator
Using Raspberry Pi and Web interface to remotely control appliances
STM32 “Cloud” Music Player
Raspberry Pi Remote Monitoring
Design of a glow tube clock based on STM32
DIY FPGA Minimum System Board (PCB can be directly made)
Building NAS with Raspberry Pi 4 for easy hard disk networking
ESP32 Car Software and Hardware Practical Sharing
Complete gesture recognition with only 79 lines of code
IoT + Electronic Ink Screen can create custom displays
Building a pathfinding robot worth over a thousand for just a few dozen yuan
3D holographic display, visual persistence POV project
DIY gesture recognition module
Practical small design that can be DIYed from scratch
Raspberry Pi builds a smart doorbell + smart lock that can video
Strange! My development board can play games automatically
DIY Breathing Machine
ESP8266 + Zigbee network transformation wall switch
Wireless Home Monitoring System
DIY Bionic Arm, a tool to free your hands
Handmade air purifier, design materials fully open source
Technology Toy: Remote-Controlled Bluetooth Artillery
Using ST sensors to make the LittleBee monitoring system, allowing bees to “speak”
DIY Cat Petting Device
STM32 + Raspberry Pi achieves 6s Rubik’s Cube Robot
Blindly modified drone controller, DIY “Foam” Drone

Making an intelligent relay without an arc using STM32

Making a practical new type necklace with only 5 components

The simplest method for heart rate measurement (suitable for secondary development)

Cracking the magnetic levitation globe

Can light transmit video? Uncovering the production process

DIY smart watch with STM32 60FPS animation

Paying tribute to the classic radio, observing the production process

DIY Third Eye: “Special” glasses with Bluetooth/OLED/lens function

DIY solar charger that tracks the maximum power point

MCU-free night vision goggles, just need wiring

The correct way to DIY flow meter, interest transformer

DIY high-difficulty racing timer (lap/thermal printing)

DIY phone WIFI controlled LED dice

Gas burning power bank

DIY simple Raspberry Pi security system

Using microcontroller + ESP8266 to create a small weather station

Super mini & highly expandable palm robot car

Dream linkage, remotely developing microcontrollers with Raspberry Pi

Automatic tracking + pest recognition plant protection robot

uECG achieves heartbeat LED light ring

Wireless smart high-power switch

Recommended Reading:

Project Sharing | Electric Competition Series | Artificial Intelligence | Postgraduate Entrance Examination
Must-know Knowledge Points | Graduation Project | Switch Power Supply | Job Hunting
We are Nimo, the founder of Darwin, who only talks about technology and not flirting. The Darwin online education platform aims to serve professionals in the electronics industry, providing skill training videos covering popular topics in various sub-fields, such as embedded systems, FPGA, artificial intelligence, etc. It customizes layered learning content for different groups of people, such as commonly used knowledge points, disassembly assessments, electric competitions/smart cars/postgraduate entrance examinations, etc. Welcome to follow.
Official website: www.darwinlearns.com
Bilibili: Darwin
QQ Group: Group 1: 786258064 (full)
Group 2: 1057755357 (full)
Group 3: 871373286
Building an ESP8266 Smart Health Watch from Scratch

Leave a Comment

×