📜 ⬆️ ⬇️

How to make a lightbirder based on Arduino

Hi, Habr!

Work and life constantly throw up new puzzles, their number multiplies every day. Will it be easier? Not. That's life. It only remains to come up with a suitable solution or to adopt the existing experience. On Habré, articles and notes about efficient work, time management and other things were published more than once. Some tips I use, some - does not work. In principle, a more or less clear day regimen helps to be efficient and vigorous. But it is not always possible to start the day at the scheduled time. One of the reasons - in the dark, our brain secretes a sleep hormone - melatonin. To wake up easily and to be awake you need light, which helps reduce the amount of melatonin in the body. And then you wake up awake and rested. But it is late in the autumn and winter, and in the summer thick curtains prevent the sun rays from entering the room. And even before planned, I would not want to get up, if we talk about summer. So we take the topic under control and manage the dawn in our own house on our own, according to an individual schedule, i.e. do the light alarm clock. And that's what happened:


')

What do we need

The Master Kit has a set of EK-004A - a designer for assembling an FM radio based on Arduino, which was decided to use to create a light detector.

To the standard set of EK-004A add:



Connect the MP1095 to a special connector on the center board, as shown in the figure:



Connect the MP1094 to a special connector on the center board, as shown in the figure:



Inside the case / box:

image

Lighting LEDs are glued to the bottom wall:



The new version of the software for the radio EK-004A will turn your radio into an alarm clock:

Download firmware / sketch

Libraries:

DS1307RTC
Time
PinChangeInt
MP1092
MP1091
MP1090S

Description of work and purpose of the remote buttons:

buttons - volume control
rewind buttons | <<, >> | - tuning stations
buttons 1, 2, 3 - transition to the stations installed by the corresponding (wired) buttons connected to the radio board

“clock” button (second from top to first left) - time setting:
- rewind buttons - watch
- volume buttons - minutes
- exit - press the “clock” button again

SEL button - set LED brightness:
- volume buttons - brightness control
- exit - press the SEL button again

“on / off” button (first on the top and on the left) - on / off. LEDs (included with the current brightness value, default 0)

MODE button - set the alarm:
- first press - setting the alarm time:
- rewind buttons - watch
- volume buttons - minutes
- second press - setting the LED brightness: volume buttons - brightness adjustment
- the third press - setting the radio station and volume: rewind buttons - setting the station buttons 1, 2, 3 - go to the recorded stations
- volume buttons - set the volume
- fourth pressing - setting the start time of “dawn” in minutes, maximum 30 minutes, minimum - 1. (For example, if set: alarm time is 6:00, start time is 10, then the LEDs will light up at 5:50 and will glow from given brightness (second step) at 6:00)
- fifth press - exit from alarm settings
- arrow button (first from top to second from left) - alarm activation / deactivation (0 off, 1 on)

Source: https://habr.com/ru/post/253957/


All Articles