1.16 - Infrared Service

Overview

For Fullscreen: https://www.youtube.com/watch?v=YtFbPD3PEWY&t=1s

This tutorial will show you how to use the infrared service with the Quantum system.


What is the Infrared Service?

The infrared service is a collection of IR codes that can be utilized with it’s corresponding service object in the app builder to send specific codes out of an IR emitter in order to control countless IR devices like TVs, media centers, ac units and much more. With the Quantum Platform instead of having to scour the internet for specific IR codes that many manufacturers neglect to release to the public or spend the money on IR hex code reader the service stores IR codes from a variety of sources including irdb, one of the largest crowdsource manufacturer independent databases of infrared remote control codes on the web.


Build the Circuits

We will start by connecting a simple IR emitter to one Builder Base and a push button to another.

The used IR emitter comes with our Component Kit. As you can see it has a emitter on top that is connected to a pcb with a 10k resistor and three pin headers. One for the signal, one for five volts and one ground pin.


Pair the Builder Base

From the home screen of your Q-Server go to Clients on the left side. Click on the “Unpaired” tab.

Connect the Builder Bases, which are connected to the button and the IR emitter, to your Q-Server. If you don’t know which client is connected to which hardware, simply click on the three dots below ‘Action' and then click on 'Identify’. The Builder Base should blink double green.

Now again click on the three dots below ‘Action’ of the right Client and click on “Edit”.

Name your client and also set a Location, where the client is used then it is easier for you to determine which client is which later on. Then hit “Save”.


Build the Firmware

Head to the Firmware tab of your Q-Server and click on “+ Create New” to start a new firmware file.

Give it a name so you remember your files. We named it “IR Emitter”. Once you finished that we can add hardware to our firmware file. Simply click on the IR Emitter firmware and then on “+ Add Hardware”.

You can now search for the ir emitter by typing in the search bar or scrolling down until you find it.

We named it accordingly to the firmware “IR Emitter”. After naming click “Add Hardware”. Next select the drop down menu for it.

Now we have to edit the hardware. For the driver we choose the “IR Emitter” since we are using a IR emitter and for the pin we are choosing “GP0”. If you connected your IR emitter to a different pin then you have to choose that one.

After that click on the three dots and hit “Upload”. Select the Client that is connected to the IR emitter hardware and then upload the firmware.

Once the firmware file is uploading we are going to create another firmware file for the Client that is connected to the push button. We named it “Pushbutton”

Now we add a button hardware to the firmware file like we did before with the IR emitter hardware.

Once you added the hardware we are going to edit it. For the Driver select “GPIO”, the connected pin is “GP0”, debounce to “Enabled” and since one corner of the button is connected to 3.3V of the Builder Base we are using a “Input Pull Down” circuit.

Upload the firmware file to the Client that is connected to the button.

All your firmware files are set up and you are ready to move on!


Infrared Service Setup

The next step is to turn on our IR Service. To do so go to the Library tab on your Q-Server and go to “Services“.

Move to the Services section and click on the “Download“ button of the Infrared.

A green check mark should appear and say “Installed“.

After this we need to activate the infrared service. Move to the “Service“ tab of your Q-Server.

Click on the three dots below “Actions“ and hit “Start“.

A menu will open. Click on “Activate“ to run the infrared service.

Notice the Status of the Infrared service changes to “Running”.


Build the App

Here is the demo app that we created for the IR emitter. Basically it has a couple options on how you can configure, store and send your IR hex codes to the IR emitter in order to perform a certain action. The purple object is the Infrared object. It utilizes the infrared service we activated before on the Quantum Q-Server. The infrared service is basically a large database full of different IR hex codes for a bunch of different devices and is all stored in one place so you can easily configure what you want and then it will send it out through the IR emitter.

Let’s get into more detail. First we will start with the Initial Trigger object. When we start the application the Initial Trigger will start the Infrared service object. Trough the connected drop down interface objects we’ll be able to select what type of IR hex code, the brand and configurations we want. They will send the selected options back to the Infrared service object and it will send a code out and store it in a Static String object. The Pushbutton on the left is equivalent to the physical push button on the breadboard. It can be used to send out the stored information to our IR Emitter object in order to finally send it to the TV or any other receiving device that uses infrared. This setup is only able to perform a single action that you want to send out. If you want more actions to send out trough the IR Emitter object based on different buttons you press you will need multiple copies of this.

We also have a Interfacebutton right below the Pushbutton. With this button we can also send out our IR hex code via the dashboard or any device that can access the dashboard. On the right side we also have a Text object which will show us the IR hex codes once they send out to the IR Emitter object. This is usefull because once you know the IR hex code of certain actions you can simplify the app.

Once you know the desired IR hex codes you can simply copy them and paste them into the String port of the Static String object. This creates a smaller and manageable app but also harder to make quick changes to the send out signal.

After finishing building your app make sure to safe your application.

The next step is to map the hardware. Click on the play button to start the mapping progress.

We will now map the actual hardware we have to the software we made in the app. Select the right Client the IR emitter is connected to.

Select the right Client for the push button as well.

After mapping hit save and run.


Demo

Lastly we will use the app in a litte example now. So let’s head to the dashboard by clicking on the dashboard icon in the top right corner.

Now you can see four drop down interface objects. We have our button interface object and also below the text object. Since we are using a Samsung TV we are going to set everything up to control it via our IR Emitter app.

By clicking on the button the TV should be powered on and also we will get the hex code that is send out via the Static String object.

Like we mentioned before when you know the hex codes you can use them to simplify your app immensely.

Happy making!