HTE - IR Emitter

Overview

For Fullscreen:https://www.youtube.com/watch?v=MRqcluz2APo

This tutorial will show you how to connect and use an IR emitter with the Quantum system and create a demo using it.


How does the IR emitter work?

The infrared emitter is a type of cheap and efficient led that emits light in the infrared range of the electromagnetic radiation spectrum.

IR LEDs are useful in a number of types of electronics. They can be used to control devices such as your TV. If you hit a button on your TV remote an IR LED repeatedly turns on and of typically at 38 kHz to transmit information like the volume or channel control to an IR photo sensor on your TV.


Assemble the Circuit

Picture

Name

Quantity

Link

Picture

Name

Quantity

Link

 

IR Emitter

1

Included in Starter Kit

 

Jumper Cables (MF)

3

Included in Starter Kit

Or you can purchase it here

Q-Client Builder Base

1

Q-Client

If you have all the parts listed above, we can go ahead and build the circuit. It should look like this:

The IR module is basically just one emitter on a pcb with a 10k resistor and three pin headers. One for the signal, one for 5V and one for the ground. After building this simple circuit you will just need to power your Builder Base.


Pair the Builder Base

Now we want to pair the Builder Base with our Q-Server. In order to do so, go to the Homescreen of your Q-Server.

Next click on the lift side symbol labeled “Clients”. Switch to the “Unpaired” tab at the top middle of the screen.

You should see your unpaired Builder Base. If not, check if you have plugged in the power supply for the Builder Base. Now move to the three dots below “Actions” and click “Pair”.

Once your Client is paired, click the “Setup” button.

Now you can edit your Client. Give him a Name you want and also a location where you are going to use it. Hit “Save” when you finished.


Install the Infrared Service

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 Firmware

Next we will build the firmware for our project. Move to the firmware tab of your Q-Server.

Click on “+ Create New” to start building a new firmware. Give it a name so you can identify it. We named ours “IR Emitter”.

The next step is to add hardware to our firmware.

Search for an IR emitter and also give it a name. After that click “Add Hardware“.

Click on your added hardware to open a drop down menu. For the “Driver” select the “IR Emitter”.

Select the pin you connected the signal port of the IR emitter to the Builder Base. In our case it’s GP0.

When you are finished click on “Save“. Last step is to upload the firmware we created. To do so click on the three dots and select “Upload”.

Select the right Client you want to upload the firmware to.

Hit “Upload”.

The progress of the upload can be seen on the right side in your Q-Server. Your firmware is now finished and we can move to the next step.


Overview 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 Interface button on the left 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.

The second option you see does the same job but with less objects used. It will send out a Stored IR Code from a Static String object by pressing a button. However you’ll need to know the IR hex codes in advance. You can use an IR code reader and then once you figured out the code you just go to the Static String and type in the value you read before. Also if you are using a device that has the IR codes in our infrared database you can just do this initially to figure out the IR hex codes. Simply connect the “Code Out” port of the Infrared object with the “In” port of the Text object. Then simply copy and paste it into the Static String object.


Build the App (Option 1)

Move to your Apps tab on your Q-Server and hit “+ Create New”.

We named our app IR Emitter. You will find yourself on the canvas.

First thing we bring in is the Infrared Service object. You can either use the search bar on the left and type in “infrared” or go to the purple “Service section and click on the Infrared Service object and drag it onto the canvas.

The next object we will need is a Initial Trigger object.

Connect the “Trigger” port of the Initial Trigger object with the “Load Brands” port of the Infrared object.

Next we will need the four Dropdown objects.

Once you placed them on the canvas connect the “Brands”, “Devices”, “Configs” and “Actions” port of the Infrared object with one of the Dropdown objects.

Now we want to name and label all of the Dropdown objects according to their connection port of the Infrared object. Name and label the first Dropdown object “Brands”.

Do this with all four Dropdown objects accordingly to their connection. It should look like this.

So the Initial Trigger is loading the database to the Dropdown menus and you select which brands, devices, configs and actions you want to have. They will be send back to the Infrared object. So we need to connect the Value port of each Dropdown object with the according ports of the Infrared object.

Now we need the Static String object. Place it somewhere on the right side below the Dropdown objects.

The “String” port of the Static String object will be connected with the “Code Out” port of the Infrared object.

The Static String object is basically going to store the IR hex code we chose to use until we trigger it send it out. So to send out and trigger the Static String object we will need a Button object.

If you don’t want to use a button you can also use any other digital trigger the Static String object.

Lastly we will need the IR emitter hardware object to actually send out our hex codes. Connect the IR Emitter object with the “String” port of the Static String object.

As you noticed we also placed a Text object onto the canvas. Connect this to the “Code Out” port of the Infrared object to get the hex codes send out. We can see how they look like and also save them for the second option we are going to build later.

Once you finished hit “Save App” and then return to your apps.


Map Hardware & Get Hex Codes

Click on the play button of the IR Emitter app to start it.

Map the IR emitter hardware object in the application to our IR emitter Client with the firmware file we named IR Emitter.

When you are finished click “Save + Run”. The play button should change to green.

From there we are going to open the “Dashboard” to see what our app looks like. You will see all your apps running.

Click on the IR Emitter to open it.

You can see all the dropdown interfaces, the IR Service trigger button and below that the Text object IR Code. In our case we are using a Samsung TV so we select Samsung for the Brand.

As you can see we selected the actions and so forth. The IR Code will be shown in blue number in the text box. Once you selected everything you are good to go to hit the button to send out the hex code. In our case the Samsung TV should turn on. This is the hex code we mentioned before. We are going to use this now to build the second option and later on we will show you both options in action. Copy it to your clipboard.


Build the App (Option 2)

Move back to your Apps tab and edit the IR Emitter app by clicking on the three dots and select “Edit”.

For the second option we need another Button and another Static String object. Connect them like before. Now use the saved hex codes and paste it into the “String” port of the Static String object. Make sure to hit “Save Properties”.

Connect the Static String object with the IR Emitter object.

To make sure we see when the code is send out we are going to get another Text object and connect it to the second Static String object.

Once you finished click on “Save App” again and hit the run button. Since we already mapped the hardware before we don’t need to do this again so we can straight go to the dashboard.


Demo

As you can see we have both configurations now in our application. The only negative thing is, if you restart the app you will loose the existing settings we made before like brands etc..

By clicking on the “Option 2” button the hex code should appear below. Now we know the hex code has been sent out to the IR Emitter. The IR Emitter can now be controlled via your computer, phone or tablet.

Now we turn on the TV with the second option via our phone.

As you can see via the text box the hex code has been send out and the TV turns back on.

That’s how you use an IR emitter with the Quantum System to control an IR device like your TV.

Happy making!