Yet Another Flap Clock

by drtonis in Circuits > Clocks

3090 Views, 46 Favorites, 0 Comments

Yet Another Flap Clock

2023-07-03 18.49.27.jpg
FlapClock Video2
2023-07-03 18.41.51.jpg
2023-07-03 18.47.22.jpg
2023-07-03 18.52.04.jpg

At around 2022 Christmas time I was wandering around on the internet and saw a Vestaboard - a flap display. It’s a nice flap display, however very expensive. After some thinking I decided to make my own, I just wanted to have one.

My initial plan was simple. I’m a Hardware guy, thus my DIY version would not be with a fancy app. I thought that the controller should be ESP based. It can connect to Wi-Fi for time updates or webpage connections. Thus, my DIY version would focus on the HW buildup and the SW would be relatively simple with potential to improve. The main design would be made with Fusion360 and I use a 3d printer.

Usually one can read about successful projects, but this one would be slightly different. The whole project took me almost 7 months and I'm still not happy with the result. The main issues will be discussed in the following chapters. Nevertheless, I'm happy with my concept and buildup strategy, however the flaps must be reworked. Eventually, just to end the project, I made the display partially functional.

I would like to thank Seeedstudio for providing the XIAO ESP32 and PCBA. Their help was really needed as the project cost me much more than I would usually invest in a DIY project. The communication with Seeedstudio was very professional and they were very supportive. Take a look it here: https://www.seeedstudio.com/fusion.html 

Supplies

This project is quite resource hungry:

  • Time and patience
  • More time
  • 3d printer with few kilos of filament
  • self gluing paper (to print the flap digits) - I'm still looking for some better alternatives
  • Driver PCBs - I used 3
  • XIAO - preferably ESP32C3 - 1 is required
  • 28BYJ-48 Stepper motors 5V - 12 per PCB 
  • JST 1.25MM 3 Pin 100MM wire (preferably same direction version) - same amount as motors
  • A3144 Hall Effect Sensor Transistor - same amount as motors
  • 3x1mm magnets - same amount as motors
  • 2 pole 2.54MM Dupont Female-Female wire, 100mm (150mm would better) - I used 3
  • 3 pole 2.54MM Dupont Female-Female wire, 100mm (150mm would better) - I used 4
  • 4 pole 2.54MM Dupont Female-Female wire, 100mm (150mm would better) - I used 2 
  • M3 screws 8-10mm long - for wood/plastic or self tapping - I used approximately 250 (4 x Nr. of Motors)
  • 9-24V power supply
  • Wood plates to fix everything

Mechanical Design

aa.jpg
cc.jpg
bb.jpg
timelapse FlapFrame 55 min. print
timelapse FlapWheel 22 min. print
IMG_0322.jpg
IMG_0325.jpg
IMG_0335.jpg
IMG_0338.jpg
IMG_0341.jpg

The first thing in my mind was the flap design. I knew already at the beginning of the project that the flaps would be the main challenge. I was not interested in paying a lot of money for a custom print and cutting, thus real DIY was my main coal. I was considering a lot of different ways to make the flaps as simple as possible. 

The Vestaboard is using 64 flaps (bits as they call them) and I decided to go with the same number. The 28BYJ-48 stepper has 4096 steps per rotation, thus the number of flaps should ideally be a power of 2. At the same time 64 flaps per digit means a lot of work. My first idea was to use 5x12=60 digits and they require 3840 flaps in total. Simple build is a must here. In the end I had "only" 2304 flaps.

I was considering possibilities to use laminated paper and cut it out, however the small and fine cuts were not as easy as I would have liked. Probably it’s doable, still it’s more work than needed and it requires too much time. 

Alternatively one could use a long paper strip and glue it together making a flap. Folding precisely was not as easy as hoped. Additionally, I had difficulties finding a good way to fix something for the movement.

I have considered a laminated paper and a laser cutter. However, I do not have one. Additionally, the ones I could have an access to, were not able to home precisely enough for the flap cutting. Too much manual fiddling would be required. Therefore, I have not looked much into the laser cutter solution. Now, after all the struggle, I am considering giving the idea a try.

