Casino'clock
Intro: Casino'clock
One of the main difficulty to make a split flap display with 3D printer is the fabrication of flaps. Therefore I used off-the-shelf playing cards for flaps, and made a funny and crazy clock with minimum number of parts.
- Simple design : each display unit consists of only 3 types of parts. No sensor is used to find the origin.
- Funny motion : by arranging cards randomly, you can enjoy busy motion of flaps
- WiFi time acquisition : current time is acquired via WiFi using ntp
STEP 1: 3D Print
3D-print of parts for a single unit.
- Print them with supplied posture.
- Support structure is not necessary to print.
- Print 14 copies of hinge.stl.
- Parts for a single unit can be printed out with common 200mm x 200mm 3D printer.
- Remove debris and blobs around the printed parts.
If your card is a bit long and tends to jam, please try to use "axis-5mm-taller.stl". The other "axis-5mm-taller-antijam.stl" has wedge shape on the base plate that might avoid jam of the cards.
STEP 2: Assemble the Rotor
The process of assembly is also illustrated in the video above.
- Before attaching the card holder (hinge), please make sure that the card can be inserted smoothly.
- Attach the hinge to the rotor by snap-fit manner.
- Please note that each hinge has front and back. Please check the figure above.
- After attaching the hinge, confirm the smoothness of rotation. Rubbing (frequent motion of hinge with some strong force) might make it smooth.
STEP 3: Attach the Motor
- Attach the motor with two tapping screws.
- Cables should be drawn to backward.
- Fix cables with zip ties.
STEP 4: Attach the Rotor to the Motor
- Insert the axis of the stepper motor to the hole of the rotor.
- if they are loose, one drop of superglue from the outer hole will fix it.
STEP 5: Attach Cards
- Stick double-sided adhesive tape to the short edge of the card.
- Slide-in the card to the channel of the card holder (hinge).
- 1-2mm gap between the card and the the pillar is ideal.
- You can arrange the cards either randomly (for fun) or ordered (less noise). Please note that it rotates clockwise.
STEP 6: Make 3 Units Getting Together
- Print base.stl, and attach the units to the base with tapping screws.
- Attach motor driver to the base.
- (optional : cover.stl can be used to hide the driver boards in the final step. If you use Dupont connectors, the cover.stl is too small to cover them. To use this cover, direct soldering of the wires are necessary. M5stack can be attached with a M2 screw.)
STEP 7: Connect Microcontroller
Selection of microcontrollers
- The clock code with WiFi time acquisition assumes ESP8266 / ESP32 type modules.
- You can use any micro controller with 12 or more GPIO ports to control three stepper motors.
- I used M5stamp-C3 for this clock.
Connection example of M5stamp-C3
- Connect four pins of first (1minute) motor to G4, G5, G6, G7.
- Connect four pins of second (10minute) motor to G0, G1, G8, G10.
- Connect four pins of third (hour) motor to G9, G18, G19, G21.
- Connect 5V and GND to the microcontroller. (M5stamp-C3 has three 5V and GND pairs)
STEP 8: Edit Source Code and Flash
Test
- Two types of test codes are provided : for a single unit, or three units driven simultaneously.
- Register the order of the cards into the source code.
- If you use microcontrollers other than M5stamp, edit the ports assignment.
- Flash the code using Arduino IDE.
- Confirm the correctness of card order by using single-unit-test.ino before using clock.ino because the clock code is too slow to check all cards.
Use it as a clock
- Copy the card order definition from the test code to clock.ino.
- Flash clock.ino to the microcontroller with Arduino IDE.
SSID / password configuration using SmartConfig
You can set SSID and password of your WiFi station using smartphone app.This function is named SmartConfig. The apps for setting are at
- Android : https://play.google.com/store/apps/details?id=com.khoazero123.iot_esptouch_demo
- iOS : https://apps.apple.com/jp/app/espressif-esptouch/id1071176700
Please not that your smartphone should be connected to 2.4GHz WiFi.
LED colors on M5stamp (clock.ino)
- green : initializing the rotors (counter clockwise rotation)
- blue : connecting WiFi previously stored in non-volatile memory
- red : smartConfig mode. If WiFi connection fails, it enters to this mode. Please set SSID and password using smartConfig app.
- LED is turned off : clock operation mode
68 Comments
popi1854 2 months ago
My casino-clock has been running nicely for two years now. Everyone loves it! It has developed a slight lean to the left, due to the weight of the drum and cards. Its not a problem as it still runs well. However, if the sag continues I may have to rebuild the base a bit wider so the vertical posts can be made thicker for stability. Did I mention that everyone LOVES my casino'clock!
ioanargatu8 4 months ago
shiura 3 months ago
https://en.wikipedia.org/wiki/Bicycle_Playing_Cards#:~:text=They%20are%20available%20with%20standard,designed%20for%20the%20visually%20impaired.
ioanargatu8 3 months ago
I will see. Thanks again!
IvanI43 1 year ago
GlueGun_RaR 1 year ago
LeandroB53 1 year ago
Obrigado
shiura 1 year ago
LeandroB53 1 year ago
shiura 1 year ago
khuong 1 year ago
Question: triple-test works great... using the clock.ino.. hour motor staggers.. after homing.. and turns/stutters.. (triple-test does not)
shiura 1 year ago
khuong 1 year ago
I'm having drifting in my 10 mins now though .. works fine for a few loops, then starts to show 1 position earlier, then 2.. then 3.. after like 10-15 loops
khuong 1 year ago
Had to make the following changes for the NODEMCU v1.. (and obvious pin changes)
```
#include <Adafruit_NeoPixel.h>
#include <ESP8266WiFi.h>
#include <NTPClient.h>
#include <WiFiUdp.h>
#include "time.h"
...
bool getLocalTime(struct tm * info)
{
uint32_t start = millis();
time_t now;
while ((millis() - start) <= 5000) {
time(&now);
localtime_r(&now, info);
if (info->tm_year > (2016 - 1900)) {
return true;
}
delay(10);
}
return false;
}
...
//Serial.println(&timeinfo, "%A, %Y-%m-%d %H:%M:%S");
khuong 1 year ago
(It lines up 100% properly at the starts, and slowly drifts..) is there a variable ot setting for this?
shiura 1 year ago
int dt = 30;
The acceleration of the motor becomes slower.
khuong 1 year ago
khuong 1 year ago
Been running for about 14 hours with no interrupts. -- made it flashable via webpage now so i dont have to keep plugging it into the pc since i'm running nodemcu -- with ability to re-"home" it as well. :)
hausofpayne17 2 years ago
Just an issue. When the sketch starts to by reversing to the home position, the cards jam against the base and then when it goes forward any cards sweeping forward in the base also jam and throw the calibration off. The distance from the base to the throat of the slot in the card holder is 80mm but the height of the cards is 89mm (French deck).
How can I fix this? Should I cut the vertical side of the base and extend it about 7mm so the cards are vertical and not touching the base as they swing through the lowest position? Or is there another suggestion?
I'm going to put it at my high school but the employer doesn't let me put ESP32s on the wifi. So instead, I'm using an Arduino Mega with a real time clock module and I'll use a bluetooth transceiver to update the time with my phone
This is going to be great when it's done! Thanks again for a great project!
Gord
shiura 2 years ago
It is easy for me to extend the height of the frame. How long do you need to be extended? Or I think it could be solved by adding a triangle-shaped guide, as shown in the attached picture (red part). Could you test the idea by adding such guide by cardboard or something? Then I will release either (or both) of extended frame and/or the triangle guide.