Starter Kit: Hardware Hacking – Tinkerforge

- Getting Started
  - Primer
  - Tutorials
  - FAQ
- Hardware
  - Bricks
  - Bricklets
  - Master Extensions
  - Power Supplies
  - Accessories
  - Timeline
- Software
  - Brick Daemon (brickd)
  - Brick Viewer (brickv)
  - API Bindings
  - Firmwares and Plugins
  - Device Identifier
  - Source Code and Bug Tracking
  - Programming Interface
- Starter Kits
  - Weather Station
  - Hardware Hacking
    - Features
    - Description
    - Technical Specifications
    - Resources
    - Required Tools
    - Firmware updating and first tests
    - How it works
      - Detect Digital Signals up to 36V
      - Short Signals with a Voltage up to 30V
    - Hardware Hacking for Beginners
      - Details
    - Examples
      - Control Mains Switches Remotely
        - Hardware Setup
        - Using Android
        - Using Windows Phone
        - Using iOS
        - Using C# with GUI
        - Using C/C++
        - Using C#
        - Using Delphi/Lazarus
        - Using Java
        - Using PHP
        - Using Python
        - Using Ruby
        - Using Visual Basic .NET
      - Read out Smoke Detectors
        - Hardware Setup
        - Using C/C++
        - Using C#
        - Using Delphi/Lazarus
        - Using Java
        - Using PHP
        - Using Python
        - Using Ruby
        - Using Visual Basic .NET
      - Control Garage Doors Remotely
        - Hardware Setup
        - Using Android
        - Using Windows Phone
        - Using iOS
      - Is someone at the Door? - Doorbell Notifier
        - Hardware Setup
        - Using Python
  - Server Room Monitoring
  - Blinkenlights
  - Internet of Things
  - Camera Slider
- Embedded Boards
  - Raspberry Pi
- Specifications
  - Technical Data
  - TCP/IP Protocol
  - Modbus Protocol
  - Wireshark Dissector

In Shop

# Starter Kit: Hardware Hacking

{% from "macros.html" import tfdocstart, tfdocimg, tfdocend %} {{ tfdocstart("Kits/hardware_hacking_kit_tilted_350.jpg", "Kits/hardware_hacking_kit_tilted_800.jpg", "Hardware Hacking: Soldered Kit with Mains Sockets") }} {{ tfdocimg("Kits/hardware_hacking_remote_finished_100.jpg", "Kits/hardware_hacking_remote_finished_800.jpg", "Hardware Hacking: Kit with Remote Switches") }} {{ tfdocimg("Kits/hardware_hacking_smoke_detector_finished_100.jpg", "Kits/hardware_hacking_smoke_detector_finished_800.jpg", "Hardware Hacking: Kit with Smoke Detector") }} {{ tfdocimg("Kits/hardware_hacking_garage_remote_finished_100.jpg", "Kits/hardware_hacking_garage_remote_finished_800.jpg", "Hardware Hacking: Kit with Garage Door Remote") }} {{ tfdocimg("Kits/hardware_hacking_smoke_detector_and_remote_new_100.jpg", "Kits/hardware_hacking_smoke_detector_and_remote_new_800.jpg", "Hardware Hacking: Kit with Remote Switches and Smoke Detector") }} {{ tfdocimg("Kits/hardware_hacking_content_100.jpg", "Kits/hardware_hacking_content_800.jpg", "Hardware Hacking: Content") }} {{ tfdocimg("Kits/hardware_hacking_remote_soldered_closeup_remote_100.jpg", "Kits/hardware_hacking_remote_soldered_closeup_remote_800.jpg", "Hardware Hacking: Remote soldered") }} {{ tfdocimg("Kits/hardware_hacking_remote_soldered_closeup_iqr_top_100.jpg", "Kits/hardware_hacking_remote_soldered_closeup_iqr_top_800.jpg", "Hardware Hacking: Quad Relay wiring") }} {{ tfdocend() }}

## Features

- Hack any low voltage electronic appliance and make it controllable by
  - PC, smart phone/tablet, Raspberry Pi or over the Internet (Internet of Things).
  - Demo applications for Android, Windows Phone and iOS are available.