In the end I decided to use a 3d printer. The first idea was to print the plate and glue a sticker on it. I decided to go as small as possible and did not consider the flap thickness. My first flaps were 0.8mm thick and the resulting flaps didn't really fit.

Since the printed plates were too thick I thought of going back to the laminated paper idea and using something small to fix the on the roll. Again a lot of thinking and I came up with an idea to print clips. Unfortunately they were too weak and insatiable. 

So, I returned to my printed flap idea, but reduced the thickness to 0.4mm. Printing them wasn't very easy as my printer nozzle diameter is 0.4mm. I needed a lot of the flaps and printing the flaps flat on the printer bed would require way too much time. Thus, I printed them standing. That caused new stability issues and I had some elephant foot problems. In the end I added a raft under everyhting. That made the printing stable, however removing it was time to time still quite difficult. One needs well calibrated printer.

I decided to go as small as possible and the stepper motor here defines the size. It took several iterations to find the proper size of the flaps and the fixing rolls. I wanted to keep the distance between the flaps as small as possible, however due to the 3d printer inaccuracy I had to settle with the value of around 0.8 to 1.0mm (double nozzle size). I tried different ways, unfortunately they were not sustainable and stable for "mass" production.

In the pictures one can see the iteration steps. Not all steps are shown and I think I printed more than 10 versions of each part before I settled. During prototyping I noticed that the flaps are very light and they don't make the correct sound. Something that I didn't think of before the design. However in the final design the flap sound was good enough.

The frame design is not very complicated and I tried to find a balance between material usage and print speed. With less material usage the print time would increase and vice versa. In addition, mechanical strength is important too and I tried to find a suitable balance. Here again the aim was to reduce the size as much as possible.

Electronics

IMG_0329.jpg
2023-03-19 15.20.44.jpg

Motor Control

At first I planned to use 60 digits and each of them has 4 digital input pins. That's a whooping 240 digital output pins just for the motors. Additionally, one needs to consider how to define the home position. Thus, all in all, the minimum was 300 digital input/output pins. Obviously there are no microcontrollers with such a high pin count.

For the motor control pins I decided to use a regular shift register. It’s a simple thing and there are almost no limitations on how many pins I could add. My experience says that I need 2ms between the motor steps, thus there should be enough time to send all the necessary shift register inputs, between each step. The motor control with shift registers worked exactly as intended and I’m happy with that. 

The motor has gear Reduction Ratio of 64:1 and the step angle is 5.625 deg (360/5.625 = 64 steps). Meaning one needs 64*64 = 4096 steps for one full circle. As I have decided to use 64 bits/characters it divides well with 4096 -> 64 steps between the bits. 

Homeing

Homing is slightly more complicated. I was considering possibilities to add a mechanical switch, however that is physically always large. Same with the optical solutions (as long it’s not a custom made). Therefore, the most reasonable solution seemed to be a magnet with a hall sensor. 

Most hall sensors give an analog signal as an output. Reading 60 analog signals is not desirable. So I was looking for possibilities to turn it into a digital signal. That could be done using an comparator (opamp), however that is an additional component. Then I discovered the A3144 hall sensor, it is a digital switch and would be perfect here. 

Now I had the endstop digital switch, however I still had no connection to the microcontroller. Suddenly I had an idea to enable/disable the stepper motor directly with the endstop. In the homing state I rotate all the dials at the same time. When the magnet reaches the hall sensor, it triggers and disables the motor. I used AND gates for that reason. By using this method I do not have direct endstop feedback, however I can still define the dial positions. At least that was the theory. In the next chapter I talk more about the drawbacks.

Power

From the 28BYJ-48 datasheet one can read that the typical operating current is 240mA. If all the 12 motors are running, a PCB requires 240 * 12 = 2880 mA (@ 5V = 14.4W). The standard DC-DC converters are usually rated to 2A. Therefore, I decided to split the motor power and it has 2 DC-DC converters per PCB. 

