Build an interactive Pac-Man bedside clock, with a touch screen, and animated Pac-Man figures.

This cool project is surprisingly simple to make and is a great gift for those nostalgic Pac-Man addicts.

As well as being able to interact with the Pac-Man game, you can record a sound of your choice for the alarm.

Step 1: Gather the Materials

The Retro Pac-Man Clock is made from 5 key modules along with a case that is laser cut from MDF wood.

  1. Arduino Board - Arduino Mega 2560 R3
  2. Real Time Clock module - DS3231 RTC
  3. Touch Screen - 3.2" TFT LCD Display + Touch Screen for Arduino's Mega 2560
  4. Touch Screen Arduino Shield - 3.2 inch Mega Touch LCD Expansion Board Shield
  5. Voice Recorder Module - ISD1820 Voice Recorder

Enclosed in the instructable is the necessary Arduino code, links to libraries and any special graphics files you will need to build the project.

In the list above there are links to suppliers of parts that are similar to the items used in the prototype. You are free to source the parts from wherever you see fit to ensure costs are minimized.

In addition to these modules, you will require the following components

  1. Panel Pins x 4 for fastening front case to body
  2. Two Part Epoxy Resin for gluing case together
  3. Sandpaper sheets - 4 sheets each of fine and medium grade for sanding wood
  4. Electric Drill with 3mm diameter wood drill bit.
  5. USB Cable 1m length
  6. USB charger (used for the power supply for the clock)
  7. 150mm x 30mm x 3mm MDF or Styrene to build a bracket to hold circuit in place within case
  8. Hot glue gun

Step 2: Build the Case

The case is made from 9mm and 3mm MDF wood which has been laser cut to shape. Below are files with the dimensions and number of parts required that you can send to a local laser cutter company to do this for you.

1. Front Panel

The front panel is sandwiched between two side rings and glued into place with 5-minute two-part epoxy glue. Be careful not to overdo the glue as it will show if it oozes out the sides.

In addition to this, a small piece of material is glued over the front cover grill to provide a nice effect and also allow the alarm speaker sound to carry out the front of the clock.

Four Panel Pins have been inserted into the corners of the inside of the front panel and glued into place with approx 10mm protruding back into the case. This will be inserted into the back panel so that it can be removed during testing.

2. Back Panel

The back panel consists of five side rings followed by the back case which is sandwiched by the final side ring. Once again and glued into place with 5-minute two-part epoxy glue. Be careful not to overdo the glue as it will show if it oozes out the sides.

Using the hole positions from the front panel pins carefully mark and drill 3mm holes and check the front and back units connect together.

3. Sand and Paint Components
Once you have the front and back units assembled you can choose to paint any colour or just sand lightly by hand and cover with a clear lacquer spray. I chose the latter because I quite liked the stressed wood effect that the laser cutter left after a light sanding. I had to put 3 to 4 coats of clear lacquer spray on the wood to get it sealed as the wood is very porous.

Step 3: Assemble the Electronic Modules

The overall circuit contains a Real Time Clock, Arduino Mega, Sound Module, Touch Screen and a Screen Sheild.

1. Real Time Clock

Mount the Realtime clock on the back of the Arduino Mega as in the picture provided. I used a hot glue gun and packing foam to ensure they are not touching and there is some cushioning to absorb movement. In my case, I soldered 2 of the RTC legs directly to the Arduino and used hookup wire to connect 5v and GND to the Arduino.

2. Sound Recording Module

These are really cool and easy to use. In a similar fashion as above, use foam and hot glue to position the module and the speaker on the back of the Arduino taking care to ensure they are insulated from touching. The Sound Module is triggered by D8 on the Arduino, so this and the power supply need connecting as per the circuit diagram provided.

3. TFT Screen and Arduino Shield

Carefully push the 3.2' TFT Touch Screen connectors into the TFT Arduino Shield. Then carefully connect to the top of the Arduino as per the picture provided.

The RTC has a battery so will retain the correct time even if power has been removed. The Alarm time is stored in Eeprom on the Arduino which means it will be retained if there is a powercut.

Step 4: Upload the Code and Test the Clock

