my project is abox of (tamr) for EFTAR RAMADAN
it doesn't solve a big problem , but it makes a funny vibes at eftar time especially kids and remind them with dua'a
i care about this idea because i like funny vibes , i like funny reminders , and teaching kids any usful things at all
i inspired by RAMADAN vibes specially that our graduation will be at RAMADAN
FUSION 360
By using fusion 360 i designed my box as the following steps
step 0 : first open it and save the file name
"final project"
step 1 : create new component " front face"
than create new skitch
i draw the skitch with the certain dimentions containing T- SLOT and X-SLOT
i made 2 circles 7.5 cm for RGB led
finish skitch
then extrude 3mm new body
i repeat STEP 1 to create "back face"
i draw the skitch with the certain dimentions containing T- SLOT and X-SLOT
finish skitch
then extrude 3mm new body
i repeat STEP 1 to create "speaker side"
finish skitch
then extrude 3mm new body
i repeat STEP 1 to create "arduino side"
considering the on/off switch and the hole of the door closer at the end of this side
finish skitch
then extrude 3mm new body
i repeat STEP 1 to create "partition" with 3 T-SLOTS to fit with the two sides
finish skitch
then extrude 3mm new body
after assembling the 4 sides and partition i used the PROJECT feature
i repeat STEP 1 to create "base"
creat project
then i choose all tabes
i creat rectangles for decoration parts
20 * 3mm with distance 60mm by using move & copy
finish skitch then extrude 3mm
i repeat STEP 1 to create "door"
i draw the door considering the 2pins as a hing to open & close the door
also i made half circle to cover the IR sensor to make the sense of opening & closing
after assembling the 4 sides and partition i used the PROJECT feature
i repeat STEP 1 to create "closer"
create project
i draw rectagle for the closer considering the IR sensor space
i project the lcd opening and 2 circles for led s then extrude cut them
i used GRABCAD to download arduino , lcd and speaker
i used the JOINT feature for assembly then i project the openings to the "speaker side"
but it was too small to fit my real speaker
i use OFFSET feature to enlarge the opening
i used the JOINT feature for assembly then i project the openings to the "arduino side"
i used the JOINT feature for assembly then i project the openings of the pins to the "closer side"
i used the JOINT feature for assembly
then i use DXF FOR LASER for every side to save my design as dxf
with laser kerf =.15mm
i searched for RAMADAN dxf files , mosque and islamic pattern
i found some with dxf format and others was jpg
i convert files by converto website to dxf
i modify them by fusion 360 to reach the suitable size then i added tabs with dimention 20*6mm
i export them as dxf for laser
open lasercad
import all sides
try to optimize spaces
i choose cut for all lines with power 65 & speed 10
exept the red one was speed cut with power 30 & speed 200
Laser cutting
when you switch on the power
green led will give light as an indication to the device status
lcd backlight is on
welcoming message will appear on the lcd
" RAMADAN KARIM"
RAMADAN song will be played
then the real time will appear on the lcd
when the time of MAGHRIB prayer comes, the sound of AZAN will start and RGB lights will blink
when you open the door , the IR senses HIGH
if the time between FAJR & MAGHRIB
the buzzer will give alarm
red light will blink from rgb led
if the time between MAGHRIB & FAJR
green light will blink from rgb led
i didn't find some components on tinkercad , so i use other components which is the same connection
i use PIR insted of the IR sensor
i use ultrasonic sensor insted of RTC
buzzer
out put
gives the error alarm
on/off switch
input
controlling all circuit
IR sensor
input
sense the door status
opened or closed
RTC module
input
timing control
resistance
decrease current reached to led & RGB
breadboard
connecting tool
arduino uno
the brain
led
output
gives the state of the whole device
mp3
input
play sound tracks
speaker
output
gives the sound of tracks
LCD
output
display time & welcoming message
RGB LED
output
gives lighs for decoration
my project power source is 5volts adapter
it is suitable for my project because all components need max 5volts
HERE I'M ILLUSTRATING EVERY CODING STEP WITH BOLD BLACK COMMENT
// i download from library this codes :
#include <RTClib.h> // for timing
#include <LCD-I2C.h> // for lcd
#include <Wire.h>
LCD_I2C lcd(0x27, 16, 2);
RTC_DS3231 rtc;
#include "DFRobotDFPlayerMini.h" // for mp3 & speaker
// i define the time of maghrib like this
#define MAGHREB_HOUR 17 // Set maghreb hour
#define MAGHREB_MIN 55 // set maghrib min
#define MAGHREB_SEC 0
// i define the time of fajr like this
#define FAJR_HOUR 4 // Set FAJR hour
#define FAJR_MIN 50 // set FAJR min
#define FAJR_SEC 0
// i define the RGB LED COLORS
#define LEDRED_PIN 3
#define LEDGREEN_PIN 5
#define LEDBLUE_PIN 6
#define IR_PIN 7 // IR sensor
#define BUZZER_PIN 9 // buzzer
// the following code for mp3
#if (defined(ARDUINO_AVR_UNO) || defined(ESP8266)) // Using a soft serial port
#include <SoftwareSerial.h>
SoftwareSerial softSerial(/*rx =*/10, /*tx =*/11);
#define FPSerial softSerial
#else
#define FPSerial Serial1
#endif
DFRobotDFPlayerMini myDFPlayer;
void printDetail(uint8_t type, int value);
// the following function for decoration lights to use it when needed without repeating every time
void rgbled() {
for (int i = 0; i < 30; i++) {
digitalWrite(LEDRED_PIN, HIGH);
delay(500);
digitalWrite(LEDRED_PIN, LOW);
delay(500);
digitalWrite(LEDGREEN_PIN, HIGH);
delay(500);
digitalWrite(LEDGREEN_PIN, LOW);
delay(500);
digitalWrite(LEDBLUE_PIN, HIGH);
delay(500);
digitalWrite(LEDBLUE_PIN, LOW);
digitalWrite(LEDRED_PIN, HIGH);
digitalWrite(LEDGREEN_PIN, HIGH);
digitalWrite(LEDBLUE_PIN, HIGH);
delay(500);
digitalWrite(LEDRED_PIN, LOW);
digitalWrite(LEDGREEN_PIN, LOW);
digitalWrite(LEDBLUE_PIN, LOW);
}
void setup() {
// put your setup code here, to run once:
// i put setup for lcd to start with backlight when the device is ON
then the welcoming message appears "RAMADAN KAREEM"
Wire.begin();
lcd.begin(&Wire);
lcd.display();
lcd.backlight();
lcd.print(" RAMADAN");
lcd.setCursor(5, 1); // I CHOOSE SPACES
lcd.print("KAREEM");
delay(500);
// i put setup for buzzer , IR & RGB led
pinMode(BUZZER_PIN, OUTPUT);
pinMode(IR_PIN, INPUT);
pinMode(LEDRED_PIN, OUTPUT);
pinMode(LEDBLUE_PIN, OUTPUT);
pinMode(LEDGREEN_PIN, OUTPUT);
// SPEAKER SETUP START
#if (defined ESP32)
FPSerial.begin(9600, SERIAL_8N1, /*rx =*/D3, /*tx =*/D2);
#else
FPSerial.begin(9600);
#endif
Serial.begin(115200);
Serial.println();
Serial.println(F("DFRobot DFPlayer Mini Demo"));
Serial.println(F("Initializing DFPlayer ... (May take 3~5 seconds)"));
if (!myDFPlayer.begin(FPSerial, /*isACK = */ true, /*doReset = */ true)) { //Use serial to communicate with mp3.
Serial.println(F("Unable to begin:"));
Serial.println(F("1.Please recheck the connection!"));
Serial.println(F("2.Please insert the SD card!"));
while (true) {
delay(0); // Code to compatible with ESP8266 watch dog.
}
}
Serial.println(F("DFPlayer Mini online."));
myDFPlayer.volume(30); //Set volume value. From 0 to 30
myDFPlayer.play(2); //Play the 2nd mp3 ramadan song
// SPAEKER SETUP END
// void rgbled();
// staring lights
for (int i = 0; i < 10; i++) {
digitalWrite(LEDRED_PIN, HIGH);
delay(1000);
digitalWrite(LEDRED_PIN, LOW);
delay(1000);
digitalWrite(LEDGREEN_PIN, HIGH);
delay(1000);
digitalWrite(LEDGREEN_PIN, LOW);
delay(1000);
digitalWrite(LEDBLUE_PIN, HIGH);
delay(1000);
digitalWrite(LEDBLUE_PIN, LOW);
digitalWrite(LEDRED_PIN, HIGH);
digitalWrite(LEDGREEN_PIN, HIGH);
digitalWrite(LEDBLUE_PIN, HIGH);
delay(1000);
digitalWrite(LEDRED_PIN, LOW);
digitalWrite(LEDGREEN_PIN, LOW);
digitalWrite(LEDBLUE_PIN, LOW);
Serial.begin(9600);
// RTC setup
if (!rtc.begin()) {
Serial.println("RTC not found");
while (true)
;
}
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
}
}
void loop() {
// display time on lcd by hours & minuits & seconds in the first line
// the second line is message "ramadan kareem"
DateTime now = rtc.now();
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Time: ");
lcd.print(now.hour());
lcd.print(':');
lcd.print(now.minute());
lcd.print(':');
lcd.print(now.second());
lcd.setCursor(0, 1);
lcd.print("RAMADAN kareem");
// IR sensor setup
int reading = digitalRead(IR_PIN);
// if you open the box and the time is between fajr & maghrib you will hear the sound of buzzer and red led will blink
if ((reading == HIGH) && (FAJR_HOUR <= now.hour() <= MAGHREB_HOUR )){
&& FAJR_MIN <= now.minute() <= MAGHREB_MIN
&& (reading == HIGH)) {
digitalWrite(BUZZER_PIN, HIGH);
digitalWrite(LEDRED_PIN, HIGH);
delay(500); // wait for a second
digitalWrite(BUZZER_PIN, LOW);
digitalWrite(LEDRED_PIN, LOW);
delay(500);
}
// if you open the box any other time green light will blink and no buzzer is set
else if (reading == HIGH) {
// if i want time more specified
// else if (FAJR_HOUR >= now.hour() >= 00
// && 23 >= now.hour() >= MAGHREB_HOUR
// && (reading == HIGH)) {
digitalWrite(BUZZER_PIN, LOW); // turn the LED on (HIGH is the voltage level)
digitalWrite(LEDGREEN_PIN, HIGH);
delay(500); // wait for a second
digitalWrite(LEDGREEN_PIN, LOW);
delay(500);
}
// when maghrib time comes , the AZAN sound will be played and decoration lights are ON
if (now.hour() == MAGHREB_HOUR && now.minute() == MAGHREB_MIN && now.second() == MAGHREB_SEC) {
static unsigned long timer = millis();
myDFPlayer.play(1);
rgbled();
}
}
acually i integrate them in steps
1- ir sensor with buzzer
2- then i added RGB led
3- RTC with buzzer
4- RTC with buzzer & rgb
5- integrate all
6- RTC with speaker
7- RTC with lcd
8-integrate all
the idea of painting was YASSIN'S
i was inspired by his lantern , he brought me the brown color
i didn't find all decorated parts by dxf files
MOHANNAD adviced me to search for online convrting tool
i google search , i found this site
i was trying the if condition by my self
i use copilot to debug "if " condition
if ((reading == HIGH) && (FAJR_HOUR <= now.hour() <= MAGHREB_HOUR )){
&& FAJR_MIN <= now.minute() <= MAGHREB_MIN
&& (reading == HIGH)) {
if i had more time , i would like to add some interactive actions and more lights