Files
Alarm_Clock/README.md
Christian Mittring 66c0ebac5a [Update]: Reedme
2018-04-01 12:33:11 +02:00

95 lines
2.6 KiB
Markdown

# Alarm_Clock
This is an Alarm Clock (Radio) based on the Arduino Uno in combination with a MAX7219 LED-Matrix, Relay-Board, DS3231 RTC and a standalone Radio/Audio Module.
Note: This Project is under heavy development at the moment.
## Wiring
Image how to wire the project will follow.
###### LED-Matrix:
| LED-Matrix | Arduino |
| -------- | -------- |
| VCC | Vin/5V+ |
| GND | GND |
| DIN | GPIO13 (HSPID) |
| CS | GPIO 10 |
| CLK | GPIO14 (HSPICLK) |
###### RTC DS3231:
| DS3231 | Arduino |
| -------- | -------- |
| 3,3V | 3,3V |
| GND | GND |
| SCL | GPIO5 |
| SDA | GPIO4 |
###### Relay-Module:
| Relay-Module | Arduino | Type |
| -------- | -------- | -------- |
| VCC | Vin/5V+ | Power |
| GND | GND | GND |
| In1 | GPIO8 | Power |
| In2 | GPIO7 | Input |
| In3 | GPIO7 | Input |
| In4 | GPIO7 | Input |
###### Switch:
The switch should connect the GPIO to ground if it is pressed down:
* power_sw: GPIO2
* input_sw: GPIO5
* alarm_sw: GPIO4
* sleep_sw: GPIO3
You can also change this at the beginning of the code:
```
//Pin Taster
const int pinTime = 2; //Pin fuer Toggle_Power und Einstellen der Uhrzeit (Lang)
const int pinSet = 3; //Pin fuer Sleep und Zeit_Einstellung im Alarm/Time Set Mode
const int pinAlarm = 4; //Pin fuer Alarm An/Aus und setzen der Alarmzeiten (Lang)
const int pinInput = 5; //Pin für die Eingangswahl
const int pinSleep = 6; //Pin Unbenutzt
//Pin Relay
const int outInput = 7;
const int outPower = 8;
```
## How does it work
The Clock can control 2 relays:
* Power Relay: is used to turn on/off a AMP, Radio or any other device.
* Input Relay: is to switch between two Inputs like Radio for Alarm and CD/MP3 or Aux for normal Music.
* If an alarm is triggerd both relays are switched on.
The Clock is controlled with 4 Buttons
* Power-Button: turn power relay on/off
* Power-Button (long-press): Set clock (Day, Month, Year, Hour, Minute, Second) with Sleep-Button
* Input-Button: turn input relay on/off
* Alarm-Button: toggle active alarm (Alarm 1 -> Alarm 2 -> Alarm 1 and Alarm 2 -> Alarm off)
* Alarm-Button (long-press): set alarm time (Alarm 1 Hour, Alarm 1 Minute, Alarm 2 Hour, Alarm 2 Minute) with Sleep-Button
* Sleep-Button : set time to turn power relay off (90 Min -> 60 -> 30 -> 15 -> Off)
## Issues
* Long-Press blocks display until release.
## Dependencies
LedMatrix.h : [https://github.com/squix78/MAX7219LedMatrix](https://github.com/squix78/MAX7219LedMatrix)
DS3231.h : [https://github.com/NorthernWidget/DS3231](https://github.com/NorthernWidget/DS3231)