- Ready to Hack: Two Remote Control Mains Switches included.
- Read out and control low voltage mainstream devices,
  - e.g. smoke detectors, remote mains switches, garage door openers and doorbells.
- Interaction over USB, Wi-Fi or Ethernet possible.

## Description

The Starter Kit: Hardware Hacking is about hacking low voltage mainstream devices to connect them with Tinkerforge modules. Any (Embedded-) PC, Smart Phone or Tablet can be used to interact with devices hacked by this kit. Interaction is possible over USB or via Wi-Fi if a WIFI Extension is added. Also a direct Ethernet interface with the Ethernet Extension can be achieved.

Two remote control mains switches are included in this kit, so you can directly start to hack something. A step-by-step guide will tell you how to do it (soldering iron, solder and a screwdriver are required).

There are two groups of applications of this kit: controlling and reading out. For control applications an Industrial Quad Relay Bricklet is included. It contains four on/off switches. For read-out applications an Industrial Digital In 4 Bricklet is included. It can read out four digital galvanically isolated signals with voltages up to 36V.

Documented example applications are:

- Forwarding smoke detector alarm to a PC.
- Controlling remote mains switches with a PC and smart phone/tablet (Android, Windows Phone and iOS).
- Opening/Closing garage doors over a smart phone/tablet (Android, Windows Phone and iOS).
- Forwarding door bell ringing to a PC.

Many more applications are possible, anything that is controlled by a remote control or output digital signals is easily hackable by this Kit. The given examples applications should be enough to give you the power to hack any electronic appliance in this category.

