Friday, November 6, 2009
Sinead's 1-Wire Alarm Clock
My daughter Sinead has a problem getting up for college in the morning.
She finds standard alarm clocks do not work for her. Too easy to turn off and go snoozing again.
We investigated a number of solutions, such as louder alarm clocks etc, but nothing really provided a complete solution.
I have been involved, some people would say obsessed, with Home Automation for a while now. One of the technologies that I use is called '1-Wire'.
1-Wire is basically a 2 wire network, that can be used with a number of components supplied by Dallas Semiconductor Co (now Maxim) to perform a number of functions, controlled by a computer for example.
They are probably best known, in geekdom, for their DS18S20 temperature sensor. I use these throughout the house to measure the temperature in different rooms.
They product other chips that do different things. The one I used in this case was a DS2405 addressable switch. It is an oldish device that has been superseded by the DS2406 and DS2408.
Anyway, it can be used as a switch and as a sensor to detect voltage. Pretty useful.
When the alarm goes off, the patron will need to get out of the scratcher, go to where the computer is, bring up a web page and click 'OFF'. She has an iPaq which is connected to the network. There will be a block on using an iPaq to turn off the alarm. Hehe! Evil, evil, evil.
My design is as follows:
1. Use my existing 1-Wire network to control the DS2405.
2. Use the DS2405 to control a relay.
3. Use the relay to switch on and off a sound source.
4. Use a PHP web page to interface with the set-up, i.e. turn on/off, set-up schedules, etc.
5. Use bash scripts to manage the schedule automatically.
6. Cost me nothing, except time.
List of materials:
DS2405 (or DS2406 or DS2408)
Some relay. I used a Opto-Isolator, which I already had. I used Opto-isolator,ISD74 5300Vac/50mA DIP8 which I got from Radionics.ie
A door /window alarm I got from Lidl a number of years ago. There is a small siren, that is loud enough for this application. I shouldn't wake people in other rooms.
5V Transformer. I used one from an old Sony walkman.
Various cabling, cat-5 and phone cable.
Some heat shrink sleeving (to make it all neat-o)
Prepare the alarm. Strip out the button batteries, remove the battery contacts. You are left with a red and black wire. I also removed the reed relay sensor.
Connect the 1-Wire cable to the GND and 5V of the DS2405.
Connect the PIO and GND of the DS2405 to the appropriate pins. See spec sheet for this chip.
Connect the output pins to the 5V+. One to the walkman and the other to the 5V on the alarm siren (red wire).
Connect the black wire from the alarm to the gnd on the transformer.
I was able to fit all the components in to the alarm, after removing the batteries and cutting a plastic separator.
Wired it up to the 1-Wire controller and tested it. Worked perfectly.
Patched it through from where the main computer is to Sinead's bedroom.
Write the PHP script to provide an interface to turn it off, when the patron has arisin.
Put together a bash script to automate the switch on and off of the alarm. I think 30 mins on would be sufficient. I you can't get up in that time, you are not there or there is a serious problem.
This will be the easy part.