loading

Better binary than the others I looked at!!
I prefer the full binary output for the sec/min/hr (rather than "Binary Coded Decimal" with just minutes and Hours.). I like to see the binary seconds ticking!!

I'm using code for the UNO!! (and Nano!!)
Yes, there are enough pins on the UNO :)

Hardware required:

  1. an Arduino Uno (or Mega or Nano)
  2. 17 LEDs (groups of 6/6/5 if you want different colors for HRs/MINs/SECs)
  3. 17 resisters for the LEDs *IMPORTANT*
  4. 35 jumper wires
  5. Breadboard

When complete, it will display time as binary for SEC / MIN / HR.
This is different than many of the others which use BCD (Binary Coded Decimal). This one sets the numbers using only one row of LEDs. I like this setup more because it is not mixing binary and decimal together.

  • Step 1 is for hardware connections
  • Step 2 is for Programming V0.1 (top picture)
  • Code is also included on step 3, please post any issues!
  • Step 3 is for programming and circuit enhancements - Added timing code and upgraded wiring to include dimmed LEDs to allow for reading the LEDs in the dark!
    *Uses an on-board Nano!
  • Step 4 will link to the 3D print and the $5 solar cell, a couple pics up now, links soon!

Step 1: Connect Hardware (V0.1)

Connect Hardware (using breadboard)

  • Arduino UNO (Mega can be used, but it would use different pin assignments)
  • 17 LEDs
  • 17 Resistors
  • 35 Jumper wires
  1. Connect 17 LEDs from (-) ground to the board in groups of 6, 6, 5.
  2. Wire resisters for EACH of the LEDs.
  3. Connect to Arduino UNO pins as shown.
  4. Connect ground to common ground for all the LEDs.

    Power will come from the pins through the resisters to the ground through the LEDs, do not need to wire anything else!

*WARNING* If you do not use the proper resisters with the LEDs (with one for each), you may damage the LEDs.
*NOTE* Adjust the brightness of the LEDs by putting higher value resistors on any that are too bright!

Step 2: Program and Run Arduino Code

Load the code on your Arduino!

Download the text file, upload to your UNO using the IDE.

Couple notes:

  • The millis() function is critical for counting time, it is not good to count time using delay().
    • Most accurate time will be from a RTC (Real Time Clock) which can compensate for temperature changes (and has a battery in case of loss of power).
  • The DEC to BIN conversion is very easy, 4 lines to write to pins (could be two).
  • I need the delay() line near the end in order for the simulation to run acceptably, it is not required for the hardware version.
  • If you wanna see it run, but don't have the hardware, you can see it on the simulator from the link below :)

Comment if you need help!

Here's the simulation!!
http://123d.circuits.io/circuits/645817-binary-clo...

Step 3: Upgrade Wiring and Programming for V0.3

OK, some enhancements!!

First off, the programming is very similar, but is running on the Nano now with the hardware instead of the simulation :) (I also have a new simulation at this link it you want to look at the new one http://123d.circuits.io/circuits/649386-binary-cl... )

The changes to the wiring are:

  1. Incorporated an on-board Arduino Nano.
  2. Add 3.3v power through a higher value resistor and a diode for the "OFF" LEDs
    The purpose is to be able to count the "OFF" LEDs in the dark!
  3. Added code for jumpers / buttons to allow setting the time without reprogramming
    I am using jumpers at the moment because I don't have any buttons on-hand!
  4. Added power supply from a battery pack (think I'll try a solar power cell later!
  5. Dimming the display!

-1-
Installing the Nano is easy! Just plug it into the board!! (though you will need to re-wire the components)

*NOTE: I shorted the ground pin to power by brushing a jumper on the ground pin ... I needed to replace the Schottky Diode (it fried) to get power again from USB, be careful, do not touch power to ground! (best to leave off when wiring and check the circuit before powering!).

-2-
To provide a dimmed "OFF" state for the LEDs (to read them in low light), I needed to move all the resistors to make room for a diode and another wire for the low level power.

The circuit is revised so that the "LOW" power goes from the 3.3v Nano pin through a higher power resister (about 47k depends on the individual LEDs). A diode is in front of the "HIGH" resistor to flow current through the LEDs since the Nano pins are set to ground (0v) when they are off.

"HIGH" power goes through the diode and then through the LED.

-3-
I coded the jumpers to pins 0&1.

BOTH PINS NEED to be GROUNDED to keep time. The timer begins adding +1 for each 1/2 second, but then speeds up until adding +1 each 1/10 sec. To set the hours, I disconnect ground from pin 0 and to set minutes, I disconnect ground from pin 1.

Since these pins will interfere with downloading a program if they are grounded they need to be disconnected to program the Nano.

-4-
5V power source through the USB connector :)
I think I'll drop $4 on some cheap solar lights to make a solar power cell.

-5-

Dim all the lights together by adding resistance to the ground! I put this in the circuit diagram showing the ground going through a potentiometer before going to the ground rail. Adjusting the dial will reduce the overall voltage for the LEDs.

Thanks if you read up to here!
I expect to be adding more steps with solar power, diagram to build from "scratch" using the Mega chip instead of the full blown Nano, diagram for prototype perf board / PCB and 3D prints for the enclosure!

Step 4: 3D Print and $5 Solar Cell! Coming Soon!

Here are pictures of the initial development for the 3D printed "minimalist" frame and the $5 solar cell.

I'll post them in separate instructables link will be added below soon!

<p>hi, I just made the simpler version and Ive been having some problems. </p><p>First, I changed the timerRef to just have a time.</p><p>The seconds blink away as they should but the minutes and hours dont show. There is a very very faint light that is on them but its hardly noticable. I assume, obviously, that theres a power issue but I dont know where it is or how to change. </p><p>Please help! </p><p>Thanks</p>
<p>please helpp! :(</p>
Help. My 13 yr old autistic son made this same clock except no buttons to set time. He's very upset because he &amp; I can't figure out what kind of buttons to get, where to put them and how to hook them up and program. Please help.
<p>I really liked how you set up this binary clock system but have been having trouble uploading it. The message I am receiving is the following: avrdude:ser_open () : can't open device &quot; \ \ .\COM4&quot; : The system cannot find the file specified. Thanks for your help!!</p>
Thanks for your prompt reply. I changed my port and that corrected the error message. What I think I've done is used a board that is a bit smaller than yours...it's short by one section, so it's a 5 across compared to your 6. FYI...I've reset the board, successfully verified and uploaded it, and my blink test is working. What do you think?
<p>Thanks for the comment!</p><p>There could be a lot of reasons for that error.</p><p>Try resetting the board (from the reset button on the Arduino). If using batteries for power, make sure they have a good charge. </p><p>Also check to make sure that the &quot;blink&quot; sketch will run, if you are not able to load any sketches, make sure the correct device is selected under &quot;tools-&gt;Board&quot; and &quot;Tools-&gt;Port&quot;</p>
<p>Very nice!</p>

About This Instructable

2,176views

23favorites

License:

More by evilgenius-xyz:Arduino binary clock! 
Add instructable to: