Alarm clock with voice alarm using Raspberry Pi

Call for Price

Alarm clock with voice alarm using Raspberry Pi

SKU: Alarm clock with voice alarm using Raspberry Pi Category:

Description

ABSTRACT

From this Raspberry Pi alarm system, you can able to learn how to use Time function in Raspberry Pi to obtain time using python programming and will learn about the text to speech conversion using the espeak library. By using this application, when you run this program you will be prompted to enter the time to set as alarm in the Railway time format. After time set for alarm system, checks the time for the match, when it reaches the time, it speak out the Good morning message with the alarm sound echoed by the Buzzer which is interfaced to the GPIO pins of Raspberry Pi. Voice message is spoke out by connecting speaker in the Audio jack of Raspberry Pi

 

HARDWARE REQUIRED

  • Raspberry Pi
  • SD card
  • Power supply
  • VGA to HDMI converter (Optional)
  • MCP3008 (ADC IC)
  • Speaker
  • Buzzer

SOFTWARE REQUIRED

  • Raspbian Stretch OS      
  • SD card Formatter
  • Win32DiskImager (or) Etcher

 

PYTHON LIBRARIES USED

  • RPi.GPIO as GPIO (To access the GPIO Pins of Raspberry Pi)
  • Time library (For Time delay)
  • Espeak Library for voice speech
  • Subprocess Library

 

CODE

import time

import RPi.GPIO as GPIO

import datetime

import subprocess

GPIO.setmode(GPIO.BCM)

GPIO.setwarnings(False)

Buzzer=21

i=0

int HOUR=0

int MINUTE=0


GPIO.setup(Buzzer,GPIO.OUT)


while True:

        a = datetime.datetime.now()
        b=str(a)
        splt=b.split(' ')
        tme=splt[1]
        hour=tme.split(':')
        hr=hour[0]
        minte=hour[1]
        print (a)
        #print (hr)
        #print (minte)
        print("ENTER THE HOUR IN THE RAILWAY TIME FORMAT")
        HOUR = int(input('Enter the HOUR to set Alarm'))
        MINUTE = int(input('Enter the MINUTE to set Alarm'))
        if ((hr==HOUR)and(minte==MINUTE)):
                print("Time reached")
                for i in range 2:
                    GPIO.output(Buzzer, True)
                    time.sleep(0.5)
                    GPIO.output(Buzzer, False)
                    time.sleep(0.5)
                var = "Times up!!! Happy Morning Have a Good day"
                subprocess.call(["sudo", "espeak", var])
        else:
            GPIO.output(Buzzer, False)

Additional information

Weight 0.000000 kg

Reviews

There are no reviews yet.

Be the first to review “Alarm clock with voice alarm using Raspberry Pi”

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.