Wireless doorbell

To be installed down at the space — probably next Weds (02/03):



A challenge!

The Arduino code for our doorbell can be found here:

Now, when the button on the wireless transmitter is pressed, the relay in the receiver closes. When the switch is released, the relay de-energises.

The code runs in a loop, checking the status of the relay in the receiver module, and if it’s activated it plays the chime. However, if you slowly release the button, the message to tell the receiver that this has happened is not transmitted (probably because the generator in the energy-harvesting switch does not work properly).

This means that the doorbell can latch on, playing a tune indefinitely. Or at least until the button is pressed again and transmits the release signal.

Suggested improvements/patches to the code are invited :smiley:



I’ll fetch it home & have a go at the code this weekend, @9600. Leave it with me.

The code is here:

You need one of those USB UARTs to upload it.

The problem is that if the button does not release with sufficient energy to transmit the “button release” signal, the wireless receiver stays latched (relay contacts closed), so with every iteration of the main loop in the code it will play the doorbell. So what needs to happen is that before playing the doorbell it first checks to see if it was played on the last iteration, and if it was and the contacts are closed, it won’t play again until it detects the contacts opening and closing again (meaning another press). Or something like that…

You can test by pushing the doorbell with normal force and then very gently releasing, so that it transmits a “pressed” signal but not a “released” one. Remember also that you push the button at one end (it’s a rocker switch, but that’s not obvious with the waterproof cover over it).

I’ve never heard of USB UART, but googled it. Is there one in the space anywhere, @9600 ?

There are a few, in one of those plastic containers on the shelf. Minimal Arduino-compatible designs keep the cost down by omitting the USB<–>Serial interface that you need to program the microcontroller. Also makes them a bit smaller and you mostly only need a USB interface for programming, so it’s arguably overkill to have one on the main circuit board, like most Arduinos.

Be sure to get the orientation the right way round when plugging it into the “Cuttlefish” (minimal Arduino-compatible) board.