# IOT IR Remote using Raspberry Pi Zero W and QtPy Hat

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/101/302/medium800/internet_of_things___iot_assembled.png?1618094410)

In this project, we will create an infrared remote control for your TV, cable box, DVR, Blu-ray, or another similar consumer electronic device. The remote control is operated by a webpage interface. The Raspberry Pi serves the webpage over your local Wi-Fi network. You can access it on your PC, laptop, tablet, or phone as long as it is connected to your local Wi-Fi network.

The ability to control your TV or cable/DVR and other devices over a webpage is a very popular idea that has led to some commercially available products. Such products are often expensive, limited in their customization capabilities, and often dependent upon cloud-based services that can be a security risk and may not survive the useful life of the product.

These devices are especially useful as an assistive technology device for a person with a disability&nbsp;such as me. Someone with limited strength and hand dexterity often cannot use a traditional remote control. The ability to use a web interface is a handy alternative to a traditional remote because it also allows leveraging the power of other assistive technology solutions such as eye gaze, speech recognition, and AT switch control which the user may already have implemented for accessing the internet.

It is based on a Raspberry Pi Zero W and Adafruit QT Py-SAMD21. The QT Py is soldered to a custom open-source Hat that attaches to the Raspberry Pi Zero W.

The board, called the QT Py Hat, was designed by Bill Binko. The Hat also contains infrared transmit and receive circuitry. The Raspberry Pi communicates with the QT Py through the UART RX and TX pins via the hat. There is also the option to connect I<sup>2</sup>C or SPI interfaces of the two boards through the hat via various jumpers.

Although a Raspberry Pi on its own could do infrared output, it would have to do so via bit-bang because it cannot do PWM output to the IR LED driver circuit. It would require complicated drivers. It ties up the processor which could cause an interruption in other activities such as Wi-Fi data coming and going. By handing off the IR processing to the QT Py, it simplifies the entire process and makes it more reliable.

The combination of Raspberry Pi and QT Py provides for a variety of other potential uses such as adding analog I/O to the Raspberry Pi. We will only be concentrating on the infrared aspects of this system but future software updates will make it easier to use the other functions of the QT Py as well as its STEMMA QT interface.

Here is a YouTube video demonstrating how the device works to control my TV and Cable DVR box. Note it can be reconfigured for most any consumer electronic device such as a Blu-ray player or even an old VCR that uses an infrared remote.

https://www.youtube.com/watch?v=Dx4EevMcxJE

## Project History

Here's a brief personal history of how this project came to be. It's not necessary to know this to build the project but I thought you might find it interesting.&nbsp;

