Pacman Clock - Seeed Wio Terminal

by TechKiwiGadgets in Circuits > Clocks

2773 Views, 18 Favorites, 0 Comments

Pacman Clock - Seeed Wio Terminal

IMG_0243.JPG
TikTok Video.gif

Build your own Pacman Clock for your work bench or desk!! The Clock is interactive through use of the joystick and buttons and also has an Alarm. Time is synchronised using the Wifi connectivity of the device.

Supplies

Wio Terminal Unboxing.jpg
Pacman Clock on Seed Wio Terminal
  1. Seeed Wio Terminal - Programmable All in one display with USB C interface, Mini Joystick, Wifi and Buzzer
  2. Wio Terminal Reference Instructions
  3. USB-C to USB-A Cable to Program the Wio Terminal
  4. Arduino IDE loaded on a Mac or Windows device

Background

Wio Terminal Unboxing 2.jpg
Wio Terminal Unboxing 4.jpg
WioT-Hardware-OverviewNew.png

Some time ago I developed an Arduino and ESP32 Pacman Clock which proved to be popular with DIY electronics Makers. I was looking for an alternative all in one platform device that meant no electronics skills would be required so I reworked the code to work with a Seeed Wio Terminal and the results were pretty cool.


The Wio Terminal is a SAMD51-based microcontroller with Wireless Connectivity powered by Realtek RTL8720DN that’s compatible with Arduino and MicroPython. Currently, wireless connectivity is only supported by Arduino. It runs at 120MHz (Boost up to 200MHz), 4MB External Flash and 192KB RAM. It supports both Bluetooth and Wi-Fi providing backbone for IoT projects. The Wio Terminal itself is equipped with a 2.4” LCD Screen, onboard IMU(LIS3DHTR), Microphone, Buzzer, microSD card slot, Light sensor, and Infrared Emitter(IR 940nm). On top of that, it also has two multifunctional Grove ports for Grove Ecosystem and 40 Raspberry pi compatible pin GPIO for more add-ons.

Setup the Wio Terminal

1. Front Page.jpg
Screen Shot 2022-12-17 at 9.22.00 PM.png
Screen Shot 2022-12-17 at 9.20.28 PM.png
Screen Shot 2022-12-17 at 9.20.14 PM.png
  1. Load the Arduino IDE
  2. Go to the Arduino IDE site and download the appropriate version of the IDE for your desktop device.
  3. Install Library Files
  4. I have compressed the correct library files into a Zip folder here - Wio Terminal Pacman Clock libraries.Zip
  5. Delete your existing Arduino Library directory and copy the files into the Library Directory.
  6. Connect your Computer to the Wio Terminal
  7. Using the USB-C cable connect the Wio Terminal to your computer
  8. The device should startup
  9. You can read about the basics of setting up the Wio Terminal here
  10. You will need to add a URL to include a new Board Library and the instructions are clearly included in the Wio Terminal site
  11. Configure the Arduino IDE to communicate with the Wio Terminal
  12. Once Connected to your desktop, make sure you have the correct port loaded and that you can see the Wio Terminal device
  13. Follow the Wio Terminal instructions to load the Blink sketch to test everything is working


Check the Correct Wifi Firmware Is Loaded in the Wio Terminal

Screen Shot 2023-01-05 at 8.50.28 AM.png

In order to use the Wifi function you have to update the “Wireless Core Firmware’ in the Seeed Wio Terminal

Seeed have changed their approach to Wifi since I wrote the code so here are the instructions on how to ensure the earlier Wifi drivers are loaded.

The Pacman Clock uses RTL8720 Firmware Version: 2.1.2

You can check your firmware version by uploading this sketch using the Arduino IDE "Check RTL8720 Firmware Version from Arduino IDE"

If this does not show 2.1.2 you need to follow the procedure to flash the Wio terminal with the correct version for this project.

The procedure is outlined here by Seeed here

The correct version of flash code for this project can be found here

Loading the Pacman Clock Code

Wio-Terminal-Powerup.png
Screen Shot 2022-12-17 at 10.46.46 PM.png
Screen Shot 2022-12-17 at 10.13.44 PM.png
Screen Shot 2022-12-17 at 9.43.27 PM.png

There are two minor changes to the code you need to do to ensure the device can connect to your Wifi and that the correct time zone is setup.


  1. Loading the Pacman Clock code
  2. I have made the code available here - Wio_Pacmanclock_Instructables_V1.Zip
  3. Download and extract the sketch onto your desktop device into one subdirectory.
  4. Open the code with the Arduino IDE
  5. Enter your Wifi Credentials
  6. Note the device only synchronises the Real Time Clock on start up and does not rely Wifi to display the time once this has been done.
  7. Got to lines 175 and 176 in the code and enter your Wifi Credentials. Both Router Name and Password. See picture above
  8. Set Your Time Zone
  9. Use Google Search to identify what you current time zone in UMT based on your geographic location.
  10. Go to line 5391 and edit the code to reflect your time zone.
  11. Modify the variable tzOffset to reflect the UMT time offset.
  12. This is expressed in seconds and must have UL at the end. See the example in the picture above.
  13. Save and Load the code
  14. If you have successfully loaded the IDE Libraries, Wifi Credentials and the Time Zone information then you are ready to load the code.
  15. Proceed with loading the code with the IDE. It should take seconds and you should see successful load details for the Wio Terminal in the IDE message bar as shown in the picture above.
  16. When loaded the Wio Terminal will take approx 30 seconds to connect to Wifi and Synchronise time befor displaying the Pacman Screen and time. You are good to go!!



Using the Controls

4. Setting Character or Speed.jpg
4. Setting Alarm.jpg
Wio-Terminal-Wiki.jpg
Wio Terminal Unboxing 3.jpg

I have configured the code to be able to use the 5 way switchlike a Joystick to change the direction of Pacman (Up, Down, Left, Right).

Depressing the 5 way switch also puts you into Menu Mode where you can use the menu buttons to set the Alarm, Change the Pacman Character to Ms Pacman and Change the speed of the animation. See the youtube video for this.

Next Steps

The next step for this project would be to 3d Print mounted case or clip so you can place it on your Desk in the Office or Clip it to a screen.

Over to you to experiment, enjoy !!!