Arduino + Coffee Machine Alarm
The light bulb represents the Coffee Machine and the RTC module will send the time to the LCD display, then you can set the alarm.
PARTS I USED:
Arduino Uno
Real Time Module for Arduino
LCD 16x2
Wires
Resistors (220Ω, 1kΩ)
Potentiometer
Coffee Machine (light bulb in the simulator)
Diode (1N4001)
Transistor NPN (2222A)
Relay SPDT 5VDC
Soldering iron
Grounding Converters (2) like the one in the picture
Once I had everything, I wired the coffee machine as the light bulb in the simulator.
Schematics View:
The Real Time module was wired as following:
Those Pins may vary on other Arduinos... just make sure you are wiring them to the SCL and SDA pins.
Code:
// WakeUpDarling!
// Dedicated to my wife.
// Author: Niam Moltta
// Downloaded from: https://circuits.io/circuits/3126865-wakeupdarling
#include <DS3231.h> //download if you don't have it yet.
#include <LiquidCrystal.h>
DS3231 rtc(SDA, SCL);
Time t;
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
void setup()
{
// Setup Serial connection
Serial.begin(115200);
pinMode(9, OUTPUT);
digitalWrite(9, LOW);
rtc.begin();
//rtc.setTime(6, 59, 50); // Uncomment this line to set the real time for the module, then comment it again after uploading.
//<hour, minutes, seconds> (24hr format)
//rtc.setDate(1, 1, 2017); // Uncomment to set the date to January 1st, 2017 (optional, it won't be showed in the display unless you want it to)
}
void loop()
{
t = rtc.getTime();
lcd.begin(16, 2);
lcd.clear();
// Send time
lcd.setCursor(1,0);
lcd.print("Wake up Darling");
lcd.setCursor(0,1);
lcd.print(t.hour, DEC);
lcd.print("hrs ");
lcd.print(t.min, DEC);
lcd.print("min ");
lcd.print(t.sec, DEC);
lcd.print("sec");
delay(1000);
//set alarm:
if (t.hour == 7 && t.min == 0) //time to wake up
{
digitalWrite (9, HIGH); //turns on coffee machine
}
if (t.hour == 9 && t.min == 0) //you left before this time and forgot to turn it off... an accident can happen!...
{
digitalWrite (9, LOW); //turns off the coffee machine and saves the world.
}
}
This is how it looks finished:
I used an old box to put it inside so water/dust wouldn't damage it.
Good coffee helps this project to work better ;)