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.



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.
· 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.

Connection of the OLED screen and the main control:

And test in the Adafruit SSD1306 library in Arduino:

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.
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.

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.

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

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

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

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.

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:

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.

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).

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.

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

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!

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?
Compiler: Wind Blowing Wheat Waves

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:
