Raspberry Pi Chiming Clock

From ProjectPages
Jump to: navigation, search

Use the Getting Started page first to get to a working Raspberry Pi. I used the Pi Zero for this project.

Connections

GPIO Pi ILI9341 ILI9341 Pi GPIO
3V3 1 TFT - 8 - LED Relay + 2 5V
GPIO2 3 4 5V
GPIO3 5 Relay GND 6 GND
GPIO4 7 8 GPIO14
GND 9 10 GPIO15
GPIO17 11 TFT - 5 - D/C 12 GPIO18
GPIO27 13 14 GND
GPIO22 15 TFT - 4 - RST 16 GPIO23
3V3 17 TFT - 1 - VCC Relay Control 18 GPIO24
GPIO10 19 TFT - 6 - MOSI TFT - 2 - GND 20 GND
GPIO9 21 TFT - 9 - MISO 22 GPIO25
GPIO11 23 TFT - 7 - SCLK TFT - 3 - CS 24 GPIO8
GND 25 26 GPIO7


Install My ILI9341 Driver

Download the Zip file from here

Copy the contents of Raspberry_Pi_ILI9341-master to /home/pi/python

Install The Source

Download the source as a Zip file from Raspberry Pi Alarm Clock

Copy the contents of Raspberry-Pi-Alarm-Clock-master to /home/pi/python


Run

sudo apt-get install python-rpi.gpio python3-rpi.gpio
sudo apt-get install python3-spidev
sudo apt-get -y install python3-pip
sudo apt-get install libopenjp2-7-dev
sudo apt-get install libtiff5
sudo apt-get install python-imaging python3-pil

Now you can try the clock by running it with Python

pi@clock:~ $ cd python
pi@clock:~/python $ python clock.py

Make The Service

cd /lib/systemd/system
sudo nano clock.service
[Unit]
Description=Clock Service
After=multi-user.target

[Service]
Type=idle
ExecStart=/home/pi/python/clock.py

[Install]
WantedBy=multi-user.target

sudo systemctl enable clock
sudo systemctl start clock