» Electronics » Arduino »Alarm lamp on Arduino

Alarm lamp on Arduino

Alarm lamp on Arduino

The solution for creating such an alarm clock may be suitable for those who have long been tired of a normal alarm clock with a nasty signal. The lamp on it has the ability to smoothly increase brightness, thereby simulating the sunrise. The main feature of such an alarm clock is the ability to fine-tune its components. A repeating signal with a setting for any day of the week, a smooth eclipse, the maximum brightness of the light, the duration of the increase in brightness, etc.

Materials:
- Arduino Uno
- bright LEDs 12 pcs
- 300 Ohm resistors 12 pcs
- NPN transistor (author uses TIP-120)
- buttons 7 pcs
- resistors of 10 kOhm 8 pcs
- LCD display (the author uses an LCD display with I2C interface to save Arduino ports)
- squeaker (buzzer)
- plugs for connecting parts to Arduino

Circuit assembly:


To facilitate connecting / disconnecting LEDs to the circuit, the author soldered the connector to the wires for the LEDs. This will come in handy when the entire structure will fit in the housing at the end of the job.


Further, all other components are connected according to the scheme.


The source code of the program can be downloaded under the article
The archive contains a sketch for Arduino and all libraries. The author decided not to create the "Bounce", "LiquidCristal_I2C" and "Wire" libraries, but if you decide you can also use them, they are in the public domain. The author also created
After downloading the program in Arduino, you can begin to create the enclosure.


LEDs are placed in the ceiling, the display and buttons are mounted in specially drilled places for them.
Here is the alarm in the final assembly:




The display says “Maandag” which means “Monday” in the author’s language, but everything is changed to English in the code.

source-code.zip [55.29 Kb] (downloads: 422)
0
0
0

Add a comment

    • smilesmilesxaxaokdontknowyahoonea
      bossscratchfoolyesyes-yesaggressivesecret
      sorrydancedance2dance3pardonhelpdrinks
      stopfriendsgoodgoodgoodwhistleswoontongue
      smokeclappingcraydeclarederisivedon-t_mentiondownload
      heatirefullaugh1mdameetingmoskingnegative
      not_ipopcornpunishreadscarescaressearch
      tauntthank_youthisto_clueumnikacuteagree
      badbeeeblack_eyeblum3blushboastboredom
      censoredpleasantrysecret2threatenvictoryyusun_bespectacled
      shokrespektlolprevedwelcomekrutoyya_za
      ya_dobryihelperne_huliganne_othodifludbanclose
1 a comment
Something code does not want to work:

Arduino: 1.8.6 Hourly Build 2018/05/22 06:33 (Windows 10), Board: "Arduino / Genuino Uno"

In file included from C: \ Users \ Arduino \ libraries \ Alarm / AlarmController.h: 8: 0,

from C: \ Users \ arduino-nightly-windows \ Drafts \ WakeUpLight \ WakeUpLight.ino: 4:

C: \ Arduino \ libraries \ Alarm / AlarmSettings.h: 21: 5: error: 'Time' does not name a type

Time * getTime ();

^

C: \ Arduino \ libraries \ Alarm / AlarmSettings.h: 22: 18: error: 'Time' has not been declared

void setTime (Time * time);

^

C: \ Arduino \ libraries \ Alarm / AlarmSettings.h: 59: 5: error: 'Time' does not name a type

Time * _time;

^

C: \ arduino-nightly-windows \ Drafts \ WakeUpLight \ WakeUpLight.ino: In function 'void loop ()':

WakeUpLight: 121: 9: error: 'class AlarmSettings' has no member named 'getTime'

set.getTime () -> addMillis ((4294967295ul - timeOnPrev) + timeOn);

^

WakeUpLight: 124: 9: error: 'class AlarmSettings' has no member named 'getTime'

set.getTime () -> addMillis (timeOn - timeOnPrev);

^


exit status 1
'class AlarmSettings' has no member named 'getTime'

We advise you to read:

Hand it for the smartphone ...