Category Archive:

Muting DSTV using Arduino


I have been playing around with infrared remote controls as part of the upcoming Introduction to MSP430 course – Guy and I were looking for an interesting use of PWM and timers, so the suggestion was to produce an infrared signal using an IR led.

I set out to learn a bit more about IR and prototype using the Arduino. After searching online, I found Ken Shirriff’s excellent IR library for Arduino on Github:

It supports some standard TV remote controls and a “raw” mode which looked promising for controlling other things, e.g. my DSTV remote control, air conditioner etc

In this mode you can give it an array of unsigned integers. For example:

unsigned int raw[36]={250,842,242,2374,...,250,81862};

For background on how IR remote controls works check out this article on the irq5 blog.  In short the signal is encoded in bursts of “on” and “off”.  When the LED is on, it is PWM’d at a certain frequency. To use the “raw” mode, we need to know the PWM frequency (typical values between 35-40 kHz) and then the “on” and “off” durations.  The array is then made as follows:

unsigned int raw[36]={"duration on","duration off",....};

Using an IR LED, a resistor (e.g. 10K) and an oscilloscope, one can readily discover the signal sent from the remote control:

IR Led and 10k resistor

One "ON" pulse showing PWM

The duration of seven modulation cycle for the DSTV remote control is measure as 183uS, which corresponds to ~38kHz.

To get the on-off durations, the easiest is to use an IR receiver and the InfraredReceivers sketch found on

Infrared receiver

Infrared receivers removes the 38kHz and gives a digital HIGH / LOW for the received pulses.  The Arduino Playground sketch samples the duration of these pulses at 4uS and prints to the serial console.

However, to use the output I had to subtract 10uS from each measurement – I suspectthis is an additional delay in IRremote library to switch the LED.

Muting DSTV

Connecting an IR LED to pin 3 through a 220 ohm resistor

IR LED connected to pin3 and 220 ohm resistor to ground

and running the following sketch mutes DSTV PVR:

#include <IRremote.h>
IRsend irsend;

void setup(){}

unsigned int raw[36]= {250,842,242,2374,250,834,250,2790,250,1254,

void loop() {

Next steps is to apply this to the Airconditioner at House4Hack, to be able to control that as part of the course.

Posted in: Random

Continue Reading

Introduction to Android 23 February


Registration for Introduction to Android by Toby Kurien is closed.

Please contact for any queries or booking of future Android courses

Posted in: Random

Continue Reading

Let’s Talk Hack


We have launched a webcast called Let’s Talk Hack!

As the name suggests it is part of the Let’s Talk Network which has their studio at House4Hack. LTN allows us to use their equipment and provides technical support – for the first show, the Let’s Talk Geek mixer stepped up and we are much obliged!

Shows is recorded and streamed live and we will notify on the mailing list the dates, but aiming for roughly once a month.

The shows will focus on a main topic and in the first one,  co-host Tom presents USB reverse engineering – starting with some background on USB and then digging into the hardware and software tools available.

To watch the show (low,med,high res) or listen to a podcast, go to the show’s homepage Let’s Talk Hack


Posted in: Random

Continue Reading

Get involved

Mailing List / Forum: Google Group

  • Schalk 082 777 7098
    schalk dot heunis at gmail dot com
  • Guy 084 678 0045
    guy dot vandenberg at microsmart dot co dot za
  • Toby