Introduction: Dog-Walking Alarm Clock
This instructable was created in fulfillment of the project
requirement of the Makecourse at the University of South Florida (www.makecourse.com)
Need a reminder to walk your dog at a certain time? This clock is for you!
This project uses a simplistic setup of an LCD screen to display the current calculated time, a target alarm time' that can be set in the sketch, and a servo motor with a tail that will wag whenever the alarm is triggered. There is also a snooze button that allows the project to continue functioning like a simple clock.
For a good place to start, let's move on to the frame!
- Arduino Uno
- Servo Motor
- Small Breadboard
- Jumper wires
- 2 LEDs (any color) and respective resistors (I use red LEDs w/220 ohm resistors)
- LCD screen with i2C module
- Small pushbutton
- Access to 3D printer
Step 1: 3D Models
Here are the 3D models for the project.
The main stand is designed to have the breadboard and LCD screen sit upright and the arduino rest in the tray behind them. In order for the LCD screen to be supported enough, the right arm needs to be shorter because of the protrusion on the right side The servo motor also has a space to sit, with a cutout for wires included.
The tail part is designed to be short enough so it won't clip against the breadboard, but tall enough that it is recognizable as a tail. It is designed to slide onto the plastic mounting hardware of the servo motor.
Note that the enclosure for the servo motor ended up slightly mis-sized in my prints, so this may depend on your individual printer.
Step 2: Arduino Circuit
The arduino circuit is shown in the image above.
The breadboard is given 5 volts of power directly from the arduino, and the LCD screen is powered with 5 volts by being plugged into the breadboard. The ground wires for the LCD screen and breadboard were placed that way because it fit the flow of the project; the same thing applies for both the ground and power wires for the servo motor.
The LCD data wires (SDA and SCL) are plugged in at the top of the board. They are followed by the rest of the input / output wires for the LEDs (pins 8 and 10) and button (pin 13), and the signal wire for the servo motor (pin 9).
NOTE: in the project, I placed the LED cathode wires directly in the breadboard ground line, and extended the anode wires into the center. I could not do that in the circuit maker, hence the small "red wire" leading to the resistor. The project picture will be shown below.
Step 3: Build Process
- Place servo motor into its enclosure and screw it in. Use the smaller screw to secure the mounting piece to the motor (image 1)
- Slide tail piece onto servo mounting piece. Make sure the tail sits high enough so it will not clip the breadboard when spinning (image 2)
- Place LEDs into breadboard with resistors *see circuit note above, image also included for clarity (image 3)
- Place button on breadboard, high enough so the LCD screen will not cover it
- Place breadboard into respective slot
- Place LCD screen and arduino into respective slots
- Wire according to circuit diagram above. For neatness sake, I had put the LED and button's jumper wires lower on the breadboard so they would not be seen behind the LCD screen (image 4)
(if needed) Adjust LCD contrast so the text can be seen by twisting the blue potentiometer (image 5)
Step 4: Arduino Sketch
NOTE: the LiquidCrystal_i2C library is specifically made to work with a LCD display that has an i2C module.
The code is separated into a few parts:
- The setup -- importing libraries, setting data pins, turning on LCD screen
- Printing the clock time
- Calculating the time -- per second/minute/hour to update screen on next loop
- Triggering the alarm (LEDs and "tail wagging" servo) -- when the "target time" is printed to the LCD screen
- Snoozing the alarm (LEDs and "tail wagging" servo) when the button is pressed