Make a Cube Timer Using 4 OLED Displays and I2C Multiplexer

by Jaychouu in Circuits > Clocks

971 Views, 7 Favorites, 0 Comments

Make a Cube Timer Using 4 OLED Displays and I2C Multiplexer

时钟.png
时钟2.png
How I2C Protocol Works - Using Gravity: Digital 1-to-8 I2C Multiplexer

Have you ever counted how much time you spend on your phone a day? I counted and the result shocked me. I cannot even remember the last time I truly focused on sth without looking at my phone for 2 hours. I realized that my phone impairs my ability to concentrate, so I really need a tool that can keep me reliably distraction-free. I searched online and found that timing is a good idea. It is said that when people understand that there's a tangible end to whatever they're doing, they will be able to focus on that one activity better. This inspires me why not make a timer? And I happened to have four OLED displays so I decided to make a cube timer with different time durations displayed on each of its four sides.

This final effect is shown in the video at 4: 19.

Supplies

Hardware

QQ图片20220725112419.png
四个屏幕.png

First here comes a problem. The display communicates with the MCU via the I2C port, and the devices can't be connected to the same I2C port and thus share the same address due to address conflict, otherwise, they can't communicate with each other normally. Now the ESP32-E controller has only one I2C port, and even with an expansion board, there are only three, which cannot suffice for four displays.

This time an I2C Multiplexer will just come in handy. 

Laser Cutting the Shell

QQ图片20220725151702.jpg
QQ图片20220725151939.jpg
  1. Laser cut a rectangular hole in the four sides of the plastic shell respectively for installing the displays.
  2. Generally, we need to cut at least 2 times to cut a thick plastic successfully. Multiple cuttings may lead to the edge-curl phenomenon, so here I used a utility knife to trim the kerf edge.

Install Displays

QQ图片20220725151943.jpg
QQ图片20220725151948.jpg
QQ图片20220725151951.jpg
QQ图片20220725151956.jpg
  1.  Install the displays.
  2. The sizes of the cutouts are determined by those of the displays, so they match perfectly.
  3. Attach and fix a 3M single-sided adhesive foam tape on the back of the displays respectively to avoid a short circuit caused by hardware touching.

Connect Displays, I2C Multiplexer and ESP32-E

QQ图片20220727132553.jpg
QQ图片20220725152002.jpg
QQ图片20220725152009.jpg
QQ图片20220727132557.jpg
QQ图片20220725152013.jpg
  1. Cut DuPont wires to a suitable length.
  2.  Connect the 4 displays to ports 0-3 of the I2C Multiplexer respectively.
  3. Then connect the I2C port of the I2C Multiplexer to that of the ESP32-E main controller.


Connect Battery and RTC

QQ图片20220725152017.jpg
QQ图片20220727132601.jpg
QQ图片20220725152020.jpg
QQ图片20220725152025.jpg


  1. Connect the battery to the corresponding port of the ESP32-E main controller.
  2. And connect the I2C port of the RTC module to that of the ESP32-E main controller
  3. The overall view is as shown in the figure.

Make Capacitive Pin Button

QQ图片20220725161137.jpg
QQ图片20220725161133.jpg
QQ图片20220725161129.jpg
时钟.png
  1. Solder the capacitive touch pin (D12) of the main controller with one of the screws on the shell, so that the screw can be used as a touch sensing button.
  2. Fix the tilt sensor inside the top cover of the shell at a certain angle with hot melt adhesive.
  3. And hook up the wires
  4. Finally, assemble the top cover and the box, and fix them with the screws. Then all done.

Conclusion

QQ图片20220727112413.png

You may find that the title sensor is not used in this project, that because I made two versions for this project. One is the cube timer stated above, and the other is a clock box with four types of information shown on the displays: countdown, time, date, and motto. The tilt sensor is used to set countdown time and the capacitive touch pin is used to switch on/off screens. And these functions are still included in the codes

Problem During the Making:

When all finished, I just found that the timer has no response to the touch button, but it works fine in the test before assembly.

I thought maybe there was a short circuit between parts, so I attached the 3M foam tape to them. But the problem remains.

Then I guessed maybe the circuit connections went wrong, so I re-connected and got all connections right.

Sadly, the problem still exists.

After many tests, the problem disappears when I replace the capacitive touch button with a general one. It turns out there is something wrong with the capacitive touch button.

For the touch pin, the touchRead() function returns the value of about 10 when mains-powered and returns about 30 when battery-powered.

Still, there are things to be improved in this project, all ideas are welcome. Thanks for reading!