Intro: Using Parallax Basic Stamp II to Ring a Doorbell Remotely
The problem? A dog that gets way too excited when the doorbell rings.
The solution? Ring the doorbell at random times when no one is there, and nobody answers it, so as to counter-condition the dog - to break the association that a ringing doorbell equals excitement.
The technology? A Parallax 418 MHz RF Keychain Transmitter, Receiver, and a Basic Stamp 2.
Step 1: Design
Parallax makes some very easy to use Microcontrollers. For this project, I used their Basic Stamp II and their 418 MHz keychain tramsitter and its matching receiver.
On the schematic, the receiver is marked IC2, the Basic Stamp is marked IC3. IC1 is an LM7805 voltage regulator. BP1-3 are binding posts. P1-11 are sockets and plugs, where off-board components connect to the on-board components. S4 and S5 were going to be dipswitches, but ended up being jumpers. The idea is that if I steal the BS2 for some other project, I can close these two jumpers and connect two of the RF Receiver buttons directly to the relays.
The relays are S101N11 solid-state relays.
I built it on Perfboard, cut to fit a Radio Shack project box. I didn't have connectors or headers on-hand so I used some machine-pin sockets. They're in five groups. P2 is where the internal 9V battery plugs in, if I'm powering it from an internal 9V battery. P1+P3+P4 connects to the external power binding posts, the on-off switch, and the power-on LED. P5+P7+P10 and P6+P8+P11 connect to the switched binding posts, the indicator LEDs, and the momentary contact test switches. P9 is the Basic Stamp serial programming interface.
Step 2: Soldering
There are plenty of instructables explaining how to solder, so I won't recap.
I built this on perfboard in a Radio Shack project box.
My usual technique for through-hole perf-board soldering is to use wire-wrap to make the connections, then to solder the wire-wrapped connections. The thick black wire wrapping around the board is the antenna.
The first picture shows the back of the board, where the connections are made. The second shows the front of the board, inserted into the box with the connections to the off-board devices (switches, LED, and binding posts) made.
Step 3: The Code
The code is pretty simple - Basic Stamps are programmed in Basic, as the name would suggest.
The program has buttons 1&3 switch one relay, buttons 2&4 switch the other relay, and button 5 starts switching the relays randomly, between five and fifteen minutes apart.
You'll notice two commented-out sections. I used to have buttons 3&4 latch the relays - press them once and they'd close, press them again and they'd open. That's not appropriate for a doorbell, but I left the code in the file in case I use the box for something else.
Step 4: Installed
When I went to install this, I found that the doorbell wiring was a tangled rats nest that was impossible to work with. So I made a little junction panel out of a piece of basswood and some screw-down junctions. Two wires from the transformer, two wires from each of the two doorbell buttons, three wires from each of the two doorbell ringers, all come into separate screwdowns on the outside rows of the junction panel, and are connected using short patch wires between the inside rows. The panel is screwed into the wall with 1/4" standoffs.
The project box is mounted using velcro against the wall, sitting on the top edge of the junction panel.
Rather than relying on a battery, I added a the smaller project box on top. This contains a bridge rectifier, a 1000 uF 35V capacitor, an LM7809 voltage regulator on a small heat sink, and the 7809's ripple caps. This converts the doorbell circuit's 16VAC into 9VDC, which is acceptable as input to both the 7805 and the BS2's onboard voltage regulator.
You can see the transmitter hanging on a nail.