Description: A nightlight combined with a wake-up alarm has been developed. This nightlight incorporates six LEDs that activate when a photosensor detects low ambient light levels. Additionally, a buzzer plays a cheerful tune when ambient light levels increase again. The system serves two main purposes: it provides light in dark environments to comfort those afraid of the dark, and it audibly signals the return of light for individuals who may be asleep or have impaired vision. The system successfully illuminates in darkness and plays a melody as intended. An enhancement could include a continuous alarm that users can deactivate, potentially through a potentiometer, similar to a traditional alarm clock. A snooze button could also be integrated. The LEDs are arranged in a line on a breadboard alongside the photoresistor, with the speaker positioned across the center divider of another breadboard. Connecting ground and +5V to the power rails of the breadboard is advisable for subsequent steps. The photoresistor's output values can be monitored using the serial monitor and the Serial.println() function, with adjustments made to the PHOTO_MAX and PHOTO_MIN values as necessary.
This project involves the integration of a nightlight and alarm system, designed to function based on ambient light conditions. The circuit comprises six light-emitting diodes (LEDs) and a buzzer, which are controlled by a microcontroller, typically an Arduino. The LEDs serve as the primary light source, illuminating the area when the photosensor detects low light levels, typically defined by a threshold value set in the software.
The photosensor, connected to an analog input pin, continuously monitors ambient light levels. When the light level falls below a predetermined threshold (DARKNESS), the microcontroller activates the LEDs, providing illumination. As the ambient light increases above another threshold (LIGHT), the microcontroller deactivates the LEDs and triggers the buzzer to play a melody, signaling the transition from dark to light.
The circuit design includes the following components:
- **Microcontroller**: Acts as the central processing unit, executing the programmed logic to control the LEDs and buzzer based on inputs from the photosensor.
- **Photosensor**: A light-dependent resistor (LDR) that changes resistance based on light exposure, providing the necessary input to the microcontroller.
- **LEDs**: Six LEDs arranged in a line, connected to digital output pins of the microcontroller. Each LED can be turned on or off based on the light conditions.
- **Buzzer**: A piezoelectric speaker connected to a digital output pin, programmed to emit sound when the ambient light increases.
The software component includes defining constants for light thresholds, pin assignments, and musical notes. The program initializes the LED pins as outputs and the photosensor pin as an input. In the main loop, the program reads the value from the photosensor and compares it to the defined thresholds, activating or deactivating the LEDs and the buzzer accordingly.
For enhanced functionality, the system could be modified to include a potentiometer that allows users to adjust the sensitivity of the photosensor, giving them control over when the nightlight activates. Additionally, a snooze button could be implemented to temporarily silence the alarm, allowing for a more customizable user experience.
Overall, this nightlight and alarm system combines practical functionality with user-friendly features, providing comfort and convenience in a simple yet effective design.We chose to build a nightlight combined with a wake-up alarm. Our nightlight features not one, not two, not three, not four, not five, but SIX ” yes, SIX! ” LEDs that turn on when a photosensor detects a decreased amount of ambient light. Not only that, but we also included a buzzer that plays a friendly tune whenever our system detects that a mbient light levels have increased again. The purpose of this system is twofold: First, by providing light when its surroundings are dark, it reassures and comforts those who are afraid of the dark. Second, it audibly announces the return of light to those who might have closed their eyes or otherwise lost sensory input (e.
g. , the sleeping or suddenly blind). Our system is a smashing success, as it correctly lights up in the dark and plays a tune, as specified. We particularly liked the reassuring charm of the system`s adorable lights and catchy jingle. A possible improvement would be implementing a continuous alarm that the user can turn off (for example, by turning a potentiometer) ” more like a typical alarm clock.
We could even include a snooze button. 1. Set up the LEDs in a line on a bread board next to the photoresistor. Place the speaker across the cen ter divider of the other bread board. You may find it help ful to con nect ground and +5V to the power rails of the bread board for the fol low ing steps. 3. Check the val ues out put by the photoresistor using the ser ial mon i tor and the Serial. println() func tion. In the code, change the PHOTO_MAX and PHOTO_MIN val ues as appropriate. /* Authors: jasnyder, cwhetung, menewman, jyltwo Date: 2/25/2013 COS 436 Lab L1: The Nightlight Alarm The nightlight alarm: lights turn on when it`s dark, and when it gets bright again, the lights turn off and an alarm goes off to wake you up!
*/ #include "pitches. h" const int FALSE = 0; const int TRUE = 1; // Input / Output Constants const int PHOTO_MIN = 100; // set me as appropriate! const int PHOTO_MAX = 1023; // set me as appropriate! const int DARKNESS = 500; // set me as appropriate! const int LIGHT = 700; // set me as appropriate! // Musical Constants const int NOTE_DELAY = 300; // (ms) const int NOTE_DUR = 250; // Pin Connection Constants const int photo = A0; const int red1 = 5; const int red2 = 3; const int red3 = 1; const int yellow1 = 4; const int yellow2 = 2; const int yellow3 = 0; const int speaker = 8; // Variables boolean islight = false; int photovalue = 0; // value returned by photo sensor // Set internal pull-ups for output on LED pins void setup() { pinMode(red1, OUTPUT); pinMode(red2, OUTPUT); pinMode(red3, OUTPUT); pinMode(y< DARKNESS && islight true; } } // Play a clas
This simple and inexpensive circuit built around a popular CMOS hex inverter IC CD4069UB offers four sequential switching outputs that may be used to control 200 LEDs (50 LEDs per channel), driven directly from mains supply. Input supply of 230V...
After soldering the components indicated in the circuit diagram, a quick verification is necessary. A voltage of 3 volts was supplied using a pair of AA batteries for this purpose.
The verification process involves ensuring that all components are correctly soldered...
This circuit was designed as a warning flasher to alert road users to dangerous situations in the dark. Alternatively, it can act as a bicycle light.
The circuit operates by utilizing a light-emitting diode (LED) as the primary visual alerting component....
The circuit is based on an LM3914N bar graph display driver device (IC1), which can be used to drive up to ten LEDs. This is connected so that with OV12 at the input only the first LED indicator switches on....
This is a low-cost circuit diagram for an emergency light utilizing a white LED. Components include an LM317 IC, a resistor, a transformer, an LED, and a variable resistor.
The emergency light circuit using a white LED is designed for efficiency...
This project is also an essential part of the expandable analyser to be published soon or perhaps eventually, and one meter circuit is used for each frequency band. There are many other uses for a simple LED VU meter. They...
In the circuit below, 60 individual LEDs indicate the minutes of a clock, while 12 LEDs represent the hours. The power supply and timing circuitry are similar to those described in the previous 28 LED clock circuit. The minute section...
The concept involves mounting a microphone on a stick with an LED and designing a circuit that responds to loud noises detected by the microphone input (such as blowing) to turn off the LED. The schematic is straightforward, powered by...
Up to 100 lights, LEDs, or optocoupler triac circuits can be sequentially activated by this circuit. One (U1) 4017 decodes and sequences 10 LEDs, whose common anode is returned through a second (U2) CD4017, which counts at one-tenth of the...
We use cookies to enhance your experience, analyze traffic, and (if you allow) serve personalized ads.
By clicking Accept All, you agree to our use of cookies.
Learn more