The Memento Game

1,927

27

10

Introduction: The Memento Game

You probably know those games where the player memorizes a sequence of colors and sounds and has to play them back, right?

The Memento Game adds prizes for extra fun! Once a player hits a predetermined score, they win the game and the box opens, revealing the prize.

I had a few requirements: the box needed to be sturdy, capable of being manhandled by a small child; the compartment had to be big enough to hold small gifts; and I wanted some way of changing the difficulty level, without allowing the players to do it themselves.

Here's a video of the whole process, wherein I learn how to use Tinkercad, design the box and circuit, and then proceed to the actual build. The video skips a couple of parts and is mostly sped up 150x but don't worry, because all the actual instructions are in the next steps. Also, for improved readability, all the files, plans, code, etc. are posted in the last step.

Step 1: Designing the Box

It was surprisingly easy to design the box using Tinkercad. I went through a few of the official tutorials to get the hang of it, then youtube saw me through the rest. Here's the box so you can tinker with it (drag to view it in 3D):

If you open this in Tinkercad, you can click on each part and then press the arrow keys to move it around (Ctrl+up if you want to go up). Using those keys you can get an "exploded view". The wedge shape inside the box represents the solenoid lock, just in case you're wondering.

If there's one element of design of which I'm proud, it's the gravity powered door. By adding that perpendicular wood board next to the door hinge (inside the box, you have to open it to see it), the door naturally wants to stay open and the only thing keeping it closed is the solenoid lock, which, when the player wins, opens for a second.

Step 2: Designing the Arduino Circuit

So, turns out Tinkercad has Circuits which is an easy to use electronics simulator. By that I mean that it actually simulates the behavior of electronic components including an actual Arduino. When I ran my simulation it even threw out warnings that the LEDs were getting too much current. Sorry Circuits, but I do know better. The LEDs are not on all the time, so 220 Ω resistors are fine. Thanks for the warning, though.

The whole thing is very intuitive, I only did a couple of tutorials before getting the hang of Circuits, so I immediately starting designing the whole thing. Here it is:

https://www.tinkercad.com/things/1mPEFTjZVTQ-the-m...

You can see the 4 colored lights, each with it's own button, the speaker, and a white lamp.

