Smartwatch Journey – Part #8

I found out that smartwatch has been stucking because of BLE and Ticker. These 2 events are interfacing with the display where the while loops and delays are used. So I added a boolean variable for drawing state. If the ticker wants to refresh time after 60 seconds it first set drawing = true then it begins to draw, so if it got BLE event, it can wait while the ticker is drawing with while(drawing); loop. This solution works also vice versa. Another problem was that I had to use custom shiftOut function instead of hardware SPI, it doesn’t work for me ?.

The next issue was the battery life. Smartwatch lasted only few hours. I found out that the sleep function in library wasn’t complete. Sending data after command was missing, so I added it. Smartwatch could survive for 1 day then. But, that wasn’t surprising. I expected one week! I have been using my smartwatch few days and discharging the battery to the 3.35V. This time, as I am writing this article the display shows 4.03V after 8 hours of use. This sounds much better. Besides that, I am running LiPo discharge logger which writes voltage of 100mAh LiPo battery to the file in SD card. It’s simple. I use 10kOhm resistor as drain. By the Ohm’s law 3.7V / 10kOhm = 370uA which is average power consumption of the smartwatch. I will write an article about How to determine battery percentage from voltage.

If You want to know about something another, please feel free and leave me a commen. I can write tutorial or anything for you which may help you.

Smartwatch Journey – Part #7

It’s finished! Somehow…

You can check some photos on my Instagram @kovacdottop.

First of all, I was using millis() function to get the current time but the millis() resets after 68 minutes. So I was looking for another option. I am using Ticker object now. I execute void every seconds which increments seconds variable storing unix time in seconds. I use another variable to count up to 60 and then I refresh time, date day name, battery voltage if changed. This is better solution than looking for overflowing millis because if you want to run BLE you have to waitForEvent in the loop void, so you can’t refresh time.

Next, I added onReceive(String msg) void for BLE. I wait for any ble event and if I receive any data I show example logo.

But there is a problem, it gets stucked sometimes when there is some ble event. The time isn’t refreshed anymore. So this is on my current queue.

How to properly use Bluetooth communication with Arduino and HC-05/06

Bluetooth Module HC-05 or HC-06 comes with Serial interface with default baudrate 9600 bits per second. It is easy to hook it up. I prefer to use hardware Serial if it’s possible. Arduino Mega 2560 has 3 spare hardware Serials, Arduino Micro or Pro Micro has one spare and regular Arduino Uno has no spare Serial. In this case You can use Software Serial library which likes to use interrup pins of Arduino Uno 2 and 3.  When You have already connected bluetooth to the Arduino it’s time to try it out.

    1. Include SoftwareSerial library
      #include <SoftwareSerial.h>
    2. Declare bluetooth object
      SoftwareSerial bluetooth(RX_PIN, TX_PIN); // usually pin 2 and 3
    3. Start serial communications
    4. Add receive and transmit functions to the void loop
      if (Serial.available() > 0) {
      if (bluetooth.available() > 0) {


You want to make something complex sometimes like saving every received byte to the string and then displaying it as text.

  1. Declare string object outside any void
    String buffer = "";
  2. Add this code to the while loop
    if (bluetooth.available() > 0) {
      char rd = char(;
      if (rd == '.') {
        buffer = "";
      } else {
        buffer += rd;


Smartwatch Journey – Part #6

After long time of problem solving I can finally run E-ink display on my RedBearLab BLE v2. I got some problems to run it with hardware SPI, so I had to use different pins and custom shiftOut function for data proper transfer. The final design doesn’t look like an Apple Watch or nice Samsung Watch but I hope it will be functional.

The every part which will be used:

  1. 3D printed case in black PLA
  2. RedBearLab Nano v2
  3. Vibrator motor
  4. Pushbutton 6×6 mm
  5. LiPo 301530 100mAh battery
  6. TP4056 LiPo charger
  7. uUSB connector (i hope there will be enough space for this)
  8. Some hot glue, wires and resistors for voltage division and measuring

Stand By mode should refresh time every 10th minute, not every 10 minutes! When I will receive some message, it will display a logo of the app, sender or title and the content. I will play with this when it will be finished hardwarely.

I expect one week of usage.

I consider to make custom pcb with all the parts soldered on the only one board, so there will be more space for battery and it will be thinner and nicer.