How to set an alarm?

Go To Last Post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello guys,

I have a question. I'm making an alarm clock which switches on one motor for a constant time. There will be 4 alarms. THe clock will have no display. I was thinking of using four of these for setting the clock http://sos.sk/?str=371&artnum=S0... for setting the time and 5 buttons. WHen one of them would be pressed the time or one of the alarms would be set.

Unfortunately, these switches are VERY expensive and not on the store right now, so I was wondering if there's any other, better way of setting such a clock that comes into mind.

Thanks,

David

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Might be cheaper to add the display and just use pushbuttons!

How do you know what time the clock is set to with no display?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well the device is supposed to be simply somewhere, running of a battery with no human intervention or someone looking at it for the time for even a half a year. And it's also supposed to be for forest like winter temperatures, so that rules out using LCDs.

I've thought about the display though, no LCD. Maybe OLED? What temperatures do they work in? Or a 7seg LED, but that would drain too much power unless It would be used only when a button was pressed.

Thanks,

David

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sounds like you won't change alarm settings too often.
Maybe write them into EEPROM of AVR.
And start the program at a known time like noon.
Doesn't get cheaper than that. :wink:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That would be the ideal possibility. But the device is for a group of people that aren't very technically skilled. I wanted to use the COM port on the computer, but the guy for whom I'm making it said no, that many of the possible users have problems checking their email. So it has to be self sufficient.

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Perhaps simply use jumpers ?
Eventually in a 1-of-ten mode
for all digits, so users need not
know binary numbers.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jumpers and 1-of-ten aren't a problem. Use a dec:bin decoder/encoder IC. These usually cost a few cents and convert any decimal you select (for example with a jumper) to a binary number. You'll have 4 binary pins for one decimal then. Then connect these binaries to the AVR and calculate the time from them. That's not hard to do.

I'd still create some kind of display (7-segment, led, whatever) and use up/down pushbuttons. Less peripherals, less soldering and a more user-friendly interface. But that's my opinion ;-)

Markus

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here are a couple of ideas.

Have a pushbutton switch for each of current time, alarm 1, alarm 2, and alarm 3. Each switch would also have a single LED. Press the switch and the LED turns on. Release the switch and the LED turns off. Hold the switch to set the specified time or alarm. The LED/resistor would be in series with the switch. Use the port pin pull-up and the switch to pull the LED and pull-up to GND. Call these switches the "set" switches.

Have two more pushbutton switches ("time" switches), each with a single LED to set the hours and minutes. But on these, connect the LEDs to port pins.

While one of the 4 "set" switches is pressed, monitor the "time" switches. To set the current time (7:22am), press and hold the current time "set" switch. Then, press and hold the hour "time" switch until you see the LED blink 7 times. Set the minutes by pressing the current time "set" switch and the minute "time" switch until you count out 22 LED blinks.

Whenever you set the hours and minutes, always start from hour 1 and minute 1. Blink the time LED at a 1Hz rate. It could take up to 59 seconds to set the minutes, but if this is not being done very frequently it should be OK. After reaching 23 hours or 59 minutes, roll the hour or minute to zero and leave the LED off.

This scheme may be too complicated for the end user.

I think a better solution would be to have a two-digit 7-segment LED to display the hour or minute of the current time, alarm 1, alarm 2, or alarm 3. Want to check the current time? Press the current time "set" switch while pressing the hour "time" switch and the current hour is displayed on the LED segments. Press the current time "set" switch while pressing the minute "time" switch and the current minute is displayed on the LED segments. No need to start from 1 during the set function, start at the actual hour or minute stored for the selected current time or alarm time(s). The LED segments would only be on while setting or checking the selected time.

While setting an alarm hour and/or minute, when rolling over from 23 to 0 or 59 to 0, blank the digits (and maybe switch on the DP) for one second. If the user stops with the digits blanked, disable that alarm.

In the end, I think your idea with the rotary switches is an elegant and simple solution.

Tom

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

THanks guys for the suggestions. If a display was available, then I'd skip the rotaries and go for 4 small potentiometers (trimmers) and put them on the ADC. If a change was noted, than the display would turn on and display the value of the four pots (the first one would set 10xhours, the second 1xhour, the third 10xminute, the fourth 1x minute) and the buttons would enable them selves. I'll ask if I cant use a display, but that would complify the casing.

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why not just make it so you can plug an LCD in when you need to set the time, then unplug it before you need to put it where your gonna put it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

David,

Here is a link to Digi-key rotary hex switches and they are $3.88 each. Looks like they have over 1000 in stock. How many do you need??

http://rocky.digikey.com/scripts...

John

Just some guy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Here is a link to Digi-key rotary hex switches and they are $3.88 each. Looks like they have over 1000 in stock. How many do you need??

Unfortunately, 3.88 is the price I can get them here for. I've found ones for about 1.6USD, but they don't have them on storage, so I'll just wait a couple of weeks. Or do something better.

Quote:
Why not just make it so you can plug an LCD in when you need to set the time, then unplug it before you need to put it where your gonna put it.

Instersting idea, I was actually thinking of moving the whole setup system to another box, but I can see the postal-gone user knockoing at my door in half a year saying that he doesn't know where he put the setup box.

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Instersting idea, I was actually thinking of moving the whole setup system to another box, but I can see the postal-gone user knockoing at my door in half a year saying that he doesn't know where he put the setup box.

Thats when you happily offer to sell them a new one.

If I went to the store where I purchased my TV and explained to them that I could not find the remote I would imagine they would tell me how much a new will cost me. :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi daqq,
I got some of type PT65 501 very cheaply !

see here:

http://drehcodierschalter.hartma...

10 positions BCD coded. If you want to built only
one or two of this clock, I might have enough !

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, I want to build only a prototype. I'll PM you, OK?

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you all for your ideas/help/suggestions. I've chosen in the end the BCD switches, as ossi will provide them.

Thanks again,

David

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.