Friday, January 28, 2011

The mail notifier

In order to ease the work for the local postmen in Denmark where I live, the goverment decided that apartment complexes should install mailboxes on the ground level, so the postmen would not have to run up and down stairs many thousind times a day. This is a good deal for the postmen, however it also means that I have to check my mailbox daily if I want to be up to date with the mail I receive. The dilemma is this: I could go and check my mailbox daily, but if my mailbox is empty that would be a waste of time and just plan irritating. On the other hand if I only check my mail say every 3 days then I might miss something urgent that needs my attention.

So I decided to build a small system that could notify me whenever someone had dropped something in my mailbox. To ease the build I brought a cheep wireless doorbell for its wireless capabilities. The plan was simple. Mount the transmitter part on the inside of the mailbox and extend the pushbutton with some wires and a microswitch to detect when the lid is open. The “new mail” notification would then be handled by means of a blinking LED on the doorbell receiver unit placed in my apartment.
To remember if the mailbox lid had been opened I made a electronic flip-flop that was set when the lid is opened and reset when a small reset pushbutton was pressed.


This is the logic schematic for the little addon bord I made for the doorbell unit.


This is how it looked when testing out the circuit on my breadboard:

the LED shown here was just for testing, the one installed in the end is a 4 mm selfblinking one. The IC I am using is a quad NOR-gate TTL type. (74HCT02N)


I didn't bother to make sure that the same gate would always win the power on race, I just took the power on and off a couple of times to see which one of them that came first most of the time. After all I will only have this problem when the circuit is re-powered after a battery change, and then there is always the chance that it will power up the right way. If not it is just a matter of pressing the reset button.

After a bit of reverse engineering I found a suitable “set” signal to tab into on the doorbell main board. This signal is only high as long as the doorbell's pushbutton is pressed. Strangely enough the signal was only 3V and I had been expecting about 4.5V since the doorbell unit uses 3 AA batteries. It turned out that two of the batteries was dedicated for driving the electronics while the last one were to drive only the speaker. A bad design if you ask me, it must have drained the batteries very unevenly. On the bright side I could throw a battery away and still have working electronics. Since the IC I am using is TTL type the relatively low 3V supply should still be sufficient to drive my electronics properly.
Here is a picture of the electronics with my finished addon board attached:
 In the top left corner you can see the backside of the reset button and the LED.

With the receiver unit done I moved on to the transmitter part of the doorbell system. None of the electronics in the transmitter part had to be altered, it was just a matter of adding a microswitch contact in parallel with the one already on the board:
I glued a wooden spacer to the switch to make it fit in the mailbox:

When the lid is closed the switch is pressed so the function becomes inverted. In order to de-invert it, the switch is wired up as normally closed. This way I get a high signal when the lid is opened.

With everything reassembled it was time for testing, which I thought would be ever so easy. Hell no! For some reason it would not work reliably on distances more than just a few meters... The problem obviously had something to do with electrical noise, which is really a bitch to do any faultfinding on. I tried routing the wires from my addon board as far away from the antenna as possible but nothing worked. Finally I made a tiny hole in the receiver and fed the antenna through to the outside of the casing, which worked brilliantly. My guess is that either my addonboard must have acted like an antenna for a noise source on the receiver board or that the addonboard itself have made some kind on noise. However I dont see how the simple components of my own board could ever make any kind if HF noise. Anyways now I know exactly when I have to empty my mailbox, no more running emptyhanded!