Pico Unicorn Mini Desk Clock

by NickZero in Circuits > Clocks

607 Views, 2 Favorites, 0 Comments

Pico Unicorn Mini Desk Clock

20230904_211011.gif
20230904_200940.jpg
20230904_200918.jpg
20230904_200954.jpg

This is a mini desk clock made from a Pi PicoWH and Pimoroni Unicorn LED matrix pack. It connects to WiFi to get the time, and has selectable colours and brightness. No soldering required :)

Supplies

picow.png
unicornpack.png

Raspberry Pi Pico WH (WiFi with Headers)

Pimoroni Unicorn Matrix Pack

3D Printer for the Case / White PLA (or any lighter coloured PLA)

Micro USB Cable

Thony IDE for the programming

Pico / Unicorn Setup

20230904_201936.jpg
firmware.png

If you have never worked with a Pico before - there is a great and easy tutorial here:

https://learn.pimoroni.com/article/getting-started-with-pico


Download the custom Pimoroni PicoW Firmware (make sure to get the "W" one): pimoroni-picow-v1.20.4-micropython.uf2 from here: https://github.com/pimoroni/pimoroni-pico/releases


Push the Unicorn Pack firmly onto the headers on the Pico - making sure you get the orientation correct.

Push and HOLD down the Boot Select button while hooking it up to the USB port on your PC, this should open a file explorer window, now drag and drop the UF2 file into the window. Once the file is copied the Pico will instantly reboot with the new firmware.


Programming the Pico

thony.png
thony_com.png

If you havent already, download and install the "Thony" IDE: https://thonny.org/

Make sure you can talk to the connected Pico by checking the status bar at the bottom of the Thony window - your COM port may differ.

If you have issues, try a reboot and/or close all other programs, sometimes they can lock the COM port.


Copy and paste the python code "main.py" into Thony - edit lines 20 and 21 to your own WiFi SSID and Password. You might also need to adjust the NTP delta value at line 16 - 3600 adds an hour to get GMT + 1. You might also want to adjust the NTP server value at line 17.

Forgive my coding skills - I am sure the program could be written much more efficiently, but I am no python expert... :)


#WIFI Variables
ssid = 'YOUR SSID'
password = 'YOUR PASSWORD'


Save the code onto the Pico, naming it "main.py" - this will make sure that the code autoruns when you power up.

Downloads

Printing the Case

Print out the case parts using your 3D printer. I used a high density setting to give the case some strength and ridigity - 80%, but you can experiment with your own settings. I used white PLA as the LEDs show through easily, but again experiment with you own colours :)

Putting It All Together

Before putting it all together, make sure that the clock works, connects to WiFi and gets the correct time. Adjust the NTP_DELTA value if you need to.


Push the Pico/Unicorn fully into the case, so that the buttons come through the holes to the front. You might have to push quite hard to get it in as it is a neat fit. Make sure your micro USB cable fits, and push the lid on, again this could be quite tight but is designed to push fit and not come apart once in place.

Operation

20230904_201250.jpg

On powerup, the top left corner LED with flash green while trying to connect to WiFi and go orange when getting the time. If it goes red, then there has been a failure of some kind. I have seen on occasion, it might need a couple of trys to get it running.


There are 15 colours to choose from, plus a bright/dim option.

The buttons on the front operate as follows:


Hour Colour -> O O <- Minute Colour

Tick Colour -> O O <- Bright/Dim


The device will happily run off of a power bank for a few days if you need it to be portable.


Future enhancements might include a built in battery, auto bright/dim, other clock funtions, fancy colour options etc :)