IR Remote

Overview

We love the idea of being able to control multiple devices from a single universal remote, so we decided to build a remote with our system that does exactly that. The IR Remote project utilizes 4 buttons and an IR LED to create a basic universal remote. The remote can be used to interface with any device that accepts IR input, such as a TV, Thermostat, Audio Receiver, or older generations of Apple TVs.

beginner

10 Minutes

1 Client


Hardware Components

Picture

Name

Quantity

Link

Picture

Name

Quantity

Link

 

Momentary push button

4

Included in the Component Kit

Or, they can be purchased here

 

IR LED

1

Included in the Component Kit

Or, they can be purchased here

 

MM Jumper Wires

10

Included in the Component Kit

Or, they can be purchased here

 

Q-Client Builder Base

1

Q-Client

Tools Used

Picture

Name

Quantity

Link

Picture

Name

Quantity

Link

 

Small slotted-head screwdriver

1

Included in the Component Kit

or you can pick from one on our Recommended Tools List


Assemble the Circuit

Start by placing your 4 push buttons on the breadboard and attaching two MM wires to each, as done below.

Now, place your IR LED on the bread board and connect a wire to each of its leads. Be sure to take note of which leg is long and which is short.

Attach the red wires that are connected to your buttons to the positive voltage rail on your breadboard, attach the negative (short) lead from your LED to the GND rail on your breadboard. Next, attach the 3.3V and GND ports on your Builder Base to the positive voltage and GND rails to your breadboard, respectively.

Now we will wire the Buttons and the LED to the Builder Base. Follow the table below. The numbering of the buttons is one through four with the left most button being button number one.

Component

GP Port

Component

GP Port

IR LED

GP0

B1

GP1

B2

GP2

B3

GP3

B4

GP4

That’s it, your circuit is now complete!


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.


Build the Firmware

In this section we will build the firmware used in this project.

Navigate to the Firmware and select “+ Create New”.

You will now be prompted to name your firmware file, we named ours “IR Remote”.

Now, select the “+ Add Hardware” button and an IR Emitter device to your firmware.

Now, repeating the steps above, we will add four button devices to our firmware file.

On the right side you should see all your added hardwares.

Now we will select and configure the drivers for each device. Starting with the IR Emitter, Select IR Emitter for the driver and set the Pin to GP0.

 

Now we will configure the buttons. Starting with button “B1” Select the GPIO driver, set the Pin to GP1, Debounce to Enabled, and mode to Input Pull Down.

 

Now we will configure button “B2”.

 

Now we will configure the button “B3”.

 

Lastly, we will configure button “B4”.

 

That’s it, save your firmware and upload it to the client that your IR Remote circuit is connected to!

 


Build the App

Before you start building your app make sure your IR DB service is up and running!

Navigate from the Firmware Builder to the App Builder via the toolbar on the left side of the screen.

Once there, click “+ Create New”.

Name your app and hit create.

You will be redirected to the canvas where you will build your App.

Use the search bar on the left hand side of the screen to find the “Button” hardware object and drag four of them onto the Canvas. Arrange them as shown.

 

To rename your button objects, Click on the button object you wish to rename and on the right hand side of the screen you will be presented with the properties panel. Here you can name the object. We named ours “B1” - “B4”. Naming your objects makes it easier to identify them during the mapping stage, so we suggest naming them.

 

Next, use the search function again to find the “Static String” object and drag four of them onto the screen. Arrange and connect them to the button objects as shown.

We will now drag four IR Service objects onto the screen. Arrange them as shown and connect a “Code out” port from each of the Infrared objects to one of the “String” in ports on the Static string objects.

Now, drag 16 Dropdown objects onto the canvas. Four will be used for each Infrared object. Arrange them as shown.

Now, we must name each of the dropdown interface objects. If you don’t, arranging them in the dashboard will be a nightmare. Notice how each of the four drop down objects are grouped with an infrared object. We will name them according to their grouping.

From top to bottom, name the interface objects following the table below:

Name:

Name:

B1 - Brands

B1- Devices

B1 - Configs

B1 - Actions

