I want to make a simple, but somewhat unusual, kind of alarm clock. The attached picture shows what I want it to look like, more or less.
The digits in the top row are either the seconds or the date. You would be able to press a button (on the top of the clock, not shown in the picture) to switch between them.
The middle row is for the time.
The bottom row of digits is for the alarm. The alarm is a different color from the time: that's how I want it.
The buttons below the display are for setting the alarm. There is no snooze feature: if you decide you want to sleep later, you just set the alarm for a different time. To keep things simple, the alarm is set in 5-minute increments, and both the time and the alarm are in 24-hour notation.
The button to set the time will be hidden, either inside or underneath the clock. That makes five buttons altogether.
I envision the clock as being maybe 6 inches (15 cm) high, with the digits maybe about an inch (2 or 3 cm) high. The case will be thick enough to stand on a shelf.
I have built Arduino-based clocks with external RTC, so I have an idea how to deal with the timekeeping side of things. What I'm not sure about here is the displays.
What sort of displays do you recommend I use, and what hardware and/or software should I use to drive them? Keep in mind that I will be using 2 pins for a buzzer, 2 more pins for the Chronodot, and another 5 pins for buttons, so there really won't be that many pins left.
Hello my name is Bowan & I run an Arduino Uno R3.
I am looking to multiplex on my arduino but I do not understand how to control ground.
My display is 5461AS.
I do not understand how I would change segments without manually moving the wire.
2nd Sidenote.
I put 5v instead of the 3.3v to one of my segments (pin 1/Segment E, Digit 1) when testing out and the light stopped working, even with 3.3v. I am not sure if I broke it or what I need to do. All other segments work fine but Digit 1, Pin 1/Segment E
You need current limit resistors between the arduino pins and the anode segment pins.
You need to multiplex the display. An easy way is to use a part like ULN2803 to buffer 4 Arduino output pins to sink the current from the 8 segments.
Write data for digit1 to the segment pins, turn on cathode1, wait 3mS, turn it off.
Write data for digit2 to the segment pins, turn on cathode2, wait 3mS, turn it off.
Write data for digit3 to the segment pins, turn on cathode3, wait 3mS, turn it off.
Write data for digit4 to the segment pins, turn on cathode4, wait 3mS, turn it off.
Repeat.
Persistence of vision will trick your eye/brain into see all 4 digits as on.
During the 3mS, your code can be doing other stuff. Read about blink without delay for doing that.
Google 5461AS, it brings up other Arduino pages where similar has been done.
BowWhalley:
2nd Sidenote.
I put 5v instead of the 3.3v to one of my segments (pin 1/Segment E, Digit 1) when testing out and the light stopped working, even with 3.3v. I am not sure if I broke it or what I need to do. All other segments work fine but Digit 1, Pin 1/Segment E
Yes, you blew it. If you need that segment to work you must buy a replacement display.
Never connect any led without a series resistor.
The only exception is where you are using a chip or circuit that has a "constant current" output designed to drive a led without a series resistor, for example a max7219. Most chip outputs, including Arduino outputs, are not "constant current".
PaulRB:
Yes, you blew it. If you need that segment to work you must buy a replacement display.
Never connect any led without a series resistor.
The only exception is where you are using a chip or circuit that has a "constant current" output designed to drive a led without a series resistor, for example a max7219. Most chip outputs, including Arduino outputs, are not "constant current".
Paul
Thankyou. I am not experienced with using Resistors. Hopefully someone may lead me in the right direction to knowing if I have the right resistor aswell as when/where to use them.
I do not know where I can buy a replacement as I got this display with a kit as a gift from my uncle. I could not find any on amazon and I do not trust ebay.
odometer:
What sort of displays do you recommend I use, and what hardware and/or software should I use to drive them?
Hi,
Your first job is to find some displays that match your requirements in terms of size and colour. Do not make any purchase yet. Post links here to the displays, ideally their data sheets. We need to know the voltage and current requirements and whether they are common-anode or common-cathode before we can recommend the best way to drive them. Number of Arduino pins should not be a problem, there are many ways to reduce the number of pins needed.
If you have not already purchased an rtc module, I would recommend a ds3231 based module. They are more accurate (and have a built-in temperature sensor, which may be useful) and cost about the same as the less accurate ds1307 modules.
You need 9 digits total, so 2+4+3 digit display. Or 9 one-digit displays and some single LEDs for the various dots.
Check here, see if there's colors/sizes you like. http://www.kingbright.com/content/listitem/psearch/32
MAX7219 could control 8 common cathode digits, and use a shift register with resistors for the 9th if you have discrete digits. Unused 8th bit of each digit can be used to drive 8 different indicators (time semi-colons, dots, whatever).
That will consume clock-data-chip select (I'd use SPI), and same clock-data plus 2nd chip select (latch) for the shift register. 5 pins total (SCK, MOSI, MISO pin is tied up, SS1, SS2). Leaves 15 for everything else. You describe 9, so 14 total. 6 still available so you've got pins free for that snooze button still
DS3231 (I2C) or DS3234 (SPI) for RTC.
(Or use MAX7219 to control 3+4, and use 2 shift registers for the other two.
Or use shift registers for all of them.
Or work out your own arduino controlled multiplexing for 9 digits using a couple of shift registers to expand the # of segment and cathode pins.
Or ...)
Next time use a current limit resistor.
Finding a value: (5V - Vf)/current = resistor value
If the LEDs have a Vf of 2.2V (typical for red, up 3.2 to 3.5 for other colors), and you want 10mA of current (most LEDs are 20mA max for continuous on operation), then:
(5V - 2.2V)/.01A = 280 ohm. 270 ohm is a standard value you could use, resulting in:
(5V - 2.2V)/270 ohm = 0.01037A, or 10.37mA.
In practice, there will also be another transistor in series also for the on/off, so the equation is more like
(5V - Vf - Vce)/current = resistor.
If you use N-channel MOSFETs instead of ULN2803, they have an On State Resistance, Rds, that can be quite low, and Vce is then Vds instead, equal to Rds x current.
With Rds = 0.01 ohm current = 0.01A, then Vds = .0001, so effectively nothing.
I like this one for just that reason. Arduino can drive it directly, and there is little voltage drop across it.
I was going to suggest 2 x max7219 for several reasons:
If you are going to use 2 chips, make them the same to keep the design simpler.
This would also allow extra digits, up to 16 in total, that could display date and seconds or temperature as I suggested earlier.
With an alarm clock, its important to fade the display based on the light level in the bedroom, otherwise the display will be too bright to sleep with at night and to dim to see on a bright day. Two max chips make this easy and consistent
PaulRB:
With an alarm clock, its important to fade the display based on the light level in the bedroom, otherwise the display will be too bright to sleep with at night and to dim to see on a bright day. Two max chips make this easy and consistent
[/list]
As I am much more comfortable with a keyboard than with a soldering iron, I think I would choose the brightness level based on the time of day, perhaps taking into account the time of year as well.
Make sure you get 0.1uF, 10uF, and 10K resistor for each one.
Common cathode displays will make setup easy.
Use 5 2-digit displays if you can't find 4-digit displays with : in the middle.
And of course, it is not actually necessary to have common-cathode displays to use the MAX7219, it will function perfectly well with common-anode displays, it is merely more of a challenge to code as with a common-anode display, each byte in a register contains the bits for one particular segment of all of the displays.
BowWhalley:
Here is an Image of the resistor I currently have.
I do not know if this is right or not. I see many with different colours so I get confused.