Ever wanted a binary alarm clock? Me too. So I looked around on Instructables, because there are many good ones around.
What's even better: they're based on the Arduino, one of my favourite toys.
My favourite is this one: https://www.instructables.com/id/Arduino-Binary-Alarm-Clock/. It inspired me a lot and yes I took the code as a base for my project. But this one is far too big for me. I wanted something I can take with me when I visit Hacking Conventions and don't want to miss the early lectures. Nothing is more annoying, if you finally got some tickets for the con, go there and don't wake up after a long (really long.....) hacking and builing night and miss a workshop you'd really want to join.
So what's small enough to fit in a pocket and is also a really great case for projects like this? Yes, an ALTOIDS tin :)
Actually this instructable isn't complete at the moment. First I thought, I'd just share some pictures, but some friends asked for an instructable, so I'll add a detailed how-to the next days.
The pictures on this side are from the first version. You will find newer (but not really better pictures, because my camera died and so I shot a lot of pictures with a crappy web cam or used some for the parts I found on Google) pictures in the following steps.
As said, the pictures are sometimes blurry and crappy. That's why I've entered this to the pocket-sized contest. I really need a new camera.... ;) Please vote 4 me :)
Step 1: things you need
Ok, lt's see what we need. If you're a geek like me, you'll have most of the parts lying around...
For my pocket binary alarm clock I used:
An Arduino. I used a Duemilanove, which fits really good in an Altoids tin. Wonder if there's a deal between the people behind the Arduino project and ALTOIDS ?!?! There must be one, because they're made for each other ;)
- 11 LEDs, I used different colors for minutes and hours. For my first version (as seen in the introduction pictures) I used yellow and green ones. The final version has now ultra bright red and blue ones. Looks far better :)
- 11 1kΩ resistors
ProtoShield (no, we don't want to spend 16 bucks or more for a ready to use one, we do it on our own):
- Perfboard with separate solderpads for each hole, we will build a super cheap shield in this project
2 x 8pin male header
2 x 6pin male header
- 1 Piezo Speaker, you could use other speakers too, but it'll be hard to fit it in the tin. If you've got a unused computer case check, if there's something you can use. My one is out of one. Pretty small and all you've got to do is to cut of the connector to the mainboard.
Setting time and alarm
- 2 Buttons for setting hour and minutes
- 1 Switch to change between time and alarm time
- Hookup wire (solid core wire!!!)
- Electrical tape (for insulation)
- Solder (if you don't like the smell of melting solder use a fume extractor. You don't have one? Look around here on instructables.com, you'll find a lot of DIY versions here
- and of course an ALTOIDS tin (the best case for all pocket stuff things)
- A soldering iron
- helping hands (at least if you're not a multi handed mutant member of the X-Men)
- Wirecutter and wirestripper
- Drill, or something else to make holes in the case for buttons.
- Dremel or tin snip scissor to cut the openings for the USB port and power connector
- Saw to get the perf board to the right size (I once tried to do this with scissors but the only thing I got was a lot of mess....)
- A multimeter for testing connections is great, but you can do this nice little project without it
For your security:
- Safety glasses (ok they don't look cool, but if you snip off some LED legs and they hit your eye, you don't look cool either...)
For your convenience:
- your favourite drink (my fav is Club Mate)
- good music
- maybe some sweets for the breaks
Step 2: The ProtoShield
My first atempt was to just connect the wires to the Arduino. But this wasn't a good idea. they slipped out quite often and it was really a pain to get them back in position.
So I decided to make a Proto shield. Of course you can buy one, but hey, we are "makers" not simple consumers. so we can do it quite easy.
Take the perf board, mark the size of the Arduino on it and cut this piece out with a saw.
Next, insert the the male connectors on the board so that they fit in the Arduino. Don't worry if this doesn't work at your first try. The spacing on the Arduino board differs a bit from that of the perf board. but you can bend the pins if you heaten them up with your solder iron a bit.
If everything fits nice, solder it together. Well done!
Step 3: Building the display
We want a binary display, so we need 11 LEDs
O O O O O
16 8 4 2 1 the layout of the hour display (e.g. if LEDs 4, 2 and 1 light up it's 4+2+1= 7 o'clock
O O O O O O
32 16 8 4 2 1 the layout of the minute display (same here, just add up the values and you get the actual minutes)
Make sure that all LEDs are ok, I missed that step in my first attempt and had to desolder a lot to change on broken LED....
Place the LEDs like mentioned above on the perf board. It sholud look like picture 1
Turn over the board and bend all the short legs of the LEDs to the middle (picture 2)
Solder the short legs to the solder pads
Now strip off the coat of a solid core wire and lay it over the short legs (picture 5)
Solder all short legs to the wire (picture 6)
Clip off the lose ends, so it looks nicer
Now bend the long legs to the outer side and solder them to the pads.
Add a resistor to every LED (picture 7)
Solder the resistors to the long legs and clip off lose ends (picture 8)
Step 4: Connecting the LEDs to the shield
Ok, let's connect the LEDs to the pins of the protoshield.
Use coated wire to connect the long legs of the LEDs to the pins! If you look on the backside of your Proto shield, you start on the upper side from RIGHT(!!!) to left. LED ground (the wire in the middle), minute LED 1, minute LED 2, and so on....
Same on the lower side. Start again from right and go on to the left side.
Step 5: The Altoids tin aka pocket project case
Grab your ALTOIDS tin, eat the reminding mints (if there are more than you want to eat, put them somewhere else or give them to your friends or family) and clean the box. Wash it, let it dry (water + electronics = not much fun...). Now mark the opening for the USB connector and the power connector on the small side of the tin. Cut it with whatever you feel comfortable with. Don't use too much pressure when you cut or drill holes otherwhise the tin will lose it's shape and looks disgusting (or even worse: doesn't close right anymore).
The tricky part: Drill holes for the display and the speaker. This is the part where you should really measure and measure again (maybe a third time) to make sure that every thing will fit nice. After spending really a lot of time (I think the soldering part wasn't as long as this....)
You're almost done.
It should look like the pictures below
Step 6: Buttons and speaker
Now it's time to add the buttons for setting hours and minutes, the switch to change time/alarm time setting and the Piezo speaker.
Place it wherever you find free space in your tin. Maybe on the lid of the tin, maybe on the side. Look at step 4 to find out the right pins.
Step 7: The touch sensor aka snooze button
I'll add this step as soon as I've got a working touch sensor switch.
Step 8: The code
First you need the CapSense Library and the Tone Library
Unzip and place the folders in the folder libraries in your sketchbook folder.
Now download the binary clock source code attached to this step, unzip it, and place the folder in your sketchbook folder too.
Credits go to njakol! (https://www.instructables.com/member/njakol/)
Plug in your arduino, open the binary_clock_v1 sketch and press the upload button.
If you did it right, you reached your goal and your binary alarm clock should be ready! If it doesn't work first check all connectons, maybe you made an unwanted solder bridge somewhere? Maybe you connected something to a wrong pin.