Smart Alarm Clock
Have you ever wanted a smart clock? If so, this is the solution for you!
I made Smart Alarm Clock, this is a clock that you can change the alarm time according to the website. When the alarm goes off, there will be a sound of choice and a led strip will be lit. To disable the alarm, press the button on the back. The Smart Alarm Clock also measures the temperature and humidity.
This is my first project in my field of study: Multimedia and communication Technology (MCT) at Howest (Kortrijk belgium).
Components
here is a description of the components i use
- Raspberry pi 4
- Raspberry Pi power supply
- 5641AS (4x7 segment)
- push button
- DHT-11 (temperature and humidity sensor)
- DS18B10 (temperature sensor)
- WS2812b led strip
- power supply
- RTC DS1307
- MAX7219
- level shifter
- speake
Hardware
After collecting all the components, I could starting connecting everything. First I made a Fritzing schematic to make sure I wouldn’t fry any components by connecting them wrong. After some feedback from my teachers, I made some corrections which resulted in the following schematic diagram and wiring diagram:
Most of the GPIO pins are interchangeable, so you can switch a few of them if you want. Don’t forget to change the pin numbers in the code accordingly though.
Some elements must be connected to certain pins however.
Database
You can see my ERD diagram above.
With this database you will be able to show multiple things like:
- The temperature
- Humidity
- alarm
- which sound is selected
which color is selected
Connect With Raspberry Pi
First of all you will need to download Putty, there is a free version available on their website. You'll also need Raspbian which you can download here.
When you open Putty you'll need to click on 'session'. When you have done that you'll need to fill in the IP address of the Pi under 'Remote Host'. Then you can enter a username which you can choose. then click on 'OK'.
Normally after all these steps it will automatically startup a connection. Then you'll need to enter your password, and you're connected.
Raspberry Pi Code
For my code to work (which I will link below) you'll need to install some packages and libraries. First thing that is needed is for you to update your Pi.
First, update your system's package list by entering the following command: sudo apt-get update Next, upgrade all your installed packages to their latest versions with the following command: sudo apt-get dist-upgrade After you have installed the packages you'll need to install some libraries:
- Flaskflask_cors
- RPI.GPIO
- datetime
- threading
- time
- subprocess
- lSocketIO
- pygame
also i used the adafruit DHT and neopixel library that you also need to install import Adafruit_DHT and import neopixel
You can download my code from github
Site
While the Pi is booting up, it will start running my python script. This will be taking care of getting the data to show on the website and making it possible to set an alarm. The site is also responsive so it could be opened on mobile without losing features or otherwise.
Case
for my case i made a 3d print
You can also make your own 3d design.