The Project will require the following files and libraries to be loaded before it will compile and run. The code is unique and built around the capability of the libraries, the hardware, some custom graphics and other projects that I've borrowed from.

1. Libraries

These need to be downloaded and added to the IDE (Integrated Development Environment) that runs on your computer, used to write and upload computer code to the physical board.

2. Graphics Files

There are a group of bitmap files that I have included below that need to sit in the same subdirectory as the Arduino code when you begin to load into the Arduino. Therefore download the 17 files below and use the IDE to load.

3. Setup the Clock

Once the code has loaded successfully press the center of the screen and this should bring up the setup screen.

Use the menu to set the time and the alarm in 24 hour format.

Press the SAVE button to store the setting.

The RTC has a battery so will retain the correct time even if power has been removed. The Alarm time is stored in Eeprom which means it will be retained if there is a powercut.

4. Testing the Alarm

The Sound module is used to provide the Alarm. The ISD1820 is controlled by the Arduino D8 pin. Sound can be easily added by playing sound into the microphone while simultaneously pushing the record button on the ISD1820. In my case, I recorded the original Pac-Man introduction music from a audio file played through another device.

Once the sound is recorded the recording can be tested by pushing the PLAY-E button which should play the sound through the speaker.

Use the setup menu to set the clock time and the alarm time a few minutes apart. Be sure to "SET" the alarm and push the "SAVE" menu buttons. Once back to the main screen the Alarm should sound when the time occurs.

Turning off the Alarm can be done by pressing the center of the touch screen panel resulting in the Setup Screen.

5. Interacting with the game

The game has been designed to roughly emulate the original rules. The rules are as follows

  • If Pac-Man eats a fruit the Ghost turns blue and can be eaten to score points
  • If Ghost is red and touches Pac-Man then Ghost gets points
  • The user can interact with Pac-Man by touching the LHS, RHS, Top Middle or Bottom Middle of the touch screen to issue commands. Pac-Man will only respond to a direction to go in the opposite direction to the way of travel. i.e if going left can be told to go right. If there is enough interest in the project I can add all directions later.
  • Every minute the fruit resets and any characters that have been eliminated are returned to the game.
  • Game scores reset at 95

When left alone the characters battle out the scores by randomly wandering through the maze. It's fun to watch and interact.

Step 5: Putting It All Together!

1. Adding External Power

The final step is to add the external power. Using a drill bit, add a hole in the back of the cabinet. Thread the USB cable through the back panel and then attach the USB cable VCC, GND, D+ and D- wires to the base of the Arduino USB Connector as per the circuit diagram. This has two advantages, firstly the USB input to Arduino Mega Boards has over current protection, and secondly you can use the USB cable to upload code changes without having to dismantle the box.

Hot glue the power cable insulation to the back of the Arduino to provide protection from cable tension when assembling front and back panels.

Add a cord grip to the cable by placing a cable tie tightly around the cable on the inside of the case on the power cable 6-8 cm from the Arduino connection. The cable tie should avoid tension on the joints when the USB cable is pulled by butting up against the inside of the case.

2. Mounting the Electronics in the case

Using 3mm thick Styrene or MDF cut out two brackets that are 105mm width x 12mm height. Cut a section out 95mm x 6 mm as per picture above.

Place the Circuit on top of the front panel and power on the circuit so you can see the front panel screen, Carefully position the brackets and screen in position and glue into place with Hot Glue.

Carefully do one bracket corner at a time and check the orientation and position of the screen. Let each glue joint cool before moving onto the next.

The outcome is a snug fit with a straight screen which is centered in the cutout hole.

3. Final Assembly

Gently push the Front Panel onto the Back Panel taking care to align the panel pins with each hole and gently pulling the USB power cord to take up the slack in the back panel. The cord grip is useful here and should protect any damage to wiring.

Plug into the USB charger and you're good to go. Enjoy!!