I noticed that sometimes the motors were stalling. The printed parts were not perfectly straight and from time to time caused too much friction. Additionally, most probably some of the motors were not at the best quality as few had difficulties to rotate already without any load. I decided to increase the motor voltage to provide more power. I still use 5V motors, but drive them at 8V. On continuous power they are getting hot, thus small breaks are required and I turned power off after every movement. At least I have not noticed overheating issues. On the contrary I do not have an access to the inner motors, thus the reality could be different. On top of that I had to increase the power supply as the demand was higher than first calculated.

Flaps

2023-07-03 17.50.10.jpg
2023-07-03 18.42.56.jpg
timelapse FlapFlaps 1h Print
timelapse FlapFlaps 2h Print
2023-04-02 12.49.45.jpg
IMG_20230326_142843_hdr.jpg
2023-07-08 10.51.29.jpg

The flap design was my biggest concern and now I have to admit it is still the weakest part of the whole design. Theoretically my idea to glue the symbols on the flaps is not too bad, however it was the most time and energy demanding job of the whole build. It was very difficult to remove the sticker behind the paper and then glue it straight on the flap.

On top of that, after fiddling a lot around the stickers some do not stick very well on the flaps. During my design phase I didn’t test the 3d printed flaps with the glued paper. Although single paper thickness is very small, all of them together adds up. Together with not perfectly sticking makes the flaps way thicker than expected and one can see it (take a look the added pictures).

In the attached videos one could notice that some digits do not move smoothly. The hard edges of the printed holes and flaps get from time to time (or almost always) somehow stuck and the flap does not turn. In the "Thanks Seeed'' video one can see it very well. The upper right flap usually does not flip as it should and stays blue instead of falling to white. Despite the fact that I have tried to smoothen all the edges it still is stubborn.

All in all I have to admit that the flaps are the weakest part of my design and I’m not happy with it. If I could find a better way to make them I would rebuild the whole thing. 

One can find the digit symbols I used here: https://github.com/drtonis/FlapClock

PCB

2023-07-03 17.47.46.jpg
2023-07-03 17.48.34.jpg
2023-07-05 18.50.31.jpg

Seeed Studio was very kind and paid for the PCBA work. Their service was excellent and I was positively surprised. I had to change my PCB layout and they did the work without any extra costs. Definitely a company that I would use again.

I ordered the first PCB and a few days later discovered that I had a small logic mistake on it. The mistake did not affect the normal operation, however I was not able to do the homing. I did a lot of testing on the breadboard, however I did not try the homing before ordering the PCB. Lesson learned again, test everything before committing.

That meant I had to redesign the PCB. Seeed was already ready with the PCB production, nevertheless they have not started with the assembly. Seeed Studio was very kind and I was able to send them the new design and I did not have to pay extra for my mistake. Respect!

The PCBA I got from Seeed Studio was very good and there is not much to say about it. It was exactly what I expected and they even sent me a few extra components.

I have used some other PCBA services and sometimes large PCBs are not perfectly straight. My PCB is almost 500mm long and at this length one can easily notice if the PCB is bent. With the Seeed Studio work I did not have this issue. The straight PCB helped a lot with the assembly. I was prepared for the worst case and had some extra fixing holes prepared to compensate the bended PCBs. Luckily they were not needed.

How to connect different panels together is shown on the PCB schematics. It may take a moment to understand the logic, as long you do not make any short circuits it should be OK. I have not used polarity safe plugs due to cost and simplicity reasons.

Check it out yourself: https://www.seeedstudio.com/fusion.html 

One can find the PCB files here: https://github.com/drtonis/FlapClock

Homing Issues

2023-07-03 17.49.30.jpg
2023-07-03 17.49.54.jpg
2023-05-19 11.06.15.jpg
FlapClock Video3

