I have a large space in my room and I don't have a clock in it also missing having a night light as I wake up early in the night and the light is so boor .so I decided to make my own clock with a PIR to detect my movement in the dark and open the clock light so that I can hit two birds with one stone.
I think how to make a good shape clock with colourful lights after the first sprint I didn't satisfy with my first clock design .after that AHMED IBRAHIM provides me with some great ideas about 3d giant wall clock which inspire me to start my giant addressable led clock.
step#1:clock frame
the main body of the clock is the clock frame which will hold all the led strip
the frame is in the shape of 4 seven segments two to display the time minutes and the others to show the hours
the middle of the frame contain 8 leds which will flashing when the clock is working
I decided to put the PIR sensor in the middle of the frame so I open a groove in the centre of the clock to put the pir sensor
5. i convert the frame to a dxf form which make me able to cut it in the laser cutting machine
6.after making the frame of 4 mm plywood than I start to paint it.I like the brown colour in wood so I decide to paint it brown , but I cover the guide of the led strip place with tape to make it easy to put the led in the place
step#2:oblique frame
7. I design the frame of the oblique as a spirit parts then I glued each three with each other
8.the first design wasted a lot of material so i decide to cut it into half then glued them again to save the used material
9.the second oblique design
9. i make a wood frame which help in gluing the parts together but it takes me alot of time to finsh it
10.then the oblique has to be a transition medium of light so I make a white acrylic cover for the oblique
the acrylic cover design of the middle part
11. then I start to cut the frame of the middle part and make also an acrylic cover for it
step#3:electronics
projects components
atmega328
crystall oscillator 16MHZ
10-uf capacitor
22pf CAP (2)
led for power
330-ohm resistor
10 k resistor
voltage regulator LM805
Pin headedr
PIR SENSOR
RTC MODULE 1307
.5 mm wire for connection
2 m addresable led (ws2812b)
step#3:pcp design using eagle
using eagle software i start to design my pcp to get a good shape without any wires for connection.
#after that i start to routing the pcp following the design rules of fablab
#after extracting the JOP files from eagle i use GARBER viewer to get the pdf files for the bottom and profile and also for the drills with the profile
using gimb i get the traces as PNG which is the fab module format
drills PNG FROM GIMB
PROFILE PNG
then i upload the png to the fab module to start making my pcp
I used .4 mm tool (v bit) to grave the PCP traces
I used .8 mm tool for the drills
this process required a 2 mm tool diameter
#NOTE: AFTER CUTTING THE PCP THE RTC MODULE WAS FLIPED A5, A4 SO I CONNECTED THEM WITH JUMPERS
step#4:pcp enclosure design
after design the PCP I thought about how to make a cool enclosure for the PCP and the electronics. I seek to have a good shape and safe enclosure to keep away the childs' hand .so I started to take the dimensions of the PCP and the RTC module then I design a good shape enclosure
front ace of the enclosure
back face of the enclosure with the cover
enclosure after subjecting the PCP into
step#5:soldering the led strib
i buy the led strip(ws2812b) from maker electronics .i cut the 2 m led strip which have 120 led in it into pieces each piece has 4 led .then i glued it on the frame with a sequence then soldering it with each other
leds soldering sequence
step#6:coding
1-import some libraries
#include <Adafruit_NeoPixel.h>
#include <EEPROM.h>
#include <FastLED.h>
#include <Wire.h>
#include "RTClib.h"
define the global variables
define the RTC MODULE AS "RTC" (connect SDL to A5 and SDA to A4)
middle LEDSconnect to pin 11
define the number of LEDSin the middle
then we write the number of seven-segment shape we make which are 4
I define a variables to save the hours,minutes and seconds value wich come fom the RTC
connect the pir to pin 2
I made an [10][28] array which hold the value of the bits for each digit to told the addresable LEDS which segment must be blinking
then i define the clock strip in adafruit lib as it required the number of LEDS which connected to pin 12 and the frequency
in the setup section i define the bud rate to be (59600)
in the line number 122 start the wire lib
define the PIR sensor pin as input
make a condition to check IF the PIR sensor is working OR NOT
LINE 131 for adjusing the date and time of the RTC module to time when the sketch is compiled
start the stib libcommunication
then set the brightness of the less to be maximum (255)
then initializeall pixels to "off"
start the communication of the middle leds with fast led lib
in the loop section first of all i check the state of the pir sensor and assign it to "pirstate"
then i make a condition if the state is high then it mean there is some one in the room
the for loop is for making the clock open for 40 second after detecting some one in the room
the time hour is assign in time_h
the time minute is assign to time_m which come from the rtc module
then the second condition is for closing the clock if the state of the pir is low which mean there is no one in the room
this first function for define the showstrib function which send the signal to the leds
the second funcation is for set the colour of each pixels in the strib and define the colors
this function is for changing the color of the leds in sequence of wheel one after one
then I define a function to change the color of the middle leds to 7 colors as a flash
this function take the values from the rtc and mask it to the sevens segment as a mask of the digit which we deifinedd in the golbal section for each number from 0:9
then it is colouring each digits as a rainbow which makes a great colourful shape
you can open the comment line which make a slow transition of color which I intend to make a blutetooh app to change the modes of the clock by it
I used led strip effects generator to generate the mode of colors I want from this site
the last function is for closing the clock when the pir sensor is low
step#7:final output (NOT BAD)
problems
i face a problem in glueing oblique parts together its takes me a lot of effort to adjust the parts as I could
i found a problem in the PCP as there was a short circuit between pin A0 and ground I found it using the AVOMETER
there was a problem in connecting the RTC MODULE as i flipped the pin of connection in the PCP design so that makes me connect it with wires
the intensity of the light was low as it required more LEDs for each segment
I GET FINALLY A GOOD FINAL OUTPUT FROM THE FIRST TIME
I learn a lot of information about PCP making as this interesting for me .and now I can make a PCP from scratch for any projects I need
I want to thank Mohamed asker for his great effort with us and his useful advice in the session and his patient to make us understand the information
I want to thank Ahmed Ibrahim for the information he told us and It’s a pleasure to work with him as he makes a friendly and inspiring work environment.
finally I am so glad to be a part of fab lab and san3a tech for the last threes moths as it was a good experience I will never forget also I was faces some diffiucicalty to do my best because of the limiting time .