Posts

Showing posts from October, 2021

4 Stage Timer With DS3231RTC Module.

Image
Componet List 1-Arduino Uno or Arduino Nano 2-DS3231 RTC Module 3-16x2 LCD screen 4-5v 2A DC Regulated power Supply 5- 5v DC, 10A single Channel Relay Module  6-ON/OFF Switch 7-Normaly open Push buttons-4 Numbers 8-Green LED with Holder 9-10 K Preset 10-100 Ohm Resistance 11-10 A barrel fuse with Holder 12-13 A /AC Socket Outlet 13-PG Gland 14-3 core 4 mm copper flexible cable. 15-13 A ,3 pin Plug 16- Plastic Mounting screws. 17-8"x 5" Size PVC junction Box. 18-5 Volt DC Buzzer 19-4 mm square single core wire 20-Female Header Connector. ------------------------------------------------  #include <DS3231.h>//Memanggil RTC3231 Library #include <Wire.h>  // i2C Conection Library #include <LiquidCrystal.h> //Libraries #include <EEPROM.h> LiquidCrystal lcd(2, 3, 4, 5, 6, 7); //Arduino pins to lcd #define bt_clock  A0 #define bt_up     A1 #define bt_down   A2 #define bt_timer  A3 #define relay 8 #define buzzer 13 // Init DS3231 DS3231  rtc(SDA, SCL); // Init

DS1302 RTC Module Alarm clock

Image
#include <Wire.h> #include <LiquidCrystal_I2C.h>          // library for LCD with I2C #include <virtuabotixRTC.h> virtuabotixRTC myRTC(6, 7, 8); LiquidCrystal_I2C lcd(0x27, 16, 2); #include <EEPROM.h> const int btnChange = 2; const int btnOK = 3; const int btnMode = 4; const int buzzer = 5; int alarmHour = 12; int alarmMinutes = 0; boolean hourMode = 0; boolean alarmOn = 1; int M = 10; int D = 12; int Y = 2021; int day = 3; int h = 12; int m = 48; int addrH[] = {0, 1, 2, 3, 4}; int addrM[] = {5, 6, 7, 8, 9}; int addrActive[] = {10, 11, 12, 13, 14}; int mode = 1; int submode = 1; int slot = 0; byte clockChar[] = {B00000, B01110, B10101, B10101, B10111, B10001, B01110, B00000}; byte alarmChar[] = {B00100, B01110, B01110, B01110, B11111, B00000, B00100, B00000}; byte dateChar[] = {B11111, B00000, B01100, B01010, B01010, B01100, B00000, B11111}; void setup()  {   pinMode(btnChange, INPUT_PULLUP);   pinMode(btnOK, INPUT_PULLUP);   pinMode(btnMode, INPUT_PULLUP);   pi