Arduino Wake Up Light Alarm Clock

Turn your bedside lamp into a wake light with this cool device.

Jun 27, 2019

13489 views

6 respects

Components and supplies

1

High Accuracy Pi RTC (DS3231)

1

Arduino Nano R3

1

LED switch button (green)

1

Graphic OLED, 128 x 32 Pixels

1

LED switch button (blue)

1

LED Light Bulb, Frosted GLS

1

Rotary potentiometer (generic)

1

DC-DC Buck (Step Down) Regulator, Adjustable

1

Power MOSFET N-Channel

Tools and machines

1

Solder Wire, Lead Free

1

Soldering iron (generic)

1

Solder Flux, Soldering

Project description

Code

wakeup.c

c_cpp

Main routine for the wakeup clock

Downloadable files

Electrical diagram

Electrical diagram

Electrical diagram

Electrical diagram

Comments

Only logged in users can leave comments

Anonymous user

3 years ago

Overall a nice project, but there are some errors. In order to get this thing working here are some additions. 1) global variables are missing, add the following lines to //Initialize Flags: Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); RtcDS3231<TwoWire> rtcObject(Wire); 2) Initialization of display is missing, add the following lines to setup(), screen_address is the I2C slave address of the display: if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) { Serial.println(F("SSD1306 allocation failed")); for(;;); // Don't proceed, loop forever } 3) In the schematic: swap source and drain of the N-channel MOSFET 4) 78XX is not a buck-down regulator. You can also directly connect the 12V power supply to VIN of arduino. 5) Connect the gate of the N-Channel MOSFET to D9 of arduino, A6 is not a PWM output. 6) The schematic is missing the display, connect SDA and SCL of Display to A5 and A6.