A_Person_Who_makes_things
Published © GPL3+

Out the Door!!!- Morning Alarm System ***Concept***

Do you have trouble getting out of bed in the morning? Try this system!

IntermediateFull instructions providedOver 1 day43

Things used in this project

Hardware components

RTC module
×1
PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
×1
Limit Switch
×1
Amazon Web Services Generic FDM Plastic 3d Printing Part Procurement
×1
Any Type of 3/4th-1in Thickness wood. Length and Width may vary based on Wall Placement
×1
Wood Screws & Wall Mounting Screws. (Wood screws should be long enough to penetrate chosen wood, Wall mounting screws as well+ extra length to mount to wall
×1
Arduino Nano R3
Arduino Nano R3
×1
Breadboard (generic)
Breadboard (generic)
×1
Elegoo Mini Breadboard
×1
Dupont Wires (All three types)
Having an assortment of all three types (M-F),(M-M),(F-F) at your disposal is recommended.
×1
Two Wire 22-24 AWG Wire Extension Cables
×1
Three Wire 22-24 AWG Wire Extension Cables
×1
35KG Continuous 360° Servo + Aluminum Winch
×1
5V Screw Terminal to AC Barrel Adapter + Power Cord
×1

Software apps and online services

Alarmy

Hand tools and fabrication machines

Drill / Driver, 20V
Drill / Driver, 20V

Story

Read more

Custom parts and enclosures

Main Casings

The top and bottom halves of the main cases that contain most of the electronics

PIR Housings

Apparatus to attach the PIR sensor to your walls

Schematics

Wiring Layout

Basic Wiring Connection Layout for Circuit

Code

Code for the pulley system

Arduino
If you're planning on rebooting the mechanism frequently, make sure to remove rtc.adjust(DateTime(F(__DATE__),F(__TIME__))); after your first upload.
#include <RTClib.h>
#include <Servo.h>
#include <Wire.h>
#define Limitswitch 5
int detectPin=7;
Servo pulley;
RTC_DS3231 rtc;
bool Onetime = false;


void setup() {
 pinMode(detectPin,INPUT);
 pinMode(Limitswitch,INPUT_PULLUP);
 pulley.attach(9);
 rtc.begin();
 rtc.adjust(DateTime(F(__DATE__),F(__TIME__)));
}


void loop() {
DateTime now =rtc.now();
int currenttime = now.hour();
if (currenttime>=5&&currenttime<8&& digitalRead (detectPin)==HIGH&&!Onetime){
  unsigned long startTime = millis();
  while (digitalRead(Limitswitch)==HIGH && (millis() - startTime < 20000)){
  fwd();
  }
  stop();
  delay(500);
  bwd();
  delay(4500);
  stop();
  Onetime=true;
}
if(currenttime==0){
  Onetime=false;
}
}
void fwd(){
  pulley.write(180);
  }
void bwd(){
  pulley.write(0);
  }
void stop(){
  pulley.write(90);
  }

Credits

A_Person_Who_makes_things
1 project • 0 followers

Comments