Use the properties panel to rename the objects, click on the object whose name you wish to change, and its properties panel will appear on the right hand side of the screen. After making your changes, be sure to hit the “save properties” button at the bottom of the screen. If you don’t your changes will be lost.

Now, repeat the steps above for the remaining dropdown objects, but be sure to change the “Bx” prefix to whatever number grouping you are changing. So, for example, for the “B2” grouping, use the “B2” prefix for all of the dropdown objects. When you’ve finished naming your dropdown objects, your App should look like this.

 

We will now set the links between the Infrared and the dropdown objects.

We will show you how to make the connections for the B1 grouping, as the connections for the remaining groupings are the same.

Start by connecting the “Brands” out port from the B1 infrared object to the “Array” in port on the B1 - Brands dropdown object.

And then connect the “Value” out port from the Brands dropdown object to the “Brand” in port on the infrared object, as shown below.

Now, connect the “Devices” out port from the B1 infrared object to the “Array” in port on the B1 - Devices dropdown object.

And then connect the “Value” out port from the Devices dropdown object to the “Device” in port on the infrared object, as shown below.

Now, connect the “Configs” out port from the B1 infrared object to the “Array” in port on the B1 - Configs dropdown object.

And then connect the “Value” out port from the Configs dropdown object to the “Config” in port on the infrared object, as shown below.

Now, connect the “Actions” out port from the B1 infrared object to the “Array” in port on the B1 - Actions dropdown object.

And then connect the “Value” out port from the Actions dropdown object to the “Action” in port on the infrared object, as shown below.

Now, repeat the above steps for the B2 - B4 groupings. When your done, your app should look something like this:

Now search for and drag an “Initial Trigger” code object onto the screen and connect its trigger out port to each of the “Load Brands” ports on the Infrared objects.

Next, search for and drag an IR Emitter hardware object onto the screen. Connect each of the “String” out ports on the static string objects to the “Value” in port on the IR Emitter hardware object.

Lastly, we will configure dashboard. To configure the dashboard navigate to the right side of the canvas and select the Dash Builder tab.

Select the “Add Tab” Button and add three new tabs. We edited the names of our tabs to be Button 1 → Button 4.

Now, select the objects panel.

Then select the “Button 2” Tab and the “Group 1” Group. From here, select the “Add Gadget” button and add all B2 interface objects to this tab.

 

Repeat the same steps for the Button 3 and Button 4 tabs, grouping the B3 and B4 objects respectively.

Thats it!

Your App is now complete. You can save it by clicking the “Save App” button in the upper right hand corner of the screen.

After saving, click “Return To My Apps”


Map the Hardware

Make sure your infrared service is downloaded and running before you start your application. If it isn’t your app wont work!

You should now be back on the Apps page.

Find your “IR Remote” app and hit the play button.

A list containing all of the devices in your application will expand.

Next click on the “IR Emitter” device and the client dropdown menu will appear on the right.

Select the IR Emitter driver from the dropdown menu and hit “Done”.

Next click on the “B1” device and the client dropdown menu will appear on the right.

Select the B1 driver from the dropdown menu and hit “Done”.

Now, map the remaining B2, B3, and B4 devices.

Notice how the status symbols have changed to green checkmarks.


Run the App!

Congrats on building your first project, It’s now time to use it!

Hit “Save + Run”.

Voila! Your IR Remote project is now complete.

Setting the Button Actions

Now that your application is up and running, we can configure the action each button performs.

Start by navigating to your dashboard. Once there, select the IR Remote app.

You will now see the dropdown menus, the four menus are used to configure a single button. You can see that there are four separate button tabs, each tab will take you to the configuration drop downs for that button.

We will configure our buttons for use with a Sony TV, so we will select “Sony” from the Brands dropdown, TV from the Devices dropdown, we will set Configs to (1,-1), and the action to Power On/OFF.

We repeated the same configurations for the remaining buttons, but for each we selected a different action.

Button 2:

Button 3:

Button 4:

Now you can use your remote! Enjoy!

 


Resources

App

 

Firmware

 

Schematic

Diagram