Introduction: ''Sleep Tight'' Visual Sleeping Alarm O'clock

Sleep tight is an alarm clock to help you sleep well.

The principle is that you can set the sleep timer on the app when the time comes, the whole device will be bounce, and the lights will blink from weak to strong because of, and the red threads will also be influenced by the beating of the heart. So at that, As the sleep time is set, the heart's lights will become brighter and more flickering. This method is used to disturb the user's earlier sleep。

The reason why I choose the human heart is that sleep late is terrible for people's health. If you sleep late, it also will give your heart burden, so I use the direct method to raise people's awareness.

Another point is that your light will be still bright before you go to bed until you put your phone or electronic device on the sleep alarm clock so it will push you to sleep early and achieve your goal. (after you place your phone on the device, the light of the device will turn down)

Step 1: Step 1: Prepare Materials

1.acrylic board (5 piece)

2. laser cutter acrylic board ( make some small hole for the red thread)

3.knitting wool (red)

4.rubber human heart prop

5. 6 neopixel

6. some wires

7. light sensor

Step 2: Step 2: Circuit Diagram and Code

here is my code

in my code, i input 2 parts, neopixel and light sensor

#include

#ifdef __AVR__ #include #endif

#define PIN 5 #define numpixels 6

int photocellPin = A1; // the cell and 10K pulldown are connected to a1 int photocellReading; // the analog reading from the sensor divider int animationCounter = 0;

// Parameter 1 = number of pixels in strip // Parameter 2 = Arduino pin number (most are valid) // Parameter 3 = pixel type flags, add together as needed: // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) // NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products) Adafruit_NeoPixel strip = Adafruit_NeoPixel(numpixels, PIN, NEO_GRB + NEO_KHZ800);

// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across // pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input // and minimize distance between Arduino and first pixel. Avoid connecting // on a live circuit...if you must, connect GND first.

// the following variables are unsigned longs because the time, measured in // milliseconds, will quickly become a bigger number than can be stored in an int. unsigned long lastChangeTime = 0; // the last time the animation state changed unsigned long timeInterval = 5000; // 5 seconds between changes

void setup() { // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket #if defined (__AVR_ATtiny85__) if (F_CPU == 16000000) clock_prescale_set(clock_div_1); #endif // End of trinket special code

Serial.begin(9600); strip.begin(); strip.show(); // Initialize all pixels to 'off' }

void loop() { photocellReading = analogRead(photocellPin); Serial.println(photocellReading); if(photocellReading<500){ strip.setPixelColor(animationCounter-1, strip.Color(0, 0, 0)); strip.show(); animationCounter--; if (animationCounter < 0){ //once all the pixels are off, keep this variable from continuing to increment animationCounter = 0; }else{ delay(50); // pause in betweeen shutting off each pixel, but only when they are not all off } }else{ strip.setPixelColor(animationCounter, strip.Color(255, 0, 0)); strip.show(); animationCounter++; if (animationCounter > numpixels){ //once all the pixels are lit up, keep this variable from continuing to increase animationCounter = numpixels; } else{ delay(1000); // pause one second in betweeen lighting up each pixel, but only when they are not all lit up } } }

// Fill the dots one after the other with a color void colorWipe(uint32_t c, int wait) { for(uint16_t i=0; i

Step 3: Step 3: Making Acrylic Board

cut the acrylic in different size( because of thickness)

and then use acrylic glue to connect it

the tools in the second pic is so useful

tips: don't put it on the acrylic, it is difficult to clean and affect the effect

Step 4: Step 4:Model Making

use knitting wool to connect all the holes.

and make the average distance between each hole.

the amount should be averaged.

(when you make it, you need to make sure all of the coding and circuit are worked.

because it is so tricky to make it again)

Step 5: Step 5: Experience and Testing With Friends for Receive Feedback