A3144 is a fine pitch THT IC (there is an SMD variant too). I was considering soldering it directly on the PCB, however I was not able to place the magnet close enough for that. I had no intention of making another PCB for the sensor, thus I was looking for alternative ideas and eventually decided to use a 1.27mm pitch JST cable for that. Luckily, one can order these from AliExpress. They are cheap and the pitch fits. Getting the sensor pins into the cable plug is not always simple, however after some fiddling, it will have sufficient contact and is stable enough. During the squeezing process I bent several sensors, therefore some reserve is required. Just as a reminder - the cable allows inserting the sensor both ways and one can simply apply the wrong polarity, try avoid it.

After some testing I discovered that the A3144 detects the magenta only in one direction. One needs to be careful when placing the magnet - polarity needs to be correct. I discovered it again in the hard way. Therefore, I tested all the magnets on a small breadboard before installing them.

Another important thing with the A3144 is the wiring correct polarity. I am not sure if I connected the sensor with the wrong polarity or the sensor itself was broken, however I had a few that heated up to very high temperatures. The 3D printed parts do not like high temperatures and so I had a few meltdowns. Like always it took me a few failures before I discovered what was causing the issues. Usually I noticed it first after the next dial could not rotate anymore due to deformed plastic part.

My plan with the simple homing does not work perfectly since each digit stops at a different spot. It should not be a huge surprise, however the difference is much larger than expected. Additionally, I assembled the flaps slightly wrong and the home position is green, not white as I was intending. This small displacement I noticed when I had almost all digits assembled and then I had no motivation to disassemble all of them. 

Now after running the unit I have to admit that maybe having a sensor PCB would not be such a bad idea. The THT sensor is not fixed and sometimes it changes its position. The cable behind is a little fiddly and the placement is like it is. Thus, the homing position is not always the same. The sensor placement is very crucial and a PCB would have been easier to fix to the frame.

Additional issue, that I have not mentioned yet, is the magnet size. If the green or white bit is active the magnet is triggering the hall sensor and the homing does not work, the sensor is already triggered. Staying at green is not an issue as it is the home position, however the white is not. Therefore, in the manual mode, I move first all the digits a few times, so that all of the hall sensors are not active, and then proceed with the homing (that can be seen in the first video). 

Alternatively one needs to perform homing twice. First homing, then moving a few bits and then home again. In this way one homes in all the digits, however it looks strange and it takes time. That needs to be done after boot-up. Later theoretically we should know which bit we are showing and we could first move all that are too close to the homing position further and then perform homing only once. Nevertheless, that is something that should be looked into only after improving the flaps generally.

Building the Clock

2023-07-03 17.49.07.jpg
timelapse FlapWheel printing 2h30min
timelapse FlapFrame 2h30min
Flap Clock first tests
IMG_20230326_130835_1.jpg
IMG_20230326_110534_hdr.jpg
IMG_20230326_110515_hdr.jpg
IMG_20230326_110524_hdr.jpg

Total print times and required material (for 3 lines / 36 digits):

  • FlapFlaps: 36 pcs / 2300 minutes / 620 gramms / color black
  • FlapFrameEnd: 3 pcs / 65 minutes / 32 gramms / color white
  • FlapFrame: 36 pcs / 385 minutes / 820 gramms / color white
  • FlapWheel2: 36 pcs / 340 minutes / 75 gramms / color white
  • FlapWheel: 36 pcs / 800 minutes / 325 gramms / color white

Wooden plates, I used (for 3 lines / 36 digits):

  • 2 pcs side plates 12x120x275mm
  • 4 pcs horisontal layers 8x100x440mm

I printed the flaps black, since I did not have enough white for that. I think the black color adds some nice contrast, thus the decision was good here.

The single digit design is simple enough and that works like I expected. Only the edge that prevents flaps from falling should be made wider. There are few digits where the cylinder slides slightly to the right and then the flaps just fall down. One can notice it on the videos (bottom row 5th digit from the left).

I added several screw holes to fix digits with each other, however after several disassemble actions I noticed that it is much easier and sufficient to add only one screw on the top and use a PCB fixture in the back. The good quality Seeed Studio PCBA helped here a lot. First, I built up a whole 12 digits and assembled them together before doing many tests. After several issues I realized that I should test each digit separately before assembling them. Nothing really new.

