Raspberry Pi Pico W - Fibonacci Clock
by Guitarman9119 in Circuits > Raspberry Pi
655 Views, 2 Favorites, 0 Comments
Raspberry Pi Pico W - Fibonacci Clock
Welcome to this tutorial on creating a Fibonacci Clock with the Raspberry Pi Pico W. The Fibonacci sequence is a series of numbers where each number is the sum of the two previous numbers. The first five numbers in the sequence are 1, 1, 2, 3, and 5. Using this sequence we can create a clock to show the the time in hours and minutes in increments of 5. The screen of the clock is made up of five squares whose side lengths match the first five Fibonacci numbers: 1, 1, 2, 3 and 5. The hours are displayed using red and the minutes using green. When a square is used to display both the hours and minutes it turns blue. White squares are ignored. To tell time on the Fibonacci clock you need to do some math. To read the hour, simply add up the corresponding values of the red and blue squares. To read the minutes, do the same with the green and blue squares. The minutes are displayed in 5 minute increments (0 to 12) so you have to multiply your result by 5 to get the actual number.
Inspiration for Project:
The inspiration for the project comes from: https://www.instructables.com/The-Fibonacci-Clock/
Supplies
Here is the breakdown of components needed for the Macro Keyboard (assuming you have basic tools):
- Custom PCB
- Raspberry Pi Pico W
- WS2810B LED strip +- 2 meter
- 2.54 20 pin Header x 2
- Miscellaneous Depending on Design
Schematic Diagram
The schematic diagram was created using EasyEDA. All components used are through-hole types, making the soldering process easier and more accessible. The PCB allows us to easily connect the 5 different WS2812 neopixel LEDs to the Pico.
PCB Design
Features of PCB
- Two Push Buttons: Two buttons are added to PCB, which could be used for brightness control, color change, or different modes
- Bluetooth Connector: An integrated connector for adding Bluetooth functionality via the HC-05 module, allowing for wireless control.
- Mounting Holes: The PCB is equipped with four 3mm mounting holes, making it easy to secure within an enclosure.
Order PCB
Order PCB (JLCPCB)
The PCB was ordered through JLCPCB. They offer great PCBs at a low cost and have promotions and coupons available throughout the year. You can sign up using here, or using the following link:
https://jlcpcb.com/?from=Nerd that will support me as a creator to keep making content that is accessible and open source at no charge to you.
Ordering the PCB is very simple:
- Download the Gerber file here.
- Click on Add Gerber file
- Leave all the settings as default given. You might want change the PCB color.
- Enter you shipping details, save to cart
Then after a few days depending on your location you will receive your great quality PCB.
Code
In order to use the Fibonnaci Clock, you will have to create an account on IP Geolocation in order to access the API to get the correct time over Wifi. Visit the following tutorial to learn about it: Before we dive into the code, you’ll need to set up an API key with the IP Geolocation API. Follow these steps to get your key: Tutorial
Download the full demo code here, which include the neopixel and urequest library.
main.py
This is the main file that will be booted once your power the Pico. Comments is given in the code as detailed as possible and explained below.
config.json
You will need to update the following config.json file with your Wifi ssid and password, change the date_time_api to your key given by IP Geolocation, and update the time_zone
Enclosure Design
The enclosure was designed in Fusion360. The enclosure consist of three main parts. The main body which the LED bracket will be inserted which you need to solder all the LED rows and then the insert squares which will diffuse the light from the LEDs. The STL files are available here.
The parts does not require any supports when printing.
If anyone decides to recreate this project and comes up with an improved design for the case, please feel free to share it with me. I would love to see what you create!
Conclusion
The enclosure still needs to be updated as it does not have a back cover yet lol. So future plans is to make a version which will look more like golden ratio, and use LEDs connected on PCB.