The while lamp represents the solenoid lock which opens the box, and the speaker actually had to be amplified (you can see me googling simple amplifier circuits in the video, if you don't blink).

Step 3: Coding the Game

Circuits runs a simulation because we code some instructions for the Arduino. How did I do that? I searched for other Arduino memory games, there were quite a few to choose from, so I ended up doing exactly that. I chose some bits of code from here, some from there, added my own secret sauce, and mashed everything in a coherent enough way that it works. I should have documented it better, sorry I didn't. Feel free to hack my code to pieces if there's anything there that serves you. Just click on the Code button in Circuits to see it.

I used the Arduino IDE to actually send the code to my Arduino for a real live prototype, before moving on to the next step.

Step 4: Barebones Arduino

As I explain in the video, I chose a barebones Arduino setup, so I could fit the extra circuits and components in the same board. You don't have to do this, you can use any Arduino, but in case you want to replicate my build, I used Nick Gammon's design.

The extra pieces to fit were:

An isolated relay circuit to drive the 9v solenoid lock that opens the door.

A simple amplifier circuit for the speaker.

I've attached a Fritzing drawing that shows what connects where. I purposely left a space between the ATmega328P-PU pins and the rest of the components, but they are in fact connected.

The ATmega328P-PU chip is covered by a cool label to help identify which pins correspond to the Arduino pins. There's a file for that at the end too.

There is a bypass reed switch in that drawing that I did not implement in the actual game (didn't arrive in time), but I still think it's a good idea. Let me break it down:

Suppose the box is locked and you want to open it, but you either can't solve the current difficulty setting, or somehow there is some unexpected error that does not send the open door signal to the lock. If you actuate the reed switch (by passing a strong magnet nearby), the 9 V battery connects to the lock directly, bypassing the whole circuit. Only you would know this secret "unlock code" and the correct placement of the reed switch.

As it stands, my box looks closed, even on close inspection, but the bottom is just attached by non-glued dowels that happen to fit really tight. If I pull hard enough, it starts to open.

Step 5: Build Tips and Tricks

If I were to do it again, I would skip making my own wood box, and would just buy something and adapt that. I've seen some sturdy looking plywood boxes selling really cheap, so I would just have to cut one wall for the door and maybe screw the top on. If you're any good at woodworking, go for it. For me it was just way too much trouble. Still, the end result was nice.

The lock was placed by a process of trial and error, I bent that piece of metal you see in the photo with pliers, and adjusted the tolerances taking into account the unintended sideways movement that the metal hinge makes.

I had to carve out a couple of millimeters where the hinge screws to the door and box ceiling.

I planed and sanded the wood boards that were butt joined with dowels. Then I applied varnish to the outside of the box and the inside of the compartment, where the gift is placed. I did not bother with the electronics housing.

I used cardboard to make everything fit snuggly. The box has been dropped and kept on working.

I used some Dupont connectors to make assembling and troubleshooting easier. Every major part of the circuit snaps in and out when needed.

If space is a concern, don't use six 1.5 V batteries to replace one 9 V battery like I did. At the time I was assembling it I did not have the proper connector and didn't feel like changing it afterwards. On the plus side, the lock will have power for years.

I glued the more isolated female Dupont connectors to other, more robust, vertical walls on the main board. Like the relay, or other connectors that had more pins soldered to the board.

As commented in the source code, to change levels you connect ground to a combination of analog pins. There's a file for that too, at the end of the instructable.

Step 6: The Real Game Goals: Memory Skills and Perseverance

This is a game that my daughter keeps on playing. She's 3 and currently she's getting about 50% success on level 5. Sometimes I put a little toy in there (I have several Lego people which she hasn't seen yet), or a cookie, and she loves it. I've seen her playing alone, and sometimes she solves the game just so she can put a gift in there (one of her toys) for me. Of course I have to solve the game to get it. I've been changing levels when she reaches about 90% success to keep it difficult enough to be motivating.

This particular level (5) has been a real challenge for her, but I want her to know the value of perseverance. Also, that it's fine not to get things right on the first try. You can get better with time and practice.

Step 7: Source Code, Plans, Links and Files, Come and Get Them, Use Them at Will!

Links:

The speed build video: https://youtu.be/2i8izHXbzJY

The Tinkercad Circuits design with source code: https://www.tinkercad.com/things/1mPEFTjZVTQ-the-memento-game-arduino-circuit

The Tinkercad 3D box design: https://www.tinkercad.com/things/jY0WXxDMiUT-the-memento-game

Attached files:

The Fritzing layout

A "How to change level" text file

A pdf file which has lots of labels to paste on top of your ATmega328P-PU chips.


First Time Author Contest

Runner Up in the
First Time Author Contest

Be the First to Share

    Recommendations

    • First Time Author Contest

      First Time Author Contest
    • Halloween Contest

      Halloween Contest
    • 3D Printed Student Design Challenge

      3D Printed Student Design Challenge

    10 Comments

    0
    victorqedu
    victorqedu

    8 months ago on Step 7

    One of the coolest games I've seen.

    0
    ycodryn
    ycodryn

    11 months ago

    Hey man this is a very cool project. I want to make this for my kid and I`m so new at this but I have some hobby experience with soldering. I see that the isolated relay circuit and some transistors are missing from scheme for arduino uno vs barebone one. The push button leds are with 2 pins with default state on? One more thing, for relay I have to use another power source right? Thank you.

    0
    artifexcreator
    artifexcreator

    Reply 11 months ago

    1 - The arduino schematic (on Tinkercad Circuits) was an early prototype, I only had a bulb light up on WIN. When I moved to Fritzing, made a series of "upgrades":
    1.1 - Barebones instead of full arduino
    1.2 - Isolated relay circuit to drive a solenoid lock instead of WIN bulb.
    1.3 - Added 9V power to said isolated relay circuit. You can use a small 9V battery, instead of my giant 6x1.5V setup.
    1.4 - There are some comments in the code that help make sense of the whole thing.

    2 - Each push button LED uses only 1 pin. That pin deals out the voltage that lights it up. Also, in "attract mode", since I used PWM pins, they give out varying/fading voltage.
    2.1 - The LED pins are not default state on. The program actually boots up with the "attract mode" on until someone presses a button, so they fade in and out.
    2.2 - You didn't ask about it, but the push buttons pins are set as INPUT_PULLUP which uses the builtin 20k resistors that the microcontroller offers. It helps with debouncing.

    3 - Do it, it's worth it. My kid still plays with this all the time. Level 5 was definitely the one that took the most time, but she's now getting good enough that I might change it to 6.

    0
    ycodryn
    ycodryn

    Reply 11 months ago

    Thank you for updates. I'm not so lucky to find in my local store items needed for this project and I have to order from extern....long wait time but I found a 5v solenoid that can be powered directly by arduino. For a kid's box I'm thinking that you don't need a huge 12v solenoid. Thank you again for this great idea.

    0
    artifexcreator
    artifexcreator

    Reply 11 months ago

    Great, go for it. It's important to never connect it directly to the arduino, because of the flyback power spikes (powerful magnetic magic when the solenoid goes back to the initial state).
    Here's a simple schematic I could find, in case you need it.
    https://core-electronics.com.au/tutorials/solenoid...

    0
    ycodryn
    ycodryn

    Reply 11 months ago

    Sure thing, thanks.

    0
    Penolopy Bulnick
    Penolopy Bulnick

    1 year ago

    This project is great! I loved watching your video and seeing how you learned how to use Tinkercad and then made this project :)

    0
    artifexcreator
    artifexcreator

    Reply 1 year ago

    Thanks, I'm glad you liked it.
    Learning has always been a big part of my projects, mainly because I like to learn, but also mainly because I actually don't know any of this stuff.
    Now that I have a little one to make projects with/for, I'm planning on making more projects like this. Also, I think the videos themselves will be a nice memento from her dad when she's older, and a lesson on learning and perseverance.