Pages: 1 [2]   Go Down
Author Topic: Alarm clock from Atmega328 and 7-segment display  (Read 5803 times)
0 Members and 1 Guest are viewing this topic.
Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7198
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I made different clocks back in college - transformer to get voltage down to a rectifiable voltage to make DC, dividing down the mains to make 1Hz.  One design had 60 LEDs in an outer circle for minutes, 12 in an inner circle for hours. Learned about switch bounce on that one too.
I still have the board for it, covered in dust in a box, chips pulled out for a later project.
The mix of hardware/software that uCs bring to the table make things a lot easier to bring to completion without a big pile of chips.


The frequency may not work in all parts of the world (50/60Hz difference) smiley

BTW, did you do Charlie-plexing on the 60 LEDs?
Logged


Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27118
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nope. Just had a few demux type chips, 74154 or 74150, that kind of part.
Was all built from scratch using 74xx logic.  Maybe 74LS. Point to point soldering on non-copper clad perfboard and PCB mount sockets expoxied in place, or maybe held in place via the decoupling caps.  Crude looking wiring job, did the best I could with materials I could scrounge/afford as  a poor college kid.  My designing/building is way better these days smiley-cool
« Last Edit: June 15, 2011, 02:09:25 pm by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Made this clock the other day as it was the only thing I could understand, it was simple and I had parts.  Hats off to Nick for passing on the info so clearly.  I did find one problem.  The center digit segments (SEGG) were not lighting properly and the whole thing seemed buggy (like a bad ground or a pin floating) but I could not put my finger on it.  Finally I found the trouble.  I cannot explain the "why" but apparently having the SEGG on pin13 is not good in this case.  I noticed the SEGG in digit 2 flash as I uploaded, it was in sync to the led on pin13 on my boarduino. So, I switched the alarm led and SEGG pins, pin8 and pin 13, and it fixed the problem.

I also have a question. I'm not a programmer (I just started using Arduino IDE this week and I have no previous experience beyond Basic stamp and lighting leds) so bear with me on my lack of proper usage of terms etc.

Question: My display has the 4 decimal points AND a colon.  The colon is treated like another digit as I understand things. I can't figure out how to flash it instead of the decimal point. I think I need another output pin and then I'm lost on the code although it looks like it has something to do with the switch statements/functions/procedures?  Any advice would be helpful and thanks again.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18810
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have a link to the part? Does it have 8 segments (A to G, DP and colon)?

If so, you probably need to wire the colon (and a resistor) to an extra spare output (if you can find one). Then in the digit function turn it on or flash it in a similar way to the way it is done for the DST dot.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My plan is to use a shift register and gain some extra pins, when I can figure it out.  I don't understand how the digit function works either so I'll just have to keep at it.

display datasheet link--www.adafruit.com/datasheets/BL-Q56C-43.pdf




* LED_7_segment.png (42.21 KB, 520x242 - viewed 6 times.)
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18810
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It looks like the colon is wired between pins 7 and 8 of the display.

Quote
I don't understand how the digit function works either so I'll just have to keep at it.

The display is multiplexed. Only one digit is shown at a time. For a particular digit, first it sets up the segments:

Code:
for (byte i = 0; i < 7; i++)
    digitalWrite (pins [i], pat [i] ^ adjust);

(7 segments are turned on or off as required).

Then it sinks the current through the "digit" pin:

Code:
  // bring appropriate digit low to activate it

  digitalWrite (pin, LOW ^ adjust);

So in effect it "sources" the segments and "sinks" the digit. It holds that for a few milliseconds (so you can see it) and then moves onto the next digit. To the eye it appears that they are all on at once.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I see.
Logged

Brazil
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, cool project.

I have one simple question. The LM7805 does not need a heatsink ? Can I use it without a heatsink when converting 12V to 5V ?

Thanks in advance.

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27118
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Depends how much current is being drawn. Circuit like Nick's is not using much, so no heatsink needed.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: 1 [2]   Go Up
Jump to: