Doorbell IRC bot
Project: Doorbell IRC bot | |
---|---|
Featured: | |
State | Completed |
Members | Prodigity |
GitHub | No GitHub project defined. Add your project here. |
Description | A doorbell / IRC interface |
Picture | |
No project picture! Fill in form Picture or Upload a jpeg here |
Ah yes, caffeine induced hacking sessions seem to be quite effective...
I've hooked up the doorbell to one of the space arduino's, and used the ethernet shield (which was collecting dust..) to make an IRC doorbell bot which sends a message to the #ackspace irc channel.
Here's what I did
First I made a simple mental sketch of how everything was going to be hooked up:
The arduino is going to 'read' the doorbell, send data to the ethernet shield which is going to communicate with IRC directly. Furthermore the arduino is going to be provided with a usb cable for power and the ethernet shield is connected with a utp cable ofc.
Power
Soon I realized that the doorbell didn't actually need batteries anymore; the Arduino was being fed with USB power, so the doorbell can just as well leech from that right?
Just to be sure I wasn't going to set fire to anything I measured the current draw of the doorbell by placing the multimeter between one of the batteries and its terminal,
it was 20 mA (I think..) idle and 60 mA under load so there was no question I was going to power the doorbell with USB power and remove the batteries.
The batteries however were about 3.2 volts and the 3.3 volts from the arduino can only supply 50 mA which it might have been able to handle but I wasn't going to take the risk;
instead I opted to use 3 diodes in series with the arduino 5v which gives a voltage drop of about 2.1 (5 - 3 * 0.7 = 2.9).
I could have used 2 diodes but supplying a higher voltage to the doorbell (5 - 2 * 0.7 = 3.6) might have damaged it (Probably not but I rather stay on the safe side).
So yeah, no more batteries!
Interfacing
Now I needed to find a usable signal from the doorbell to present to the arduino.
I noticed there was a LED to signify ringing had took place but there were no wires connected to it (herp derp?)
I probed the board, couldn't find anything, got impatient and decided to use the wires running to the speaker.
First I tried it the 'hard' way:
Transistor to buffer signal with lowpass filter to get a pulse.
However I did not check the signals presented to the speaker properly and could therefore not get it to work.
Measuring the signal yielded something slightly surprising; the speaker wasn't hooked up to ground but to the positive power supply, and the audio signal was achieved by pulling the voltage over the speaker down..
Which led to another discovery; everytime the doorbell rang the multimeter measured a voltage drop (2.85v - 2.15v = 0.7v) over one of the speaker terminals to ground.
Then I did it the 'easy' way:
1: Solder cable to speaker
2: Connect cable to arduino
3: ?????
4: Profit!!
Seriously, that easy >.>
Programming
I used one of the ethernet library examples ("TelnetClient"), as my starting point.
I was quickly annoyed by the fact that it didn't use DHCP but static IP's and a quick search on arduino.cc gave me data I needed..
Except it didn't work... :'(
Soon after the realisation came I was still working with a ar