Programming can be done with all of the available bindings (C/C++, C#, Delphi/Lazarus, Java, JavaScript, LabVIEW, Mathematica, MATLAB/Octave, Perl, PHP, Python, Ruby, Shell, Visual Basic .NET). Example implementations for many of the languages are available. This kit will also give you a good starting point into the programming with Tinkerforge.

A how-to video that shows how to hack the mains switches and some applications can be found on Youtube:

## Technical Specifications

Property | Value
--- | ---
Digital Inputs | 4
Digital Input Low Level Voltage | 0-2V
Digital Input High Level Voltage | 3-36V
Digital Outputs | 4
Maximum Switching Current | 1.2A per switch
Maximum Switching Voltage | 30V per switch

## Resources

- Example Source Code for Control Remote Mains Switches (Download: C, C#, Delphi, Java, PHP, Python, Ruby, Visual Basic .NET)
- Example Source Code for Control Remote Mains Switches with GUI (Download: C#)
- Example Source Code for Control Remote Mains Switches over Smart Phone (Download: Android (Java), Windows Phone (C#), iOS (ObjC))
- Example Source Code for Read out Smoke Detectors (Download: C, C#, Delphi, Java, PHP, Python, Ruby, Visual Basic .NET)
- Example Source Code for Control Garage Door over Smart Phone (Download: Android (Java), Windows Phone (C#), iOS (ObjC))
- Example Source Code for Doorbell Notifier (Download: Python)
- Demo Application for Control Remote Mains Switches with GUI (Download: Windows (.NET), Linux (Mono), Mac OS X (Mono))
- Demo Apps for Control Remote Mains Switches over Smart Phone (Download: Android, Windows Phone, iOS)
- Demo Apps for Control Garage Door over Smart Phone (Download: Android, Windows Phone, iOS)

## Required Tools

- Soldering Iron
- Solder
- Screwdriver (to open casings etc.)

## Firmware updating and first tests

As a very first step you should try out and update your Bricks and Bricklets.

For that you need to install the Brick Daemon and the Brick Viewer. Connect all Bricklets to the Master Brick and connect it via USB to your PC. Afterwards use Brick Viewer to find out if all of the firmwares are up to date (Updates / Flashing button). If not, you can update the Bricks and update the Bricklets with the Brick Viewer, too:

As next step click through the tabs of the Brick Viewer to see if the Bricklets are working correctly. Now you can be sure that the Bricks and Bricklets have versions that work together.

## How it works

Basically there are two different options with this kit: Detect digital signals and short-circuit signals. A detailed description of the basics can be found in the Hardware Hacking for Beginners tutorial.

Warning

Keep voltages in mentioned limitations and don't hack devices which are supplied by dangerous high voltages (e.g. mains voltage)!

### Detect Digital Signals up to 36V

If you want to read out the state of an electronic device, often there is a voltage source somewhere that represents this state. If it is a digital signal and the voltage is below 36V, you can connect the Industrial Digital In 4 Bricklet to it and read it out. A good option are LEDs. If your device has an LED representing a state you can easily read the state.

It is important to keep in mind that a high signal level is detected starting at 3V and a low signal level is detected below 2V. In between the behavior is undefined.

To read out a signal, connect it to one of the input ports of the Industrial Digital In 4 Bricklet. If you don't see any reaction of the input port in the Brick Viewer you likely have to reverse the polarity of the input. You can find the correct polarity by trial and error, the Bricklet is protected against reversed polarity.

Below you can find a connection diagram that shows a possible setup if you want to detect the state of an LED. The series resistor is included to obtain suffice levels for high/low detection.

### Short Signals with a Voltage up to 30V

With the Industrial Quad Relay Bricklet you can switch (short circuit) signals. Many devices have switches or push buttons that can be hacked with this the Bricklet. Remote controls are good examples.

Below you can find a connection diagram that shows a possible setup if you want to operate a switch with the Industrial Quad Relay Bricklet.

## Hardware Hacking for Beginners

To connect the Industrial Digital In 4 or the Industrial Quad Relay Bricklet to a device you have to accomplish two things:

- Find solder pads that can be used to measure or switch a voltage.
- Solder wires to these pads.

If you have never done this, take a look at the Hardware Hacking for Beginners tutorial for an in-depth guide that explains both steps.

## Examples

There are many low voltage appliances that can be hacked. Here are some examples:

### Control Mains Switches Remotely

This kit includes the remote switch set ELRO AB440WD/2. These remote control mains switches can be used as a first step towards home automation. We are going to hack the remote control of these switches and connect it to a PC to create software controlled remote switches.

We connect an Industrial Quad Relay Bricklet to the buttons of the ELRO AB440RA remote control. There are a vast number of remote switches available on the market. Most of the commercially available remote controls use the HX2262 IC with the same hardware design as the ELRO remote control. So this guide can be applied to most remote switches.

The full description of the hardware setup can be found here.

Example apps for Android (Java), Windows Phone (C#) and iOS (ObjC) are available.

An example implementation of a GUI (compatible to Windows (.NET), Linux (Mono) and Mac OS X (Mono)) is available in C#.

Minimalistic examples are available in:

C, C#, Delphi, Java, PHP, Python, Ruby, Visual Basic .NET

### Read out Smoke Detectors

Wirelessly interconnectable smoke detectors allow to read out the alarm signal of a whole smoke detector network at a single point. We are going to hack such a smoke detector and utilized this feature to trigger actions if smoke is detected. For example, notify someone with an email or a text message about the alarm.

For this project we use the wireless smoke detector set ELRO FA20RF/2 and connect an Industrial Digital In 4 to one of its LEDs that light up during an alarm.

The full description of the hardware setup can be found here.

Example implementations with step-by-step instructions are available for:

C, C#, Delphi, Java, PHP, Python, Ruby, Visual Basic .NET

### Control Garage Doors Remotely

Garage door openers are quite useful. Typically they come with a remote control and we are going to hack one. After the hack your smart phone can control the garage door and you don't need to carry around the original remote control anymore. This project is based on this project.

A small description of the hardware setup can be found here.

Example apps for Android (Java), Windows Phone (C#) and iOS (ObjC) are available.

### Is someone at the Door? - Doorbell Notifier

In this project one port of the Industrial Digital In 4 Bricklet is connected to a typical 12V driven Doorbell. A Python script prints "Ring Ring Ring!" if someone actuates the doorbell. You can extend this project such that it will send an SMS or let your phone ring if someone is at your door. Be creative!

Description of the hardware setup and more pictures can be found here.

An example application is available in Python.

The content of this page is licensed under Creative Commons Attribution 3.0 Unported License.