Pi-shaped Mental Arithmetics Clock

by Doglover 8D in Circuits > Clocks

1252 Views, 7 Favorites, 0 Comments

Pi-shaped Mental Arithmetics Clock

20221109_163838.jpg
20221109_163039.jpg
20221109_161558.jpg
20221109_162035.jpg
20221109_162022.jpg
20221109_162029.jpg
20221109_162046.jpg
20221109_162055.jpg

Around two years ago I was sitting at home, doing maths-homework and thinking to myself: "Why do we have to practice mental arithmetics again? I'm in 7th grade, everyone in my school (Schillerschule Hannover, Germany) should be able to add, subtract, multiply and divide numbers between 1 and 100 in their head. Maybe I can build something that helps practicing that!"

With that, my idea of the Calculator Clock was born. First I focused on the programming. The programme that would control the clock would break down the time into two arithmetical problems, one for the hours and one for the minutes. I even created 5 different levels. First you would just have to add two easy numbers, then it would get harder. I added subtraction, multiplication, division and negative numbers. It would also help practicing basic algebraic rules like multiplication/division before addition/substraction.

After long hours of staring at my computer, typing and troubleshooting, I finished the programme.

But I didn't know where to put it to make it look nice so I just got a frame and glued the LCD and the microcontroller to the inside. I also added christmas decoration (it was just before Christmas back then) and pictures of gnomes to hide the ESP and I hung it in the hallway. And there it still hangs.

A few weeks ago I looked at it again and thought: "Hmm... I should change the decoration. It's a long way to Christmas. Maybe I can use some pumpkins and halloween decoration to update it. But if I want it to stay up-to-date I would need to change it every few weeks!"

Then an idea hit me: I will make a universally usable Pi-shaped Calculator Clock!

Supplies

  • 3D-Printer + filament
  • USB-cable
  • LCD 128x64 (I used this one: https://www.aliexpress.com/item/1005004237282931.html)
  • ESP8266 D1 Mini
  • Screws (stainless steel)
  • Wiring tool (WSU-30 M)
  • Wires


  • Fusion 360
  • Software for converting an image to a 3D object (e.g. Microsoft 3D-Builder)

Transforming Pi Into a 3D Object

Screenshot_20221030_140838.png
Screenshot_20221030_140527.png

Choose a shape for your calculator clock. It should be able to stand on its own when 3D-printed. Find a picture of it on the internet. I chose Pi as my shape (see Step 13 for more information on Pi) and I used this picture: https://www.clipartmax.com/middle/m2i8A0m2K9i8K9K9_pi-symbol/ (Accessed on 2022/10/14)

In the next steps I am going to show you what to do for Pi. If you chose a different shape you might need to adjust the instructions a bit.

Then open the image in your conversion software (I used Microsoft 3D-Builder) and change the size to what you need, the measurements of my Pi are 125*121*64.5mm. The depth should be a little more than the width of your LCD. Then convert it to a .stl or .obj.

Fusion 360: Opening and Hollowing Out Pi

Screenshot_20221030_141134.png
Screenshot_20221030_150602.png
Screenshot_20221030_151030.png

Insert the 3D-file you created earlier in Fusion 360 and make sure the measurements are correct.

Hollow out the Pi using the Shell button in the Modify menu. The walls should be at least 3mm thick to prevent the Pi from breaking.

Then convert the mesh to a solid.

Fusion 360: Adding Holes for the LCD and Cable

Screenshot_20221030_151140.png
Screenshot_20221030_151232.png

Now you will make holes in some walls of the Pi where you will insert the cable for the microcontroller and the LCD later.

To do that create two sketches in the shape of the holes. Pay attention to the exact measurements of your display. The LCD should fit exactly in the hole where it is going to stick out later. Do the same for the cable then extrude the sketches as a cut in the wall of the Pi. Using the offset make sure they are in the center.

Fusion 360: Creating the Sliding Mechanism for LCD and D1 Mini

Screenshot_20221030_152038.png
Screenshot_20221030_152341.png
Screenshot_20221102_203228.png

I wanted to make sure the LCD and microcontroller stay in place and don't wobble inside my Pi-shaped Calculator Clock. That's why I created a sliding mechanism for the LCD and a small hollow room for the D1 Mini. If there's enough space for a sliding mechanism for your microcontroller you can of course do that.

For the LCD create two sketches around the opening for the LCD in the shape of an L. Then extrude them to the full height of the Pi.

To fill in the gaps between the Pi clock and the LCD create two more little pieces. Join four boxes in the shape you can see in the picture. Then mirror it.

For the microcontroller create two rectangles as sketches. Extrude the outer one and join it to the Pi. Extrude the other one that should be a bit smaller as a cut. The microcontroller should fit in the created room.

Fusion 360: Filling in the Corners

Screenshot_20221030_151337.png
Screenshot_20221030_151415.png

Later you will cut the Pi in three pieces so you can slide the LCD, microcontroller and cables in. Then you will screw the pieces together. Now you will fill in the corners of you Pi shape for the screws. In order to do that create sketches in the shape of the corner. Then extrude them to the full depth of the Pi.

Fusion 360: Adding Holes for the Screws

Screenshot_20221031_095539.png

Later we will screw the 3 parts of the Pi together. To do that we will need screws and holes for them.

Go to the solid -> create menu and press hole. Select the filled in corners and if needed the sliding mechanism block. Set the diameter to the diameter of your screws. You should have at least four screws on the front and back.

Fusion 360: Splitting the Pi Into 3 Pieces

Screenshot_20221030_185139.png

To slide in the LCD, D1 Mini and wires later you will have to split the Pi in at least 2 pieces. For better printing I did 3 pieces.

In order to split the Pi, move it up or down so the level you want to split it at is the ground level. Then press Split Body in the Modify-menu and choose the ground level as splitting tool. Move one of the bodies away and repeat the splitting until there are 3 bodies.

Fusion 360: Adding the First 60 Digits of Pi

Screenshot_20221030_185833.png

This step is optional. You don't have to add numbers, you can also add letters or just skip this step. To make the Pi-shaped Calculator Clock a real Pi-clock I wanted to add a few digits of Pi on a curved line. Create a new sketch and then create a Fit Point Spline. Choose two points and then make it curved by mooving the green line. Then add text along path and choose the line you created earlier as a path. Adjust the size of the letters until they fit on the Pi.

Printing the Pi

20221106_102303.jpg

Export the files as .stl or any other format that works with your 3D-Printer. Scroll down to find my files. Then print them.

Programming the Calculator Clock

Screenshot_20221106_143005.png

That's the hard part :). I won't go into details here, if you want to know exactly how the programme works, just translate the comments. If you can find a shorter version feel free to share it!

Set SSID and PASSWORD in lines 44 and 45 to your Wifi-name and password.

The basic idea for the levels is:

  • Level 1: Add or subtract two numbers, one should be between 0 and 10.
  • Level 2: Add or subtract with numbers between 0 and 100.
  • Level 3: Add two numbers, one of them is negative, the other one is greater than 10.
  • Level 4: Multiply and divide numbers.
  • Level 5: Multiplication, division, addition, subtraction and multiplication/division before addition/subtraction.

Wiring Everything

20221106_102618.jpg
20221106_102806.jpg
20221106_102822.jpg
20221106_102859.jpg
20221106_103513.jpg

I couldn't use normal cables because the microcontroller barely fit in the Pi. That's why I used a wiring tool, the WSU-30 M. It allowed me to use no extra space to connect the wires to the microcontroller.

First strip the cables at around 3 cm. Then put the wire into the hole at one end of the wiring tool. Put it onto the pin and turn it. Repeat the process and connect GND->GND, VCC->3.3V, SCL->D1, SDA->D2.

Assembling and Finishing

20221106_103621.jpg
20221106_103715.jpg
20221106_103750.jpg
20221106_103820(0).jpg
20221106_103940.jpg
20221106_104142.jpg
20221106_104537.jpg
20221106_104229.jpg
20221106_110053.jpg
20221106_110519.jpg

Slide in the cable, D1 mini, the LCD and the little pieces that will hold the LCD in place. Screw the three parts together. If you want to you can paint the digits of Pi black or any other colour. Upload the programme and you're done. Congratulations!

Side Note: Pi

Pi is widely known as the ratio of the circumference of a circle to the diameter of that circle and is used to calculate the area of circles and the surface area of cylinders, spheres and more. It is irrational which means that the digits never end or become repetitive. The record for memorizing the most digits is at around 70 000. If you want to learn more about Pi go to this website: https://www.piday.org/learn-about-pi/.