Categoriearchief: RF

How to hack a doorbell and connect it to Twitter - Part 2: Sniffing a wireless RF signal

The first thing to do is detecting which signal is sent when pressing the doorbell button. For this purpose, we connect the RF receiver to the LINE IN connection of a PC and record the received signals with Audacity. This way, the PC acts like a kind of occiloscope, which I think is very cool. I was really suprised when it turned out that this really works!

First, build the following circuit:

You will need two resistors: 39 KOhm and 10 KOhm (which act as voltage dividers) and an audio cable with 3 segments on its plug. I stripped the 3 wires inside the cable and soldered it to 3 pins, so I could easily plug it into a breadboard. The power (5V) is supplied by the Arduino.

IMG_20130627_203811

IMG_20130627_205752

Now download and install Audacity. Audactity is a free to use audio editor. With this program, you can record the signal from the LINE IN input of your PC. While recording, press the doorbell button. The signal I recorded looks like this:

Schermafdruk van 2013-07-16 09:06:07

You can clearly see the moment on which I pressed the doorbell button.

Zooming in reveals that the same signal is repeated over and over again, with a long, low "sync" signal inbetween:

Schermafdruk van 2013-07-16 09:07:44

Zooming even further:

Schermafdruk van 2013-07-16 09:08:27

You can see that that this signal is built from just two different "building blocks":

  • a long high pulse, followed by a short low pulse. We will encode this as a "1" in our Arduino sketch later on;
  • a short high pulse, followed by a long low pulse. We will encode this as a "0" in our Arduino sketch.

This means that the code sent by the doorbell button is 0101 1111 0110 0010 0000 1000. The following question is: what is the duration of each pulse? When you zoom in even further, the sample points become visible as dots:

Schermafdruk van 2013-07-16 09:20:38

By counting the dots and noticing the sample rate at the lower left screen of the window, you can calculate the duration of the high and low pulses.

For example: when the recorded signal has a frequenct of 48000 Hz (samples per second) and you count 25 samples in the short signal, this signal has a duration of 25/48000 = (approximately) 520 microseconds.

Also notice that a long pulse is 3 times as long as a short pulse.

Sources:

Share Button

How to hack a doorbell and connect it to Twitter - Part 1: Introduction

Introduction

When I bought a wireless doorbell recently, the following idea came to mind: there are so many home appliances which make use of wireless radio (RF) signals, why not try to control them with my Arduino Uno? Besides a brand new doorbell, I also have a wireless weather station, wireless speakers, a remote power supply, a toy car and my car keys which send and receive those wireless signals. Wouldn't it be cool to connect them to the internet and control them this way?

RF apparaten

The most practical thing to do would be to use the remote power sockets and use the Arduino to control a lamp in the living room. But this has already been done. I also wanted to to make it a little easier on myself, so I decided to use the doorbell (Grundig model QH-831A), which makes use of just one signal instead of several different on/off codes. It would also be fun to connect it to Twitter. "Why?", several people asked me, raising their eyebrows. "Because!", I replied.

In the next drawing you can see the things we will have to do.

IMG_20130716_113246

  • Detecting when someone pushes the doorbell button and using the Arduino to post a message to Twitter when this happens.
  • Searching Twitter and when a specific hashtag is found, make the doorbell chime.

Requirements

  • RF sender and receiver components. I bought these.
  • Arduino board. I use an Arduino Uno, together with a breadboard and some wires.
  • Arduino WiFi shield. I'm pretty sure that an ethernet shield would also work when you change the Arduino code slightly, but I don't have one, so I couldn't test it.
  • To make the sniffer circuit mentioned in part 2:
    • 3,5 mm audio plug with 3 segments (3 wires in its cable).
    • A 10 KOhm resistor and a 39 KOhm resistor.
    • A twitter account just for this purpose. Mine is @ArduinoDeurbel.

IMG_20130718_142140

Share Button

Twitterdeurbel: hoe staat het ervoor

Het derde punt van mijn to do lijstje is gewoon gelukt! Ik kan het signaal dat door de originele deurbelknop wordt verzonden nu ook met de Arduino versturen. Ik had gedacht dat het niet zo moeilijk zou zijn om dit signaal door een ontvanger op de Arduino te detecteren, maar dat valt helaas vies tegen... Mijn to do lijst wordt dus uitgebreid met:

  • Uitzoeken hoe het deurbelsignaal door de ontvanger op de Arduino kan worden gedetecteerd.
Share Button

Twitterdeurbel: de stand van zaken

Intussen schiet het al aardig op met de "TinkerBell". Het is me al gelukt om een signaal van de zender- naar de ontvanger te sturen en het plaatsen van een tweet (van @ArduinoDeurbel) vanaf de Wifi shield van de Arduino werkt ook.

De volgende zaken staan nog op mijn to do lijst:

  • De Arduino laten reageren op specifieke tekst (hashtags) in mentions aan @ArduinoDeurbel.
  • Een oplossing vinden voor het probleem dat de Twitter software op de Arduino slechts maximaal 90 karakters kan tweeten.
  • Het signaal dat de deurbel wordt verzonden "sniffen" en een Arduino sketch schrijven die dit signaal ook kan verzenden. Het sniffen gebeurt door middel van een circuit dat RF signalen opvangt en doorzendt naar de Line In ingang van de geluidskaart van een computer. Door dit signaal met Audacity op te nemen kan ik precies achterhalen op welk moment welk signaal wordt verzonden.

Zodra alles werkt schrijf ik weer een uitgebreide handleiding!

Share Button

Volgende Arduino project: De Twitterdeurbel

Ik had er nooit zo bij stilgestaan, maar in elk huishouden zijn behoorlijk wat apparaten te vinden die gebruik maken van (draadloze) radiosignalen:

  • WeerstationRF apparaten
  • Deurbel
  • Speelgoed, zoals op afstand bestuurbare auto's
  • Stopcontact met afstandsbediening
  • Huisalarm
  • Autosleutel
  • Garagepoort

Toen ik een tijdje geleden een nieuwe - draadloze - deurbel kocht, bedacht ik me dat met de juiste elektronica zo'n ding ook vast wel door een Arduino kan worden aangestuurd. Maar wat zou je er dan verder voor leuks mee kunnen doen? Omdat ik ook nog een WiFi shield tot mijn beschikking heb nu mijn leerlingen het toch niet meer gebruiken, dacht ik: laat ik eens gaan proberen de bel via internet te bedienen. En wel via Twitter! Een tweet plaatsen wanneer iemand op de bel drukt, maar daarnaast ook via Twitter de bel laten luiden.

Lees verder Volgende Arduino project: De Twitterdeurbel

Share Button