The motor should be installed as high as possible. The screw holes are large enough and one should try to push the motor as high as it goes. One needs as much distance as possible between the frame and the flap cylinder. Otherwise the friction between the parts may prevent smooth movement.

I placed each layer on a wood plate and used the same for the sides. I did not consider it well during the PCB design, however the XIAO should be turned 180 degrees. At the moment when I have the side wall placed I cannot connect the USB cable and that makes software testing and improvements impossible.

My original plan was to build the whole thing two layers higher, after some struggle I decided to go with four 4 lines, however since the flap construction required considerably more work than expected I reduced it to 3. The wooden side plates are therefore too high. For a better look I painted the wooden plates white to blend better with the white design.

The construction is process would be something like this:

  • Print all the needed components
  • Prepare the flaps
  • Place magnet in the flap cylinder (check polarity)
  • Mount all the flaps on the cylinder
  • Mount the motor
  • Mount the cylinder to the motor
  • Do the same for the other 11 digits
  • Add them next to each other
  • Place a PCB in the back (first without screws) and connect the motors
  • Test if each motor is running. If not, check if there is enough clearance between the frame and the cylinder.
  • Prepare hall sensors
  • Connect the hall sensors with the PCB, but do not insert them into the frame jet
  • Try running the motors again and check each hall sensor temperature
  • If any hall sensor is warm replace them / check polarity
  • If everything looks good, insert the sensors to the designated place
  • Try to check if homing works, since the digits are not screwed together it can be little fiddly and unstable (homing does not work)
  • If everything looks good, add one screw on the top and one through the PCB
  • Check if all the sensors are in the correct position
  • Run the homing again
  • I used cable ties to fix the sensors
  • Run the homing test again.
  • Do the same procedure with the next line.

Some strong material plates, for example wood, are required between the lines. However the side panels are fully optional.

One can find the STL Files here: https://github.com/drtonis/FlapClock

Software

The software I made is not ready. Since I had difficulties with the hardware I was just tired of the struggle and made it just partially functional. There are possibilities to improve it in several ways. All the ideas with calendar connections, weather forecast, time updates, OTA and so on are not implemented.

During software testing I thought about using the serial over Wi-Fi, nevertheless it does not work with ESP32-C3. I was googling a lot and could not find a working solution. The same with over the air firmware update. All the sophisticated solutions were not compiling. As much I could find was that it does not work with the new ESP32 versions. Very disappointing, however it is my own mistake that I placed the XIAO to the PCB the wrong way.

I found a simple OTA that works: https://randomnerdtutorials.com/esp32-over-the-air-ota-programming/

The problem with that script is the fact that one cannot run a web interface parallel to it. Or at least I don’t know how. Additionally the update screen is blocking the code and making it slower. However, it works.

The code works like this:

  • Do homing
  • Add some correction to end at white
  • Move only the necessary digits further till the preferred symbol is shown.

Since the motors are slow I can easily us the shift register and I did not notice any delays or problems on that part.

The idea that between each symbol is 64 steps did not work out exactly as expected. It was varying and I assume it has to do with the homing. 

The Arduino code can be found here: https://github.com/drtonis/FlapClock

Conclusion

2023-07-03 17.46.59.jpg
2023-07-03 19.02.52.jpg
FlapClock Video1

My second attempt to build a flap clock and again I was struggling with the flaps itself. I am happy with my design concept as I could extend it quite a lot, however the flap build up still requires a total rethinking.

Seeed Studio provided very high quality PCBA and XIAO control board that helped me a lot. Still due to shortcomings of the mechanical design the final result has improvement possibilities. At the moment the look and feel of the display is still not as expected.

If I could find a better way to make the flaps I would rebuild it. I still would like to have the display and I like the sound of it. Unfortunately not all the project ends as expected. Life is unfair :D


I would like to thank Seeed Studio again for the good support and perfect PCBA. If I have a chance to rebuild the display I would keep the current PCB and XIAO control. I would focus mainly on the flaps and not on the electronics.