<p>Ok, I could not wait for the screen to arrive so I used an 3.2inch ILI9481 TFT I had laying around but it does not have touch and its 480x320 so it does not extent to the whole screen. Any ideas how to resize it to full screen? Here is a short video of it: https://youtu.be/lf7iJK237BA</p>
If it's like the tft for raspberryPIs, then there's a config file you might need. I had to tell my Pi to acknowledge a smaller resolution because it wanted to default to a higher res (1920x1080). the file for Raspberry pi was the config.txt on the boot partition. I haven't had the chance to play with the Arduinos yet.
No, you dont resize it that easily like in raspberrys. You need to resize all objects and locations in the code to the new size of the screen.
<p>hey nice work. Its deinitely doable. The screen Ive used is 319x239 pixels so would need to scale out the code for higher resolution. </p>
<p>Ok, so I'll need to do changes in the code to resize things. I'll do that while waiting for the new screen with touch panel on it: <a href="http://www.ebay.com/itm/272219211370" rel="nofollow">http://www.ebay.com/itm/272219211370</a> </p><p>I also got the time set by compile time for now, using the system variable: &quot;__TIME__ &quot; and &quot;__DATE__&quot;</p>
<p>I did a remix for the 3D printed case with hooks on the front-back plates to mount it on the case body without glue if you wish too. See it here: <a href="http://www.thingiverse.com/thing:2183736" rel="nofollow">http://www.thingiverse.com/thing:2183736</a></p><p>Thanks</p>
<p>nice work sir! Like the color. </p>
<p>Thanks! The Filament I used is Bronze PLA from MatterHackers</p>
@tronicgr : If you don't mind my asking, about how much filament did you wind up using for this project and about how much did that much filament cost for a project that of that size? <br><br>Interested in getting into 3d printing for a couple project prototypes in the future but have no idea about cost-to-use after shelling out money for the printer itself. <br><br>Thanks, <br>nvanbkirk
It didnt use much filament at 0.3mm height print. I think total 40-60 meters. I have a cost estimator option on the slicer, total cost was about $4 on filament... i buy filaments by 1kg reels that cost $30-$40, and print lots of stuff non stop since i got the printer 4 months ago...
<p>I updated the 3D print with front panel that has 3d printed grill as well...</p>
<p>Hello, Can I connect the screen directly to the Arduino Mega? remove the Expansion board shield? Thanks</p>
<p>The display works at 3v and the Arduino at 5v so the screen will end up being damaged. However you can do so if you use resisters to drop the voltage. The problem is it creates a whole lot of wiring and soldering so thats why I recommend the shield.</p>
<p>I found this tft that I think its perfect for the retro pacman clock... no need for shield, it has level shifting chips on it already and plugs directly on the ATmega2560: <a href="http://www.ebay.com/itm/272219211370" rel="nofollow">http://www.ebay.com/itm/272219211370</a></p><p>It even breaks out some unused pins! :)</p>
This one got different resolution. Are you able to adjust the code? Is so please share. Thanks.
Thats the plan, as soon i have revised code for the larger screen working I'll share it on thingiverse remix files, follow that for updates as soon its ready. :)<br><br>http://www.thingiverse.com/thing:2183736
<p>sounds like its worth checking out</p>
Thank you! I'm glad I asked...
<p>Do you know if it would be possible 3D print the case parts?</p>
3D printing the parts shouldn't be a problem and if you still want that wood-feeling you can always use wood filament :)
I'll see if I can make STL files from the files you provided then.
I would be interested in these too! I was thinking about adding this to my to do list
<p>Someone else beat me to it</p><p><a href="http://www.thingiverse.com/thing:2176898" rel="nofollow">http://www.thingiverse.com/thing:2176898</a></p>
<p>Looks good. Havnt tried however it looks like the design is different and doesnt have the front and back overhang. Still worth looking at.</p><p>Id quite like someone to do the same style in 3D and include the mounting brackets fir the board.</p>
<p>I made that 3D printed case, looks good even without the overhangs. I might add the overhangs in a remix of that later: </p><p><a href="http://www.thingiverse.com/make:313669" rel="nofollow">http://www.thingiverse.com/make:313669</a></p>
<p>nice work. Looks great!</p>
<p>Please do </p>
<p>Can use a GPS clock?</p>
<p>Nice Job ! With wihch Version do you made with Arduino? I have a Problem with Time.h :-(</p>
<p>Thx , thats&acute;s it a new install the libary Time.h </p>
<p>send me a message with error. Often its time.h library is not loaded so try reinstalling it in the IDE.</p>
What tool did you use to convert the pacman and ghost character bitmaps to C code data? Any link to it?
<p>go to rinkydinkelectronics site where libraries are and they have a converter there.</p>
<p>Thanks! It lead me to the tools folder in the UTFT library and there it is!</p>
<p>You can get the Display, shield and Arduino Mega as a bundle from eBay for US$28.49 (Shipped from China):<br></p><p><a href="http://www.ebay.com/itm/3-2-TFT-LCD-Display-Touch-Screen-Shield-V2-2-Mega2560-Board-Kit-for-Arduino-/331607425639?var=&hash=item4d3557c267:m:mv01mVhmDdFSyprstOHc_Vw" rel="nofollow">http://www.ebay.com/itm/3-2-TFT-LCD-Display-Touch-...</a></p><p>The RTC for US$0.99:</p><p><a href="http://www.ebay.com/itm/Gikfun-DS3231-AT24C32-IIC-module-precision-Real-time-clock-module-memory-Arduino-/381769927580?hash=item58e342cb9c:g:V1wAAOSwSHZWgOkd" rel="nofollow">http://www.ebay.com/itm/Gikfun-DS3231-AT24C32-IIC-...</a></p><p>And the Voice module for US$4.42:</p><p><a href="http://www.ebay.com/itm/1Pcs-ISD1820-Recording-Voice-Module-Board-With-Microphone-To-Send-0-5W-Speaker-/182481759667?hash=item2a7cc2adb3:g:9TYAAOSwCU1Yv%7EiH" rel="nofollow">http://www.ebay.com/itm/1Pcs-ISD1820-Recording-Voi...</a></p><p>Total cost for electronics = US$33.90</p>
<p>nice work thanks</p>
<p>how much would this cost? and, just out of curiosity, how easy would it be to modify the project to be some other old game? donkey kong? pong?</p>
<p>Costs depend on where you get parts. Yep my intention was to try and build something that could be modified for other games.</p>
What do you think the cheapest you could do is?
<p>looks like someone just got all parts for $33 in one of comments</p>
<p>cool. I'm going to try the Arduino class and do this when I'm done</p>
<p>Hello, Can I use the 3.5 inch screen instead of the 3.2 inch? Thanks.</p>
<p>Hi</p><p>Ive written the code specifically for this sized screen so probably not without serious modification. This site http://www.rinkydinkelectronics.com has some resources for other types of screens if that helps.</p>
Thank you!<br>
<p>Do you have the file for the case in dxf or the sizes for the case so that the local wood working company near me could convert it into their CAD program?</p>
<p>Hey just put up dfx file that was created using online converter.</p>
<p>Thank you so much!!!! I really appreciate it!</p>
<p>Hi I'll try and get the file converted to dxf when Im back home (next 24 hours). Most laser companies can cope with a PDF or SVG file however will get thjis for you.</p>
<p>i have only recently 'discovered' Arduino. My son is a retro games developer (RPG) and i would love to make this clock for him. He is an old PacMan fan. Trouble is I am not sure if I can do this. I have ordered the Electronics parts list but my concern is in uploading the files to the MEGA.</p><p>Can I be a real pain in the butt and ask if you would answer my questions (and i am sure there will be many) once i have the parts list in place.</p><p>With thanks, Ken Jarman. kenjarman@gmail.com Sydney, Australia,</p>
<p>No problems happy to help. Instructables has a free Arduino Training session where lesson 2 covers how to load the software and upload code here <a href="https://www.instructables.com/class/Arduino-Class/">https://www.instructables.com/class/Arduino-Class/</a></p><p>If you get stuck message me</p><p>TechKiwi</p>

About This Instructable




Bio: Crazy about technology and the possibilities it can bring. I love the challenge of building unique things. My goal is to make technology fun, relevant ... More »
More by TechKiwiGadgets:Retro Pac-Man Clock Interactive LED Shoes - Arduino Personalised Word Clock With Animated Time Transitions 
Add instructable to: