Software apps and online services
Hand tools and fabrication machines
I was looking for a new project and I came across a really great write-up for an alphanumeric split flap display by Scott Bezek. I was intrigued to see how it worked, so I ordered all of the parts and got to building. In a matter of days, I had my own split flap module and I was feeling pretty proud of myself, but I wondered what else you could use a split flap display for...
After 6 months and a lot of hard work, I'm proud to present version 1.0 of the Automated Tarot Machine.
I figure now that the machine is in a place where it's fully functional, the best thing to do is to share what I've learned with anyone who might be interested in making one of these for themselves.
Some of the files for this project (mostly the card artwork) are VERY large, so I've included a link to a google drive folder that has all of the files you could possibly need to complete this project.1: Laser Cutting / Assembling the Housing
The housing and flap wheel were first on the list of things that needed to be made for this project. In order to accomplish this, I used a piece of 16" x 24" x.25" acrylic and a laser cutter.
The housing is held together with 1 inch 8-32 bolts and nuts which makes for smooth assembly/disassembly.
The only item that requires glue is the flap wheel. I used an acrylic adhesive which is strong, and also bonds very quickly.
If you'd like to see a more detailed walkthrough of the assembly, I made a video that you can find here.2: 3D Printing the Base
The next thing that needed to be made was the base. This holds the electronics and serves as a stand for the split flap display.
I've included the.STL files for the baseplate and cover below. Admittedly, there are a lot of problems with the current design. It gets the job done, but it's at the top of my list of things to improve when I revisit this project.
The flaps for the display start their life as 12" x 24" x.03" sheets of acrylic which need to be laser cut into the correct flap shape. A tarot deck has 78 cards + 1 blank to display the back of a card when the unit is at it's home position. I decided to round this out to 80 with the addition of one more "top of the deck" card.
After laser cutting all of the flaps, it was time to move on to the card art. I have access to a large format printer which has the ability to both print and cut sticker material. I made files for each card which include a cut-path that matches the shape of the laser-cut acrylic flaps. I then applied the stickers to each flap in the roll.
Since each flap contains half of two different cards, the order in which the stickers are applied is VERY important. The top part of one card also contains the bottom half of the next card in the stack. (You can find the appropriate order in the Card Guide file below)
For example: If the flap has the top of the Ace of Swords on one side it will have the bottom of the Two of Swords on other side.
Once all of the stickers were applied and I had a fat stack of flaps, it was time to put them in the flap wheel. This would have to wait however, because the location of each card in the flap wheel depends on where "home" or the top of the deck should be located. To figure out how to set the home position, we'll need to move on to the next section...4: How does it do that?! A Brief Overview
Split Flap Go Home:
The first and most important thing the split flap display needs to do is decipher where home (or in our case the top of the deck) is located. This orients the stepper motor and ensures that we know exactly where each card is located in relation to the home position so that our printouts will be accurate.
For this task I use the Hall effect sensor and a magnet that's embedded in the flap wheel.
Hall effect sensors are triggered when they sense a magnetic field, so finding home is simply a matter of rotating the flap wheel until the hall effect sensor is tripped by the magnet. The function that accomplishes this is aptly named FindHome() and it runs each time the machine is turned in addition to after every "draw" from the deck.
Because the machine goes home after each reading it's pretty stable and accurate (barring any major skips from the motor).
Stepper motors 101
The stepper motor that I'm using moves 1.8° per step, so 200 steps per full rotation (360° / 1.8 = 200). If you've never used stepper motors before, one really useful feature they have is the ability to be triggered in a "microstepping" mode which increases the number of steps it takes for the shaft to complete a full rotation. (this is what MS1, MS2 refers to on the easydriver)
The options for microstepping with the motor I'm using are as follows:
1/1 = 200 steps
1/2 = 400 steps
1/4 = 800 steps
1/8 = 1600 steps
** Another great stepper motor explanation video
How does it know what card is pulled?
I found that the unit functioned best when I was in 1/8 microstepping mode, so that means every time the motor takes 20 steps we will move forward one card. (1600 steps in a full rotation / 80 cards in the flap wheel = 20 steps per card).
Based on the knowledge that there should be a card every 20 steps, I assigned each card a number value which represents how many steps it takes to get from the home position to the desired card.
Pick a Card, Any Card
The PickACard() function is where the Arduino will determine which card is going to be pulled by choosing a number between 40 - 1580. (we exclude 0 - 39 because these are the home cards)
Obviously we want the card that's drawn to be as random as possible, but when I was doing the initial testing, I found that the Arduino's built in random function really wasn't doing the job.
After a little googling I found this Entropy library which uses jitter in the Arduino clock to generate it's random seed and it's been working perfectly.
Additionally, I wanted to ensure that whatever random number is pulled is a multiple of 20. The main reason for this is that I don't want there to be any variation in how far the stepper motor runs for each card. This increases the accuracy of the unit as well as making it easier for me to identify each card by a single numeric value as opposed to a range.5: Building a Better Oracle
In a traditional tarot card reading, the direction that the cards is facing once it’s been pulled plays a role in how the card is interpreted. Generally, if the card is pulled upright it’s interpreted positively. If the card is pulled in reverse, the negative aspects of the card are highlighted.
As with everything in the realm of the esoteric and mystical, these are not hard and fast rules, but for my purposes those guidelines work just fine.
To include this element in my tarot reader, I decided that the best option would be to create multiple interpretation printouts that the Arduino could choose from once the card had been selected. Each card has 3 possible readings positive, open, and negative.
To show how the Arduino picks which interpretation to print, the example below uses the card The Fool which corresponds to number 40 in the guide.
Once the card is selected, I utilized the entropy library again to select a random number between 0 - 30. Each reading type is then assigned a range of numbers:
Postive: 0 - 9
Open: 10 - 19
Negative: 20 - 30
Depending on what number is selected, the Arduino then streams the bitmap image data for the corresponding interpretation to the thermal printer and the reading is printed out.
The bitmap image data is in a folder on the google drive called Tarot-Interpretations-MASTER; the contents of this folder need to be copied to an SD card and placed in the SD card module that's hooked up to pins 50-53.
I'm working on an in-depth video to explain this process more thoroughly so that if you wanted to modify the readings or card art you could do so. I'll edit this tutorial and post it here when it's finished.
The circuit diagram for this project should be pretty self explanatory, but it is by no means simple or without its pitfalls. I'm 98.154% sure the diagram is accurate, but do yourself a favor and set up the entire circuit with a breadboard first.
Below are a few things that are noteworthy to keep in mind when assembling the electronic elements and familiarizing yourself with the code.
There are two optional electronics/code elements in this build that I did not include in the circuit diagram; an external push button and LEDs.
The button is only really necessary if you want to operate the machine when it's not hooked up to the computer. You can hook it up to any pin of your choosing, but in my code it's connected to pin 11. It is coded to produce a "Card of the day" reading.
The LEDs serve an aesthetic function, but they also deepen the machine's connection to traditional tarot practices. Each tarot card in the minor arcana relates to an element (i.e. wands are fire, pentacles are earth) so I coded the LEDs to display whatever elemental color the card is associated with. The LEDs are wired to pin 7.
Adafruit has a lot of great documentation on their printer, and one of the things I would suggest is to get your printer set up to do "Hardware handshaking." This allows the printer to receive data faster. There's a great tutorial on how to do this on the Adafruit website.
Printing Text Reversed:
Another thing you're going to have to do is make sure that the printer is capable of printing text upside down. To do this, you'll have to go into the Adafruit_Thermal.cpp file and change some code. A guide to accomplish this can be found here.7: Putting in the flaps
Now that we've got that out of the way, it's time to revisit your fat stack of flaps. Turn on the machine and it will auto-home itself which will let you know where the top of your deck should be located.
It's worth noting here that because we have an extra "top of the deck" card, we want to be sure that the home card is the FIRST of the two blank cards. The order of the first three cards should be as follows:
Home: blank card
20 steps: blank card
40 steps: The Fool
Putting in the flaps is EASILY the most stressful part of the build. The nubs that hold the flaps in the wheel are pretty fragile, and if you're not careful you will break them.
Once the flaps are in and the code is loaded, the machine is ready to start spitting out mystical advice!
I hope you found this project as interesting and enjoyable as I did. I'm working on a video that I will post here which shows the machine going through some of its basic functions.
If you have any questions feel free to reach out, and happy building!