Numismatic Clock
REAL is the brazilian currency since 1994 and for celebrate its 25th aniversary, last year (2019) the Casa da Moeda (brazilian mint) made a commemorative 1 REAL coin with a hummingbird in the obverse (not the usual effigy of the republic).
The hummingbird was the image on the 1 REAL bill when the currency was launched 25 yers ago. The 1 REAL bill is no longer produced.
As a numismatic enthusiastic, I used an old RaspberryPi 2, a TFT LCD Display and some code in JavaScript to make a clock that displays the time with bills and coins of the second family of the REAL. It is a real computer that acts as a clock.
You can change the JPG files to show another currency (euro, pesos, dolar, etc) and it will work in the same way.
Supplies
- Raspberry Pi board
-TFT 3.5'' LCD
-Wooden box
Preparing the Box
I had this old wooden box laying around for long time, I think it was used to keep teabags. I "break" the front panel and made a square hole with a Dremel tool to fit the 3,5'' display.
After mount all the componentes I will glue the piece back.
The display is hotglued to the panel.
Coding
The very function of the RaspberryPi in this project is to display a webpage on Chrome in fullscreen mode.
For example if the time is 3:05, it will show a 2 REAL bill and a 1 REAL coin for the hours, and a 5 cents coin for the minutes.
I made the actual page available to test on the link http://numismaticclock.freetzi.com , but in the project it wil be running locally.
It is a HTML page with some JavaScript to refresh the page when a minute passes. The project has 13 images to show hours (0h and 12h is the same image but diferent files) and 60 images to show minutes. The HTML file (index.html) and the 73 JPG are on the file relogio.rar. Is important to keep all the files in the same folder.
The script prints the tags to show pictures every time the page is loaded. A variable gets the actual minute of the system outside the timing function while another variable gets it inside the function. Every second, these two variables are compared, and if they are different it means a minute had pass, so the page is refreshed.
Downloads
Setting the Right Raspbian Image
First of all, you will need to download the especific Raspbian image that work with your display. In my case, my display is the KeDei 6.2 version, so I downloaded the distro from http://kedei.net/raspberry/raspberry.html
You will need a software called WinDisk32Imager to burn the image on a SD card and then, boot your board.
Transfer the Files to the Board
The content of the file relogio.rar (Step 3) will need to be transfered to the RaspberryPi.
You can use a pendrive to do or can make it through SSH with a software called WinSCP. Put all the files in a folder inside /home/pi/
The path of the index.html file will be ~/home/pi/relogio/index.html
I recommend use Putty to make easier to do the next settings.
Setting Linux Parameters
At this point, the files are saved on your board and you can connect a keyboard, open the navigator and type /home/pi/relogio/index.html in the addressbar. It will display the clock page, then press F11 to enter fullscreen mode and its done!
But we can make it better.
You can download a software that hides the mouse cursor when its not in use.
sudo apt-get install unclutter
When its finished, you type the following command to hide the cursor if it not moves for 2 seconds:
sudo unclutter -idle 2 -root
Chrome browser can be opened through the command line in fullscreen mode and direct to the clock page (dont use sudo int his command):
chromium-browser --homepage /home/pi/relogio/index.html --start-fullscreen
We can make it even better.
We will setting an alias, i.e., with a single command we will run the software to hide the cursor and open Chrome on the clock page.
To do so, type the following command:
sudo nano /home/pi/.bashrc
Near the "Alias definition" section, insert the following text (just like the image):
alias relogio='chromium-browser --homepage /home/pi/relogio/index.html --start-fullscreen | sudo unclutter -idle 2 -root &'
Close and reopen your terminal or type:
source /home/pi/.bashrc
Now when you type the command relogio on the terminal, it will automatically run the unclutter software and opens the Chrome.
Placing the Components
The RasbperryPi I used in this project is heavily damaged. Only two USB ports still works and I extend them with jumpers to put it in te back of the box. I also made an extension from the PP1 and PP2 solder spots on the board to a power connector.
Also mode another square hole ont he left side for the ethernet connector.
Finishing the Box
I cut some popsicle sticks to make a frame around the screen in order to hide some imperfections.
I could easily glued the front panel back in the box. Also glued a magnet to hold a commemorative coin above the screen.
Enjoy Your Numismatic Clock
The box has space to hold a power bank inside, if you use a dongle for wifi (or a newer version of the board) it will make it full wireless.
Enjoy Your Minicomputer
It can be used as a regular computer, running a storage server for example.
I hope you enjoy and it could and be helpful in similar projects.
PS. Sorry for the dirty keyboard :)