A few weeks ago I made the first version of the 3:30 Clock. It worked ok some of the time but because it was based on gently closing an electric circuit, it didn't work all of the time.
In this version I'm using LDRs and the outcome is a bit more professional. I also added a buzzer that beeps from 3:15 PM til 3:30 PM in decreasing intervals.
Step 1: Equiptment
In addition to the equipment used in the first version, I added the following:
- Pro Micro - 3.3V/8MHz
170-Point Breadboard (White)
2 10k 1/4 watt Resistors
In Israel, I get all of my electronics from 4P.
Step 2: Electronics
I used the Pro Micro controller to program all of the logic. I'm working with Arduino 1.6.6
I recommend following all of the instructions in the Hookup Guide. I'm working on Windows 10 and it works. I did have to use a slightly different platform.txt file (see below) located in the hardware\sparkfun\avr directory.
There are 2 LDRs - 1 determines if its there's day light and the second is on the clock and is covered by the hour hand between 3:15 and 3:35.
There is also a buzzer that's connected to the board and the 2 Leds that are installed behind the 3:30 hour and minute positions.
The microcontroller is powered by 2 recharchable AA batteries.
I soldered header pins to the board at the following pins:
- 9 - for the Photo resistor that detects if its daytime
- 10 - for the Photo resistor that detects if its around 3:30
- 6 - for the Leds
- 3 - for the buzzer
- VCC - for the battery power and then from there to the LDRs
- 3 x GND (Ground) - for the battery, the resistors the are connected to the LDRs and the Leds
Although I went over it many times, I still can't really explain the logic behind a voltage divider and all. The following links explain this and you can look at the diagrams there to understand exactly how to hook it all up.
I only had yellow covered wire so I used it for all of the connections. Of course a much better practice is to use different colors for each type of connection (power - red, ground - black, etc...)
I did have black wire insulation which was quite helpful in sealing the connections. You need to heat it with a soldering iron and then it reduces to the size of the wire underneath.
I also recommend using a small breadboard to connect most of the wire. It saves lot of soldering and can easily be reconfigured.
Step 3: Assembly
- I put one the 330 LDR on the face of the clock in the pair of small holes I had cut out of the plexiglass. In the first version I cut 4 small holes. When using an LDR you only need 2.
- The Daylight LDR I put on the side of the clock exposing it to more or less the same amount of light as the first one.
- I built a small case out of cardboard to enclose the board and keep away dust.
- I used double sided tape to stick on the breadboard and the battery pack.
- Since all of the weight ended up on one side I added a small piece of plywood on the other side for balance. It might be better just to have all of the electronics at the bottom center of the clock. Later I also added a few pieces of cardboard glued on top of each other on top of the piece of plywood to keep both sides equal distance from the wall.
Step 4: Coding
For reference see:
In the code below there's a threshold for determining if its daylight or not. You need to do a few runs with Serial Monitor open to see what the right value for you is. You should really test in the place you're planning to place the clock.
The second condition is that there is a large difference between the LDRs values. Since they are exposed to similar light this means that the 330 LDR is being covered by the hour hand.
Step 5: Summary
I really enjoy the options micro controllers add to simple projects. The Pro Micro only costs $20 and its small enough to fit on a small 170 point breadboard.