Several years ago I purchased a commercially available web-based IR remote called a "RedEye Remote" however its web interface was dependent upon a cloud-based server. When the company went bankrupt, the device became a useless brick. Then I developed my own solution using an Arduino compatible board called Pinochio. (That's how they spelled it to avoid potential trademark infringement.) It was an early system providing IoT capabilities. Unfortunately, it too relied on a cloud service that eventually disappeared.

My next solution was to use an Arduino Yún which was the first official Arduino product supporting IoT. It consisted of a small Linux system running WRT and was interfaced with what was essentially an Arduino Leonardo based on the ATMEGA 32u4. My infrared transmit and receive library IRLib2 already supported the 32u4 so it was a natural choice although somewhat expensive at approximately $75.

The Yún was eventually discontinued. Fortunately, my solution did not rely on any cloud-based systems and was based entirely on my local Wi-Fi system so it continues to work to this day. There is now a revision 2 of the Yún that sells for about $56 which is still a little bit expensive.

I was recently contacted by Ean Price who works with an organization that provides assistive technology solutions to people in Canada. He had seen a video I did about various assistive technology gadgets I have built and among them was the Yún-based device. He wanted to build one for himself and perhaps as many as 5 more people. Long-term he speculated they might create as many as 50 of the devices.

After a brainstorming session with Bill Binko of [ATMakers.org](ATMakers.org "ATMakers.org"), we concluded that the Yún was expensive old technology and if we were going to be assisting lots of clients with such devices we could come up with a simpler more cost-effective solution. The result is the QT Py Hat project we present here.

Although designed to be an IR remote, it also is an extremely cost-effective alternative to the Yún. It does not yet have the software support of the Yún but we will be working to develop this platform further in the near future.

- [Next Page](https://learn.adafruit.com/iot-ir-remote-using-raspberry-pi-zero-w-and-qtpy-hat/parts-required.md)

## Featured Products

### Raspberry Pi Zero WH (Zero W with Headers)

[Raspberry Pi Zero WH (Zero W with Headers)](https://www.adafruit.com/product/3708)
If you didn't think that the Raspberry Pi Zero W could possibly get any better, then boy do we have a pleasant surprise for you!&nbsp;The new **Raspberry Pi Zero WH&nbsp;** offers all the benefits of the Pi Zero W, but with one big difference – a **pre-soldered GPIO...**

In Stock
[Buy Now](https://www.adafruit.com/product/3708)
[Related Guides to the Product](https://learn.adafruit.com/products/3708/guides)
### Adafruit QT Py - SAMD21 Dev Board with STEMMA QT

[Adafruit QT Py - SAMD21 Dev Board with STEMMA QT](https://www.adafruit.com/product/4600)
What a cutie pie! Or is it... a QT Py? This diminutive dev board comes with our favorite lil chip, the SAMD21 (as made famous in our GEMMA M0 and Trinket M0 boards).

This time it comes with [our favorite connector - the STEMMA QT](http://adafruit.com/stemma), a chainable I2C...

In Stock
[Buy Now](https://www.adafruit.com/product/4600)
[Related Guides to the Product](https://learn.adafruit.com/products/4600/guides)
### 16GB Card with NOOBS 3.1 for Raspberry Pi Computers including 4

[16GB Card with NOOBS 3.1 for Raspberry Pi Computers including 4](https://www.adafruit.com/product/4266)
NOOBS 3.1&nbsp;is the fastest way to have a variety of operating systems on your Pi. Available on a 16G card, you can now boot multiple OS's such as Raspbian, Pidora, RaspBMC, Snappy Ubuntu, etc. There's a boot up menu for selecting which one you like.&nbsp; **This card has NooBs...**

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/4266)
[Related Guides to the Product](https://learn.adafruit.com/products/4266/guides)
### GD25Q16 - 2MB SPI Flash in 8-Pin SOIC package

[GD25Q16 - 2MB SPI Flash in 8-Pin SOIC package](https://www.adafruit.com/product/4763)
These little chips are like miniature SSD drives for your electronics. When you don't need something with as much storage as a micro SD card, but an EEPROM is too small, SPI (or QSPI) Flash chips give you on-the-order-of megabytes, with little cost and complexity. We use these chips all...

In Stock
[Buy Now](https://www.adafruit.com/product/4763)
[Related Guides to the Product](https://learn.adafruit.com/products/4763/guides)

## Related Guides

- [Adafruit QT Py SAMD21](https://learn.adafruit.com/adafruit-qt-py.md)
- [WiFi Weather Station](https://learn.adafruit.com/wifi-weather-station-arduino-cc3000.md)
- [No-Code IoT CO2 "Canary In a Coalmine"](https://learn.adafruit.com/iot-canary.md)
- [MQTT in CircuitPython](https://learn.adafruit.com/mqtt-in-circuitpython.md)
- [PyPortal GitHub Stars Trophy](https://learn.adafruit.com/pyportal-github-stars-trophy.md)
- [How to train new TensorFlow Lite micro speech models](https://learn.adafruit.com/how-to-train-new-tensorflow-lite-micro-speech-models.md)
- [Sparkle Motion Christmas Tree Lights](https://learn.adafruit.com/sparkle-motion-christmas-tree-lights.md)
- [Adafruit MagTag Project Selector](https://learn.adafruit.com/adafruit-magtag-project-selector.md)
- [PyPortal Tides Viewer](https://learn.adafruit.com/pyportal-tides-viewer.md)
- [Where's My Friend? A Location-Aware Display with PyPortal and ItsASnap](https://learn.adafruit.com/where-s-my-friend-a-location-display-frame-with-pyportal.md)
- [PyPortal Philips Hue Lighting Controller](https://learn.adafruit.com/pyportal-philips-hue-lighting-controller.md)
- [PyPortal Event Countdown Clock](https://learn.adafruit.com/pyportal-event-countdown-clock.md)
- [Fog Machine with Motion Sensor and Adafruit IO](https://learn.adafruit.com/fog-machine-remote-trigger.md)
- [PyPortal Astronauts in Space](https://learn.adafruit.com/pyportal-astronauts-in-space.md)
- [Blinking an LED with the Zephyr RTOS](https://learn.adafruit.com/blinking-led-with-zephyr-rtos.md)
- [Magic Mirror with Glowing Secret Messages](https://learn.adafruit.com/magic-mirror-with-glowing-secret-messages.md)
