Setdown Snooze Alarm Clock

by zhoukp in Circuits > Clocks

161 Views, 3 Favorites, 0 Comments

Setdown Snooze Alarm Clock

3.jpeg

Hey! This is a super easy alarm clock that you could make at home. You can even snooze it by dropping the case down!

Supplies

1.jpeg

1x Button

1x Microphone

1x Adafruit APDS9960 Distance Sensor

1x Raspberry Pi 3+ Model A

Any necessary wires

Installing Circuitpython on Raspberry Pi

Our professor has a really good step by step tutorial - but this step is crucial in order to install dependencies needed for the project.


Link to installing Circuitpython: https://gallaugher.com/makersnack-installing-circuitpython-on-a-raspberry-pi/


In some circumstances, you also need to setup the Raspberry Pi first.

Here's the link to do so: https://gallaugher.com/makersnack-setup-a-raspberry-pi-without-a-keyboard-or-mouse-headless-install/

Installing Dependencies Onto Pi

There's a few libraries that we will need for this project - Schedule, APDS9960 and Debouncer.

Under terminal, after logging onto the pi using ssh command, enter this command to install schedule:

pip3 install schedule

The schedule library allows the Raspberry Pi to schedule an upcoming alarm - which was pre-set in the code but is changeable.

Enter this command to install the relevant APDS9960 library:

sudo pip3 install adafruit-circuitpython-apds9960

The APDS library allows us to use adafruit's APDS9960 distance sensor. Which is great for getting distance in a very close proximity.

Enter this command to install Debouncer:

sudo pip3 install adafruit-circuitpython-debouncer

The Debouncer library allows us to have a "better" version of the button, which forces only one output with each input.

Setting Up the Clock

After installing the relevant libraries, all you need is to setup the wires.

Connect the button to any GND and any other input pin.

Make sure to connect the corresponding SCL, SDA wire to the corresponding SCL, SDA pin on the Raspberry Pi.


Then, drag the clock.py file into the Raspberry Pi disk. And make a separate folder called "times" to store the other .wav files.

To change to a specific time, simply use this website (http://www.fromtexttospeech.com) to create a time of your own. Then, save it as **-**.wav, where **-** corresponds to the time. Then, in clock.py, in the get_alarm_time function, add another line to the if else statement to catch that counter.

3D Printing the Case

If you already have a case, great! Otherwise, I've attached a link to the 3D print I used for this project and also uploaded the one I used for the project. I edited mine slightly to fit the Raspberry Pi.


Make sure to print the project with maximal support. There are little hinges in the design, which would cause the print to fail if there's no support.


Link to original 3D print: https://pinshape.com/items/662-3d-printed-elephant

Downloads

Assemble

Assembly should be relatively easy. I used two pieces of double sided tape to tape down the Raspberry Pi and the Distance Sensor.


To use, simply click on the button to cycle through the possible time options, then hold the button for more than 1.5 second to "arm" the alarm. Which will ring when the current time is the same as the "armed" time.

That should be it! Here's a video of it working in real time.

Downloads