Sunrise Alarm

by anwilliams25 in Circuits > Clocks

132 Views, 1 Favorites, 0 Comments

Sunrise Alarm

Screenshot 2023-01-31 12.21.32 PM.png

It is very healthy for your body to arise naturally and wake up to the sunlight , but unforntantely not eevryone has the luxury to do that everyday. So a sunrise alarm is meant to mimic the rise of the sun so your body can still wake up gently and not adpurtly to the pain staking sound of a alarm. Recreating the sunrise for when there is no light outside you can wake up on time but with your body horomones closer to balance leaving you in a better mood.

Supplies

Argon particle microcontroller

soder

sodering iron

wire , preferred solid core wire

tape

2 paper lanterns

5 foot neopixel lights strip

Amazon account

alexa App

phone / and or alexa

Set Up

Screenshot 2023-01-29 11.01.09 PM.png

set up argon

-reference this link for help on this process


https://docs.particle.io/quickstart/argon/

go to Ifttt website , create account

download amazon alexa app on phone or grab your amazon device for example an echo dot

-press create on ifttt website

..for IF THIS select Amazon Alexa , through this service you will be able to set alarm time by asking Alexa to set alarm or setting the alarm manually through the alexa app on phone

  • after selecting service then pick , ifttt IF ALARM GOES OFF

For THEN select Make web request

this will call your agron to be triggered

  • reference this doc on grabbing your device id and access token to formulate the URL needed for the IfTTT

https://docs.google.com/document/d/1mejw0o89wcZs31G3F_7WYNiHlUZQVPi0il6Wx7kKiEQ/edit


Make sure that "sunrise" is the name that is going to be called within the URL


Setting Up the Lights

  1. Cut the 5 foot neopixel strips into 3 pieces , directly in the middle of each copper pad cut
  • Cut the first piece of the strip into 1 and a 1/3 of a foot strip
  • Cut the second piece of the strip into 1 and a 1/3 of a foot strip
  • Cut the strip into 1 and a 1/3 of a foot strip
  • leaving the last piece of strip at 2 and 1/3 of a foot in length
  • soder the wires onto the begginging and ending copper pad connecting the strips of lights back together to extend them , follow the arrows and connect them together in the order of short strip , long strip , and then the last shrot strip leaving the 2 and 1/3 in the middle.

Connecting the Circut Board

Copy of NeoPixel Strip.png
Screenshot 2023-01-31 7.51.37 AM.png
  • connect the gnd wire , to gnd pin on the agron via bread board
  • connect the din wire to d6 pin on argon via breadboard
  • connect the 5v5 wire to the 3v3 pin on agron via breadboard

-In this circuit an arduino microcontroller is in place but you should have a argon , so the 5v5 pin should go to 3v3 instead of 3.3v


Creating the Lantern

Screenshot 2023-01-31 12.13.45 PM.png
Screenshot 2023-01-31 12.16.48 PM.png
Screenshot 2023-01-31 12.19.49 PM.png
  1. set up first latern
  2. stick your hand inside th latern if possible and hold it steady from insdie out
  3. using your other hand wrap around the lights and tape them as well as you can to the outside of the latern rating from the top of the latern till you reach the bottom.... ideally the short strip should be at the top, long innthe middle , and last at the bottom
  4. once that is secure grab your second latern and cut it straight down the middle and cut the about 3 bottom ringds off and slide that lantern on top of the one with the lights taped so they cover the lights
  5. place the wiring argon very carefully inside the latern powered by the power bank.


Software

Here is the software to my project

flash the code when done coppying and pasting


#include <neopixel.h>


#ifdef __AVR__

 #include <avr/power.h>

#endif


#define PIXEL_COUNT 88 // 88 pixels on my strip , count your pixels to enter the correct number into the code

#define PIXEL_PIN D6 //

#define PIXEL_TYPE WS2812B


bool isOn = false;

unsigned long prevTimeA = millis();

unsigned long prevTimeB = millis();

unsigned long prevTimeC = millis();


bool hasA_GoneOff = false;

bool hasB_GoneOff = false;

bool hasC_GoneOff = false;



bool hasAlarmGoneOff = false;


int potentimeter= A2;


Adafruit_NeoPixel strip(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);

 

int TimeRange=0;

int Settings=0;


void setup() {

  //prevTime=millis();

  strip.begin(); 

  

  //strip.show();




  Particle.function("sunrise", blinkLED);

}




int blinkLED(String param)

{

  hasAlarmGoneOff = true;

  prevTimeA = millis();

  prevTimeB = millis();

  prevTimeC = millis();

   

   

   

  isOn = !isOn;

   

  return 0;

}


void loop() {

   

  if ( hasAlarmGoneOff)

  {

     

    // Behavior A

    if ( hasA_GoneOff == false && millis()-prevTimeA > 600000 )

    {

     TimeRange++;

      

     colorAll( strip.Color(245, 206, 12 )); // change numbers of this function if you want a different sunset color pattern using the rgb color picker

     strip.setBrightness(30);

     delay(1000);

     strip.show();

      

      

      

    

     

      hasA_GoneOff = true;

      

    }

     

     

     

     

     if (hasC_GoneOff == false && millis()-prevTimeC> 1200000)

    {

      

      colorAll( strip.Color(201, 97, 6) ); 

       

       

       strip.setBrightness(90);

     

      strip.show();

    

       

       

     

      hasC_GoneOff = true;

       

       

       

      

    }

     

    // Behavior B

    if (hasB_GoneOff == false && millis()-prevTimeB >1800000 )

    { 

     

      

      colorAll( strip.Color(200, 35, 52) ); 

       

       

       strip.setBrightness(250);


      strip.show();

     

        

     }

      

      

      

      

      

     if ( hasAC_GoneOff==false && millis()-prevTimeAA>182000){

        

       strip.setBrightness(255);

     

      strip.show();

      hasAC_GoneOff==true;

        

     }*/

       

       

      hasB_GoneOff = true;

       

       

       delay(200);

      strip.setBrightness(0);

      //prevTime=millis();

    }

     

    

}

}

  

   

   

   


  



void colorAll (uint32_t c)

{

 uint16_t i;


 for(i=0; i<strip.numPixels(); i++) {

  strip.setPixelColor(i,c); 

 }

}


Trigger

IMG_3039.PNG
IMG_3038.PNG
Sunrise Alarm pt 1
Sunrise alarm

To trigger open alexa app on iphone and search set an alarm and set your alarm about 40 mins BEFORE you want to wake up so the alarm can gradually build up to full brightness waking you up