For the most part, the serial communication labs from both last week and this week worked for me without too much of a hitch, but those involved connecting the Arduino to p5.js. For the midterm project, I was assigned to work with Code Master P, Phil Guo and he wanted to do a serial communication without using p5. Since I’m always open to a challenge that was fine with me, but I knew this could lead to something a bit too ambitious.
I had many ideas, but our professor, Benedetta’s words stuck out in my mind. “Don’t think of the technology, think of the user experience.” And that’s when the insane fortune teller came to mind. Phil liked the idea because he had a text to speech circuit board he used for another class that would work perfectly. The Arduino could serially communicate with the board, fulfilling the assigned requirements. And the functionality of the project came to us quite easily.
You would need to turn it on and press start. Then the fortune teller would prompt you to pick a category, health, wealth or love, and then press the fortune button. There would be an array of fortune options in each section. One would play back once you pressed the final button. Phil left the writing up to me, but he was worried about the build. We had agreed on a basic interface – more specific designs to come – but we knew what parts we needed.
First we set off to Tinkersphere and then we went to Metropolitan Wood and Hardware where I spent a long time negotiating for a nice piece of poplar at a decent price for the housing (turns out their horrendous customer service review on Yelp is completely founded). Phil had already bought some options for the cover and a few of the inner parts from other projects so this trip rounded out most of what we would need.
And then came the writing. The only way the user experience would be fun would be based on how amusing the fortunes were. I knew this would be time consuming so I started this process early, before we built anything.
Most fortune tellers in their attempts to seem real give very vague fortunes. I decided to go in completely the opposite direction. The fortunes would need to be as specific and outrageous as possible. This lead to many hours of conjuring up fortunes. I finally settled on ten options for each category, five good and five bad.
HEALTH:
- “You take up gardening and grow a fabulous vegetable patch in your backyard. Unbeknownst to you, the stream running through it is fed from the fountain of youth. You live to the ripe, old age of 145, but never appear older than 50.”
- “Despite spending most of your years consuming only gin and chocolate, your incredibly adept immune system keeps you in good health to the age of 105 when you die peacefully in your sleep after a lovely gin buzz from the evening before.”
- “You are hit by a train and have your legs and arms amputated. This is the worst experience of your life until you are picked to be the first android and are given new body parts with rebuilt limbs that are stronger, faster and better than any natural limbs. You become the leading crime fighter in all the world.”
- “You check off organ donor on your New York license thinking your organs could be put to good use. Upon your death, in addition to saving numerous others, you yourself are saved. A brilliant doctor transplants your brain into a robotic body and you become the first human to reach immortality.”
- “It turns out that all of those awful romantic vampire novels are true. The most spectacular looking human you have ever set eyes on falls passionately in love with you and grants you immortality with a single nibble. You spend the rest of your life making love to this perfect specimen and drinking fake blood which remarkably tastes like chocolate egg creams.
- “You will die a slow, painful death.”
- “You choke to death on your favorite French pastry on your 52nd birthday, but you die blissfully. It is deamed, ‘death by custard’.”
- “You find an old lamp at a yard sale. When you rub it, a genie pops out, only not the good kind. He switches places with you, stealing your life and imprisons you in the lamp for all eternity.”
- “On a trip to Mexico, you encounter the fabled Chupacabra on a secluded beach after a night of Margaritas. You put up a good fight, but thanks to the terrible hangover, the Chupacabra bests you.”
- “After watching a movie marathon of Trading Places and Coming to America because John Landis and Eddie Murphy made a perfect filmmaking team, you fall asleep blissfully on the couch. Instead of a peaceful death, suddenly at 2AM your body implodes. You become one of the only documented cases of spontaneous combustion.” (This one hit the cutting room floor when we needed each category to be exactly ten. I feared many foreign students would miss the movie references.)
- “You invent an incredibly strong, incredibly cheap method to make glass windows. To demonstrate your ingenious invention, you have the window installed in a conference room on the 15th floor. To demonstrate your unbreakable glass to investors, you throw yourself against it. Unfortunately, it turns out to in fact be breakable and you fall 15 stories to your death.”
WEALTH:
- “You grab a rock while snorkeling in Aruba. It turns out to be Spanish bullion. A little more searching uncovers an entire sunken pirate ship with overflowing chests of solid gold coins. You become an instant billionaire.”
- “A relative you never knew in a tiny country called Partisia dies. He was the sole ruler with no other living family. You inherit the throne, his castle and millions upon millions of dollars.”
- “You see a leprechaun on the F train. He leads you to a pot of gold in an abandoned train tunnel. You become a multi-millionaire and can finally afford to live well in New York.”
- “On a vacation to Scotland, you spot the Lochness monster and capture the best picture of ‘Nessie’ ever caught on camera. The photo sells for over $100,000 to The Mirror. You invest in your own startup with the money and become a billionaire.”
- “You invent an AI robot dog. The animal is like a real dog in every way except that it never needs to be walked or fed. And it never dies. People on the street cannot tell the AI dogs from the real ones. They became a huge craze around the world. You grow extraordinarily rich and live happily ever after surrounded by your loving, adorable canine friends.”
- “You come up with an ingenious idea and partner up with a fellow student at ITP. Your friend does very little work on it, but you like him so you keep him on board. Google offers to buy it for fifty million dollars, however you learn that your friend patented the project under his name only. You get none of the money, grow bitter and uninspired and die alone under the Brooklyn Bridge after living in poverty for the next twenty years.”
- “You create a brilliant technology for people in the third world to grow food despite global warming. You refuse to sell the patent and insist on it only being used for the good of the human race. Millions of people’s lives are saved because of you, but financially you never rise above middle class.”
- “You graduate from ITP with no particular specialty. Instead of learning a skill that might be useful, you are a hobbiest in numerous technologies. There is no gainful employment out there for someone with your skill set. Instead of prospering you drown in school and credit card debt. You never recover the money spent on your degree.”
- “The stock market crashes and burns, destroying the world’s economy to the point that it’s disbanded. The entire world goes back to the gold standard. Despite the economic turmoil, your tech patent makes you millions upon millions of dollars. Technology has moved on, but you have plenty to retire on. Unfortunately, your house is broken into and all of your solid gold bricks are stolen. You die in poverty.”
- “Robot fighting expands from Battle Bots to a huge phenomenon that rivals the popularity of Nascar. You start by building the robots for the fights so betting comes naturally to you. With your insider knowledge you easily win at first, but over time, technology moves on. You no longer work in the industry, but you can’t stop yourself from gambling on it. You are never able to pay down your debts.”
LOVE:
- “You are in the first wave of immigrants sent to the new colony on Mars. You fear you will never find the perfect significant other, but you are wrong. Your romantic fantasy turns out to be one of the ten other colonists. When the earth is destroyed before a second wave of immigrants has a chance to reach Mars, you two are required to begin repopulating humanity.”
- “You know your best friend growing up. You know the one. Amazing in every way, but not quite cute enough? Maybe a little awkward? Not quite your dream catch? Yup, that one. After many, many years apart you reunite and everything has changed. If you didn’t recognize that amazing personality, you would swear you were meeting a super model, but it isn’t. It is your “B” “F” “F”! You marry and live happily ever after.”
- “You win a fabulous cruise to the Greek Islands. The ship is wrecked during a violent storm, but you are saved by a mermaid. She takes you back to a secret Mer-colony of Mermaids and Merman. It is paradise on earth and you meet the most spectacular almost human on the plant. You two fall in love and live happily ever after in your secret hideaway.”
- “You finally follow your obsession with narwhals to the coast of Norway. While you are studying the bizarre and fascinating creatures, you cross paths with an incredibly attractive Norwegian who shares your passion. You fall in love and spend the rest of your lives documenting the unicorns of the sea.
- “After many bad breakups, a close friend buys you the latest craze in the tech world, a fully realized human sex toy. At first you are mortified, but over time it turns out to be more fun than you ever imagined. Late one night your fairy godmother sprinkles stardust on your “toy” and it becomes a real human. You live happily ever after, but can never decide on the story of how you met.”
- “When cloning becomes legal, incest laws are passed to prevent you from marrying clones of your siblings. However, you do not realize your parents had a child who died before you were born. A clone exists unbeknownst to you and when the child grows up you fall passionately in love. On your way to your happy ending, the government checks your DNA in order to sign the marriage certificate. You turn out to be cloned siblings and are forced to live the rest of your lives always pining for your impossible love.”
- “You meet the most perfect human being for you, smart, attractive, hilarious and everything you’ve ever dreamed of, but the person is already dating someone. Instead of speaking up, you say nothing and watch your perfect other half marry the wrong significant other. You eventually meet someone and marry, but you will never feel the true love you felt for the one that got away. And it is all your fault.”
- “You always believed in “the one”. And you were right. Your perfect significant other does in fact exist. Unfortunately before you two meet, an incident with a bus delivers an untimely death to your love. You spend your entire life lonely and sad because you refuse to settle for second best.”
- “You find your perfect other half online, but your fabulous potential love lives clear across the country. Despite the distance, you two decide that you must meet – it was meant to be. So you fly to Milwaukee to see this perfect person only to find out you just landed yourself in a serial killer’s lair. After torturing and dismembering you, you realize maybe you believed just a bit too much in true love.”
- “After dating many, many people, you finally realize your perfect person is the star of a Japanese Anime. You try to convince yourself otherwise, but time and time again you return to this perfect character. You are forced to realize you will forever be in love with a person who you can only interact with on the screen.”
Our hope was that if the stories were entertaining enough, everyone would want to try it out. My goal was 60 stories, but coming up with the first 30 outrageous ones was quite time consuming and we had a big build ahead of us.
First we constructed the circuit on a breadboard. We used test phrases to make it work. The coding was pretty simple.
The only problem was the amplifier. Without it, the speaker was too quiet to hear so I borrowed a speaker from the ER and it turned out everything else was running soothly. I liked the sound quality of the real speakers, but we wanted it to be an all-in-one unit so we ordered an amplifier off of Amazon.
Before moving forward, I insisted we put the actual fortunes into the code. We had thought we were all clear code wise, but we were wrong… The stories were much longer than the test words and the text to speech chip could not hold that much data. This sent Phil into a frenzy of coding before he figured out to use the memory portion of the Arduino to hold the extra information. I would have never solved this on my own so I was feeling pretty fortunate to have him as a partner. Below is the final coding that saved the day:
void readInputs() {
int potValue = analogRead(potPin);
currentCategory = constrain(map(potValue, 0, 1023, 0, 3), 0, 2);
int startButtonReading = 1 – digitalRead(startButtonPin);
int fortuneButtonReading = 1 – digitalRead(fortuneButtonPin);
if (startButtonReading != startButtonLastState) {
startButtonLastDebounceTime = millis();
}
if (millis() – startButtonLastDebounceTime > debounceDelay) {
if (startButtonReading != startButtonState) {
startButtonState = startButtonReading;
if (startButtonState) {
startButtonPressed();
}
}
}
if (fortuneButtonReading != fortuneButtonLastState) {
fortuneButtonLastDebounceTime = millis();
}
if (millis() – fortuneButtonLastDebounceTime > debounceDelay) {
if (fortuneButtonReading != fortuneButtonState) {
fortuneButtonState = fortuneButtonReading;
if (fortuneButtonState) {
fortuneButtonPressed();
}
}
}
startButtonLastState = startButtonReading;
fortuneButtonLastState = fortuneButtonReading;
}
void displayLEDIndicators() {
for (int i = 0; i < 3; i++) {
if (currentCategory == i) {
digitalWrite(ledPins[i], HIGH);
} else {
digitalWrite(ledPins[i], LOW);
}
}
}
void fortuneButtonPressed() {
if (emicReady) {
if (state == S_START_PRESSED) {
speakFortune();
state = S_FORTUNE_PRESSED;
} else if (state == S_FORTUNE_PRESSED) {
emicSerial.print(“SYou have already heard your fortune! Please hit start again.\n”);
} else if (state == S_POWER_ON) {
emicSerial.print(“SPlease hit the start button.\n”);
}
emicReady = false;
} else {
fortuneButtonCached = true;
}
}
void startButtonPressed() {
if (emicReady) {
emicSerial.print(“SPlease select a category and hit the fortune button.\n”);
emicReady = false;
state = S_START_PRESSED;
} else {
startButtonCached = true;
}
}
void speakFortune() {
// subscripting with currentCategory doesn’t work, so we fix it with this shit
switch (currentCategory) {
case 0: // health
strcpy_P(buffer, (char *)pgm_read_word(&(scripts[0][random(scriptsInEachCategory)])));
case 1: // wealth
strcpy_P(buffer, (char *)pgm_read_word(&(scripts[1][random(scriptsInEachCategory)])));
case 2: // love
strcpy_P(buffer, (char *)pgm_read_word(&(scripts[2][random(scriptsInEachCategory)])));
}
emicSerial.print(“S”);
emicSerial.println(buffer);
}
That was no small feat so Phil definitely deserves a hand for that one. And then we moved onto designing and prototyping the interface. Much time was spent perfecting the interface design we settled on below. We wanted it to be beautiful, intuitive and require no directions to use.
We liked the illustrator file, but we wanted to make sure it would look good through the laser printer so we did a test run with cardboard. It looked good and fit perfectly with the wooden housing Phil had carved out while I had been writing.
We felt pretty good about ourselves. All of the components fit neatly into our encasement. We even tested cutting the LED holes in the actual material to make sure it fit just so. It did. We were all ready to finish the next day! All was looking good.
How hard could it be to make the final circuit and put it in the box? Sadly much, much harder than we ever anticipated. I do not want to think about how many problems we had to solve and how many hours it took to make it from here to the end!
So first it took an immense amount of wire stripping and soldering to finish the final circuit. We used the blueprint below because it was hard to remember which pin was which.
And the soldering process itself was endless.
After soldering, we had problems where bulbs weren’t working so we had to check each connection with the multi meter. We fixed all of the connections and then laser cut the cover/interaction face. We used a sharpie with a dry erase to etch the words in dark enough to read them.
All the parts were finished, but when we tried to put the box together, the hard wires were our enemy. We twisted them and squeezed them into the box, but it destroyed our connections – nothing would stay in place.
So we switched to softer wires I had found a month back in the recycling bin. We soldered those and it was better, but they were still quite long and not soft enough to maintain good connections. That led us to cut them shorter and solder them once more.
It helped, but a few connections were still coming undone. They were connected to a plastic piece so we couldn’t solder it. The glue gun came to the rescue.
And then the box could finally close! We used a drill press to put in the final screws, but as I had feared for days, you could not hear the speaker once you closed it. I knew there needed to be more holes to let the sound out, but we didn’t want to destroy our beautiful interface. We started by laser cutting tiny little holes, but that didn’t work so instead we found four plastic separators and put the cover back on with a space around the sides to let the sound out.
And we finally had a working fortune teller!
Fantasy Fortune Teller – NYU ITP Project from Jamie Ruddy on Vimeo.